From 24c71e86e340d3cbde56f0f74f098bd278602abd Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 17 Mar 2026 02:15:43 +0000 Subject: [PATCH 1/2] feat: Support Chokepoint and external exposure in findings Proto PiperOrigin-RevId: 884685891 Source-Link: https://github.com/googleapis/googleapis/commit/5f6048b0222ddc57826fbbd254ea3197e2db82f3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0cf9da488515038fbc9742c0c72c93a4601e34fc Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiIwY2Y5ZGE0ODg1MTUwMzhmYmM5NzQyYzBjNzJjOTNhNDYwMWUzNGZjIn0= --- .../google-cloud-securitycenter/.OwlBot.yaml | 19 + .../google-cloud-securitycenter/.eslintignore | 7 + .../.eslintrc.json | 3 + .../.gitattributes | 4 + .../google-cloud-securitycenter/.gitignore | 14 + .../google-cloud-securitycenter/.jsdoc.js | 55 + .../google-cloud-securitycenter/.mocharc.js | 33 + .../google-cloud-securitycenter/.nycrc | 24 + .../.prettierignore | 6 + .../.prettierrc.js | 22 + .../CODE_OF_CONDUCT.md | 94 + .../CONTRIBUTING.md | 76 + .../google-cloud-securitycenter/LICENSE | 202 + .../google-cloud-securitycenter/README.md | 261 + .../cloud/securitycenter/v1/access.proto | 111 + .../cloud/securitycenter/v1/application.proto | 36 + .../cloud/securitycenter/v1/asset.proto | 136 + .../securitycenter/v1/attack_exposure.proto | 71 + .../cloud/securitycenter/v1/attack_path.proto | 131 + .../v1/backup_disaster_recovery.proto | 88 + .../securitycenter/v1/bigquery_export.proto | 103 + .../cloud/securitycenter/v1/chokepoint.proto | 35 + .../cloud/securitycenter/v1/cloud_armor.proto | 114 + .../v1/cloud_dlp_data_profile.proto | 113 + .../v1/cloud_dlp_inspection.proto | 54 + .../cloud/securitycenter/v1/compliance.proto | 39 + .../cloud/securitycenter/v1/connection.proto | 66 + .../securitycenter/v1/contact_details.proto | 37 + .../cloud/securitycenter/v1/container.proto | 48 + .../cloud/securitycenter/v1/database.proto | 63 + ...event_threat_detection_custom_module.proto | 85 + ...urity_health_analytics_custom_module.proto | 81 + ...event_threat_detection_custom_module.proto | 102 + ...tion_custom_module_validation_errors.proto | 59 + .../securitycenter/v1/exfiltration.proto | 57 + .../securitycenter/v1/external_exposure.proto | 75 + .../securitycenter/v1/external_system.proto | 103 + .../google/cloud/securitycenter/v1/file.proto | 65 + .../cloud/securitycenter/v1/finding.proto | 485 + .../cloud/securitycenter/v1/folder.proto | 36 + .../securitycenter/v1/group_membership.proto | 47 + .../cloud/securitycenter/v1/iam_binding.proto | 52 + .../cloud/securitycenter/v1/indicator.proto | 98 + .../securitycenter/v1/kernel_rootkit.proto | 62 + .../cloud/securitycenter/v1/kubernetes.proto | 216 + .../cloud/securitycenter/v1/label.proto | 37 + .../securitycenter/v1/load_balancer.proto | 32 + .../cloud/securitycenter/v1/log_entry.proto | 55 + .../securitycenter/v1/mitre_attack.proto | 299 + .../cloud/securitycenter/v1/mute_config.proto | 130 + .../cloud/securitycenter/v1/notebook.proto | 44 + .../v1/notification_config.proto | 101 + .../v1/notification_message.proto | 44 + .../cloud/securitycenter/v1/org_policy.proto | 42 + .../v1/organization_settings.proto | 87 + .../cloud/securitycenter/v1/process.proto | 74 + .../cloud/securitycenter/v1/resource.proto | 253 + .../v1/resource_value_config.proto | 123 + .../v1/run_asset_discovery_response.proto | 51 + ...urity_health_analytics_custom_config.proto | 101 + ...urity_health_analytics_custom_module.proto | 110 + .../securitycenter/v1/security_marks.proto | 69 + .../securitycenter/v1/security_posture.proto | 76 + .../v1/securitycenter_service.proto | 3188 + .../cloud/securitycenter/v1/simulation.proto | 56 + .../cloud/securitycenter/v1/source.proto | 69 + .../securitycenter/v1/toxic_combination.proto | 41 + .../securitycenter/v1/valued_resource.proto | 88 + .../securitycenter/v1/vulnerability.proto | 319 + .../cloud/securitycenter/v1beta1/asset.proto | 92 + .../securitycenter/v1beta1/finding.proto | 109 + .../v1beta1/organization_settings.proto | 78 + .../run_asset_discovery_response.proto | 48 + .../v1beta1/security_marks.proto | 52 + .../v1beta1/securitycenter_service.proto | 823 + .../cloud/securitycenter/v1beta1/source.proto | 55 + .../securitycenter/v1p1beta1/asset.proto | 134 + .../securitycenter/v1p1beta1/finding.proto | 145 + .../securitycenter/v1p1beta1/folder.proto | 37 + .../v1p1beta1/notification_config.proto | 107 + .../v1p1beta1/notification_message.proto | 43 + .../v1p1beta1/organization_settings.proto | 85 + .../securitycenter/v1p1beta1/resource.proto | 52 + .../run_asset_discovery_response.proto | 51 + .../v1p1beta1/security_marks.proto | 69 + .../v1p1beta1/securitycenter_service.proto | 1351 + .../securitycenter/v1p1beta1/source.proto | 68 + .../cloud/securitycenter/v2/access.proto | 111 + .../v2/affected_resources.proto | 31 + .../cloud/securitycenter/v2/ai_model.proto | 67 + .../cloud/securitycenter/v2/application.proto | 36 + .../securitycenter/v2/attack_exposure.proto | 72 + .../cloud/securitycenter/v2/attack_path.proto | 132 + .../v2/backup_disaster_recovery.proto | 88 + .../securitycenter/v2/bigquery_export.proto | 107 + .../cloud/securitycenter/v2/chokepoint.proto | 35 + .../cloud/securitycenter/v2/cloud_armor.proto | 122 + .../v2/cloud_dlp_data_profile.proto | 57 + .../v2/cloud_dlp_inspection.proto | 54 + .../cloud/securitycenter/v2/compliance.proto | 39 + .../cloud/securitycenter/v2/connection.proto | 66 + .../securitycenter/v2/contact_details.proto | 37 + .../cloud/securitycenter/v2/container.proto | 48 + .../securitycenter/v2/data_access_event.proto | 59 + .../securitycenter/v2/data_flow_event.proto | 63 + .../v2/data_retention_deletion_event.proto | 68 + .../cloud/securitycenter/v2/database.proto | 63 + .../google/cloud/securitycenter/v2/disk.proto | 32 + .../securitycenter/v2/exfiltration.proto | 57 + .../securitycenter/v2/external_system.proto | 112 + .../google/cloud/securitycenter/v2/file.proto | 95 + .../cloud/securitycenter/v2/finding.proto | 546 + .../cloud/securitycenter/v2/folder.proto | 36 + .../securitycenter/v2/group_membership.proto | 47 + .../cloud/securitycenter/v2/iam_binding.proto | 52 + .../cloud/securitycenter/v2/indicator.proto | 99 + .../cloud/securitycenter/v2/ip_rules.proto | 108 + .../google/cloud/securitycenter/v2/job.proto | 63 + .../securitycenter/v2/kernel_rootkit.proto | 62 + .../cloud/securitycenter/v2/kubernetes.proto | 216 + .../cloud/securitycenter/v2/label.proto | 37 + .../securitycenter/v2/load_balancer.proto | 32 + .../cloud/securitycenter/v2/log_entry.proto | 56 + .../securitycenter/v2/mitre_attack.proto | 517 + .../cloud/securitycenter/v2/mute_config.proto | 128 + .../cloud/securitycenter/v2/network.proto | 32 + .../cloud/securitycenter/v2/notebook.proto | 44 + .../v2/notification_config.proto | 110 + .../v2/notification_message.proto | 44 + .../cloud/securitycenter/v2/org_policy.proto | 43 + .../cloud/securitycenter/v2/process.proto | 78 + .../cloud/securitycenter/v2/resource.proto | 275 + .../v2/resource_value_config.proto | 126 + .../securitycenter/v2/security_marks.proto | 86 + .../securitycenter/v2/security_posture.proto | 76 + .../v2/securitycenter_service.proto | 2076 + .../cloud/securitycenter/v2/simulation.proto | 57 + .../cloud/securitycenter/v2/source.proto | 70 + .../securitycenter/v2/toxic_combination.proto | 42 + .../securitycenter/v2/valued_resource.proto | 89 + .../cloud/securitycenter/v2/vertex_ai.proto | 58 + .../securitycenter/v2/vulnerability.proto | 345 + .../protos/protos.d.ts | 64568 ++++++ .../protos/protos.js | 165024 +++++++++++++++ .../protos/protos.json | 17570 ++ ...ter.batch_create_resource_value_configs.js | 68 + .../v1/security_center.bulk_mute_findings.js | 93 + ...security_center.create_big_query_export.js | 76 + ...te_event_threat_detection_custom_module.js | 72 + .../v1/security_center.create_finding.js | 75 + .../v1/security_center.create_mute_config.js | 76 + ...urity_center.create_notification_config.js | 78 + ...security_health_analytics_custom_module.js | 71 + .../v1/security_center.create_source.js | 68 + ...security_center.delete_big_query_export.js | 64 + ...te_event_threat_detection_custom_module.js | 65 + .../v1/security_center.delete_mute_config.js | 67 + ...urity_center.delete_notification_config.js | 64 + ...ity_center.delete_resource_value_config.js | 61 + ...security_health_analytics_custom_module.js | 65 + .../security_center.get_big_query_export.js | 64 + ...ve_event_threat_detection_custom_module.js | 66 + ...security_health_analytics_custom_module.js | 65 + ...et_event_threat_detection_custom_module.js | 65 + .../v1/security_center.get_iam_policy.js | 67 + .../v1/security_center.get_mute_config.js | 67 + ...security_center.get_notification_config.js | 64 + ...curity_center.get_organization_settings.js | 62 + ...curity_center.get_resource_value_config.js | 62 + ...security_health_analytics_custom_module.js | 65 + .../v1/security_center.get_simulation.js | 64 + .../v1/security_center.get_source.js | 62 + .../v1/security_center.get_valued_resource.js | 63 + .../v1/security_center.group_assets.js | 176 + .../v1/security_center.group_findings.js | 174 + .../v1/security_center.list_assets.js | 187 + .../v1/security_center.list_attack_paths.js | 85 + .../security_center.list_big_query_exports.js | 79 + ...t_event_threat_detection_custom_modules.js | 83 + ...ecurity_health_analytics_custom_modules.js | 75 + ...e_event_threat_detection_custom_modules.js | 83 + ...ecurity_health_analytics_custom_modules.js | 75 + ...t_event_threat_detection_custom_modules.js | 83 + .../v1/security_center.list_findings.js | 191 + .../v1/security_center.list_mute_configs.js | 79 + ...curity_center.list_notification_configs.js | 76 + ...rity_center.list_resource_value_configs.js | 81 + ...ecurity_health_analytics_custom_modules.js | 75 + .../v1/security_center.list_sources.js | 76 + .../security_center.list_valued_resources.js | 100 + .../v1/security_center.run_asset_discovery.js | 63 + .../v1/security_center.set_finding_state.js | 76 + .../v1/security_center.set_iam_policy.js | 77 + .../generated/v1/security_center.set_mute.js | 71 + ...security_health_analytics_custom_module.js | 75 + .../security_center.test_iam_permissions.js | 70 + ...security_center.update_big_query_export.js | 66 + ...te_event_threat_detection_custom_module.js | 66 + .../security_center.update_external_system.js | 66 + .../v1/security_center.update_finding.js | 74 + .../v1/security_center.update_mute_config.js | 66 + ...urity_center.update_notification_config.js | 66 + ...ity_center.update_organization_settings.js | 66 + ...ity_center.update_resource_value_config.js | 66 + ...security_health_analytics_custom_module.js | 67 + .../security_center.update_security_marks.js | 75 + .../v1/security_center.update_source.js | 66 + ...te_event_threat_detection_custom_module.js | 76 + ...tadata_google.cloud.securitycenter.v1.json | 2907 + .../v1beta1/security_center.create_finding.js | 75 + .../v1beta1/security_center.create_source.js | 68 + .../v1beta1/security_center.get_iam_policy.js | 67 + ...curity_center.get_organization_settings.js | 62 + .../v1beta1/security_center.get_source.js | 62 + .../v1beta1/security_center.group_assets.js | 139 + .../v1beta1/security_center.group_findings.js | 118 + .../v1beta1/security_center.list_assets.js | 144 + .../v1beta1/security_center.list_findings.js | 121 + .../v1beta1/security_center.list_sources.js | 75 + .../security_center.run_asset_discovery.js | 63 + .../security_center.set_finding_state.js | 74 + .../v1beta1/security_center.set_iam_policy.js | 77 + .../security_center.test_iam_permissions.js | 70 + .../v1beta1/security_center.update_finding.js | 70 + ...ity_center.update_organization_settings.js | 65 + .../security_center.update_security_marks.js | 69 + .../v1beta1/security_center.update_source.js | 65 + ...a_google.cloud.securitycenter.v1beta1.json | 895 + .../security_center.create_finding.js | 73 + ...urity_center.create_notification_config.js | 75 + .../security_center.create_source.js | 68 + ...urity_center.delete_notification_config.js | 62 + .../security_center.get_iam_policy.js | 67 + ...security_center.get_notification_config.js | 62 + ...curity_center.get_organization_settings.js | 62 + .../v1p1beta1/security_center.get_source.js | 62 + .../v1p1beta1/security_center.group_assets.js | 176 + .../security_center.group_findings.js | 172 + .../v1p1beta1/security_center.list_assets.js | 185 + .../security_center.list_findings.js | 181 + ...curity_center.list_notification_configs.js | 75 + .../v1p1beta1/security_center.list_sources.js | 76 + .../security_center.run_asset_discovery.js | 63 + .../security_center.set_finding_state.js | 74 + .../security_center.set_iam_policy.js | 77 + .../security_center.test_iam_permissions.js | 70 + .../security_center.update_finding.js | 74 + ...urity_center.update_notification_config.js | 66 + ...ity_center.update_organization_settings.js | 66 + .../security_center.update_security_marks.js | 74 + .../security_center.update_source.js | 66 + ...google.cloud.securitycenter.v1p1beta1.json | 1123 + ...ter.batch_create_resource_value_configs.js | 68 + .../v2/security_center.bulk_mute_findings.js | 94 + ...security_center.create_big_query_export.js | 77 + .../v2/security_center.create_finding.js | 79 + .../v2/security_center.create_mute_config.js | 77 + ...urity_center.create_notification_config.js | 79 + .../v2/security_center.create_source.js | 68 + ...security_center.delete_big_query_export.js | 66 + .../v2/security_center.delete_mute_config.js | 69 + ...urity_center.delete_notification_config.js | 68 + ...ity_center.delete_resource_value_config.js | 61 + .../security_center.get_big_query_export.js | 66 + .../v2/security_center.get_iam_policy.js | 67 + .../v2/security_center.get_mute_config.js | 69 + ...security_center.get_notification_config.js | 68 + ...curity_center.get_resource_value_config.js | 62 + .../v2/security_center.get_simulation.js | 64 + .../v2/security_center.get_source.js | 62 + .../v2/security_center.get_valued_resource.js | 63 + .../v2/security_center.group_findings.js | 138 + .../v2/security_center.list_attack_paths.js | 85 + .../security_center.list_big_query_exports.js | 80 + .../v2/security_center.list_findings.js | 156 + .../v2/security_center.list_mute_configs.js | 82 + ...curity_center.list_notification_configs.js | 78 + ...rity_center.list_resource_value_configs.js | 81 + .../v2/security_center.list_sources.js | 76 + .../security_center.list_valued_resources.js | 98 + .../v2/security_center.set_finding_state.js | 79 + .../v2/security_center.set_iam_policy.js | 77 + .../generated/v2/security_center.set_mute.js | 79 + .../security_center.test_iam_permissions.js | 70 + ...security_center.update_big_query_export.js | 66 + .../security_center.update_external_system.js | 66 + .../v2/security_center.update_finding.js | 74 + .../v2/security_center.update_mute_config.js | 66 + ...urity_center.update_notification_config.js | 66 + ...ity_center.update_resource_value_config.js | 69 + .../security_center.update_security_marks.js | 68 + .../v2/security_center.update_source.js | 66 + ...tadata_google.cloud.securitycenter.v2.json | 1823 + .../google-cloud-securitycenter/src/index.ts | 30 + .../src/v1/gapic_metadata.json | 721 + .../src/v1/index.ts | 19 + .../src/v1/security_center_client.ts | 12666 ++ .../src/v1/security_center_client_config.json | 309 + .../src/v1/security_center_proto_list.json | 57 + .../src/v1beta1/gapic_metadata.json | 223 + .../src/v1beta1/index.ts | 19 + .../src/v1beta1/security_center_client.ts | 3681 + .../security_center_client_config.json | 116 + .../v1beta1/security_center_proto_list.json | 9 + .../src/v1p1beta1/gapic_metadata.json | 277 + .../src/v1p1beta1/index.ts | 19 + .../src/v1p1beta1/security_center_client.ts | 5466 + .../security_center_client_config.json | 141 + .../v1p1beta1/security_center_proto_list.json | 13 + .../src/v2/gapic_metadata.json | 459 + .../src/v2/index.ts | 19 + .../src/v2/security_center_client.ts | 9119 + .../src/v2/security_center_client_config.json | 186 + .../src/v2/security_center_proto_list.json | 57 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../system-test/install.ts | 49 + .../test/gapic_security_center_v1.ts | 11894 ++ .../test/gapic_security_center_v1beta1.ts | 3237 + .../test/gapic_security_center_v1p1beta1.ts | 4368 + .../test/gapic_security_center_v2.ts | 8513 + .../google-cloud-securitycenter/tsconfig.json | 22 + .../webpack.config.js | 64 + 323 files changed, 347085 insertions(+) create mode 100644 owl-bot-staging/google-cloud-securitycenter/.OwlBot.yaml create mode 100644 owl-bot-staging/google-cloud-securitycenter/.eslintignore create mode 100644 owl-bot-staging/google-cloud-securitycenter/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/.gitattributes create mode 100644 owl-bot-staging/google-cloud-securitycenter/.gitignore create mode 100644 owl-bot-staging/google-cloud-securitycenter/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/.nycrc create mode 100644 owl-bot-staging/google-cloud-securitycenter/.prettierignore create mode 100644 owl-bot-staging/google-cloud-securitycenter/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-securitycenter/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-securitycenter/LICENSE create mode 100644 owl-bot-staging/google-cloud-securitycenter/README.md create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/application.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_exposure.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_path.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_armor.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/load_balancer.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/log_entry.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notebook.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/org_policy.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource_value_config.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_posture.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/simulation.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/valued_resource.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/access.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/affected_resources.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ai_model.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/application.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_exposure.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_path.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/bigquery_export.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/chokepoint.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_armor.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/compliance.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/connection.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/contact_details.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/container.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_access_event.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_flow_event.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/database.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/disk.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/exfiltration.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/external_system.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/file.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/folder.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/iam_binding.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/indicator.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ip_rules.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/job.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kernel_rootkit.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kubernetes.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/label.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/load_balancer.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/log_entry.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mitre_attack.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mute_config.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/network.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notebook.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_config.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_message.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/org_policy.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/process.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource_value_config.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_marks.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_posture.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/securitycenter_service.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/simulation.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/source.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/valued_resource.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vertex_ai.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vulnerability.proto create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/index.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client_config.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_proto_list.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/index.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/index.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/index.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client_config.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_proto_list.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v2.ts create mode 100644 owl-bot-staging/google-cloud-securitycenter/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-securitycenter/webpack.config.js diff --git a/owl-bot-staging/google-cloud-securitycenter/.OwlBot.yaml b/owl-bot-staging/google-cloud-securitycenter/.OwlBot.yaml new file mode 100644 index 00000000000..4fe79291747 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +deep-copy-regex: + - source: /google/cloud/securitycenter/google-cloud-securitycenter-nodejs + dest: /owl-bot-staging/google-cloud-securitycenter + +api-name: securitycenter \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/.eslintignore b/owl-bot-staging/google-cloud-securitycenter/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-securitycenter/.eslintrc.json b/owl-bot-staging/google-cloud-securitycenter/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-securitycenter/.gitattributes b/owl-bot-staging/google-cloud-securitycenter/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-securitycenter/.gitignore b/owl-bot-staging/google-cloud-securitycenter/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-securitycenter/.jsdoc.js b/owl-bot-staging/google-cloud-securitycenter/.jsdoc.js new file mode 100644 index 00000000000..1a3be7ee39e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/security-center', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-securitycenter/.mocharc.js b/owl-bot-staging/google-cloud-securitycenter/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-securitycenter/.nycrc b/owl-bot-staging/google-cloud-securitycenter/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/.prettierignore b/owl-bot-staging/google-cloud-securitycenter/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-securitycenter/.prettierrc.js b/owl-bot-staging/google-cloud-securitycenter/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-securitycenter/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-securitycenter/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/CONTRIBUTING.md b/owl-bot-staging/google-cloud-securitycenter/CONTRIBUTING.md new file mode 100644 index 00000000000..d45b0e6328f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Securitycenter API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=securitycenter.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/LICENSE b/owl-bot-staging/google-cloud-securitycenter/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/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/owl-bot-staging/google-cloud-securitycenter/README.md b/owl-bot-staging/google-cloud-securitycenter/README.md new file mode 100644 index 00000000000..fde765b5dfd --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/README.md @@ -0,0 +1,261 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Security Command Center API: Nodejs Client][homepage] + +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 **stable** libraries +are addressed with the highest priority + +[![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) + +Security Command Center API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Security Command Center API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/securitycenter/latest) +* [Security Command Center API Documentation](https://cloud.google.com/security-command-center/docs/reference/rest) + +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) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Security Command Center API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/security-center +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| batch create resource value configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js) | +| bulk mute findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js) | +| create big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js) | +| create event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js) | +| create finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js) | +| create mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js) | +| create notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js) | +| create security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js) | +| create source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js) | +| delete big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js) | +| delete event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js) | +| delete mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js) | +| delete notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js) | +| delete resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js) | +| delete security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js) | +| get big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js) | +| get effective event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js) | +| get effective security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js) | +| get event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js) | +| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js) | +| get mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js) | +| get notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js) | +| get organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js) | +| get resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js) | +| get security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js) | +| get simulation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js) | +| get source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js) | +| get valued resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js) | +| group assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js) | +| group findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js) | +| list assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js) | +| list attack paths | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js) | +| list big query exports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js) | +| list descendant event threat detection custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js) | +| list descendant security health analytics custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js) | +| list effective event threat detection custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js) | +| list effective security health analytics custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js) | +| list event threat detection custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js) | +| list findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js) | +| list mute configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js) | +| list notification configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js) | +| list resource value configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js) | +| list security health analytics custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js) | +| list sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js) | +| list valued resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js) | +| run asset discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js) | +| set finding state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js) | +| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js) | +| set mute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js) | +| simulate security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js) | +| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js) | +| update big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js) | +| update event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js) | +| update external system | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js) | +| update finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js) | +| update mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js) | +| update notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js) | +| update organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js) | +| update resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js) | +| update security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js) | +| update security marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js) | +| update source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js) | +| validate event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json) | +| create finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js) | +| create source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js) | +| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js) | +| get organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js) | +| get source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js) | +| group assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js) | +| group findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js) | +| list assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js) | +| list findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js) | +| list sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js) | +| run asset discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js) | +| set finding state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js) | +| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js) | +| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js) | +| update finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js) | +| update organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js) | +| update security marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js) | +| update source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json) | +| create finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js) | +| create notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js) | +| create source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js) | +| delete notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js) | +| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js) | +| get notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js) | +| get organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js) | +| get source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js) | +| group assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js) | +| group findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js) | +| list assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js) | +| list findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js) | +| list notification configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js) | +| list sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js) | +| run asset discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js) | +| set finding state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js) | +| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js) | +| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js) | +| update finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js) | +| update notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js) | +| update organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js) | +| update security marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js) | +| update source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json) | +| batch create resource value configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js) | +| bulk mute findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js) | +| create big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js) | +| create finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js) | +| create mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js) | +| create notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js) | +| create source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js) | +| delete big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js) | +| delete mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js) | +| delete notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js) | +| delete resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js) | +| get big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js) | +| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js) | +| get mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js) | +| get notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js) | +| get resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js) | +| get simulation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js) | +| get source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js) | +| get valued resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js) | +| group findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js) | +| list attack paths | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js) | +| list big query exports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js) | +| list findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js) | +| list mute configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js) | +| list notification configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js) | +| list resource value configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js) | +| list sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js) | +| list valued resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js) | +| set finding state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js) | +| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js) | +| set mute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js) | +| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js) | +| update big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js) | +| update external system | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js) | +| update finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js) | +| update mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js) | +| update notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js) | +| update resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js) | +| update security marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js) | +| update source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/security-center@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +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/google-cloud-node/blob/main/packages/google-cloud-securitycenter/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/LICENSE) + +[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/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto new file mode 100644 index 00000000000..da892b2bb60 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto @@ -0,0 +1,111 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessProto"; +option java_package = "com.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". + // + // The email address of the authenticated user or a service account acting on + // behalf of a 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". + string caller_ip = 2; + + // The caller IP's geolocation, which identifies where the call came from. + Geolocation caller_ip_geo = 3; + + // Type of user agent associated with the finding. For example, an operating + // system shell or an embedded or standalone application. + string user_agent_family = 4; + + // The caller's user agent string associated with the finding. + string user_agent = 12; + + // 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; + + // A string that represents the principal_subject that is associated with the + // identity. Unlike `principal_email`, `principal_subject` supports principals + // that aren't associated with email addresses, such as third party + // principals. For most identities, the format is + // `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`. + // Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, + // still use the legacy format `serviceAccount:{identity pool + // name}[{subject}]`. + string principal_subject = 7; + + // The name of the service account key that was used to create or exchange + // credentials when authenticating the service account that made 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; + + // The identity delegation history of an authenticated service account that + // made the request. The `serviceAccountDelegationInfo[]` object contains + // information about the real authorities that try to access Google Cloud + // 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; + + // A string that represents a username. The username provided depends on the + // type of the finding and is likely not an IAM principal. For example, this + // can be a system username if the finding is related to a virtual machine, or + // it can be an application login username. + string user_name = 11; +} + +// 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. +message Geolocation { + // A CLDR. + string region_code = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/application.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/application.proto new file mode 100644 index 00000000000..8bdfee691b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/application.proto @@ -0,0 +1,36 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ApplicationProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents an application associated with a finding. +message Application { + // The base URI that identifies the network location of the application in + // which the vulnerability was detected. For example, `http://example.com`. + string base_uri = 1; + + // The full URI with payload that can be used to reproduce the + // vulnerability. For example, `http://example.com?p=aMmYgI6H`. + string full_uri = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto new file mode 100644 index 00000000000..0da4f568ddf --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -0,0 +1,136 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/folder.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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"; + +// Security Command Center representation of a Google Cloud +// 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}" + pattern: "folders/{folder}/assets/{asset}" + pattern: "projects/{project}/assets/{asset}" + plural: "assets" + singular: "asset" + }; + + // 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 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 Google Cloud resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // 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: + // 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; + + // 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 + // 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 + // 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; + + // 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 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 Security Command Center. + google.protobuf.Timestamp create_time = 9; + + // 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 + // 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; + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_exposure.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_exposure.proto new file mode 100644 index 00000000000..1deb1dcea8e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_exposure.proto @@ -0,0 +1,71 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "AttackExposureProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// An attack exposure contains the results of an attack path simulation run. +message AttackExposure { + // This enum defines the various states an AttackExposure can be in. + enum State { + // The state is not specified. + STATE_UNSPECIFIED = 0; + + // The attack exposure has been calculated. + CALCULATED = 1; + + // The attack exposure has not been calculated. + NOT_CALCULATED = 2; + } + + // A number between 0 (inclusive) and infinity that represents how important + // this finding is to remediate. The higher the score, the more important it + // is to remediate. + double score = 1; + + // The most recent time the attack exposure was updated on this finding. + google.protobuf.Timestamp latest_calculation_time = 2; + + // The resource name of the attack path simulation result that contains the + // details regarding this attack exposure score. + // Example: `organizations/123/simulations/456/attackExposureResults/789` + string attack_exposure_result = 3; + + // What state this AttackExposure is in. This captures whether or not an + // attack exposure has been calculated or not. + State state = 4; + + // The number of high value resources that are exposed as a result of this + // finding. + int32 exposed_high_value_resources_count = 5; + + // The number of medium value resources that are exposed as a result of this + // finding. + int32 exposed_medium_value_resources_count = 6; + + // The number of high value resources that are exposed as a result of this + // finding. + int32 exposed_low_value_resources_count = 7; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_path.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_path.proto new file mode 100644 index 00000000000..48cb6d301e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_path.proto @@ -0,0 +1,131 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "AttackPathProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// A path that an attacker could take to reach an exposed resource. +message AttackPath { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/AttackPath" + pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}" + plural: "attackPaths" + singular: "attackPath" + }; + + // Represents one point that an attacker passes through in this attack path. + message AttackPathNode { + // A finding that is associated with this node in the attack path. + message PathNodeAssociatedFinding { + // Canonical name of the associated findings. Example: + // `organizations/123/sources/456/findings/789` + string canonical_finding = 1; + + // The additional taxonomy group within findings from a given source. + string finding_category = 2; + + // Full resource name of the finding. + string name = 3; + } + + // The type of the incoming attack step node. + enum NodeType { + // Type not specified + NODE_TYPE_UNSPECIFIED = 0; + + // Incoming edge joined with AND + NODE_TYPE_AND = 1; + + // Incoming edge joined with OR + NODE_TYPE_OR = 2; + + // Incoming edge is defense + NODE_TYPE_DEFENSE = 3; + + // Incoming edge is attacker + NODE_TYPE_ATTACKER = 4; + } + + // Detailed steps the attack can take between path nodes. + message AttackStepNode { + // Unique ID for one Node + string uuid = 1; + + // Attack step type. Can be either AND, OR or DEFENSE + NodeType type = 2; + + // User friendly name of the attack step + string display_name = 3; + + // Attack step labels for metadata + map labels = 4; + + // Attack step description + string description = 5; + } + + // The name of the resource at this point in the attack path. + // The format of the name follows the Cloud Asset Inventory [resource + // name + // format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + string resource = 1; + + // The [supported resource + // type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + string resource_type = 2; + + // Human-readable name of this resource. + string display_name = 3; + + // The findings associated with this node in the attack path. + repeated PathNodeAssociatedFinding associated_findings = 4; + + // Unique id of the attack path node. + string uuid = 5; + + // A list of attack step nodes that exist in this attack path node. + repeated AttackStepNode attack_steps = 6; + } + + // Represents a connection between a source node and a destination node in + // this attack path. + message AttackPathEdge { + // The attack node uuid of the source node. + string source = 1; + + // The attack node uuid of the destination node. + string destination = 2; + } + + // The attack path name, for example, + // `organizations/12/simulation/34/valuedResources/56/attackPaths/78` + string name = 1; + + // A list of nodes that exist in this attack path. + repeated AttackPathNode path_nodes = 2; + + // A list of the edges between nodes in this attack path. + repeated AttackPathEdge edges = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto new file mode 100644 index 00000000000..592ea75b1e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto @@ -0,0 +1,88 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupDisasterRecoveryProto"; +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 Google Cloud Backup and DR Service findings. +message BackupDisasterRecovery { + // The name of a Backup and DR template which comprises one or more backup + // policies. See the [Backup and DR + // documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp) + // for more information. For example, `snap-ov`. + string backup_template = 1; + + // The names of Backup and DR policies that are associated with a template + // and that define when to run a backup, how frequently to run a backup, and + // how long to retain the backup image. For example, `onvaults`. + repeated string policies = 2; + + // The name of a Backup and DR host, which is managed by the backup and + // recovery appliance and known to the management console. The host can be of + // type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file + // system, etc.), vCenter, or an ESX server. See the [Backup and DR + // documentation on + // hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications) + // for more information. For example, `centos7-01`. + string host = 3; + + // The names of Backup and DR applications. An application is a VM, database, + // or file system on a managed host monitored by a backup and recovery + // appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`, + // `centos7-01-vol02`. + repeated string applications = 4; + + // The name of the Backup and DR storage pool that the backup and recovery + // appliance is storing data in. The storage pool could be of type Cloud, + // Primary, Snapshot, or OnVault. See the [Backup and DR documentation on + // storage + // pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools). + // For example, `DiskPoolOne`. + string storage_pool = 5; + + // The names of Backup and DR advanced policy options of a policy applying to + // an application. See the [Backup and DR documentation on policy + // options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings). + // For example, `skipofflineappsincongrp, nounmap`. + repeated string policy_options = 6; + + // The name of the Backup and DR resource profile that specifies the storage + // media for backups of application and VM data. See the [Backup and DR + // documentation on + // profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile). + // For example, `GCP`. + string profile = 7; + + // The name of the Backup and DR appliance that captures, moves, and manages + // the lifecycle of backup data. For example, `backup-server-57137`. + string appliance = 8; + + // The backup type of the Backup and DR image. + // For example, `Snapshot`, `Remote Snapshot`, `OnVault`. + string backup_type = 9; + + // The timestamp at which the Backup and DR backup was created. + google.protobuf.Timestamp backup_create_time = 10; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto new file mode 100644 index 00000000000..63265a9aa45 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto @@ -0,0 +1,103 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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}" + plural: "bigQueryExports" + singular: "bigQueryExport" + }; + + // 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 BigQuery 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 BigQuery 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 BigQuery 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 and + // upload data to the BigQuery dataset. + string principal = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto new file mode 100644 index 00000000000..95b9dd4cde6 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto @@ -0,0 +1,35 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ChokepointProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains details about a chokepoint, which is a resource or resource group +// where high-risk attack paths converge, based on [attack path simulations] +// (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). +message Chokepoint { + // List of resource names of findings associated with this chokepoint. + // For example, organizations/123/sources/456/findings/789. + // This list will have at most 100 findings. + repeated string related_findings = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_armor.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_armor.proto new file mode 100644 index 00000000000..7f63542ca90 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_armor.proto @@ -0,0 +1,114 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudArmorProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Fields related to Google Cloud Armor findings. +message CloudArmor { + // Information about the [Google Cloud Armor security + // policy](https://cloud.google.com/armor/docs/security-policy-overview) + // relevant to the finding. + SecurityPolicy security_policy = 1; + + // Information about incoming requests evaluated by [Google Cloud Armor + // security + // policies](https://cloud.google.com/armor/docs/security-policy-overview). + Requests requests = 2; + + // Information about potential Layer 7 DDoS attacks identified by [Google + // Cloud Armor Adaptive + // Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). + AdaptiveProtection adaptive_protection = 3; + + // Information about DDoS attack volume and classification. + Attack attack = 4; + + // Distinguish between volumetric & protocol DDoS attack and + // application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS + // attacks, or "L_7" for Layer 7 DDoS attacks. + string threat_vector = 5; + + // Duration of attack from the start until the current moment (updated every 5 + // minutes). + google.protobuf.Duration duration = 6; +} + +// Information about the [Google Cloud Armor security +// policy](https://cloud.google.com/armor/docs/security-policy-overview) +// relevant to the finding. +message SecurityPolicy { + // The name of the Google Cloud Armor security policy, for example, + // "my-security-policy". + string name = 1; + + // The type of Google Cloud Armor security policy for example, 'backend + // security policy', 'edge security policy', 'network edge security policy', + // or 'always-on DDoS protection'. + string type = 2; + + // Whether or not the associated rule or policy is in preview mode. + bool preview = 3; +} + +// Information about the requests relevant to the finding. +message Requests { + // For 'Increasing deny ratio', the ratio is the denied traffic divided by the + // allowed traffic. For 'Allowed traffic spike', the ratio is the allowed + // traffic in the short term divided by allowed traffic in the long term. + double ratio = 1; + + // Allowed RPS (requests per second) in the short term. + int32 short_term_allowed = 2; + + // Allowed RPS (requests per second) over the long term. + int32 long_term_allowed = 3; + + // Denied RPS (requests per second) over the long term. + int32 long_term_denied = 4; +} + +// Information about [Google Cloud Armor Adaptive +// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). +message AdaptiveProtection { + // A score of 0 means that there is low confidence that the detected event is + // an actual attack. A score of 1 means that there is high confidence that the + // detected event is an attack. See the [Adaptive Protection + // documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) + // for further explanation. + double confidence = 1; +} + +// Information about DDoS attack volume and classification. +message Attack { + // Total PPS (packets per second) volume of attack. + int32 volume_pps = 1; + + // Total BPS (bytes per second) volume of attack. + int32 volume_bps = 2; + + // Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. + string classification = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto new file mode 100644 index 00000000000..b4408c9f14f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto @@ -0,0 +1,113 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudDlpDataProfileProto"; +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: "dlp.googleapis.com/TableDataProfile" + pattern: "projects/{project}/tableProfiles/{table_profile}" + pattern: "projects/{project}/locations/{location}/tableProfiles/{table_profile}" +}; + +// The [data profile](https://cloud.google.com/dlp/docs/data-profiles) +// associated with the finding. +message CloudDlpDataProfile { + // Parents for configurations that produce data profile findings. + enum ParentType { + // Unspecified parent type. + PARENT_TYPE_UNSPECIFIED = 0; + + // Organization-level configurations. + ORGANIZATION = 1; + + // Project-level configurations. + PROJECT = 2; + } + + // Name of the data profile, for example, + // `projects/123/locations/europe/tableProfiles/8383929`. + string data_profile = 1 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/TableDataProfile" + }]; + + // The resource hierarchy level at which the data profile was generated. + ParentType parent_type = 2; + + // Type of information detected by SDP. + // Info type includes name, version and sensitivity of the detected + // information type. + repeated InfoType info_types = 3; +} + +// Type of information detected by the API. +message InfoType { + // Name of the information type. Either a name of your choosing when + // creating a CustomInfoType, or one of the names listed + // at + // https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference + // when specifying a built-in type. When sending Cloud DLP results to Data + // Catalog, infoType names should conform to the pattern + // `[A-Za-z0-9$_-]{1,64}`. + string name = 1; + + // Optional version name for this InfoType. + string version = 2; + + // Optional custom sensitivity for this InfoType. + // This only applies to data profiling. + SensitivityScore sensitivity_score = 3; +} + +// Score is calculated from of all elements in the data profile. +// A higher level means the data is more sensitive. +message SensitivityScore { + // Various sensitivity score levels for resources. + enum SensitivityScoreLevel { + // Unused. + SENSITIVITY_SCORE_LEVEL_UNSPECIFIED = 0; + + // No sensitive information detected. The resource isn't publicly + // accessible. + SENSITIVITY_LOW = 10; + + // Unable to determine sensitivity. + SENSITIVITY_UNKNOWN = 12; + + // Medium risk. Contains personally identifiable information (PII), + // potentially sensitive data, or fields with free-text data that are at a + // higher risk of having intermittent sensitive data. Consider limiting + // access. + SENSITIVITY_MODERATE = 20; + + // High risk. Sensitive personally identifiable information (SPII) can be + // present. Exfiltration of data can lead to user data loss. + // Re-identification of users might be possible. Consider limiting usage and + // or removing SPII. + SENSITIVITY_HIGH = 30; + } + + // The sensitivity score applied to the resource. + SensitivityScoreLevel score = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto new file mode 100644 index 00000000000..2b8bb20c892 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto @@ -0,0 +1,54 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudDlpInspectionProto"; +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: "dlp.googleapis.com/DlpJob" + pattern: "projects/{project}/dlpJobs/{dlp_job}" + pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}" +}; + +// Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection +// job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced +// the finding. +message CloudDlpInspection { + // Name of the inspection job, for example, + // `projects/123/locations/europe/dlpJobs/i-8383929`. + string inspect_job = 1 + [(google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" }]; + + // The type of information (or + // *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, + // for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. + string info_type = 2; + + // The number of times Cloud DLP found this infoType within this job + // and resource. + int64 info_type_count = 3; + + // Whether Cloud DLP scanned the complete resource or a sampled subset. + bool full_scan = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto new file mode 100644 index 00000000000..f3d9f25c22c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto @@ -0,0 +1,39 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 { + // Industry-wide compliance standards or benchmarks, such as CIS, PCI, and + // OWASP. + string standard = 1; + + // Version of the standard or benchmark, for example, 1.1 + string version = 2; + + // Policies within the standard or benchmark, for example, A.12.4.1 + repeated string ids = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto new file mode 100644 index 00000000000..2ebccbca549 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto @@ -0,0 +1,66 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto new file mode 100644 index 00000000000..b8928123299 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto @@ -0,0 +1,37 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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"; + +// Details about specific contacts +message ContactDetails { + // A list of contacts + repeated Contact contacts = 1; +} + +// The email address of a contact. +message Contact { + // An email address. For example, "`person123@company.com`". + string email = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto new file mode 100644 index 00000000000..6b639bbe700 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto @@ -0,0 +1,48 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 { + // Name of the container. + string name = 1; + + // Container image URI provided when configuring a pod or container. This + // string can identify a container image version using mutable tags. + string uri = 2; + + // Optional container image ID, if 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; + + // The time that the container was created. + google.protobuf.Timestamp create_time = 5; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto new file mode 100644 index 00000000000..69c9cd2b025 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 Cloud SQL instances or Cloud +// Spanner instances), or the database instance itself. Some database resources +// might not have the [full resource +// name](https://google.aip.dev/122#full-resource-names) populated because these +// resource types, such as Cloud SQL databases, are not yet supported by Cloud +// Asset Inventory. In these cases only the display name is provided. +message Database { + // Some database resources may not have the [full resource + // name](https://google.aip.dev/122#full-resource-names) populated because + // these resource types are not yet supported by Cloud Asset Inventory (e.g. + // Cloud SQL databases). In these cases only the display name will be + // provided. + // The [full resource name](https://google.aip.dev/122#full-resource-names) of + // the database that the user connected to, if it is supported by Cloud Asset + // Inventory. + string name = 1; + + // The human-readable name of the database that the user connected to. + string display_name = 2; + + // The username used to connect to the database. The username might not be an + // IAM principal and does not have a set format. + string user_name = 3; + + // The SQL statement that is associated with the database access. + string query = 4; + + // The target usernames, roles, or groups of an SQL privilege grant, which is + // not an IAM policy change. + repeated string grantees = 5; + + // The version of the database, for example, POSTGRES_14. + // See [the complete + // list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). + string version = 6; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto new file mode 100644 index 00000000000..0e2d16833ea --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto @@ -0,0 +1,85 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/struct.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "EffectiveEventThreatDetectionCustomModuleProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// An EffectiveEventThreatDetectionCustomModule is the representation of +// an Event Threat Detection custom module at a specified level of the +// resource hierarchy: organization, folder, or project. If a custom module is +// inherited from a parent organization or folder, the value of the +// `enablement_state` property in EffectiveEventThreatDetectionCustomModule is +// set to the value that is effective in the parent, instead of `INHERITED`. +// For example, if the module is enabled in a parent organization or folder, the +// effective `enablement_state` for the module in all child folders or projects +// is also `enabled`. EffectiveEventThreatDetectionCustomModule is read-only. +message EffectiveEventThreatDetectionCustomModule { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" + pattern: "organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}" + pattern: "folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}" + pattern: "projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}" + }; + + // The enablement state of the module. + enum EnablementState { + // Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0; + + // The module is enabled at the given level. + ENABLED = 1; + + // The module is disabled at the given level. + DISABLED = 2; + } + + // Output only. The resource name of the effective ETD custom module. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + // * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + // * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Config for the effective module. + google.protobuf.Struct config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The effective state of enablement for the module at the given + // level of the hierarchy. + EnablementState enablement_state = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type for the module. e.g. CONFIGURABLE_BAD_IP. + string type = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The human readable name to be displayed for the module. + string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The description for the module. + string description = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto new file mode 100644 index 00000000000..70093981f08 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto @@ -0,0 +1,81 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/security_health_analytics_custom_config.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "EffectiveSecurityHealthAnalyticsCustomModuleProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// An EffectiveSecurityHealthAnalyticsCustomModule is the representation of +// a Security Health Analytics custom module at a specified level of the +// resource hierarchy: organization, folder, or project. If a custom module is +// inherited from a parent organization or folder, the value of the +// `enablementState` property in EffectiveSecurityHealthAnalyticsCustomModule is +// set to the value that is effective in the parent, instead of `INHERITED`. +// For example, if the module is enabled in a parent organization or folder, the +// effective enablement_state for the module in all child folders or projects is +// also `enabled`. EffectiveSecurityHealthAnalyticsCustomModule is read-only. +message EffectiveSecurityHealthAnalyticsCustomModule { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule" + pattern: "organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}" + pattern: "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}" + pattern: "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}" + }; + + // The enablement state of the module. + enum EnablementState { + // Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0; + + // The module is enabled at the given level. + ENABLED = 1; + + // The module is disabled at the given level. + DISABLED = 2; + } + + // Output only. The resource name of the custom module. + // Its format is + // "organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}", + // or + // "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}", + // or + // "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user-specified configuration for the module. + CustomConfig custom_config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The effective state of enablement for the module at the given + // level of the hierarchy. + EnablementState enablement_state = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name for the custom module. The name must be + // between 1 and 128 characters, start with a lowercase letter, and contain + // alphanumeric characters or underscores only. + string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto new file mode 100644 index 00000000000..a368cc95abe --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto @@ -0,0 +1,102 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "EventThreatDetectionCustomModuleProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents an instance of an Event Threat Detection custom module, +// including its full module name, display name, enablement state, and last +// updated time. You can create a custom module at the organization, folder, or +// project level. Custom modules that you create at the organization or folder +// level are inherited by child folders and projects. +message EventThreatDetectionCustomModule { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + pattern: "organizations/{organization}/eventThreatDetectionSettings/customModules/{module}" + pattern: "folders/{folder}/eventThreatDetectionSettings/customModules/{module}" + pattern: "projects/{project}/eventThreatDetectionSettings/customModules/{module}" + }; + + // The enablement state of the module. + enum EnablementState { + // Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0; + + // The module is enabled at the given level. + ENABLED = 1; + + // The module is disabled at the given level. + DISABLED = 2; + + // When the enablement state is inherited. + INHERITED = 3; + } + + // Immutable. The resource name of the Event Threat Detection custom module. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + // * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + // * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Config for the module. For the resident module, its config value is defined + // at this level. For the inherited module, its config value is inherited from + // the ancestor module. + google.protobuf.Struct config = 2; + + // Output only. The closest ancestor module that this module inherits the + // enablement state from. The format is the same as the + // EventThreatDetectionCustomModule resource name. + string ancestor_module = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + ]; + + // The state of enablement for the module at the given level of the hierarchy. + EnablementState enablement_state = 4; + + // Type for the module. e.g. CONFIGURABLE_BAD_IP. + string type = 5; + + // The human readable name to be displayed for the module. + string display_name = 6; + + // The description for the module. + string description = 7; + + // Output only. The time the module was last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The editor the module was last updated by. + string last_editor = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto new file mode 100644 index 00000000000..7865e3e596f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto @@ -0,0 +1,59 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "EventThreatDetectionCustomModuleValidationErrorsProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// A list of zero or more errors encountered while validating the uploaded +// configuration of an Event Threat Detection Custom Module. +message CustomModuleValidationErrors { + repeated CustomModuleValidationError errors = 1; +} + +// An error encountered while validating the uploaded configuration of an +// Event Threat Detection Custom Module. +message CustomModuleValidationError { + // A description of the error, suitable for human consumption. Required. + string description = 1; + + // The path, in RFC 8901 JSON Pointer format, to the field that failed + // validation. This may be left empty if no specific field is affected. + string field_path = 2; + + // The initial position of the error in the uploaded text version of the + // module. This field may be omitted if no specific position applies, or if + // one could not be computed. + optional Position start = 3; + + // The end position of the error in the uploaded text version of the + // module. This field may be omitted if no specific position applies, or if + // one could not be computed.. + optional Position end = 4; +} + +// A position in the uploaded text version of a module. +message Position { + int32 line_number = 1; + + int32 column_number = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto new file mode 100644 index 00000000000..dea4c11a99f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto @@ -0,0 +1,57 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 from one or more sources +// to one or more targets. The `sources` attribute lists the sources of the +// exfiltrated data. The `targets` attribute lists the destinations 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; + + // Total exfiltrated bytes processed for the entire job. + int64 total_exfiltrated_bytes = 3; +} + +// Resource where data was exfiltrated from or exfiltrated to. +message ExfilResource { + // The resource's [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name). + string name = 1; + + // Subcomponents of the asset that was exfiltrated, like URIs used during + // exfiltration, table names, databases, and filenames. For example, multiple + // tables might have been exfiltrated from the same Cloud SQL instance, or + // multiple files might have been exfiltrated from the same Cloud Storage + // bucket. + repeated string components = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.proto new file mode 100644 index 00000000000..90842609448 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.proto @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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_info.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ExternalExposureProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Details about the externally exposed resource associated with the finding. +message ExternalExposure { + // Private IP address of the exposed endpoint. + string private_ip_address = 1 [(google.api.field_info).format = IPV4_OR_IPV6]; + + // Port number associated with private IP address. + string private_port = 2; + + // The name and version of the service, for example, "Jupyter + // Notebook 6.14.0". + string exposed_service = 3; + + // Public IP address of the exposed endpoint. + string public_ip_address = 4 [(google.api.field_info).format = IPV4_OR_IPV6]; + + // Public port number of the exposed endpoint. + string public_port = 5; + + // The resource which is running the exposed service, for example, + // "//compute.googleapis.com/projects/{project-id}/zones/{zone}/instances/{instance}.” + string exposed_endpoint = 6; + + // The full resource name of the load balancer firewall policy, for example, + // "//compute.googleapis.com/projects/{project-id}/global/firewallPolicies/{policy-name}". + string load_balancer_firewall_policy = 7; + + // The full resource name of the firewall policy of the exposed service, for + // example, + // "//compute.googleapis.com/projects/{project-id}/global/firewallPolicies/{policy-name}". + string service_firewall_policy = 8; + + // The full resource name of the forwarding rule, for example, + // "//compute.googleapis.com/projects/{project-id}/global/forwardingRules/{forwarding-rule-name}". + string forwarding_rule = 9; + + // The full resource name of load balancer backend service, for example, + // "//compute.googleapis.com/projects/{project-id}/global/backendServices/{name}". + string backend_service = 10; + + // The full resource name of the instance group, for example, + // "//compute.googleapis.com/projects/{project-id}/global/instanceGroups/{name}". + string instance_group = 11; + + // The full resource name of the network endpoint group, for example, + // "//compute.googleapis.com/projects/{project-id}/global/networkEndpointGroups/{name}". + string network_endpoint_group = 12; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto new file mode 100644 index 00000000000..6c3cd1d1221 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto @@ -0,0 +1,103 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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}" + plural: "externalSystems" + singular: "externalSystem" + }; + + // Information about the ticket, if any, that is being used to track the + // resolution of the issue that is identified by this finding. + message TicketInfo { + // The identifier of the ticket in the ticket system. + string id = 1; + + // The assignee of the ticket in the ticket system. + string assignee = 2; + + // The description of the ticket in the ticket system. + string description = 3; + + // The link to the ticket in the ticket system. + string uri = 4; + + // The latest status of the ticket, as reported by the ticket system. + string status = 5; + + // The time when the ticket was last updated, as reported by the ticket + // system. + google.protobuf.Timestamp update_time = 6; + } + + // Full resource name of the external system, for example: + // "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; + + // The identifier that's used to track the finding's corresponding case in the + // external system. + string external_uid = 3; + + // The most recent status of the finding's corresponding case, as reported by + // the external system. + string status = 4; + + // The time when the case was last updated, as reported by the external + // system. + google.protobuf.Timestamp external_system_update_time = 5; + + // The link to the finding's corresponding case in the external system. + string case_uri = 6; + + // The priority of the finding's corresponding case in the external system. + string case_priority = 7; + + // The SLA of the finding's corresponding case in the external system. + google.protobuf.Timestamp case_sla = 9; + + // The time when the case was created, as reported by the external system. + google.protobuf.Timestamp case_create_time = 10; + + // The time when the case was closed, as reported by the external system. + google.protobuf.Timestamp case_close_time = 11; + + // Information about the ticket, if any, that is being used to track the + // resolution of the issue that is identified by this finding. + TicketInfo ticket_info = 8; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto new file mode 100644 index 00000000000..52678aa358c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto @@ -0,0 +1,65 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 { + // Path of the file in terms of underlying disk/partition identifiers. + message DiskPath { + // UUID of the partition (format + // https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid) + string partition_uuid = 1; + + // Relative path of the file in the partition as a JSON encoded string. + // Example: /home/user1/executable_file.sh + string relative_path = 2; + } + + // 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, 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. + string contents = 6; + + // Path of the file in terms of underlying disk/partition identifiers. + DiskPath disk_path = 7; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto new file mode 100644 index 00000000000..dd7a7e1a05c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -0,0 +1,485 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/access.proto"; +import "google/cloud/securitycenter/v1/application.proto"; +import "google/cloud/securitycenter/v1/attack_exposure.proto"; +import "google/cloud/securitycenter/v1/backup_disaster_recovery.proto"; +import "google/cloud/securitycenter/v1/chokepoint.proto"; +import "google/cloud/securitycenter/v1/cloud_armor.proto"; +import "google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto"; +import "google/cloud/securitycenter/v1/cloud_dlp_inspection.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/database.proto"; +import "google/cloud/securitycenter/v1/exfiltration.proto"; +import "google/cloud/securitycenter/v1/external_exposure.proto"; +import "google/cloud/securitycenter/v1/external_system.proto"; +import "google/cloud/securitycenter/v1/file.proto"; +import "google/cloud/securitycenter/v1/group_membership.proto"; +import "google/cloud/securitycenter/v1/iam_binding.proto"; +import "google/cloud/securitycenter/v1/indicator.proto"; +import "google/cloud/securitycenter/v1/kernel_rootkit.proto"; +import "google/cloud/securitycenter/v1/kubernetes.proto"; +import "google/cloud/securitycenter/v1/load_balancer.proto"; +import "google/cloud/securitycenter/v1/log_entry.proto"; +import "google/cloud/securitycenter/v1/mitre_attack.proto"; +import "google/cloud/securitycenter/v1/notebook.proto"; +import "google/cloud/securitycenter/v1/org_policy.proto"; +import "google/cloud/securitycenter/v1/process.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/cloud/securitycenter/v1/security_posture.proto"; +import "google/cloud/securitycenter/v1/toxic_combination.proto"; +import "google/cloud/securitycenter/v1/vulnerability.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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"; + +// Security Command Center finding. +// +// A finding is a record of assessment data like security, risk, health, or +// 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 { + 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}" + plural: "findings" + singular: "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 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 and public SSH access with weak or no + // passwords. + // + // 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; + } + + // 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. + 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; + + // Describes an error that prevents some SCC functionality. + SCC_ERROR = 5; + + // Describes a potential security risk due to a change in the security + // posture. + POSTURE_VIOLATION = 6; + + // Describes a group of security issues that, when the issues + // occur together, represent a greater risk than when the issues occur + // independently. A group of such issues is referred to as a toxic + // combination. + TOXIC_COMBINATION = 7; + + // Describes a potential security risk to data assets that contain sensitive + // data. + SENSITIVE_DATA_RISK = 8; + + // Describes a resource or resource group where high risk attack paths + // converge, based on attack path simulations (APS). + CHOKEPOINT = 9; + + // Describes a potential security risk due to the resource being exposed to + // the internet. + EXTERNAL_EXPOSURE = 10; + } + + // Mute information about the finding, including whether the finding has a + // static mute or any matching dynamic mute rules. + message MuteInfo { + // Information about the static mute state. A static mute state overrides + // any dynamic mute rules that apply to this finding. The static mute state + // can be set by a static mute rule or by muting the finding directly. + message StaticMute { + // The static mute state. If the value is `MUTED` or `UNMUTED`, then the + // finding's overall mute state will have the same value. + Mute state = 1; + + // When the static mute was applied. + google.protobuf.Timestamp apply_time = 2; + } + + // The record of a dynamic mute rule that matches the finding. + message DynamicMuteRecord { + // The relative resource name of the mute rule, represented by a mute + // config, that created this record, for example + // `organizations/123/muteConfigs/mymuteconfig` or + // `organizations/123/locations/global/muteConfigs/mymuteconfig`. + string mute_config = 1; + + // When the dynamic mute rule first matched the finding. + google.protobuf.Timestamp match_time = 2; + } + + // If set, the static mute applied to this finding. Static mutes override + // dynamic mutes. If unset, there is no static mute. + StaticMute static_mute = 1; + + // The list of dynamic mute rules that currently match the finding. + repeated DynamicMuteRecord dynamic_mute_records = 2; + } + + // The [relative resource + // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + // of the finding. Example: + // "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; + + // 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 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-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. + 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 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 + // 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 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; + + // 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; + + // 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; + + // 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; + + // 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. For more information, see [Indicator of + // compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). + Indicator indicator = 18; + + // Represents vulnerability-specific fields like CVE and CVSS scores. + // 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]; + + // 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 with the finding, such as more information on the + // caller, which method was accessed, and from where. + Access access = 26; + + // Contains information about the IP connection associated with the finding. + repeated Connection connections = 31; + + // Records additional information about the mute operation, for example, the + // [mute configuration](/security-command-center/docs/how-to-mute-findings) + // that muted the finding and the user who muted the finding. + string mute_initiator = 28; + + // Output only. The mute information regarding this finding. + MuteInfo mute_info = 61 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Represents operating system processes associated with the Finding. + repeated Process processes = 30; + + // 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 + // + // { + // "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; + + // 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 details about the finding. + string description = 37; + + // Represents exfiltrations associated with the finding. + Exfiltration exfiltration = 38; + + // Represents IAM bindings associated with the finding. + repeated IamBinding iam_bindings = 39; + + // Steps to address the finding. + string next_steps = 40; + + // Unique identifier of the module which generated the finding. + // Example: + // folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885 + string module_name = 41; + + // Containers associated with the finding. This field provides information for + // both Kubernetes and non-Kubernetes containers. + repeated Container containers = 42; + + // Kubernetes resources associated with the finding. + Kubernetes kubernetes = 43; + + // Database associated with the finding. + Database database = 44; + + // The results of an attack path simulation relevant to this finding. + AttackExposure attack_exposure = 45; + + // File associated with the finding. + repeated File files = 46; + + // Cloud Data Loss Prevention (Cloud DLP) inspection results that are + // associated with the finding. + CloudDlpInspection cloud_dlp_inspection = 48; + + // Cloud DLP data profile that is associated with the finding. + CloudDlpDataProfile cloud_dlp_data_profile = 49; + + // Signature of the kernel rootkit. + KernelRootkit kernel_rootkit = 50; + + // Contains information about the org policies associated with the finding. + repeated OrgPolicy org_policies = 51; + + // Represents an application associated with the finding. + Application application = 53; + + // Fields related to Backup and DR findings. + BackupDisasterRecovery backup_disaster_recovery = 55; + + // The security posture associated with the finding. + SecurityPosture security_posture = 56; + + // Log entries that are relevant to the finding. + repeated LogEntry log_entries = 57; + + // The load balancers associated with the finding. + repeated LoadBalancer load_balancers = 58; + + // Fields related to Cloud Armor findings. + CloudArmor cloud_armor = 59; + + // Notebook associated with the finding. + Notebook notebook = 63; + + // Contains details about a group of security issues that, when the issues + // occur together, represent a greater risk than when the issues occur + // independently. A group of such issues is referred to as a toxic + // combination. + // This field cannot be updated. Its value is ignored in all update requests. + ToxicCombination toxic_combination = 64; + + // Contains details about groups of which this finding is a member. A group is + // a collection of findings that are related in some way. + // This field cannot be updated. Its value is ignored in all update requests. + repeated GroupMembership group_memberships = 65; + + // Contains details about a chokepoint, which is a resource or resource group + // where high-risk attack paths converge, based on [attack path simulations] + // (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). + // This field cannot be updated. Its value is ignored in all update requests. + Chokepoint chokepoint = 77; + + // External exposure associated with the finding. + ExternalExposure external_exposure = 84; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto new file mode 100644 index 00000000000..d816c9ed0b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto @@ -0,0 +1,36 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto new file mode 100644 index 00000000000..1625145ca45 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto @@ -0,0 +1,47 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "GroupMembershipProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains details about groups of which this finding is a member. A group is a +// collection of findings that are related in some way. +message GroupMembership { + // Possible types of groups. + enum GroupType { + // Default value. + GROUP_TYPE_UNSPECIFIED = 0; + + // Group represents a toxic combination. + GROUP_TYPE_TOXIC_COMBINATION = 1; + + // Group represents a chokepoint. + GROUP_TYPE_CHOKEPOINT = 3; + } + + // Type of group. + GroupType group_type = 1; + + // ID of the group. + string group_id = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto new file mode 100644 index 00000000000..ad44b5e5128 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto @@ -0,0 +1,52 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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, for + // example, "foo@google.com". + string member = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto new file mode 100644 index 00000000000..00aefebd3ff --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto @@ -0,0 +1,98 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "IndicatorProto"; +option java_package = "com.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. +// For more information, see [Indicator of +// compromise](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; + } + + // Possible resource types to be associated with a signature. + enum SignatureType { + // The default signature type. + SIGNATURE_TYPE_UNSPECIFIED = 0; + + // Used for signatures concerning processes. + SIGNATURE_TYPE_PROCESS = 1; + + // Used for signatures concerning disks. + SIGNATURE_TYPE_FILE = 2; + } + + 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; + } + + // Describes the type of resource associated with the signature. + SignatureType signature_type = 8; + } + + // The list of IP addresses that are associated with 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; + + // The list of URIs associated to the Findings. + repeated string uris = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto new file mode 100644 index 00000000000..9042faaf1e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "KernelRootkitProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Kernel mode rootkit signatures. +message KernelRootkit { + // Rootkit name, when available. + string name = 1; + + // True if unexpected modifications of kernel code memory are present. + bool unexpected_code_modification = 2; + + // True if unexpected modifications of kernel read-only data memory are + // present. + bool unexpected_read_only_data_modification = 3; + + // True if `ftrace` points are present with callbacks pointing to regions + // that are not in the expected kernel or module code range. + bool unexpected_ftrace_handler = 4; + + // True if `kprobe` points are present with callbacks pointing to regions + // that are not in the expected kernel or module code range. + bool unexpected_kprobe_handler = 5; + + // True if kernel code pages that are not in the expected kernel or module + // code regions are present. + bool unexpected_kernel_code_pages = 6; + + // True if system call handlers that are are not in the expected kernel or + // module code regions are present. + bool unexpected_system_call_handler = 7; + + // True if interrupt handlers that are are not in the expected kernel or + // module code regions are present. + bool unexpected_interrupt_handler = 8; + + // True if unexpected processes in the scheduler run queue are present. Such + // processes are in the run queue, but not in the process task list. + bool unexpected_processes_in_runqueue = 9; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto new file mode 100644 index 00000000000..5d252b7bd11 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto @@ -0,0 +1,216 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 { + // A 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](https://google.aip.dev/122#full-resource-names) 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 the binding. + string ns = 1; + + // Name for the binding. + string name = 2; + + // The Role or ClusterRole referenced by the binding. + Role role = 3; + + // Represents one or more subjects that are 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 the 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 the subject. + AuthType kind = 1; + + // Namespace for the subject. + string ns = 2; + + // Name for the subject. + string name = 3; + } + + // Conveys information about a Kubernetes access review (such as one returned + // by a [`kubectl auth + // can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) + // command) that was involved in a finding. + message AccessReview { + // 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; + + // The name of the resource being requested. Empty means all. + string name = 3; + + // The optional resource type requested. "*" means all. + string resource = 4; + + // The optional subresource type. + string subresource = 5; + + // A Kubernetes resource API verb, like get, list, watch, create, update, + // delete, proxy. "*" means all. + string verb = 6; + + // The API version of the resource. "*" means all. + string version = 7; + } + + // Kubernetes object related to the finding, uniquely identified by GKNN. + // Used if the object Kind is not one of Pod, Node, NodePool, Binding, or + // AccessReview. + message Object { + // Kubernetes object group, such as "policy.k8s.io/v1". + string group = 1; + + // Kubernetes object kind, such as "Namespace". + string kind = 2; + + // Kubernetes object namespace. Must be a valid DNS label. Named + // "ns" to avoid collision with C++ namespace keyword. For details see + // https://kubernetes.io/docs/tasks/administer-cluster/namespaces/. + string ns = 3; + + // Kubernetes object name. For details see + // https://kubernetes.io/docs/concepts/overview/working-with-objects/names/. + string name = 4; + + // Pod containers associated with this finding, if any. + repeated Container containers = 5; + } + + // Kubernetes + // [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) + // associated with the finding. This field contains Pod records for each + // container that is owned by a Pod. + repeated Pod pods = 1; + + // Provides Kubernetes + // [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) + // information. + repeated Node nodes = 2; + + // GKE [node + // pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) + // associated with the finding. This field contains node pool information for + // each node, when it is available. + repeated NodePool node_pools = 3; + + // Provides Kubernetes role information for findings that involve [Roles or + // ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). + repeated Role roles = 4; + + // Provides Kubernetes role binding information for findings that involve + // [RoleBindings or + // ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). + repeated Binding bindings = 5; + + // Provides information on any Kubernetes access reviews (privilege checks) + // relevant to the finding. + repeated AccessReview access_reviews = 6; + + // Kubernetes objects related to the finding. + repeated Object objects = 7; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto new file mode 100644 index 00000000000..b08bbfd0529 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto @@ -0,0 +1,37 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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"; + +// Represents a generic name-value label. A label has separate name and value +// fields to support filtering with the `contains()` function. For more +// information, see [Filtering on array-type +// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). +message Label { + // Name of the label. + string name = 1; + + // Value that corresponds to the label's name. + string value = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/load_balancer.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/load_balancer.proto new file mode 100644 index 00000000000..9053fad15f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/load_balancer.proto @@ -0,0 +1,32 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "LoadBalancerProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains information related to the load balancer associated with the +// finding. +message LoadBalancer { + // The name of the load balancer associated with the finding. + string name = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/log_entry.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/log_entry.proto new file mode 100644 index 00000000000..93c8df2df27 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/log_entry.proto @@ -0,0 +1,55 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "LogEntryProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// An individual entry in a log. +message LogEntry { + oneof log_entry { + // An individual entry in a log stored in Cloud Logging. + CloudLoggingEntry cloud_logging_entry = 1; + } +} + +// Metadata taken from a [Cloud Logging +// LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) +message CloudLoggingEntry { + // A unique identifier for the log entry. + string insert_id = 1; + + // The type of the log (part of `log_name`. `log_name` is the resource name of + // the log to which this log entry belongs). For example: + // `cloudresourcemanager.googleapis.com/activity`. Note that this field is not + // URL-encoded, unlike the `LOG_ID` field in `LogEntry`. + string log_id = 2; + + // The organization, folder, or project of the monitored resource that + // produced this log entry. + string resource_container = 3; + + // The time the event described by the log entry occurred. + google.protobuf.Timestamp timestamp = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto new file mode 100644 index 00000000000..c820cc50a95 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -0,0 +1,299 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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/ + // Next ID: 65 + enum Technique { + // Unspecified value. + TECHNIQUE_UNSPECIFIED = 0; + + // T1036 + MASQUERADING = 49; + + // T1036.005 + MATCH_LEGITIMATE_NAME_OR_LOCATION = 50; + + // T1037 + BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37; + + // T1037.005 + STARTUP_ITEMS = 38; + + // T1046 + NETWORK_SERVICE_DISCOVERY = 32; + + // T1057 + PROCESS_DISCOVERY = 56; + + // T1059 + COMMAND_AND_SCRIPTING_INTERPRETER = 6; + + // T1059.004 + UNIX_SHELL = 7; + + // T1059.006 + PYTHON = 59; + + // T1068 + EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63; + + // T1069 + PERMISSION_GROUPS_DISCOVERY = 18; + + // T1069.003 + CLOUD_GROUPS = 19; + + // T1070.004 + INDICATOR_REMOVAL_FILE_DELETION = 64; + + // T1071 + APPLICATION_LAYER_PROTOCOL = 45; + + // T1071.004 + DNS = 46; + + // T1072 + SOFTWARE_DEPLOYMENT_TOOLS = 47; + + // T1078 + VALID_ACCOUNTS = 14; + + // T1078.001 + DEFAULT_ACCOUNTS = 35; + + // T1078.003 + LOCAL_ACCOUNTS = 15; + + // T1078.004 + CLOUD_ACCOUNTS = 16; + + // T1090 + PROXY = 9; + + // T1090.002 + EXTERNAL_PROXY = 10; + + // T1090.003 + MULTI_HOP_PROXY = 11; + + // T1098 + ACCOUNT_MANIPULATION = 22; + + // T1098.001 + ADDITIONAL_CLOUD_CREDENTIALS = 40; + + // T1098.004 + SSH_AUTHORIZED_KEYS = 23; + + // T1098.006 + ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58; + + // T1105 + INGRESS_TOOL_TRANSFER = 3; + + // T1106 + NATIVE_API = 4; + + // T1110 + BRUTE_FORCE = 44; + + // T1129 + SHARED_MODULES = 5; + + // T1134 + ACCESS_TOKEN_MANIPULATION = 33; + + // T1134.001 + TOKEN_IMPERSONATION_OR_THEFT = 39; + + // T1190 + EXPLOIT_PUBLIC_FACING_APPLICATION = 27; + + // T1484 + DOMAIN_POLICY_MODIFICATION = 30; + + // T1485 + DATA_DESTRUCTION = 29; + + // T1489 + SERVICE_STOP = 52; + + // T1490 + INHIBIT_SYSTEM_RECOVERY = 36; + + // T1496 + RESOURCE_HIJACKING = 8; + + // T1498 + NETWORK_DENIAL_OF_SERVICE = 17; + + // T1526 + CLOUD_SERVICE_DISCOVERY = 48; + + // T1528 + STEAL_APPLICATION_ACCESS_TOKEN = 42; + + // T1531 + ACCOUNT_ACCESS_REMOVAL = 51; + + // T1539 + STEAL_WEB_SESSION_COOKIE = 25; + + // T1543 + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24; + + // T1548 + ABUSE_ELEVATION_CONTROL_MECHANISM = 34; + + // T1552 + UNSECURED_CREDENTIALS = 13; + + // T1556 + MODIFY_AUTHENTICATION_PROCESS = 28; + + // T1562 + IMPAIR_DEFENSES = 31; + + // T1562.001 + DISABLE_OR_MODIFY_TOOLS = 55; + + // T1567 + EXFILTRATION_OVER_WEB_SERVICE = 20; + + // T1567.002 + EXFILTRATION_TO_CLOUD_STORAGE = 21; + + // T1568 + DYNAMIC_RESOLUTION = 12; + + // T1570 + LATERAL_TOOL_TRANSFER = 41; + + // T1578 + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26; + + // T1578.001 + CREATE_SNAPSHOT = 54; + + // T1580 + CLOUD_INFRASTRUCTURE_DISCOVERY = 53; + + // T1588 + OBTAIN_CAPABILITIES = 43; + + // T1595 + ACTIVE_SCANNING = 1; + + // T1595.001 + SCANNING_IP_BLOCKS = 2; + + // T1609 + CONTAINER_ADMINISTRATION_COMMAND = 60; + + // T1611 + ESCAPE_TO_HOST = 61; + + // T1613 + CONTAINER_AND_RESOURCE_DISCOVERY = 57; + + // T1649 + STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62; + } + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto new file mode 100644 index 00000000000..bef411206b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto @@ -0,0 +1,130 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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}" + pattern: "organizations/{organization}/locations/{location}/muteConfigs/{mute_config}" + pattern: "folders/{folder}/locations/{location}/muteConfigs/{mute_config}" + pattern: "projects/{project}/locations/{location}/muteConfigs/{mute_config}" + plural: "muteConfigs" + singular: "muteConfig" + }; + + // The type of MuteConfig. + enum MuteConfigType { + // Unused. + MUTE_CONFIG_TYPE_UNSPECIFIED = 0; + + // A static mute config, which sets the static mute state of future matching + // findings to muted. Once the static mute state has been set, finding or + // config modifications will not affect the state. + STATIC = 1; + + // A dynamic mute config, which is applied to existing and future matching + // findings, setting their dynamic mute state to "muted". If the config is + // updated or deleted, or a matching finding is updated, such that the + // finding doesn't match the config, the config will be removed from the + // finding, and the finding's dynamic mute state may become "unmuted" + // (unless other configs still match). + DYNAMIC = 2; + } + + // 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}` + // `organizations/{organization}/locations/global/muteConfigs/{mute_config}` + // `folders/{folder}/locations/global/muteConfigs/{mute_config}` + // `projects/{project}/locations/global/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]; + + // Optional. The type of the mute config, which determines what type of mute + // state the config affects. The static mute state takes precedence over the + // dynamic mute state. Immutable after creation. STATIC by default if not set + // during creation. + MuteConfigType type = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The expiry of the mute config. Only applicable for dynamic + // configs. If the expiry is set, when the config expires, it is removed from + // all findings. + google.protobuf.Timestamp expiry_time = 9 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notebook.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notebook.proto new file mode 100644 index 00000000000..38e7af770d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notebook.proto @@ -0,0 +1,44 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise +// notebook](https://cloud.google.com/colab/docs/introduction) file, that is +// associated with a finding. +message Notebook { + // The name of the notebook. + string name = 1; + + // The source notebook service, for example, "Colab Enterprise". + string service = 2; + + // The user ID of the latest author to modify the notebook. + string last_author = 3; + + // The most recent time the notebook was updated. + google.protobuf.Timestamp notebook_update_time = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto new file mode 100644 index 00000000000..374e6167c8d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -0,0 +1,101 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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}" + pattern: "folders/{folder}/notificationConfigs/{notification_config}" + pattern: "projects/{project}/notificationConfigs/{notification_config}" + plural: "notificationConfigs" + singular: "notificationConfig" + }; + + // 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", + // "folders/{folder_id}/notificationConfigs/notify_public_bucket", + // or "projects/{project_id}/notificationConfigs/notify_public_bucket". + string name = 1; + + // The description of the notification config (max of 1024 characters). + string description = 2; + + // 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" } + ]; + + // Output only. The service account that needs "pubsub.topics.publish" + // permission to publish to the Pub/Sub 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto new file mode 100644 index 00000000000..08ed4dab91f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto @@ -0,0 +1,44 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/finding.proto"; +import "google/cloud/securitycenter/v1/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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; + } + + // The Cloud resource tied to this notification's Finding. + Resource resource = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/org_policy.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/org_policy.proto new file mode 100644 index 00000000000..fb5119dbd5a --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/org_policy.proto @@ -0,0 +1,42 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyProto"; +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 org policies associated with the finding. +message OrgPolicy { + option (google.api.resource) = { + type: "orgpolicy.googleapis.com/Policy" + pattern: "organizations/{organization}/policies/{constraint_name}" + pattern: "folders/{folder}/policies/{constraint_name}" + pattern: "projects/{project}/policies/{constraint_name}" + }; + + // The resource name of the org policy. + // Example: + // "organizations/{organization_id}/policies/{constraint_name}" + string name = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto new file mode 100644 index 00000000000..8b62e150386 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -0,0 +1,87 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 Security Command +// Center organization. +message OrganizationSettings { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + pattern: "organizations/{organization}/organizationSettings" + plural: "organizationSettings" + singular: "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 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: + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto new file mode 100644 index 00000000000..0c86ac775cd --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto @@ -0,0 +1,74 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 { + // The process name, as displayed in utilities like `top` and `ps`. This name + // can be accessed through `/proc/[pid]/comm` and changed with + // `prctl(PR_SET_NAME)`. + string name = 12; + + // 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; +} + +// A name-value pair representing an environment variable used in an operating +// system 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto new file mode 100644 index 00000000000..1e0c850a140 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -0,0 +1,253 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/folder.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 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. + 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; + + // 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]; + + // Indicates which cloud provider the resource resides in. + CloudProvider cloud_provider = 9; + + // Indicates which organization or tenant in the cloud provider the finding + // applies to. + string organization = 10; + + // The parent service or product from which the resource is provided, for + // example, GKE or SNS. + string service = 11; + + // The region or location of the service (if applicable). + string location = 12; + + oneof cloud_provider_metadata { + // The AWS metadata associated with the finding. + AwsMetadata aws_metadata = 16; + + // The Azure metadata associated with the finding. + AzureMetadata azure_metadata = 17; + } + + // Provides the path to the resource within the resource hierarchy. + ResourcePath resource_path = 18; + + // A string representation of the resource path. + // For Google Cloud, it has the format of + // `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` + // where there can be any number of folders. + // For AWS, it has the format of + // `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` + // where there can be any number of organizational units. + // For Azure, it has the format of + // `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` + // where there can be any number of management groups. + string resource_path_string = 19; +} + +// Enumeration representing the various cloud providers a finding's resource +// could reside in. +enum CloudProvider { + // The cloud provider is unspecified. + CLOUD_PROVIDER_UNSPECIFIED = 0; + + // The cloud provider is Google Cloud Platform. + GOOGLE_CLOUD_PLATFORM = 1; + + // The cloud provider is Amazon Web Services. + AMAZON_WEB_SERVICES = 2; + + // The cloud provider is Microsoft Azure. + MICROSOFT_AZURE = 3; +} + +// AWS metadata associated with the resource, only applicable if the finding's +// cloud provider is Amazon Web Services. +message AwsMetadata { + // An organization is a collection of accounts that are centrally managed + // together using consolidated billing, organized hierarchically with + // organizational units (OUs), and controlled with policies. + message AwsOrganization { + // The unique identifier (ID) for the organization. The regex pattern for an + // organization ID string requires "o-" followed by from 10 to 32 lowercase + // letters or digits. + string id = 1; + } + + // An Organizational Unit (OU) is a container of AWS accounts within a root of + // an organization. Policies that are attached to an OU apply to all accounts + // contained in that OU and in any child OUs. + message AwsOrganizationalUnit { + // The unique identifier (ID) associated with this OU. The regex pattern for + // an organizational unit ID string requires "ou-" followed by from 4 to 32 + // lowercase letters or digits (the ID of the root that contains the OU). + // This string is followed by a second "-" dash and from 8 to 32 additional + // lowercase letters or digits. For example, "ou-ab12-cd34ef56". + string id = 1; + + // The friendly name of the OU. + string name = 2; + } + + // An AWS account that is a member of an organization. + message AwsAccount { + // The unique identifier (ID) of the account, containing exactly 12 digits. + string id = 1; + + // The friendly name of this account. + string name = 2; + } + + // The AWS organization associated with the resource. + AwsOrganization organization = 2; + + // A list of AWS organizational units associated with the resource, ordered + // from lowest level (closest to the account) to highest level. + repeated AwsOrganizationalUnit organizational_units = 3; + + // The AWS account associated with the resource. + AwsAccount account = 4; +} + +// Azure metadata associated with the resource, only applicable if the finding's +// cloud provider is Microsoft Azure. +message AzureMetadata { + // Represents an Azure management group. + message AzureManagementGroup { + // The UUID of the Azure management group, for example, + // `20000000-0001-0000-0000-000000000000`. + string id = 1; + + // The display name of the Azure management group. + string display_name = 2; + } + + // Represents an Azure subscription. + message AzureSubscription { + // The UUID of the Azure subscription, for example, + // `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`. + string id = 1; + + // The display name of the Azure subscription. + string display_name = 2; + } + + // Represents an Azure resource group. + message AzureResourceGroup { + // The name of the Azure resource group. This is not a UUID. + string name = 1; + } + + // A list of Azure management groups associated with the resource, ordered + // from lowest level (closest to the subscription) to highest level. + repeated AzureManagementGroup management_groups = 4; + + // The Azure subscription associated with the resource. + AzureSubscription subscription = 5; + + // The Azure resource group associated with the resource. + AzureResourceGroup resource_group = 6; +} + +// Represents the path of resources leading up to the resource this finding is +// about. +message ResourcePath { + // The type of resource the node represents. + enum ResourcePathNodeType { + // Node type is unspecified. + RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0; + + // The node represents a Google Cloud organization. + GCP_ORGANIZATION = 1; + + // The node represents a Google Cloud folder. + GCP_FOLDER = 2; + + // The node represents a Google Cloud project. + GCP_PROJECT = 3; + + // The node represents an AWS organization. + AWS_ORGANIZATION = 4; + + // The node represents an AWS organizational unit. + AWS_ORGANIZATIONAL_UNIT = 5; + + // The node represents an AWS account. + AWS_ACCOUNT = 6; + + // The node represents an Azure management group. + AZURE_MANAGEMENT_GROUP = 7; + + // The node represents an Azure subscription. + AZURE_SUBSCRIPTION = 8; + + // The node represents an Azure resource group. + AZURE_RESOURCE_GROUP = 9; + } + + // A node within the resource path. Each node represents a resource within the + // resource hierarchy. + message ResourcePathNode { + // The type of resource this node represents. + ResourcePathNodeType node_type = 1; + + // The ID of the resource this node represents. + string id = 2; + + // The display name of the resource this node represents. + string display_name = 3; + } + + // The list of nodes that make the up resource path, ordered from lowest + // level to highest level. + repeated ResourcePathNode nodes = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource_value_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource_value_config.proto new file mode 100644 index 00000000000..4416608d9e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource_value_config.proto @@ -0,0 +1,123 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourceValueConfigProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// A resource value configuration (RVC) is a mapping configuration of user's +// resources to resource values. Used in Attack path simulations. +message ResourceValueConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/ResourceValueConfig" + pattern: "organizations/{organization}/resourceValueConfigs/{resource_value_config}" + plural: "resourceValueConfigs" + singular: "resourceValueConfig" + }; + + // Resource value mapping for Sensitive Data Protection findings. + // If any of these mappings have a resource value that is not unspecified, + // the resource_value field will be ignored when reading this configuration. + message SensitiveDataProtectionMapping { + // Resource value mapping for high-sensitivity Sensitive Data Protection + // findings + ResourceValue high_sensitivity_mapping = 1; + + // Resource value mapping for medium-sensitivity Sensitive Data Protection + // findings + ResourceValue medium_sensitivity_mapping = 2; + } + + // Name for the resource value configuration + string name = 1; + + // Required. Resource value level this expression represents + ResourceValue resource_value = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Tag values combined with `AND` to check against. + // Values in the form "tagValues/123" + // Example: `[ "tagValues/123", "tagValues/456", "tagValues/789" ]` + // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing + repeated string tag_values = 3 [(google.api.field_behavior) = REQUIRED]; + + // Apply resource_value only to resources that match resource_type. + // resource_type will be checked with `AND` of other resources. + // For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" + // will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. + string resource_type = 4; + + // Project or folder to scope this configuration to. + // For example, "project/456" would apply this configuration only to resources + // in "project/456" scope will be checked with `AND` of other + // resources. + string scope = 5; + + // List of resource labels to search for, evaluated with `AND`. + // For example, `"resource_labels_selector": {"key": "value", "env": "prod"}` + // will match resources with labels "key": "value" `AND` "env": + // "prod" + // https://cloud.google.com/resource-manager/docs/creating-managing-labels + map resource_labels_selector = 6; + + // Description of the resource value configuration. + string description = 7; + + // Output only. Timestamp this resource value configuration was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp this resource value configuration was last updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud provider this configuration applies to + CloudProvider cloud_provider = 10; + + // A mapping of the sensitivity on Sensitive Data Protection finding to + // resource values. This mapping can only be used in combination with a + // resource_type that is related to BigQuery, e.g. + // "bigquery.googleapis.com/Dataset". + SensitiveDataProtectionMapping sensitive_data_protection_mapping = 11; +} + +// Value enum to map to a resource +enum ResourceValue { + // Unspecific value + RESOURCE_VALUE_UNSPECIFIED = 0; + + // High resource value + HIGH = 1; + + // Medium resource value + MEDIUM = 2; + + // Low resource value + LOW = 3; + + // No resource value, e.g. ignore these resources + NONE = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..997444a34d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -0,0 +1,51 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto new file mode 100644 index 00000000000..01209533de4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto @@ -0,0 +1,101 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/type/expr.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityHealthAnalyticsCustomConfigProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Defines the properties in a custom module configuration for Security +// Health Analytics. Use the custom module configuration to create custom +// detectors that generate custom findings for resources that you specify. +message CustomConfig { + // A set of optional name-value pairs that define custom source properties to + // return with each finding that is generated by the custom module. The custom + // source properties that are defined here are included in the finding JSON + // under `sourceProperties`. + message CustomOutputSpec { + // An individual name-value pair that defines a custom source property. + message Property { + // Name of the property for the custom output. + string name = 1; + + // The CEL expression for the custom output. A resource property can be + // specified to return the value of the property or a text string enclosed + // in quotation marks. + google.type.Expr value_expression = 2; + } + + // A list of custom output properties to add to the finding. + repeated Property properties = 1; + } + + // Resource for selecting resource type. + message ResourceSelector { + // The resource types to run the detector on. + repeated string resource_types = 1; + } + + // Defines the valid value options for the severity of a finding. + enum Severity { + // Unspecified severity. + SEVERITY_UNSPECIFIED = 0; + + // Critical severity. + CRITICAL = 1; + + // High severity. + HIGH = 2; + + // Medium severity. + MEDIUM = 3; + + // Low severity. + LOW = 4; + } + + // The CEL expression to evaluate to produce findings. When the expression + // evaluates to true against a resource, a finding is generated. + google.type.Expr predicate = 1; + + // Custom output properties. + CustomOutputSpec custom_output = 2; + + // The resource types that the custom module operates on. Each custom module + // can specify up to 5 resource types. + ResourceSelector resource_selector = 3; + + // The severity to assign to findings generated by the module. + Severity severity = 4; + + // Text that describes the vulnerability or misconfiguration that the custom + // module detects. This explanation is returned with each finding instance to + // help investigators understand the detected issue. The text must be enclosed + // in quotation marks. + string description = 5; + + // An explanation of the recommended steps that security teams can take to + // resolve the detected issue. This explanation is returned with each finding + // generated by this module in the `nextSteps` property of the finding JSON. + string recommendation = 6; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto new file mode 100644 index 00000000000..deeba1d9034 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto @@ -0,0 +1,110 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/security_health_analytics_custom_config.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityHealthAnalyticsCustomModuleProto"; +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: "securitycenter.googleapis.com/SecurityHealthAnalyticsSettings" + pattern: "organizations/{organization}/securityHealthAnalyticsSettings" + pattern: "folders/{folder}/securityHealthAnalyticsSettings" + pattern: "projects/{project}/securityHealthAnalyticsSettings" +}; + +// Represents an instance of a Security Health Analytics custom module, +// including its full module name, display name, enablement state, and last +// updated time. You can create a custom module at the organization, folder, or +// project level. Custom modules that you create at the organization or folder +// level are inherited by the child folders and projects. +message SecurityHealthAnalyticsCustomModule { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + pattern: "organizations/{organization}/securityHealthAnalyticsSettings/customModules/{custom_module}" + pattern: "folders/{folder}/securityHealthAnalyticsSettings/customModules/{custom_module}" + pattern: "projects/{project}/securityHealthAnalyticsSettings/customModules/{custom_module}" + }; + + // Possible enablement states of a custom module. + enum EnablementState { + // Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0; + + // The module is enabled at the given CRM resource. + ENABLED = 1; + + // The module is disabled at the given CRM resource. + DISABLED = 2; + + // State is inherited from an ancestor module. The module will either + // be effectively ENABLED or DISABLED based on its closest non-inherited + // ancestor module in the CRM hierarchy. + INHERITED = 3; + } + + // Immutable. The resource name of the custom module. + // Its format is + // "organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}", + // or + // "folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}", + // or + // "projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}" + // + // The id {customModule} is server-generated and is not user settable. + // It will be a numeric id containing 1-20 digits. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // The display name of the Security Health Analytics custom module. This + // display name becomes the finding category for all findings that are + // returned by this custom module. The display name must be between 1 and + // 128 characters, start with a lowercase letter, and contain alphanumeric + // characters or underscores only. + string display_name = 2; + + // The enablement state of the custom module. + EnablementState enablement_state = 4; + + // Output only. The time at which the custom module was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The editor that last updated the custom module. + string last_editor = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If empty, indicates that the custom module was created in the + // organization, folder, or project in which you are viewing the custom + // module. Otherwise, `ancestor_module` specifies the organization or folder + // from which the custom module is inherited. + string ancestor_module = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + ]; + + // The user specified custom configuration for the module. + CustomConfig custom_config = 8; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto new file mode 100644 index 00000000000..5b9dfaf8381 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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 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) = { + 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: + // 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; + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_posture.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_posture.proto new file mode 100644 index 00000000000..6ec23c86137 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_posture.proto @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityPostureProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents a posture that is deployed on Google Cloud by the +// Security Command Center Posture Management service. +// A posture contains one or more policy sets. A policy set is a +// group of policies that enforce a set of security rules on Google +// Cloud. +message SecurityPosture { + // The policy field that violates the deployed posture and its expected and + // detected values. + message PolicyDriftDetails { + // The name of the updated field, for example + // constraint.implementation.policy_rules[0].enforce + string field = 1; + + // The value of this field that was configured in a posture, for example, + // `true` or `allowed_values={"projects/29831892"}`. + string expected_value = 2; + + // The detected value that violates the deployed posture, for example, + // `false` or `allowed_values={"projects/22831892"}`. + string detected_value = 3; + } + + // Name of the posture, for example, `CIS-Posture`. + string name = 1; + + // The version of the posture, for example, `c7cfa2a8`. + string revision_id = 2; + + // The project, folder, or organization on which the posture is deployed, + // for example, `projects/{project_number}`. + string posture_deployment_resource = 3; + + // The name of the posture deployment, for example, + // `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. + string posture_deployment = 4; + + // The name of the updated policy, for example, + // `projects/{project_id}/policies/{constraint_name}`. + string changed_policy = 5; + + // The name of the updated policyset, for example, `cis-policyset`. + string policy_set = 6; + + // The ID of the updated policy, for example, `compute-policy-1`. + string policy = 7; + + // The details about a change in an updated policy that violates the deployed + // posture. + repeated PolicyDriftDetails policy_drift_details = 8; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto new file mode 100644 index 00000000000..8472bf367be --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -0,0 +1,3188 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/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/attack_path.proto"; +import "google/cloud/securitycenter/v1/bigquery_export.proto"; +import "google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto"; +import "google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto"; +import "google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto"; +import "google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.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 "google/cloud/securitycenter/v1/resource.proto"; +import "google/cloud/securitycenter/v1/resource_value_config.proto"; +import "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; +import "google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto"; +import "google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/cloud/securitycenter/v1/simulation.proto"; +import "google/cloud/securitycenter/v1/source.proto"; +import "google/cloud/securitycenter/v1/valued_resource.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"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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"; +option (google.api.resource_definition) = { + type: "securitycenter.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; +option (google.api.resource_definition) = { + type: "securitycenter.googleapis.com/FolderLocation" + pattern: "folders/{folder}/locations/{location}" +}; +option (google.api.resource_definition) = { + type: "securitycenter.googleapis.com/OrganizationSimulation" + pattern: "organizations/{organization}/simulations/{simulation}" +}; +option (google.api.resource_definition) = { + type: "securitycenter.googleapis.com/EventThreatDetectionSettings" + pattern: "organizations/{organization}/eventThreatDetectionSettings" + pattern: "folders/{folder}/eventThreatDetectionSettings" + pattern: "projects/{project}/eventThreatDetectionSettings" +}; + +// 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"; + + // 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 resident SecurityHealthAnalyticsCustomModule at the scope of the + // given CRM parent, and also creates inherited + // SecurityHealthAnalyticsCustomModules for all CRM descendants of the given + // parent. These modules are enabled by default. + rpc CreateSecurityHealthAnalyticsCustomModule( + CreateSecurityHealthAnalyticsCustomModuleRequest) + returns (SecurityHealthAnalyticsCustomModule) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules" + body: "security_health_analytics_custom_module" + additional_bindings { + post: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules" + body: "security_health_analytics_custom_module" + } + additional_bindings { + post: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules" + body: "security_health_analytics_custom_module" + } + }; + option (google.api.method_signature) = + "parent,security_health_analytics_custom_module"; + } + + // 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 + // to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + 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=organizations/*/locations/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v1/{parent=folders/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v1/{parent=folders/*/locations/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v1/{parent=projects/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v1/{parent=projects/*/locations/*}/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) = { + 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,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/*}" } + additional_bindings { + delete: "/v1/{name=organizations/*/locations/*/muteConfigs/*}" + } + additional_bindings { + delete: "/v1/{name=folders/*/locations/*/muteConfigs/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/muteConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a notification config. + 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"; + } + + // Deletes the specified SecurityHealthAnalyticsCustomModule and all of its + // descendants in the CRM hierarchy. This method is only supported for + // resident custom modules. + rpc DeleteSecurityHealthAnalyticsCustomModule( + DeleteSecurityHealthAnalyticsCustomModuleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}" + additional_bindings { + delete: "/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Get the simulation by name or the latest simulation for the given + // organization. + rpc GetSimulation(GetSimulationRequest) returns (Simulation) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/simulations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get the valued resource by name + rpc GetValuedResource(GetValuedResourceRequest) returns (ValuedResource) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/simulations/*/valuedResources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a BigQuery 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) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + 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/*}" } + additional_bindings { + get: "/v1/{name=organizations/*/locations/*/muteConfigs/*}" + } + additional_bindings { + get: "/v1/{name=folders/*/locations/*/muteConfigs/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/muteConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a notification config. + 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) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/organizationSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. + rpc GetEffectiveSecurityHealthAnalyticsCustomModule( + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest) + returns (EffectiveSecurityHealthAnalyticsCustomModule) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" + additional_bindings { + get: "/v1/{name=folders/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a SecurityHealthAnalyticsCustomModule. + rpc GetSecurityHealthAnalyticsCustomModule( + GetSecurityHealthAnalyticsCustomModuleRequest) + returns (SecurityHealthAnalyticsCustomModule) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}" + additional_bindings { + get: "/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + 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 + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option deprecated = true; + 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: "*" + } + }; + } + + // 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 + 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"; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option deprecated = true; + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/assets" + additional_bindings { get: "/v1/{parent=folders/*}/assets" } + additional_bindings { get: "/v1/{parent=projects/*}/assets" } + }; + } + + // Returns a list of all resident SecurityHealthAnalyticsCustomModules under + // the given CRM parent and all of the parent’s CRM descendants. + rpc ListDescendantSecurityHealthAnalyticsCustomModules( + ListDescendantSecurityHealthAnalyticsCustomModulesRequest) + returns (ListDescendantSecurityHealthAnalyticsCustomModulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:listDescendant" + additional_bindings { + get: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:listDescendant" + } + additional_bindings { + get: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:listDescendant" + } + }; + 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: /v1/organizations/{organization_id}/sources/-/findings + 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" } + }; + } + + // 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" } + additional_bindings { + get: "/v1/{parent=organizations/*/locations/*/muteConfigs}" + } + additional_bindings { + get: "/v1/{parent=folders/*/locations/*/muteConfigs}" + } + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/muteConfigs}" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists notification configs. + 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"; + } + + // Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the + // given parent. This includes resident modules defined at the scope of the + // parent, and inherited modules, inherited from CRM ancestors. + rpc ListEffectiveSecurityHealthAnalyticsCustomModules( + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest) + returns (ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/effectiveCustomModules" + additional_bindings { + get: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/effectiveCustomModules" + } + additional_bindings { + get: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/effectiveCustomModules" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a list of all SecurityHealthAnalyticsCustomModules for the given + // parent. This includes resident modules defined at the scope of the parent, + // and inherited modules, inherited from CRM ancestors. + rpc ListSecurityHealthAnalyticsCustomModules( + ListSecurityHealthAnalyticsCustomModulesRequest) + returns (ListSecurityHealthAnalyticsCustomModulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules" + additional_bindings { + get: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules" + } + additional_bindings { + get: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all sources belonging to an organization. + 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"; + } + + // 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 deprecated = true; + 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. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + 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"; + } + + // 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) = { + 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) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Simulates a given SecurityHealthAnalyticsCustomModule and Resource. + rpc SimulateSecurityHealthAnalyticsCustomModule( + SimulateSecurityHealthAnalyticsCustomModuleRequest) + returns (SimulateSecurityHealthAnalyticsCustomModuleResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:simulate" + body: "*" + additional_bindings { + post: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:simulate" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:simulate" + body: "*" + } + }; + option (google.api.method_signature) = "parent,custom_config,resource"; + } + + // 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) { + 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 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" + } + additional_bindings { + patch: "/v1/{mute_config.name=organizations/*/locations/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v1/{mute_config.name=folders/*/locations/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v1/{mute_config.name=projects/*/locations/*/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 + 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) { + option (google.api.http) = { + patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + option (google.api.method_signature) = "organization_settings"; + } + + // Updates the SecurityHealthAnalyticsCustomModule under the given name based + // on the given update mask. Updating the enablement state is supported on + // both resident and inherited modules (though resident modules cannot have an + // enablement state of "inherited"). Updating the display name and custom + // config of a module is supported on resident modules only. + rpc UpdateSecurityHealthAnalyticsCustomModule( + UpdateSecurityHealthAnalyticsCustomModuleRequest) + returns (SecurityHealthAnalyticsCustomModule) { + option (google.api.http) = { + patch: "/v1/{security_health_analytics_custom_module.name=organizations/*/securityHealthAnalyticsSettings/customModules/*}" + body: "security_health_analytics_custom_module" + additional_bindings { + patch: "/v1/{security_health_analytics_custom_module.name=folders/*/securityHealthAnalyticsSettings/customModules/*}" + body: "security_health_analytics_custom_module" + } + additional_bindings { + patch: "/v1/{security_health_analytics_custom_module.name=projects/*/securityHealthAnalyticsSettings/customModules/*}" + body: "security_health_analytics_custom_module" + } + }; + option (google.api.method_signature) = + "security_health_analytics_custom_module,update_mask"; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1/{source.name=organizations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "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=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"; + } + + // Creates a BigQuery 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 BigQuery 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"; + } + + // Creates a resident Event Threat Detection custom module at the scope of the + // given Resource Manager parent, and also creates inherited custom modules + // for all descendants of the given parent. These modules are enabled by + // default. + rpc CreateEventThreatDetectionCustomModule( + CreateEventThreatDetectionCustomModuleRequest) + returns (EventThreatDetectionCustomModule) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules" + body: "event_threat_detection_custom_module" + additional_bindings { + post: "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules" + body: "event_threat_detection_custom_module" + } + additional_bindings { + post: "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules" + body: "event_threat_detection_custom_module" + } + }; + option (google.api.method_signature) = + "parent,event_threat_detection_custom_module"; + } + + // Deletes the specified Event Threat Detection custom module and all of its + // descendants in the Resource Manager hierarchy. This method is only + // supported for resident custom modules. + rpc DeleteEventThreatDetectionCustomModule( + DeleteEventThreatDetectionCustomModuleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}" + additional_bindings { + delete: "/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets an Event Threat Detection custom module. + rpc GetEventThreatDetectionCustomModule( + GetEventThreatDetectionCustomModuleRequest) + returns (EventThreatDetectionCustomModule) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}" + additional_bindings { + get: "/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists all resident Event Threat Detection custom modules under the + // given Resource Manager parent and its descendants. + rpc ListDescendantEventThreatDetectionCustomModules( + ListDescendantEventThreatDetectionCustomModulesRequest) + returns (ListDescendantEventThreatDetectionCustomModulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:listDescendant" + additional_bindings { + get: "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules:listDescendant" + } + additional_bindings { + get: "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:listDescendant" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all Event Threat Detection custom modules for the given + // Resource Manager parent. This includes resident modules defined at the + // scope of the parent along with modules inherited from ancestors. + rpc ListEventThreatDetectionCustomModules( + ListEventThreatDetectionCustomModulesRequest) + returns (ListEventThreatDetectionCustomModulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules" + additional_bindings { + get: "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules" + } + additional_bindings { + get: "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the Event Threat Detection custom module with the given name based + // on the given update mask. Updating the enablement state is supported for + // both resident and inherited modules (though resident modules cannot have an + // enablement state of "inherited"). Updating the display name or + // configuration of a module is supported for resident modules only. The type + // of a module cannot be changed. + rpc UpdateEventThreatDetectionCustomModule( + UpdateEventThreatDetectionCustomModuleRequest) + returns (EventThreatDetectionCustomModule) { + option (google.api.http) = { + patch: "/v1/{event_threat_detection_custom_module.name=organizations/*/eventThreatDetectionSettings/customModules/*}" + body: "event_threat_detection_custom_module" + additional_bindings { + patch: "/v1/{event_threat_detection_custom_module.name=folders/*/eventThreatDetectionSettings/customModules/*}" + body: "event_threat_detection_custom_module" + } + additional_bindings { + patch: "/v1/{event_threat_detection_custom_module.name=projects/*/eventThreatDetectionSettings/customModules/*}" + body: "event_threat_detection_custom_module" + } + }; + option (google.api.method_signature) = + "event_threat_detection_custom_module,update_mask"; + } + + // Validates the given Event Threat Detection custom module. + rpc ValidateEventThreatDetectionCustomModule( + ValidateEventThreatDetectionCustomModuleRequest) + returns (ValidateEventThreatDetectionCustomModuleResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/eventThreatDetectionSettings}:validateCustomModule" + body: "*" + additional_bindings { + post: "/v1/{parent=folders/*/eventThreatDetectionSettings}:validateCustomModule" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*/eventThreatDetectionSettings}:validateCustomModule" + body: "*" + } + }; + } + + // Gets an effective Event Threat Detection custom module at the given level. + rpc GetEffectiveEventThreatDetectionCustomModule( + GetEffectiveEventThreatDetectionCustomModuleRequest) + returns (EffectiveEventThreatDetectionCustomModule) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/eventThreatDetectionSettings/effectiveCustomModules/*}" + additional_bindings { + get: "/v1/{name=folders/*/eventThreatDetectionSettings/effectiveCustomModules/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/eventThreatDetectionSettings/effectiveCustomModules/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists all effective Event Threat Detection custom modules for the + // given parent. This includes resident modules defined at the scope of the + // parent along with modules inherited from its ancestors. + rpc ListEffectiveEventThreatDetectionCustomModules( + ListEffectiveEventThreatDetectionCustomModulesRequest) + returns (ListEffectiveEventThreatDetectionCustomModulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/eventThreatDetectionSettings}/effectiveCustomModules" + additional_bindings { + get: "/v1/{parent=folders/*/eventThreatDetectionSettings}/effectiveCustomModules" + } + additional_bindings { + get: "/v1/{parent=projects/*/eventThreatDetectionSettings}/effectiveCustomModules" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a ResourceValueConfig for an organization. Maps user's tags to + // difference resource values for use by the attack path simulation. + rpc BatchCreateResourceValueConfigs(BatchCreateResourceValueConfigsRequest) + returns (BatchCreateResourceValueConfigsResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/resourceValueConfigs:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,requests"; + } + + // Deletes a ResourceValueConfig. + rpc DeleteResourceValueConfig(DeleteResourceValueConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/resourceValueConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a ResourceValueConfig. + rpc GetResourceValueConfig(GetResourceValueConfigRequest) + returns (ResourceValueConfig) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/resourceValueConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all ResourceValueConfigs. + rpc ListResourceValueConfigs(ListResourceValueConfigsRequest) + returns (ListResourceValueConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/resourceValueConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an existing ResourceValueConfigs with new rules. + rpc UpdateResourceValueConfig(UpdateResourceValueConfigRequest) + returns (ResourceValueConfig) { + option (google.api.http) = { + patch: "/v1/{resource_value_config.name=organizations/*/resourceValueConfigs/*}" + body: "resource_value_config" + }; + option (google.api.method_signature) = "resource_value_config,update_mask"; + } + + // Lists the valued resources for a set of simulation results and filter. + rpc ListValuedResources(ListValuedResourcesRequest) + returns (ListValuedResourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/simulations/*}/valuedResources" + additional_bindings { + get: "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists the attack paths for a set of simulation results or valued resources + // and filter. + rpc ListAttackPaths(ListAttackPathsRequest) + returns (ListAttackPathsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/simulations/*}/attackPaths" + additional_bindings { + get: "/v1/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" + } + additional_bindings { + get: "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// 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 { + // The mute state. + enum MuteState { + // Unused. + MUTE_STATE_UNSPECIFIED = 0; + + // Matching findings will be muted (default). + MUTED = 1; + + // Matching findings will have their mute state cleared. + UNDEFINED = 2; + } + + // 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]; + + // Optional. All findings matching the given filter will have their mute state + // set to this value. The default value is `MUTED`. Setting this to + // `UNDEFINED` will clear the mute state on all matching findings. + MuteState mute_state = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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 + // `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 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 only lowercase letters, numbers, and hyphens, must start + // with a letter, must end with either a letter or a number, and must be 63 + // characters or less. + string mute_config_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message to create single resource value config +message CreateResourceValueConfigRequest { + // Required. Resource name of the new ResourceValueConfig's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; + + // Required. The resource value config being created. + ResourceValueConfig resource_value_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message to create multiple resource value configs +message BatchCreateResourceValueConfigsRequest { + // Required. Resource name of the new ResourceValueConfig's parent. + // The parent field in the CreateResourceValueConfigRequest + // messages must either be empty or match this field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; + + // Required. The resource value configs to be created. + repeated CreateResourceValueConfigRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for BatchCreateResourceValueConfigs +message BatchCreateResourceValueConfigsResponse { + // The resource value configs created + repeated ResourceValueConfig resource_value_configs = 1; +} + +// Request message to delete resource value config +message DeleteResourceValueConfigRequest { + // Required. Name of the ResourceValueConfig to delete + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; +} + +// Request message to get resource value config +message GetResourceValueConfigRequest { + // Required. Name of the resource value config to retrieve. Its format is + // `organizations/{organization}/resourceValueConfigs/{config_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; +} + +// Request message to list resource value configs of a parent +message ListResourceValueConfigsRequest { + // Required. The parent, which owns the collection of resource value configs. + // Its format is + // `organizations/[organization_id]` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; + + // The number of results 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 `ListResourceValueConfigs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListResourceValueConfigs` must match the call that provided the + // page token. + // + // page_size can be specified, and the new page_size will be used. + string page_token = 3; +} + +// Response message to list resource value configs +message ListResourceValueConfigsResponse { + // The resource value configs from the specified parent. + repeated ResourceValueConfig resource_value_configs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is empty, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message to update resource value config +message UpdateResourceValueConfigRequest { + // Required. The resource value config being updated. + ResourceValueConfig resource_value_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 creating a notification config. +message CreateNotificationConfigRequest { + // 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) = { + child_type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; + + // Required. + // Unique identifier provided by the client within the parent scope. + // It must be between 1 and 128 characters and contain 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 Security Health Analytics custom modules. +message CreateSecurityHealthAnalyticsCustomModuleRequest { + // Required. Resource name of the new custom module's parent. Its format is + // `organizations/{organization}/securityHealthAnalyticsSettings`, + // `folders/{folder}/securityHealthAnalyticsSettings`, or + // `projects/{project}/securityHealthAnalyticsSettings` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + ]; + + // Required. SecurityHealthAnalytics custom module to create. The provided + // name is ignored and reset with provided parent information and + // server-generated ID. + SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = + 2 [(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 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}`, + // `projects/{project}/muteConfigs/{config_id}`, + // `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + // `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + // `projects/{project}/locations/global/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 + // `organizations/[organization_id]/notificationConfigs/[config_id]`, + // `folders/[folder_id]/notificationConfigs/[config_id]`, + // or `projects/[project_id]/notificationConfigs/[config_id]`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for deleting Security Health Analytics custom modules. +message DeleteSecurityHealthAnalyticsCustomModuleRequest { + // Required. Name of the custom module to delete. Its format is + // `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + // `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + // or + // `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + ]; +} + +// Request message for retrieving a BigQuery export. +message GetBigQueryExportRequest { + // Required. Name of the BigQuery 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 + // `organizations/{organization}/muteConfigs/{config_id}`, + // `folders/{folder}/muteConfigs/{config_id}`, + // `projects/{project}/muteConfigs/{config_id}`, + // `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + // `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + // `projects/{project}/locations/global/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 + // `organizations/[organization_id]/notificationConfigs/[config_id]`, + // `folders/[folder_id]/notificationConfigs/[config_id]`, + // or `projects/[project_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 effective Security Health Analytics custom +// modules. +message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest { + // Required. Name of the effective custom module to get. Its format is + // `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + // `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + // or + // `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule" + } + ]; +} + +// Request message for getting Security Health Analytics custom modules. +message GetSecurityHealthAnalyticsCustomModuleRequest { + // Required. Name of the custom module to get. Its format is + // `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + // `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + // or + // `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + ]; +} + +// 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. The name of the parent to group the assets by. 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/Asset" + } + ]; + + // 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 : ""` + 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; + + // 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]`, + // `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) = { + 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` + // + // * 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: `=`, `:` + 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 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 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`. + google.protobuf.Duration compare_duration = 5; + + // 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 descendant Security Health Analytics custom +// modules. +message ListDescendantSecurityHealthAnalyticsCustomModulesRequest { + // Required. Name of parent to list descendant custom modules. Its format is + // `organizations/{organization}/securityHealthAnalyticsSettings`, + // `folders/{folder}/securityHealthAnalyticsSettings`, or + // `projects/{project}/securityHealthAnalyticsSettings` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + ]; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 2; + + // The value returned by the last call indicating a continuation + string page_token = 3; +} + +// Response message for listing descendant Security Health Analytics custom +// modules. +message ListDescendantSecurityHealthAnalyticsCustomModulesResponse { + // Custom modules belonging to the requested parent and its descendants. + repeated SecurityHealthAnalyticsCustomModule + security_health_analytics_custom_modules = 1; + + // If not empty, indicates that there may be more custom modules to be + // returned. + string next_page_token = 2; +} + +// Request message for listing the valued resources for a given simulation. +message ListValuedResourcesRequest { + // Required. Name of parent to list valued resources. + // + // Valid formats: + // `organizations/{organization}`, + // `organizations/{organization}/simulations/{simulation}` + // `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/ValuedResource" + } + ]; + + // The filter expression that filters the valued resources in the response. + // Supported fields: + // + // * `resource_value` supports = + // * `resource_type` supports = + string filter = 2; + + // The value returned by the last `ListValuedResourcesResponse`; indicates + // that this is a continuation of a prior `ListValuedResources` call, and + // that the system should return the next page of data. + string page_token = 3; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 4; + + // Optional. The fields by which to order the valued resources response. + // + // Supported fields: + // + // * `exposed_score` + // + // * `resource_value` + // + // * `resource_type` + // + // * `resource` + // + // * `display_name` + // + // Values should be a comma separated list of fields. For example: + // `exposed_score,resource_value`. + // + // The default sorting order is descending. To specify ascending or descending + // order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for + // example: `exposed_score DESC`. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing the valued resources for a given simulation. +message ListValuedResourcesResponse { + // The valued resources that the attack path simulation identified. + repeated ValuedResource valued_resources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; + + // The estimated total number of results matching the query. + int32 total_size = 3; +} + +// Request message for listing the attack paths for a given simulation or valued +// resource. +message ListAttackPathsRequest { + // Required. Name of parent to list attack paths. + // + // Valid formats: + // `organizations/{organization}`, + // `organizations/{organization}/simulations/{simulation}` + // `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + // `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/AttackPath" + } + ]; + + // The filter expression that filters the attack path in the response. + // Supported fields: + // + // * `valued_resources` supports = + string filter = 2; + + // The value returned by the last `ListAttackPathsResponse`; indicates + // that this is a continuation of a prior `ListAttackPaths` call, and + // that the system should return the next page of data. + string page_token = 3; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 4; +} + +// Response message for listing the attack paths for a given simulation or +// valued resource. +message ListAttackPathsResponse { + // The attack paths that the attack path simulation identified. + repeated AttackPath attack_paths = 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 getting simulation. +// Simulation name can include "latest" to retrieve the latest simulation +// For example, "organizations/123/simulations/latest" +message GetSimulationRequest { + // Required. The organization name or simulation name of this simulation + // + // Valid format: + // `organizations/{organization}/simulations/latest` + // `organizations/{organization}/simulations/{simulation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Simulation" + } + ]; +} + +// Request message for getting a valued resource. +message GetValuedResourceRequest { + // Required. The name of this valued resource + // + // Valid format: + // `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/ValuedResource" + } + ]; +} + +// 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. The name of the parent in which to list the notification + // configurations. 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/NotificationConfig" + } + ]; + + // 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 effective Security Health Analytics custom +// modules. +message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest { + // Required. Name of parent to list effective custom modules. Its format is + // `organizations/{organization}/securityHealthAnalyticsSettings`, + // `folders/{folder}/securityHealthAnalyticsSettings`, or + // `projects/{project}/securityHealthAnalyticsSettings` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + ]; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 2; + + // The value returned by the last call indicating a continuation + string page_token = 3; +} + +// Response message for listing effective Security Health Analytics custom +// modules. +message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse { + // Effective custom modules belonging to the requested parent. + repeated EffectiveSecurityHealthAnalyticsCustomModule + effective_security_health_analytics_custom_modules = 1; + + // If not empty, indicates that there may be more effective custom modules to + // be returned. + string next_page_token = 2; +} + +// Request message for listing Security Health Analytics custom modules. +message ListSecurityHealthAnalyticsCustomModulesRequest { + // Required. Name of parent to list custom modules. Its format is + // `organizations/{organization}/securityHealthAnalyticsSettings`, + // `folders/{folder}/securityHealthAnalyticsSettings`, or + // `projects/{project}/securityHealthAnalyticsSettings` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + ]; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 2; + + // The value returned by the last call indicating a continuation + string page_token = 3; +} + +// Response message for listing Security Health Analytics custom modules. +message ListSecurityHealthAnalyticsCustomModulesResponse { + // Custom modules belonging to the requested parent. + repeated SecurityHealthAnalyticsCustomModule + security_health_analytics_custom_modules = 1; + + // If not empty, indicates that there may be more custom modules to be + // returned. + 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]`, `folders/[folder_id]`, or + // `projects/[project_id]`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Source" + } + ]; + + // 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. The name of the parent resource that contains the assets. The + // value that you can specify on parent depends on the method in which you + // specify parent. You can specify one of the following values: + // `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/Asset" + } + ]; + + // 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 : ""` + 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; + + // 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 { + // 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/-` + 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` + // + // * 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: `=`, `:` + // * resource.display_name: `=`, `:` + 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 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; + + // 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; + } + + // Information related to the Google Cloud 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 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. + 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; + + // 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; + + // Indicates which cloud provider the finding is from. + CloudProvider cloud_provider = 9; + + // Indicates which organization / tenant the finding is for. + string organization = 10; + + // The service or resource provider associated with the resource. + string service = 11; + + // The region or location of the service (if applicable). + string location = 12; + + oneof cloud_provider_metadata { + // The AWS metadata associated with the finding. + AwsMetadata aws_metadata = 16; + + // The Azure metadata associated with the finding. + AzureMetadata azure_metadata = 17; + } + + // Provides the path to the resource within the resource hierarchy. + ResourcePath resource_path = 18; + + // A string representation of the resource path. + // For Google Cloud, it has the format of + // `org/{organization_id}/folder/{folder_id}/folder/{folder_id}/project/{project_id}` + // where there can be any number of folders. + // For AWS, it has the format of + // `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` + // where there can be any number of organizational units. + // For Azure, it has the format of + // `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` + // where there can be any number of management groups. + string resource_path_string = 19; + } + + // 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // 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](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + // of the finding. Example: + // `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) = { + 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 updating a finding's mute status. +message SetMuteRequest { + // Required. The [relative resource + // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + // of the finding. Example: + // `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) = { + 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 `organizations/[organization_id]`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; +} + +// Request message to simulate a CustomConfig against a given test resource. +// Maximum size of the request is 4 MB by default. +message SimulateSecurityHealthAnalyticsCustomModuleRequest { + // Manually constructed resource name. If the custom module evaluates against + // only the resource data, you can omit the `iam_policy_data` field. If it + // evaluates only the `iam_policy_data` field, you can omit the resource data. + message SimulatedResource { + // Required. The type of the resource, for example, + // `compute.googleapis.com/Disk`. + string resource_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A representation of the Google Cloud resource. Should match the + // Google Cloud resource JSON format. + google.protobuf.Struct resource_data = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A representation of the IAM policy. + google.iam.v1.Policy iam_policy_data = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The relative resource name of the organization, project, or + // folder. For more information about relative resource names, see [Relative + // Resource + // Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + // Example: `organizations/{organization_id}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The custom configuration that you need to test. + CustomConfig custom_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Resource data to simulate custom module against. + SimulatedResource resource = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for simulating a `SecurityHealthAnalyticsCustomModule` +// against a given resource. +message SimulateSecurityHealthAnalyticsCustomModuleResponse { + // Possible test result. + message SimulatedResult { + oneof result { + // Finding that would be published for the test case, + // if a violation is detected. + Finding finding = 1; + + // Indicates that the test case does not trigger any violation. + google.protobuf.Empty no_violation = 2; + + // Error encountered during the test. + google.rpc.Status error = 3; + } + } + + // Result for test case in the corresponding request. + SimulatedResult result = 1; +} + +// 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. 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 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. + 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 Security Health Analytics custom modules. +message UpdateSecurityHealthAnalyticsCustomModuleRequest { + // Required. The SecurityHealthAnalytics custom module to update. + SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = + 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. The only fields that can be updated are + // `enablement_state` and `custom_config`. If empty or set to the wildcard + // value `*`, both `enablement_state` and `custom_config` are 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. Must be + // earlier or equal to the server time. + google.protobuf.Timestamp start_time = 3; +} + +// Request message for creating a BigQuery export. +message CreateBigQueryExportRequest { + // Required. The name of the parent resource of the new BigQuery export. 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 BigQuery 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 only lowercase letters, numbers, and hyphens, must start + // with a letter, must end with either a letter or a number, and must be 63 + // characters or less. + 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 BigQuery export. +message DeleteBigQueryExportRequest { + // Required. The name of the BigQuery 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" + } + ]; +} + +// Request to create an Event Threat Detection custom module. +message CreateEventThreatDetectionCustomModuleRequest { + // Required. The new custom module's parent. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings`. + // * `folders/{folder}/eventThreatDetectionSettings`. + // * `projects/{project}/eventThreatDetectionSettings`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + ]; + + // Required. The module to create. The + // event_threat_detection_custom_module.name will be ignored and server + // generated. + EventThreatDetectionCustomModule event_threat_detection_custom_module = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to validate an Event Threat Detection custom module. +message ValidateEventThreatDetectionCustomModuleRequest { + // Required. Resource name of the parent to validate the Custom Module under. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings`. + // * `folders/{folder}/eventThreatDetectionSettings`. + // * `projects/{project}/eventThreatDetectionSettings`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + ]; + + // Required. The raw text of the module's contents. Used to generate error + // messages. + string raw_text = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + string type = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response to validating an Event Threat Detection custom module. +message ValidateEventThreatDetectionCustomModuleResponse { + // A list of errors returned by the validator. If the list is empty, there + // were no errors. + CustomModuleValidationErrors errors = 2; +} + +// Request to delete an Event Threat Detection custom module. +message DeleteEventThreatDetectionCustomModuleRequest { + // Required. Name of the custom module to delete. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + // * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + // * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + ]; +} + +// Request to get an Event Threat Detection custom module. +message GetEventThreatDetectionCustomModuleRequest { + // Required. Name of the custom module to get. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + // * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + // * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + ]; +} + +// Request to list current and descendant resident Event Threat Detection custom +// modules. +message ListDescendantEventThreatDetectionCustomModulesRequest { + // Required. Name of the parent to list custom modules under. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings`. + // * `folders/{folder}/eventThreatDetectionSettings`. + // * `projects/{project}/eventThreatDetectionSettings`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + ]; + + // A page token, received from a previous + // `ListDescendantEventThreatDetectionCustomModules` call. Provide this to + // retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListDescendantEventThreatDetectionCustomModules` must match the call that + // provided the page token. + string page_token = 2; + + // The maximum number of modules 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 = 3; +} + +// Response for listing current and descendant resident +// Event Threat Detection custom modules. +message ListDescendantEventThreatDetectionCustomModulesResponse { + // Custom modules belonging to the requested parent. + repeated EventThreatDetectionCustomModule + event_threat_detection_custom_modules = 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 to list Event Threat Detection custom modules. +message ListEventThreatDetectionCustomModulesRequest { + // Required. Name of the parent to list custom modules under. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings`. + // * `folders/{folder}/eventThreatDetectionSettings`. + // * `projects/{project}/eventThreatDetectionSettings`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + ]; + + // A page token, received from a previous + // `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters provided to + // `ListEventThreatDetectionCustomModules` must match the call that provided + // the page token. + string page_token = 2; + + // The maximum number of modules 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 = 3; +} + +// Response for listing Event Threat Detection custom modules. +message ListEventThreatDetectionCustomModulesResponse { + // Custom modules belonging to the requested parent. + repeated EventThreatDetectionCustomModule + event_threat_detection_custom_modules = 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 to update an Event Threat Detection custom module. +message UpdateEventThreatDetectionCustomModuleRequest { + // Required. The module being updated. + EventThreatDetectionCustomModule event_threat_detection_custom_module = 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 to get an EffectiveEventThreatDetectionCustomModule. +message GetEffectiveEventThreatDetectionCustomModuleRequest { + // Required. The resource name of the effective Event Threat Detection custom + // module. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + // * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + // * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" + } + ]; +} + +// Request to list effective Event Threat Detection custom modules. +message ListEffectiveEventThreatDetectionCustomModulesRequest { + // Required. Name of the parent to list custom modules for. + // + // Its format is: + // + // * `organizations/{organization}/eventThreatDetectionSettings`. + // * `folders/{folder}/eventThreatDetectionSettings`. + // * `projects/{project}/eventThreatDetectionSettings`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" + } + ]; + + // A page token, received from a previous + // `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to + // retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListEffectiveEventThreatDetectionCustomModules` must match the call that + // provided the page token. + string page_token = 2; + + // The maximum number of modules 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 = 3; +} + +// Response for listing EffectiveEventThreatDetectionCustomModules. +message ListEffectiveEventThreatDetectionCustomModulesResponse { + // Effective custom modules belonging to the requested parent. + repeated EffectiveEventThreatDetectionCustomModule + effective_event_threat_detection_custom_modules = 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; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/simulation.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/simulation.proto new file mode 100644 index 00000000000..c110fd9993e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/simulation.proto @@ -0,0 +1,56 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/resource.proto"; +import "google/cloud/securitycenter/v1/valued_resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SimulationProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Attack path simulation +message Simulation { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Simulation" + pattern: "organizations/{organization}/simulations/{simulation}" + plural: "simulations" + singular: "simulation" + }; + + // Full resource name of the Simulation: + // `organizations/123/simulations/456` + string name = 1; + + // Output only. Time simulation was created + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource value configurations' metadata used in this simulation. Maximum of + // 100. + repeated ResourceValueConfigMetadata resource_value_configs_metadata = 3; + + // Indicates which cloud provider was used in this simulation. + CloudProvider cloud_provider = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto new file mode 100644 index 00000000000..bb4c0586921 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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"; + +// 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. +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: + // 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: + // "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." + string description = 3; + + // The canonical name of the finding source. 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto new file mode 100644 index 00000000000..37c9954f824 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto @@ -0,0 +1,41 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ToxicCombinationProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains details about a group of security issues that, when the issues +// occur together, represent a greater risk than when the issues occur +// independently. A group of such issues is referred to as a toxic combination. +message ToxicCombination { + // The + // [Attack exposure + // score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) + // of this toxic combination. The score is a measure of how much this toxic + // combination exposes one or more high-value resources to potential attack. + double attack_exposure_score = 1; + + // List of resource names of findings associated with this toxic combination. + // For example, `organizations/123/sources/456/findings/789`. + repeated string related_findings = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/valued_resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/valued_resource.proto new file mode 100644 index 00000000000..2051b389559 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/valued_resource.proto @@ -0,0 +1,88 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ValuedResourceProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// A resource that is determined to have value to a user's system +message ValuedResource { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/ValuedResource" + pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}" + plural: "valuedResources" + singular: "valuedResource" + }; + + // How valuable the resource is. + enum ResourceValue { + // The resource value isn't specified. + RESOURCE_VALUE_UNSPECIFIED = 0; + + // This is a low-value resource. + RESOURCE_VALUE_LOW = 1; + + // This is a medium-value resource. + RESOURCE_VALUE_MEDIUM = 2; + + // This is a high-value resource. + RESOURCE_VALUE_HIGH = 3; + } + + // Valued resource name, for example, + // e.g.: + // `organizations/123/simulations/456/valuedResources/789` + string name = 1; + + // The + // [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // of the valued resource. + string resource = 2; + + // The [resource + // type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // of the valued resource. + string resource_type = 3; + + // Human-readable name of the valued resource. + string display_name = 4; + + // How valuable this resource is. + ResourceValue resource_value = 5; + + // Exposed score for this valued resource. A value of 0 means no exposure was + // detected exposure. + double exposed_score = 6; + + // List of resource value configurations' metadata used to determine the value + // of this resource. Maximum of 100. + repeated ResourceValueConfigMetadata resource_value_configs_used = 7; +} + +// Metadata about a ResourceValueConfig. For example, id and name. +message ResourceValueConfigMetadata { + // Resource value config name + string name = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto new file mode 100644 index 00000000000..b531f793a16 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto @@ -0,0 +1,319 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +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; + + // The offending package is relevant to the finding. + Package offending_package = 2; + + // The fixed package is relevant to the finding. + Package fixed_package = 3; + + // The security bulletin is relevant to this finding. + SecurityBulletin security_bulletin = 4; +} + +// CVE stands for Common Vulnerabilities and Exposures. +// Information from the [CVE +// record](https://www.cve.org/ResourcesSupport/Glossary) that describes this +// vulnerability. +message Cve { + // The possible values of impact of the vulnerability if it was to be + // exploited. + enum RiskRating { + // Invalid or empty value. + RISK_RATING_UNSPECIFIED = 0; + + // Exploitation would have little to no security impact. + LOW = 1; + + // Exploitation would enable attackers to perform activities, or could allow + // attackers to have a direct impact, but would require additional steps. + MEDIUM = 2; + + // Exploitation would enable attackers to have a notable direct impact + // without needing to overcome any major mitigating factors. + HIGH = 3; + + // Exploitation would fundamentally undermine the security of affected + // systems, enable actors to perform significant attacks with minimal + // effort, with little to no mitigating factors to overcome. + CRITICAL = 4; + } + + // The possible values of exploitation activity of the vulnerability in the + // wild. + enum ExploitationActivity { + // Invalid or empty value. + EXPLOITATION_ACTIVITY_UNSPECIFIED = 0; + + // Exploitation has been reported or confirmed to widely occur. + WIDE = 1; + + // Limited reported or confirmed exploitation activities. + CONFIRMED = 2; + + // Exploit is publicly available. + AVAILABLE = 3; + + // No known exploitation activity, but has a high potential for + // exploitation. + ANTICIPATED = 4; + + // No known exploitation activity. + NO_KNOWN = 5; + } + + // 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; + + // Whether upstream fix is available for the CVE. + bool upstream_fix_available = 4; + + // The potential impact of the vulnerability if it was to be exploited. + RiskRating impact = 5; + + // The exploitation activity of the vulnerability in the wild. + ExploitationActivity exploitation_activity = 6; + + // Whether or not the vulnerability has been observed in the wild. + bool observed_in_the_wild = 7; + + // Whether or not the vulnerability was zero day when the finding was + // published. + bool zero_day = 8; + + // Date the first publicly available exploit or PoC was released. + google.protobuf.Timestamp exploit_release_date = 9; +} + +// 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; +} + +// Package is a generic definition of a package. +message Package { + // The name of the package where the vulnerability was detected. + string package_name = 1; + + // The CPE URI where the vulnerability was detected. + string cpe_uri = 2; + + // Type of package, for example, os, maven, or go. + string package_type = 3; + + // The version of the package. + string package_version = 4; +} + +// SecurityBulletin are notifications of vulnerabilities of Google products. +message SecurityBulletin { + // ID of the bulletin corresponding to the vulnerability. + string bulletin_id = 1; + + // Submission time of this Security Bulletin. + google.protobuf.Timestamp submission_time = 2; + + // This represents a version that the cluster receiving this notification + // should be upgraded to, based on its current version. For example, 1.15.0 + string suggested_upgrade_version = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto new file mode 100644 index 00000000000..a78034d669f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto @@ -0,0 +1,92 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/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"; + +option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Security Command Center representation of a Google Cloud +// 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}" + }; + + // 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 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 Google Cloud resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // 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: + // 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/{organization_id}/assets/{asset_id}". + string name = 1; + + // 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 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 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. + google.protobuf.Timestamp update_time = 10; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto new file mode 100644 index 00000000000..60dc5e5e34a --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -0,0 +1,109 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/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"; + +option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Security Command Center finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// 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" + 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; + + // 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}" + string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // 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-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. + 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 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 + // 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, 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. + google.protobuf.Timestamp create_time = 10; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto new file mode 100644 index 00000000000..00b5d93f78a --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -0,0 +1,78 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/resource.proto"; + +option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// User specified settings that are attached to the Security Command +// Center 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..b93cea3ecc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto @@ -0,0 +1,48 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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"; + +option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; +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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto new file mode 100644 index 00000000000..656df689fdc --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -0,0 +1,52 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/resource.proto"; + +option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// 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) = { + 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto new file mode 100644 index 00000000000..8270869b8ae --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -0,0 +1,823 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/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"; +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/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +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 + // to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + 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) { + 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) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/organizationSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + 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 + // 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/{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. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*}/assets" + }; + } + + // 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 + 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" + }; + 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: "/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. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + 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) { + 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) { + 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 + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + 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) { + option (google.api.http) = { + patch: "/v1beta1/{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: "/v1beta1/{source.name=organizations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "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" + } + }; + option (google.api.method_signature) = "security_marks"; + } +} + +// 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 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 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 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; + + // 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 + 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 + // 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`. + 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 { + // 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 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; + + // 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 + 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; + + // 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 { + // 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 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 [(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 { + // 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 { + // 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 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 [(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 = 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 { + // 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 + // 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. + 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. + 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. + 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. + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + google.protobuf.Timestamp start_time = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto new file mode 100644 index 00000000000..196f4c58a1c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -0,0 +1,55 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/resource.proto"; + +option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// 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 { + 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: + // "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." + string description = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto new file mode 100644 index 00000000000..367b32fac0c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -0,0 +1,134 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/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"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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"; + +// Security Command Center representation of a Google Cloud +// 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}" + pattern: "folders/{folder}/assets/{asset}" + pattern: "projects/{project}/assets/{asset}" + }; + + // 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 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 Google Cloud resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // 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: + // 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; + + // 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 + // 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/docs/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/{organization_id}/assets/{asset_id}". + string name = 1; + + // 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 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 Security Command Center. + google.protobuf.Timestamp create_time = 9; + + // 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 + // 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; + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto new file mode 100644 index 00000000000..a3c6163a6ea --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -0,0 +1,145 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/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 = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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"; + +// Security Command Center finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// 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" + 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. + 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 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; + + // 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: + // "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 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-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. + 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 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 + // 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, 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 + // 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. + google.protobuf.Timestamp create_time = 10; + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto new file mode 100644 index 00000000000..a393f3d3038 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto @@ -0,0 +1,37 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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; + + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto new file mode 100644 index 00000000000..8b2e77788bd --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto @@ -0,0 +1,107 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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 (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Security Command Center notification configs. +// +// 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" + 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 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 Pub/Sub 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto new file mode 100644 index 00000000000..dcb3de9ab51 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto @@ -0,0 +1,43 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1p1beta1/finding.proto"; +import "google/cloud/securitycenter/v1p1beta1/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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"; + +// Security Command Center'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; + } + + // The Cloud resource tied to the notification. + Resource resource = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto new file mode 100644 index 00000000000..a68c86e3a74 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto @@ -0,0 +1,85 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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 Security Command +// Center 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 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: + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto new file mode 100644 index 00000000000..b4062d3bedb --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto @@ -0,0 +1,52 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/field_behavior.proto"; +import "google/cloud/securitycenter/v1p1beta1/folder.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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; + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..3767640931c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto @@ -0,0 +1,51 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto new file mode 100644 index 00000000000..70f43a12017 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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 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) = { + 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: + // 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; + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto new file mode 100644 index 00000000000..daaec44c28b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -0,0 +1,1351 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/notification_message.proto"; +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/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"; +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 = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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: "*" + additional_bindings { + post: "/v1p1beta1/{parent=folders/*}/assets:group" + body: "*" + } + additional_bindings { + post: "/v1p1beta1/{parent=projects/*}/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/{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"; + } + + // Lists an organization's assets. + 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"; + } + + // 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" + additional_bindings { + get: "/v1p1beta1/{parent=folders/*/sources/*}/findings" + } + additional_bindings { + get: "/v1p1beta1/{parent=projects/*/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" + additional_bindings { + get: "/v1p1beta1/{parent=folders/*}/sources" + } + additional_bindings { + get: "/v1p1beta1/{parent=projects/*}/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: "*" + 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"; + } + + // 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" + 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"; + } + + // 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) = { + 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=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"; + } +} + +// 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. + 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], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Asset" + } + ]; + + // 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 : ""` + 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; + + // 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]", + // 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) = { + 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: `=`, `>`, `<`, `>=`, `<=` + // * 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 : ""` + 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 + // * severity + // + // 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 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`. + google.protobuf.Duration compare_duration = 5; + + // 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], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Source" + } + ]; + + // 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], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Asset" + } + ]; + + // 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 : ""` + 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; + + // 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 { + // 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/- + 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: `=`, `>`, `<`, `>=`, `<=` + // * 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 : ""` + 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 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; + + // 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 { + // Information related to the Google Cloud 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; + + // 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. + // + // 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto new file mode 100644 index 00000000000..5f4e5aad026 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; +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"; + +// 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 { + 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: + // 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: + // "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." + 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/access.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/access.proto new file mode 100644 index 00000000000..2192ea2a4bb --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/access.proto @@ -0,0 +1,111 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Represents an access event. +message Access { + // Associated email, such as "foo@google.com". + // + // The email address of the authenticated user or a service account acting on + // behalf of a 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". + string caller_ip = 2; + + // The caller IP's geolocation, which identifies where the call came from. + Geolocation caller_ip_geo = 3; + + // Type of user agent associated with the finding. For example, an operating + // system shell or an embedded or standalone application. + string user_agent_family = 4; + + // The caller's user agent string associated with the finding. + string user_agent = 5; + + // This is the API service that the service account made a call to, e.g. + // "iam.googleapis.com" + string service_name = 6; + + // The method that the service account called, e.g. "SetIamPolicy". + string method_name = 7; + + // A string that represents the principal_subject that is associated with the + // identity. Unlike `principal_email`, `principal_subject` supports principals + // that aren't associated with email addresses, such as third party + // principals. For most identities, the format is + // `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`. + // Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, + // still use the legacy format `serviceAccount:{identity pool + // name}[{subject}]`. + string principal_subject = 8; + + // The name of the service account key that was used to create or exchange + // credentials when authenticating the service account that made 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 = 9; + + // The identity delegation history of an authenticated service account that + // made the request. The `serviceAccountDelegationInfo[]` object contains + // information about the real authorities that try to access Google Cloud + // 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 = 10; + + // A string that represents a username. The username provided depends on the + // type of the finding and is likely not an IAM principal. For example, this + // can be a system username if the finding is related to a virtual machine, or + // it can be an application login username. + string user_name = 11; +} + +// 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. +message Geolocation { + // A CLDR. + string region_code = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/affected_resources.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/affected_resources.proto new file mode 100644 index 00000000000..030c229ce90 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/affected_resources.proto @@ -0,0 +1,31 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "AffectedResourcesProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Details about resources affected by this finding. +message AffectedResources { + // The count of resources affected by the finding. + int64 count = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ai_model.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ai_model.proto new file mode 100644 index 00000000000..f293ae692cb --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ai_model.proto @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "AiModelProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains information about the AI model associated with the finding. +message AiModel { + // The platform on which the model is deployed. + enum DeploymentPlatform { + // Unspecified deployment platform. + DEPLOYMENT_PLATFORM_UNSPECIFIED = 0; + + // Vertex AI. + VERTEX_AI = 1; + + // Google Kubernetes Engine. + GKE = 2; + + // Google Compute Engine. + GCE = 3; + + // Fine tuned model. + FINE_TUNED_MODEL = 4; + } + + // The name of the AI model, for example, "gemini:1.0.0". + string name = 1; + + // The domain of the model, for example, “image-classification”. + string domain = 2; + + // The name of the model library, for example, “transformers”. + string library = 3; + + // The region in which the model is used, for example, “us-central1”. + string location = 4; + + // The publisher of the model, for example, “google” or “nvidia”. + string publisher = 5; + + // The platform on which the model is deployed. + DeploymentPlatform deployment_platform = 6; + + // The user defined display name of model. Ex. baseline-classification-model + string display_name = 7; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/application.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/application.proto new file mode 100644 index 00000000000..6e0c2a3f87b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/application.proto @@ -0,0 +1,36 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ApplicationProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Represents an application associated with a finding. +message Application { + // The base URI that identifies the network location of the application in + // which the vulnerability was detected. For example, `http://example.com`. + string base_uri = 1; + + // The full URI with payload that could be used to reproduce the + // vulnerability. For example, `http://example.com?p=aMmYgI6H`. + string full_uri = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_exposure.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_exposure.proto new file mode 100644 index 00000000000..66e44d44372 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_exposure.proto @@ -0,0 +1,72 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "AttackExposureProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// An attack exposure contains the results of an attack path simulation run. +message AttackExposure { + // This enum defines the various states an AttackExposure can be in. + enum State { + // The state is not specified. + STATE_UNSPECIFIED = 0; + + // The attack exposure has been calculated. + CALCULATED = 1; + + // The attack exposure has not been calculated. + NOT_CALCULATED = 2; + } + + // A number between 0 (inclusive) and infinity that represents how important + // this finding is to remediate. The higher the score, the more important it + // is to remediate. + double score = 1; + + // The most recent time the attack exposure was updated on this finding. + google.protobuf.Timestamp latest_calculation_time = 2; + + // The resource name of the attack path simulation result that contains the + // details regarding this attack exposure score. + // Example: `organizations/123/simulations/456/attackExposureResults/789` + string attack_exposure_result = 3; + + // Output only. What state this AttackExposure is in. This captures whether or + // not an attack exposure has been calculated or not. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The number of high value resources that are exposed as a result of this + // finding. + int32 exposed_high_value_resources_count = 5; + + // The number of medium value resources that are exposed as a result of this + // finding. + int32 exposed_medium_value_resources_count = 6; + + // The number of high value resources that are exposed as a result of this + // finding. + int32 exposed_low_value_resources_count = 7; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_path.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_path.proto new file mode 100644 index 00000000000..8ad845b7806 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_path.proto @@ -0,0 +1,132 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "AttackPathProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// A path that an attacker could take to reach an exposed resource. +message AttackPath { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/AttackPath" + pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}" + pattern: "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}" + plural: "attackPaths" + singular: "attackPath" + }; + + // Represents one point that an attacker passes through in this attack path. + message AttackPathNode { + // A finding that is associated with this node in the attack path. + message PathNodeAssociatedFinding { + // Canonical name of the associated findings. Example: + // `organizations/123/sources/456/findings/789` + string canonical_finding = 1; + + // The additional taxonomy group within findings from a given source. + string finding_category = 2; + + // Full resource name of the finding. + string name = 3; + } + + // The type of the incoming attack step node. + enum NodeType { + // Type not specified + NODE_TYPE_UNSPECIFIED = 0; + + // Incoming edge joined with AND + NODE_TYPE_AND = 1; + + // Incoming edge joined with OR + NODE_TYPE_OR = 2; + + // Incoming edge is defense + NODE_TYPE_DEFENSE = 3; + + // Incoming edge is attacker + NODE_TYPE_ATTACKER = 4; + } + + // Detailed steps the attack can take between path nodes. + message AttackStepNode { + // Unique ID for one Node + string uuid = 1; + + // Attack step type. Can be either AND, OR or DEFENSE + NodeType type = 2; + + // User friendly name of the attack step + string display_name = 3; + + // Attack step labels for metadata + map labels = 4; + + // Attack step description + string description = 5; + } + + // The name of the resource at this point in the attack path. + // The format of the name follows the Cloud Asset Inventory [resource + // name + // format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + string resource = 1; + + // The [supported resource + // type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + string resource_type = 2; + + // Human-readable name of this resource. + string display_name = 3; + + // The findings associated with this node in the attack path. + repeated PathNodeAssociatedFinding associated_findings = 4; + + // Unique id of the attack path node. + string uuid = 5; + + // A list of attack step nodes that exist in this attack path node. + repeated AttackStepNode attack_steps = 6; + } + + // Represents a connection between a source node and a destination node in + // this attack path. + message AttackPathEdge { + // The attack node uuid of the source node. + string source = 1; + + // The attack node uuid of the destination node. + string destination = 2; + } + + // The attack path name, for example, + // `organizations/12/simulations/34/valuedResources/56/attackPaths/78` + string name = 1; + + // A list of nodes that exist in this attack path. + repeated AttackPathNode path_nodes = 2; + + // A list of the edges between nodes in this attack path. + repeated AttackPathEdge edges = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto new file mode 100644 index 00000000000..0b74672a72a --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto @@ -0,0 +1,88 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupDisasterRecoveryProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Information related to Google Cloud Backup and DR Service findings. +message BackupDisasterRecovery { + // The name of a Backup and DR template which comprises one or more backup + // policies. See the [Backup and DR + // documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp) + // for more information. For example, `snap-ov`. + string backup_template = 1; + + // The names of Backup and DR policies that are associated with a template + // and that define when to run a backup, how frequently to run a backup, and + // how long to retain the backup image. For example, `onvaults`. + repeated string policies = 2; + + // The name of a Backup and DR host, which is managed by the backup and + // recovery appliance and known to the management console. The host can be of + // type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file + // system, etc.), vCenter, or an ESX server. See the [Backup and DR + // documentation on + // hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications) + // for more information. For example, `centos7-01`. + string host = 3; + + // The names of Backup and DR applications. An application is a VM, database, + // or file system on a managed host monitored by a backup and recovery + // appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`, + // `centos7-01-vol02`. + repeated string applications = 4; + + // The name of the Backup and DR storage pool that the backup and recovery + // appliance is storing data in. The storage pool could be of type Cloud, + // Primary, Snapshot, or OnVault. See the [Backup and DR documentation on + // storage + // pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools). + // For example, `DiskPoolOne`. + string storage_pool = 5; + + // The names of Backup and DR advanced policy options of a policy applying to + // an application. See the [Backup and DR documentation on policy + // options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings). + // For example, `skipofflineappsincongrp, nounmap`. + repeated string policy_options = 6; + + // The name of the Backup and DR resource profile that specifies the storage + // media for backups of application and VM data. See the [Backup and DR + // documentation on + // profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile). + // For example, `GCP`. + string profile = 7; + + // The name of the Backup and DR appliance that captures, moves, and manages + // the lifecycle of backup data. For example, `backup-server-57137`. + string appliance = 8; + + // The backup type of the Backup and DR image. + // For example, `Snapshot`, `Remote Snapshot`, `OnVault`. + string backup_type = 9; + + // The timestamp at which the Backup and DR backup was created. + google.protobuf.Timestamp backup_create_time = 10; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/bigquery_export.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/bigquery_export.proto new file mode 100644 index 00000000000..68325fcd69e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/bigquery_export.proto @@ -0,0 +1,107 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "BigQueryExportProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Configures how to deliver Findings to BigQuery Instance. +message BigQueryExport { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/BigQueryExport" + pattern: "organizations/{organization}/locations/{location}/bigQueryExports/{export}" + pattern: "folders/{folder}/locations/{location}/bigQueryExports/{export}" + pattern: "projects/{project}/locations/{location}/bigQueryExports/{export}" + plural: "bigQueryExports" + singular: "bigQueryExport" + }; + + // Identifier. The relative resource name of this export. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name. + // The following list shows some examples: + // + // + + // `organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}` + // + `folders/{folder_id}/locations/{location_id}/bigQueryExports/{export_id}` + // + + // `projects/{project_id}/locations/{location_id}/bigQueryExports/{export_id}` + // + // This field is provided in responses, and is ignored when provided in create + // requests. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // 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 BigQuery 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 BigQuery 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 BigQuery 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 and + // upload data to the BigQuery dataset. + string principal = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/chokepoint.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/chokepoint.proto new file mode 100644 index 00000000000..4018fb214e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/chokepoint.proto @@ -0,0 +1,35 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ChokepointProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains details about a chokepoint, which is a resource or resource group +// where high-risk attack paths converge, based on [attack path simulations] +// (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). +message Chokepoint { + // List of resource names of findings associated with this chokepoint. + // For example, organizations/123/sources/456/findings/789. + // This list will have at most 100 findings. + repeated string related_findings = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_armor.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_armor.proto new file mode 100644 index 00000000000..bc8985e6573 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_armor.proto @@ -0,0 +1,122 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudArmorProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Fields related to Google Cloud Armor findings. +message CloudArmor { + // Information about the [Google Cloud Armor security + // policy](https://cloud.google.com/armor/docs/security-policy-overview) + // relevant to the finding. + SecurityPolicy security_policy = 1; + + // Information about incoming requests evaluated by [Google Cloud Armor + // security + // policies](https://cloud.google.com/armor/docs/security-policy-overview). + Requests requests = 2; + + // Information about potential Layer 7 DDoS attacks identified by [Google + // Cloud Armor Adaptive + // Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). + AdaptiveProtection adaptive_protection = 3; + + // Information about DDoS attack volume and classification. + Attack attack = 4; + + // Distinguish between volumetric & protocol DDoS attack and + // application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS + // attacks, or "L_7" for Layer 7 DDoS attacks. + string threat_vector = 5; + + // Duration of attack from the start until the current moment (updated every 5 + // minutes). + google.protobuf.Duration duration = 6; +} + +// Information about the [Google Cloud Armor security +// policy](https://cloud.google.com/armor/docs/security-policy-overview) +// relevant to the finding. +message SecurityPolicy { + // The name of the Google Cloud Armor security policy, for example, + // "my-security-policy". + string name = 1; + + // The type of Google Cloud Armor security policy for example, 'backend + // security policy', 'edge security policy', 'network edge security policy', + // or 'always-on DDoS protection'. + string type = 2; + + // Whether or not the associated rule or policy is in preview mode. + bool preview = 3; +} + +// Information about the requests relevant to the finding. +message Requests { + // For 'Increasing deny ratio', the ratio is the denied traffic divided by the + // allowed traffic. For 'Allowed traffic spike', the ratio is the allowed + // traffic in the short term divided by allowed traffic in the long term. + double ratio = 1; + + // Allowed RPS (requests per second) in the short term. + int32 short_term_allowed = 2; + + // Allowed RPS (requests per second) over the long term. + int32 long_term_allowed = 3; + + // Denied RPS (requests per second) over the long term. + int32 long_term_denied = 4; +} + +// Information about [Google Cloud Armor Adaptive +// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). +message AdaptiveProtection { + // A score of 0 means that there is low confidence that the detected event is + // an actual attack. A score of 1 means that there is high confidence that the + // detected event is an attack. See the [Adaptive Protection + // documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) + // for further explanation. + double confidence = 1; +} + +// Information about DDoS attack volume and classification. +message Attack { + // Total PPS (packets per second) volume of attack. + int64 volume_pps_long = 4; + + // Total BPS (bytes per second) volume of attack. + int64 volume_bps_long = 5; + + // Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. + string classification = 3; + + // Total PPS (packets per second) volume of attack. Deprecated - refer to + // volume_pps_long instead. + int32 volume_pps = 1 [deprecated = true]; + + // Total BPS (bytes per second) volume of attack. Deprecated - refer to + // volume_bps_long instead. + int32 volume_bps = 2 [deprecated = true]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto new file mode 100644 index 00000000000..763cd32e649 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto @@ -0,0 +1,57 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudDlpDataProfileProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/TableDataProfile" + pattern: "projects/{project}/tableProfiles/{table_profile}" + pattern: "projects/{project}/locations/{location}/tableProfiles/{table_profile}" +}; + +// The [data profile](https://cloud.google.com/dlp/docs/data-profiles) +// associated with the finding. +message CloudDlpDataProfile { + // Parents for configurations that produce data profile findings. + enum ParentType { + // Unspecified parent type. + PARENT_TYPE_UNSPECIFIED = 0; + + // Organization-level configurations. + ORGANIZATION = 1; + + // Project-level configurations. + PROJECT = 2; + } + + // Name of the data profile, for example, + // `projects/123/locations/europe/tableProfiles/8383929`. + string data_profile = 1 [(google.api.resource_reference) = { + type: "dlp.googleapis.com/TableDataProfile" + }]; + + // The resource hierarchy level at which the data profile was generated. + ParentType parent_type = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto new file mode 100644 index 00000000000..0abe898cd8d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto @@ -0,0 +1,54 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudDlpInspectionProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/DlpJob" + pattern: "projects/{project}/dlpJobs/{dlp_job}" + pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}" +}; + +// Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection +// job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced +// the finding. +message CloudDlpInspection { + // Name of the inspection job, for example, + // `projects/123/locations/europe/dlpJobs/i-8383929`. + string inspect_job = 1 + [(google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" }]; + + // The type of information (or + // *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, + // for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. + string info_type = 2; + + // The number of times Cloud DLP found this infoType within this job + // and resource. + int64 info_type_count = 3; + + // Whether Cloud DLP scanned the complete resource or a sampled subset. + bool full_scan = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/compliance.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/compliance.proto new file mode 100644 index 00000000000..e17f87f0321 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/compliance.proto @@ -0,0 +1,39 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ComplianceProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains compliance information about a security standard indicating unmet +// recommendations. +message Compliance { + // Industry-wide compliance standards or benchmarks, such as CIS, PCI, and + // OWASP. + string standard = 1; + + // Version of the standard or benchmark, for example, 1.1 + string version = 2; + + // Policies within the standard or benchmark, for example, A.12.4.1 + repeated string ids = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/connection.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/connection.proto new file mode 100644 index 00000000000..0c12251428d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/connection.proto @@ -0,0 +1,66 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectionProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/contact_details.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/contact_details.proto new file mode 100644 index 00000000000..fa748294a34 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/contact_details.proto @@ -0,0 +1,37 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ContactDetailsProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Details about specific contacts +message ContactDetails { + // A list of contacts + repeated Contact contacts = 1; +} + +// The email address of a contact. +message Contact { + // An email address. For example, "`person123@company.com`". + string email = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/container.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/container.proto new file mode 100644 index 00000000000..9e0399d9161 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/container.proto @@ -0,0 +1,48 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/cloud/securitycenter/v2/label.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ContainerProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Container associated with the finding. +message Container { + // Name of the container. + string name = 1; + + // Container image URI provided when configuring a pod or container. This + // string can identify a container image version using mutable tags. + string uri = 2; + + // Optional container image ID, if 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; + + // The time that the container was created. + google.protobuf.Timestamp create_time = 5; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_access_event.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_access_event.proto new file mode 100644 index 00000000000..8f1fe962728 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_access_event.proto @@ -0,0 +1,59 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "DataAccessEventProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Details about a data access attempt made by a principal not authorized under +// applicable data security policy. +message DataAccessEvent { + // The operation of a data access event. + enum Operation { + // The operation is unspecified. + OPERATION_UNSPECIFIED = 0; + + // Represents a read operation. + READ = 1; + + // Represents a move operation. + MOVE = 2; + + // Represents a copy operation. + COPY = 3; + } + + // Unique identifier for data access event. + string event_id = 1; + + // The email address of the principal that accessed the data. The principal + // could be a user account, service account, Google group, or other. + string principal_email = 2; + + // The operation performed by the principal to access the data. + Operation operation = 3; + + // Timestamp of data access event. + google.protobuf.Timestamp event_time = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_flow_event.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_flow_event.proto new file mode 100644 index 00000000000..2f6bb802cf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_flow_event.proto @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "DataFlowEventProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Details about a data flow event, in which either the data is moved to or is +// accessed from a non-compliant geo-location, as defined in the applicable data +// security policy. +message DataFlowEvent { + // The operation of a data flow event. + enum Operation { + // The operation is unspecified. + OPERATION_UNSPECIFIED = 0; + + // Represents a read operation. + READ = 1; + + // Represents a move operation. + MOVE = 2; + + // Represents a copy operation. + COPY = 3; + } + + // Unique identifier for data flow event. + string event_id = 1; + + // The email address of the principal that initiated the data flow event. The + // principal could be a user account, service account, Google group, or other. + string principal_email = 2; + + // The operation performed by the principal for the data flow event. + Operation operation = 3; + + // Non-compliant location of the principal or the data destination. + string violated_location = 4; + + // Timestamp of data flow event. + google.protobuf.Timestamp event_time = 5; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto new file mode 100644 index 00000000000..7f781ea5894 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "DataRetentionDeletionEventProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Details about data retention deletion violations, in which the data is +// non-compliant based on their retention or deletion time, as defined in the +// applicable data security policy. The Data Retention Deletion (DRD) control is +// a control of the DSPM (Data Security Posture Management) suite that enables +// organizations to manage data retention and deletion policies in compliance +// with regulations, such as GDPR and CRPA. DRD supports two primary policy +// types: maximum storage length (max TTL) and minimum storage length (min TTL). +// Both are aimed at helping organizations meet regulatory and data management +// commitments. +message DataRetentionDeletionEvent { + // Type of the DRD event. + enum EventType { + // Unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0; + + // The maximum retention time has been exceeded. + EVENT_TYPE_MAX_TTL_EXCEEDED = 1; + } + + // Timestamp indicating when the event was detected. + google.protobuf.Timestamp event_detection_time = 2; + + // Number of objects that violated the policy for this resource. If the number + // is less than 1,000, then the value of this field is the exact number. If + // the number of objects that violated the policy is greater than or equal to + // 1,000, then the value of this field is 1000. + int64 data_object_count = 3; + + // Maximum duration of retention allowed from the DRD control. This comes + // from the DRD control where users set a max TTL for their data. For example, + // suppose that a user sets the max TTL for a Cloud Storage bucket to 90 days. + // However, an object in that bucket is 100 days old. In this case, a + // DataRetentionDeletionEvent will be generated for that Cloud Storage bucket, + // and the max_retention_allowed is 90 days. + google.protobuf.Duration max_retention_allowed = 4; + + // Type of the DRD event. + EventType event_type = 5; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/database.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/database.proto new file mode 100644 index 00000000000..c8df5484f6e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/database.proto @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "DatabaseProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Represents database access information, such as queries. A database may be a +// sub-resource of an instance (as in the case of Cloud SQL instances or Cloud +// Spanner instances), or the database instance itself. Some database resources +// might not have the [full resource +// name](https://google.aip.dev/122#full-resource-names) populated because these +// resource types, such as Cloud SQL databases, are not yet supported by Cloud +// Asset Inventory. In these cases only the display name is provided. +message Database { + // Some database resources may not have the [full resource + // name](https://google.aip.dev/122#full-resource-names) populated because + // these resource types are not yet supported by Cloud Asset Inventory (e.g. + // Cloud SQL databases). In these cases only the display name will be + // provided. + // The [full resource name](https://google.aip.dev/122#full-resource-names) of + // the database that the user connected to, if it is supported by Cloud Asset + // Inventory. + string name = 1; + + // The human-readable name of the database that the user connected to. + string display_name = 2; + + // The username used to connect to the database. The username might not be an + // IAM principal and does not have a set format. + string user_name = 3; + + // The SQL statement that is associated with the database access. + string query = 4; + + // The target usernames, roles, or groups of an SQL privilege grant, which is + // not an IAM policy change. + repeated string grantees = 5; + + // The version of the database, for example, POSTGRES_14. + // See [the complete + // list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). + string version = 6; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/disk.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/disk.proto new file mode 100644 index 00000000000..304f1ace585 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/disk.proto @@ -0,0 +1,32 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "DiskProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains information about the disk associated with the finding. +message Disk { + // The name of the disk, for example, + // "https://www.googleapis.com/compute/v1/projects/{project-id}/zones/{zone-id}/disks/{disk-id}". + string name = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/exfiltration.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/exfiltration.proto new file mode 100644 index 00000000000..ed18353cb9b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/exfiltration.proto @@ -0,0 +1,57 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ExfiltrationProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Exfiltration represents a data exfiltration attempt from one or more sources +// to one or more targets. The `sources` attribute lists the sources of the +// exfiltrated data. The `targets` attribute lists the destinations 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; + + // Total exfiltrated bytes processed for the entire job. + int64 total_exfiltrated_bytes = 3; +} + +// Resource where data was exfiltrated from or exfiltrated to. +message ExfilResource { + // The resource's [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name). + string name = 1; + + // Subcomponents of the asset that was exfiltrated, like URIs used during + // exfiltration, table names, databases, and filenames. For example, multiple + // tables might have been exfiltrated from the same Cloud SQL instance, or + // multiple files might have been exfiltrated from the same Cloud Storage + // bucket. + repeated string components = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/external_system.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/external_system.proto new file mode 100644 index 00000000000..ac5b94470e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/external_system.proto @@ -0,0 +1,112 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ExternalSystemProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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: "organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + pattern: "folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}" + pattern: "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + pattern: "projects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}" + }; + + // Information about the ticket, if any, that is being used to track the + // resolution of the issue that is identified by this finding. + message TicketInfo { + // The identifier of the ticket in the ticket system. + string id = 1; + + // The assignee of the ticket in the ticket system. + string assignee = 2; + + // The description of the ticket in the ticket system. + string description = 3; + + // The link to the ticket in the ticket system. + string uri = 4; + + // The latest status of the ticket, as reported by the ticket system. + string status = 5; + + // The time when the ticket was last updated, as reported by the ticket + // system. + google.protobuf.Timestamp update_time = 6; + } + + // Full resource name of the external system. The following list + // shows some examples: + // + // + `organizations/1234/sources/5678/findings/123456/externalSystems/jira` + // + + // `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` + // + `folders/1234/sources/5678/findings/123456/externalSystems/jira` + // + + // `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` + // + `projects/1234/sources/5678/findings/123456/externalSystems/jira` + // + + // `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` + string name = 1; + + // References primary/secondary etc assignees in the external system. + repeated string assignees = 2; + + // The identifier that's used to track the finding's corresponding case in the + // external system. + string external_uid = 3; + + // The most recent status of the finding's corresponding case, as reported by + // the external system. + string status = 4; + + // The time when the case was last updated, as reported by the external + // system. + google.protobuf.Timestamp external_system_update_time = 5; + + // The link to the finding's corresponding case in the external system. + string case_uri = 6; + + // The priority of the finding's corresponding case in the external system. + string case_priority = 7; + + // The SLA of the finding's corresponding case in the external system. + google.protobuf.Timestamp case_sla = 9; + + // The time when the case was created, as reported by the external system. + google.protobuf.Timestamp case_create_time = 10; + + // The time when the case was closed, as reported by the external system. + google.protobuf.Timestamp case_close_time = 11; + + // Information about the ticket, if any, that is being used to track the + // resolution of the issue that is identified by this finding. + TicketInfo ticket_info = 8; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/file.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/file.proto new file mode 100644 index 00000000000..7a6ccf410d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/file.proto @@ -0,0 +1,95 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "FileProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// File information about the related binary/library used by an executable, or +// the script used by a script interpreter +message File { + // Path of the file in terms of underlying disk/partition identifiers. + message DiskPath { + // UUID of the partition (format + // https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid) + string partition_uuid = 1; + + // Relative path of the file in the partition as a JSON encoded string. + // Example: /home/user1/executable_file.sh + string relative_path = 2; + } + + // Operation(s) performed on a file. + message FileOperation { + // The type of the operation + enum OperationType { + // The operation is unspecified. + OPERATION_TYPE_UNSPECIFIED = 0; + + // Represents an open operation. + OPEN = 1; + + // Represents a read operation. + READ = 2; + + // Represents a rename operation. + RENAME = 3; + + // Represents a write operation. + WRITE = 4; + + // Represents an execute operation. + EXECUTE = 5; + } + + // The type of the operation + OperationType type = 1; + } + + // 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, 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. + string contents = 6; + + // Path of the file in terms of underlying disk/partition identifiers. + DiskPath disk_path = 7; + + // Operation(s) performed on a file. + repeated FileOperation operations = 8; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto new file mode 100644 index 00000000000..73be5a01836 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto @@ -0,0 +1,546 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v2/access.proto"; +import "google/cloud/securitycenter/v2/affected_resources.proto"; +import "google/cloud/securitycenter/v2/ai_model.proto"; +import "google/cloud/securitycenter/v2/application.proto"; +import "google/cloud/securitycenter/v2/attack_exposure.proto"; +import "google/cloud/securitycenter/v2/backup_disaster_recovery.proto"; +import "google/cloud/securitycenter/v2/chokepoint.proto"; +import "google/cloud/securitycenter/v2/cloud_armor.proto"; +import "google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto"; +import "google/cloud/securitycenter/v2/cloud_dlp_inspection.proto"; +import "google/cloud/securitycenter/v2/compliance.proto"; +import "google/cloud/securitycenter/v2/connection.proto"; +import "google/cloud/securitycenter/v2/contact_details.proto"; +import "google/cloud/securitycenter/v2/container.proto"; +import "google/cloud/securitycenter/v2/data_access_event.proto"; +import "google/cloud/securitycenter/v2/data_flow_event.proto"; +import "google/cloud/securitycenter/v2/data_retention_deletion_event.proto"; +import "google/cloud/securitycenter/v2/database.proto"; +import "google/cloud/securitycenter/v2/disk.proto"; +import "google/cloud/securitycenter/v2/exfiltration.proto"; +import "google/cloud/securitycenter/v2/external_system.proto"; +import "google/cloud/securitycenter/v2/file.proto"; +import "google/cloud/securitycenter/v2/group_membership.proto"; +import "google/cloud/securitycenter/v2/iam_binding.proto"; +import "google/cloud/securitycenter/v2/indicator.proto"; +import "google/cloud/securitycenter/v2/ip_rules.proto"; +import "google/cloud/securitycenter/v2/job.proto"; +import "google/cloud/securitycenter/v2/kernel_rootkit.proto"; +import "google/cloud/securitycenter/v2/kubernetes.proto"; +import "google/cloud/securitycenter/v2/load_balancer.proto"; +import "google/cloud/securitycenter/v2/log_entry.proto"; +import "google/cloud/securitycenter/v2/mitre_attack.proto"; +import "google/cloud/securitycenter/v2/network.proto"; +import "google/cloud/securitycenter/v2/notebook.proto"; +import "google/cloud/securitycenter/v2/org_policy.proto"; +import "google/cloud/securitycenter/v2/process.proto"; +import "google/cloud/securitycenter/v2/security_marks.proto"; +import "google/cloud/securitycenter/v2/security_posture.proto"; +import "google/cloud/securitycenter/v2/toxic_combination.proto"; +import "google/cloud/securitycenter/v2/vertex_ai.proto"; +import "google/cloud/securitycenter/v2/vulnerability.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "FindingProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Security Command Center finding. +// +// A finding is a record of assessment data like security, risk, health, or +// 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 { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Finding" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + pattern: "organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}" + pattern: "folders/{folder}/sources/{source}/locations/{location}/findings/{finding}" + pattern: "projects/{project}/sources/{source}/findings/{finding}" + pattern: "projects/{project}/sources/{source}/locations/{location}/findings/{finding}" + plural: "findings" + singular: "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 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 and public SSH access with weak or no + // passwords. + // + // 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; + } + + // 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 = 3; + } + + // Mute information about the finding, including whether the finding has a + // static mute or any matching dynamic mute rules. + message MuteInfo { + // Information about the static mute state. A static mute state overrides + // any dynamic mute rules that apply to this finding. The static mute state + // can be set by a static mute rule or by muting the finding directly. + message StaticMute { + // The static mute state. If the value is `MUTED` or `UNMUTED`, then the + // finding's overall mute state will have the same value. + Mute state = 1; + + // When the static mute was applied. + google.protobuf.Timestamp apply_time = 2; + } + + // The record of a dynamic mute rule that matches the finding. + message DynamicMuteRecord { + // The relative resource name of the mute rule, represented by a mute + // config, that created this record, for example + // `organizations/123/muteConfigs/mymuteconfig` or + // `organizations/123/locations/global/muteConfigs/mymuteconfig`. + string mute_config = 1; + + // When the dynamic mute rule first matched the finding. + google.protobuf.Timestamp match_time = 2; + } + + // If set, the static mute applied to this finding. Static mutes override + // dynamic mutes. If unset, there is no static mute. + StaticMute static_mute = 1; + + // The list of dynamic mute rules that currently match the finding. + repeated DynamicMuteRecord dynamic_mute_records = 2; + } + + // 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; + + // Describes an error that prevents some SCC functionality. + SCC_ERROR = 5; + + // Describes a potential security risk due to a change in the security + // posture. + POSTURE_VIOLATION = 6; + + // Describes a combination of security issues that represent a more severe + // security problem when taken together. + TOXIC_COMBINATION = 7; + + // Describes a potential security risk to data assets that contain sensitive + // data. + SENSITIVE_DATA_RISK = 8; + + // Describes a resource or resource group where high risk attack paths + // converge, based on attack path simulations (APS). + CHOKEPOINT = 9; + } + + // Identifier. The [relative resource + // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + // of the finding. The following list shows some examples: + // + // + + // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + // + + // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + // + + // `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + // + + // `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The canonical name of the finding. The following list shows + // some examples: + // + // + + // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + // + + // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + // + + // `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + // + + // `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + // The prefix is the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The relative resource name of the source and location the finding belongs + // to. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. The following list shows some + // examples: + // + // + `organizations/{organization_id}/sources/{source_id}` + // + `folders/{folders_id}/sources/{source_id}` + // + `projects/{projects_id}/sources/{source_id}` + // + + // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}` + // + `folders/{folders_id}/sources/{source_id}/locations/{location_id}` + // + `projects/{projects_id}/sources/{source_id}/locations/{location_id}` + string parent = 3; + + // Immutable. 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-Google Cloud resource, the resourceName can + // be a customer or partner defined string. + string resource_name = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The state of the finding. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The additional taxonomy group within findings from a given + // source. Example: "XSS_FLASH_INJECTION" + string category = 7 [(google.api.field_behavior) = IMMUTABLE]; + + // 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 = 8; + + // 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 = 9; + + // 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 = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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 = 11; + + // Output only. The time at which the finding was created in Security Command + // Center. + google.protobuf.Timestamp create_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The severity of the finding. This field is managed by the source that + // writes the finding. + Severity severity = 14; + + // 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; + + // Output only. The mute information regarding this finding. + MuteInfo mute_info = 53 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The class of the finding. + FindingClass finding_class = 16; + + // 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. For more information, see [Indicator of + // compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). + Indicator indicator = 17; + + // Represents vulnerability-specific fields like CVE and CVSS scores. + // CVE stands for Common Vulnerabilities and Exposures + // (https://cve.mitre.org/about/) + Vulnerability vulnerability = 18; + + // Output only. The most recent time this finding was muted or unmuted. + google.protobuf.Timestamp mute_update_time = 19 + [(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 = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // MITRE ATT&CK tactics and techniques related to this finding. + // See: https://attack.mitre.org + MitreAttack mitre_attack = 21; + + // Access details associated with the finding, such as more information on the + // caller, which method was accessed, and from where. + Access access = 22; + + // Contains information about the IP connection associated with the finding. + repeated Connection connections = 23; + + // Records additional information about the mute operation, for example, the + // [mute + // configuration](https://cloud.google.com/security-command-center/docs/how-to-mute-findings) + // that muted the finding and the user who muted the finding. + string mute_initiator = 24; + + // Represents operating system processes associated with the Finding. + repeated Process processes = 25; + + // 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 + // + // { + // "security": { + // "contacts": [ + // { + // "email": "person1@company.com" + // }, + // { + // "email": "person2@company.com" + // } + // ] + // } + // } + map contacts = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains compliance information for security standards associated to the + // finding. + repeated Compliance compliances = 27; + + // Output only. The human readable display name of the finding source such as + // "Event Threat Detection" or "Security Health Analytics". + string parent_display_name = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains more details about the finding. + string description = 30; + + // Represents exfiltrations associated with the finding. + Exfiltration exfiltration = 31; + + // Represents IAM bindings associated with the finding. + repeated IamBinding iam_bindings = 32; + + // Steps to address the finding. + string next_steps = 33; + + // Unique identifier of the module which generated the finding. + // Example: + // folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885 + string module_name = 34; + + // Containers associated with the finding. This field provides information for + // both Kubernetes and non-Kubernetes containers. + repeated Container containers = 35; + + // Kubernetes resources associated with the finding. + Kubernetes kubernetes = 36; + + // Database associated with the finding. + Database database = 37; + + // The results of an attack path simulation relevant to this finding. + AttackExposure attack_exposure = 38; + + // File associated with the finding. + repeated File files = 39; + + // Cloud Data Loss Prevention (Cloud DLP) inspection results that are + // associated with the finding. + CloudDlpInspection cloud_dlp_inspection = 40; + + // Cloud DLP data profile that is associated with the finding. + CloudDlpDataProfile cloud_dlp_data_profile = 41; + + // Signature of the kernel rootkit. + KernelRootkit kernel_rootkit = 42; + + // Contains information about the org policies associated with the finding. + repeated OrgPolicy org_policies = 43; + + // Job associated with the finding. + Job job = 44; + + // Represents an application associated with the finding. + Application application = 45; + + // IP rules associated with the finding. + IpRules ip_rules = 46; + + // Fields related to Backup and DR findings. + BackupDisasterRecovery backup_disaster_recovery = 47; + + // The security posture associated with the finding. + SecurityPosture security_posture = 48; + + // Log entries that are relevant to the finding. + repeated LogEntry log_entries = 49; + + // The load balancers associated with the finding. + repeated LoadBalancer load_balancers = 50; + + // Fields related to Cloud Armor findings. + CloudArmor cloud_armor = 51; + + // Notebook associated with the finding. + Notebook notebook = 55; + + // Contains details about a group of security issues that, when the issues + // occur together, represent a greater risk than when the issues occur + // independently. A group of such issues is referred to as a toxic + // combination. + // This field cannot be updated. Its value is ignored in all update requests. + ToxicCombination toxic_combination = 56; + + // Contains details about groups of which this finding is a member. A group is + // a collection of findings that are related in some way. + // This field cannot be updated. Its value is ignored in all update requests. + repeated GroupMembership group_memberships = 57; + + // Disk associated with the finding. + Disk disk = 58; + + // Data access events associated with the finding. + repeated DataAccessEvent data_access_events = 61; + + // Data flow events associated with the finding. + repeated DataFlowEvent data_flow_events = 62; + + // Represents the VPC networks that the resource is attached to. + repeated Network networks = 63; + + // Data retention deletion events associated with the finding. + repeated DataRetentionDeletionEvent data_retention_deletion_events = 64; + + // AffectedResources associated with the finding. + AffectedResources affected_resources = 65; + + // The AI model associated with the finding. + AiModel ai_model = 66; + + // Contains details about a chokepoint, which is a resource or resource group + // where high-risk attack paths converge, based on [attack path simulations] + // (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). + // This field cannot be updated. Its value is ignored in all update requests. + Chokepoint chokepoint = 69; + + // VertexAi associated with the finding. + VertexAi vertex_ai = 72; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/folder.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/folder.proto new file mode 100644 index 00000000000..f2013b8f817 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/folder.proto @@ -0,0 +1,36 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "FolderProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto new file mode 100644 index 00000000000..9a3e2bd4326 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto @@ -0,0 +1,47 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "GroupMembershipProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains details about groups of which this finding is a member. A group is a +// collection of findings that are related in some way. +message GroupMembership { + // Possible types of groups. + enum GroupType { + // Default value. + GROUP_TYPE_UNSPECIFIED = 0; + + // Group represents a toxic combination. + GROUP_TYPE_TOXIC_COMBINATION = 1; + + // Group represents a chokepoint. + GROUP_TYPE_CHOKEPOINT = 3; + } + + // Type of group. + GroupType group_type = 1; + + // ID of the group. + string group_id = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/iam_binding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/iam_binding.proto new file mode 100644 index 00000000000..786b9df678e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/iam_binding.proto @@ -0,0 +1,52 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "IamBindingProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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, for + // example, "foo@google.com". + string member = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/indicator.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/indicator.proto new file mode 100644 index 00000000000..11f3adf3c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/indicator.proto @@ -0,0 +1,99 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "IndicatorProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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. +// For more information, see [Indicator of +// compromise](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; + } + + // Possible resource types to be associated with a signature. + enum SignatureType { + // The default signature type. + SIGNATURE_TYPE_UNSPECIFIED = 0; + + // Used for signatures concerning processes. + SIGNATURE_TYPE_PROCESS = 1; + + // Used for signatures concerning disks. + SIGNATURE_TYPE_FILE = 2; + } + + // The signature. + 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; + } + + // Describes the type of resource associated with the signature. + SignatureType signature_type = 8; + } + + // The list of IP addresses that are associated with 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; + + // The list of URIs associated to the Findings. + repeated string uris = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ip_rules.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ip_rules.proto new file mode 100644 index 00000000000..8c70386f371 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ip_rules.proto @@ -0,0 +1,108 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "IpRulesProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// IP rules associated with the finding. +message IpRules { + // The type of direction that the rule is applicable to, one of ingress or + // egress. Not applicable to OPEN_X_PORT findings. + enum Direction { + // Unspecified direction value. + DIRECTION_UNSPECIFIED = 0; + + // Ingress direction value. + INGRESS = 1; + + // Egress direction value. + EGRESS = 2; + } + + // The direction that the rule is applicable to, one of ingress or egress. + Direction direction = 1; + + // The list of allow rules specified by this firewall. Each rule specifies a + // protocol and port-range tuple that describes a permitted connection. + oneof rules { + // Tuple with allowed rules. + Allowed allowed = 2; + + // Tuple with denied rules. + Denied denied = 3; + } + + // If source IP ranges are specified, the firewall rule applies only to + // traffic that has a source IP address in these ranges. These ranges must be + // expressed in CIDR format. Only supports IPv4. + repeated string source_ip_ranges = 4; + + // If destination IP ranges are specified, the firewall rule applies only to + // traffic that has a destination IP address in these ranges. These ranges + // must be expressed in CIDR format. Only supports IPv4. + repeated string destination_ip_ranges = 5; + + // Name of the network protocol service, such as FTP, that is exposed by the + // open port. Follows the naming convention available at: + // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml. + repeated string exposed_services = 6; +} + +// IP rule information. +message IpRule { + // A port range which is inclusive of the min and max values. + // Values are between 0 and 2^16-1. The max can be equal / must be not smaller + // than the min value. If min and max are equal this indicates that it is a + // single port. + message PortRange { + // Minimum port value. + int64 min = 1; + + // Maximum port value. + int64 max = 2; + } + + // The IP protocol this rule applies to. This value can either be one of the + // following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP, + // SCTP) or a string representation of the integer value. + string protocol = 1; + + // Optional. An optional list of ports to which this rule applies. This field + // is only applicable for the UDP or (S)TCP protocols. Each entry must be + // either an integer or a range including a min and max port number. + repeated PortRange port_ranges = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Allowed IP rule. +message Allowed { + // Optional. Optional list of allowed IP rules. + repeated IpRule ip_rules = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Denied IP rule. +message Denied { + // Optional. Optional list of denied IP rules. + repeated IpRule ip_rules = 1 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/job.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/job.proto new file mode 100644 index 00000000000..bb7938543d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/job.proto @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Describes a job +message Job { + // The fully-qualified name for a job. + // e.g. `projects//jobs/` + string name = 1; + + // Output only. State of the job, such as `RUNNING` or `PENDING`. + JobState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. If the job did not complete successfully, this field describes + // why. + int32 error_code = 3; + + // Optional. Gives the location where the job ran, such as `US` or + // `europe-west1` + string location = 4; +} + +// JobState represents the state of the job. +enum JobState { + // Unspecified represents an unknown state and should not be used. + JOB_STATE_UNSPECIFIED = 0; + + // Job is scheduled and pending for run + PENDING = 1; + + // Job in progress + RUNNING = 2; + + // Job has completed with success + SUCCEEDED = 3; + + // Job has completed but with failure + FAILED = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kernel_rootkit.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kernel_rootkit.proto new file mode 100644 index 00000000000..26ce3c78e1d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kernel_rootkit.proto @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "KernelRootkitProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Kernel mode rootkit signatures. +message KernelRootkit { + // Rootkit name, when available. + string name = 1; + + // True if unexpected modifications of kernel code memory are present. + bool unexpected_code_modification = 2; + + // True if unexpected modifications of kernel read-only data memory are + // present. + bool unexpected_read_only_data_modification = 3; + + // True if `ftrace` points are present with callbacks pointing to regions + // that are not in the expected kernel or module code range. + bool unexpected_ftrace_handler = 4; + + // True if `kprobe` points are present with callbacks pointing to regions + // that are not in the expected kernel or module code range. + bool unexpected_kprobe_handler = 5; + + // True if kernel code pages that are not in the expected kernel or module + // code regions are present. + bool unexpected_kernel_code_pages = 6; + + // True if system call handlers that are are not in the expected kernel or + // module code regions are present. + bool unexpected_system_call_handler = 7; + + // True if interrupt handlers that are are not in the expected kernel or + // module code regions are present. + bool unexpected_interrupt_handler = 8; + + // True if unexpected processes in the scheduler run queue are present. Such + // processes are in the run queue, but not in the process task list. + bool unexpected_processes_in_runqueue = 9; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kubernetes.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kubernetes.proto new file mode 100644 index 00000000000..a180196eee8 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kubernetes.proto @@ -0,0 +1,216 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/cloud/securitycenter/v2/container.proto"; +import "google/cloud/securitycenter/v2/label.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "KubernetesProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Kubernetes-related attributes. +message Kubernetes { + // A 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](https://google.aip.dev/122#full-resource-names) 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 the binding. + string ns = 1; + + // Name for the binding. + string name = 2; + + // The Role or ClusterRole referenced by the binding. + Role role = 3; + + // Represents one or more subjects that are 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 the 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 the subject. + AuthType kind = 1; + + // Namespace for the subject. + string ns = 2; + + // Name for the subject. + string name = 3; + } + + // Conveys information about a Kubernetes access review (such as one returned + // by a [`kubectl auth + // can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) + // command) that was involved in a finding. + message AccessReview { + // 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; + + // The name of the resource being requested. Empty means all. + string name = 3; + + // The optional resource type requested. "*" means all. + string resource = 4; + + // The optional subresource type. + string subresource = 5; + + // A Kubernetes resource API verb, like get, list, watch, create, update, + // delete, proxy. "*" means all. + string verb = 6; + + // The API version of the resource. "*" means all. + string version = 7; + } + + // Kubernetes object related to the finding, uniquely identified by GKNN. + // Used if the object Kind is not one of Pod, Node, NodePool, Binding, or + // AccessReview. + message Object { + // Kubernetes object group, such as "policy.k8s.io/v1". + string group = 1; + + // Kubernetes object kind, such as "Namespace". + string kind = 2; + + // Kubernetes object namespace. Must be a valid DNS label. Named + // "ns" to avoid collision with C++ namespace keyword. For details see + // https://kubernetes.io/docs/tasks/administer-cluster/namespaces/. + string ns = 3; + + // Kubernetes object name. For details see + // https://kubernetes.io/docs/concepts/overview/working-with-objects/names/. + string name = 4; + + // Pod containers associated with this finding, if any. + repeated Container containers = 5; + } + + // Kubernetes + // [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) + // associated with the finding. This field contains Pod records for each + // container that is owned by a Pod. + repeated Pod pods = 1; + + // Provides Kubernetes + // [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) + // information. + repeated Node nodes = 2; + + // GKE [node + // pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) + // associated with the finding. This field contains node pool information for + // each node, when it is available. + repeated NodePool node_pools = 3; + + // Provides Kubernetes role information for findings that involve [Roles or + // ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). + repeated Role roles = 4; + + // Provides Kubernetes role binding information for findings that involve + // [RoleBindings or + // ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). + repeated Binding bindings = 5; + + // Provides information on any Kubernetes access reviews (privilege checks) + // relevant to the finding. + repeated AccessReview access_reviews = 6; + + // Kubernetes objects related to the finding. + repeated Object objects = 7; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/label.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/label.proto new file mode 100644 index 00000000000..4fb9664d073 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/label.proto @@ -0,0 +1,37 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "LabelProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Represents a generic name-value label. A label has separate name and value +// fields to support filtering with the `contains()` function. For more +// information, see [Filtering on array-type +// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). +message Label { + // Name of the label. + string name = 1; + + // Value that corresponds to the label's name. + string value = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/load_balancer.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/load_balancer.proto new file mode 100644 index 00000000000..310834b7ec7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/load_balancer.proto @@ -0,0 +1,32 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "LoadBalancerProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains information related to the load balancer associated with the +// finding. +message LoadBalancer { + // The name of the load balancer associated with the finding. + string name = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/log_entry.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/log_entry.proto new file mode 100644 index 00000000000..ac179a5bc47 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/log_entry.proto @@ -0,0 +1,56 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "LogEntryProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// An individual entry in a log. +message LogEntry { + // The log entry. + oneof log_entry { + // An individual entry in a log stored in Cloud Logging. + CloudLoggingEntry cloud_logging_entry = 1; + } +} + +// Metadata taken from a [Cloud Logging +// LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) +message CloudLoggingEntry { + // A unique identifier for the log entry. + string insert_id = 1; + + // The type of the log (part of `log_name`. `log_name` is the resource name of + // the log to which this log entry belongs). For example: + // `cloudresourcemanager.googleapis.com/activity` Note that this field is not + // URL-encoded, unlike in `LogEntry`. + string log_id = 2; + + // The organization, folder, or project of the monitored resource that + // produced this log entry. + string resource_container = 3; + + // The time the event described by the log entry occurred. + google.protobuf.Timestamp timestamp = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mitre_attack.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mitre_attack.proto new file mode 100644 index 00000000000..5283d271b84 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mitre_attack.proto @@ -0,0 +1,517 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "MitreAttackProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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 Security Command Center + // findings. See: https://attack.mitre.org/techniques/enterprise/ + enum Technique { + // Unspecified value. + TECHNIQUE_UNSPECIFIED = 0; + + // T1001 + DATA_OBFUSCATION = 70; + + // T1001.002 + DATA_OBFUSCATION_STEGANOGRAPHY = 71; + + // T1003 + OS_CREDENTIAL_DUMPING = 114; + + // T1003.007 + OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM = 115; + + // T1003.008 + OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW = 122; + + // T1005 + DATA_FROM_LOCAL_SYSTEM = 117; + + // T1020 + AUTOMATED_EXFILTRATION = 68; + + // T1027 + OBFUSCATED_FILES_OR_INFO = 72; + + // T1027.003 + STEGANOGRAPHY = 73; + + // T1027.004 + COMPILE_AFTER_DELIVERY = 74; + + // T1027.010 + COMMAND_OBFUSCATION = 75; + + // T1029 + SCHEDULED_TRANSFER = 120; + + // T1033 + SYSTEM_OWNER_USER_DISCOVERY = 118; + + // T1036 + MASQUERADING = 49; + + // T1036.005 + MATCH_LEGITIMATE_NAME_OR_LOCATION = 50; + + // T1037 + BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37; + + // T1037.005 + STARTUP_ITEMS = 38; + + // T1046 + NETWORK_SERVICE_DISCOVERY = 32; + + // T1053 + SCHEDULED_TASK_JOB = 89; + + // T1053.003 + SCHEDULED_TASK_JOB_CRON = 119; + + // T1053.007 + CONTAINER_ORCHESTRATION_JOB = 90; + + // T1055 + PROCESS_INJECTION = 93; + + // T1056 + INPUT_CAPTURE = 103; + + // T1056.001 + INPUT_CAPTURE_KEYLOGGING = 104; + + // T1057 + PROCESS_DISCOVERY = 56; + + // T1059 + COMMAND_AND_SCRIPTING_INTERPRETER = 6; + + // T1059.004 + UNIX_SHELL = 7; + + // T1059.006 + PYTHON = 59; + + // T1068 + EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63; + + // T1069 + PERMISSION_GROUPS_DISCOVERY = 18; + + // T1069.003 + CLOUD_GROUPS = 19; + + // T1070 + INDICATOR_REMOVAL = 123; + + // T1070.002 + INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS = 124; + + // T1070.003 + INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY = 125; + + // T1070.004 + INDICATOR_REMOVAL_FILE_DELETION = 64; + + // T1070.006 + INDICATOR_REMOVAL_TIMESTOMP = 128; + + // T1070.008 + INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA = 126; + + // T1071 + APPLICATION_LAYER_PROTOCOL = 45; + + // T1071.004 + DNS = 46; + + // T1072 + SOFTWARE_DEPLOYMENT_TOOLS = 47; + + // T1078 + VALID_ACCOUNTS = 14; + + // T1078.001 + DEFAULT_ACCOUNTS = 35; + + // T1078.003 + LOCAL_ACCOUNTS = 15; + + // T1078.004 + CLOUD_ACCOUNTS = 16; + + // T1083 + FILE_AND_DIRECTORY_DISCOVERY = 121; + + // T1087.001 + ACCOUNT_DISCOVERY_LOCAL_ACCOUNT = 116; + + // T1090 + PROXY = 9; + + // T1090.002 + EXTERNAL_PROXY = 10; + + // T1090.003 + MULTI_HOP_PROXY = 11; + + // T1098 + ACCOUNT_MANIPULATION = 22; + + // T1098.001 + ADDITIONAL_CLOUD_CREDENTIALS = 40; + + // T1098.003 + ADDITIONAL_CLOUD_ROLES = 67; + + // T1098.004 + SSH_AUTHORIZED_KEYS = 23; + + // T1098.006 + ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58; + + // T1104 + MULTI_STAGE_CHANNELS = 76; + + // T1105 + INGRESS_TOOL_TRANSFER = 3; + + // T1106 + NATIVE_API = 4; + + // T1110 + BRUTE_FORCE = 44; + + // T1119 + AUTOMATED_COLLECTION = 94; + + // T1129 + SHARED_MODULES = 5; + + // T1132 + DATA_ENCODING = 77; + + // T1132.001 + STANDARD_ENCODING = 78; + + // T1134 + ACCESS_TOKEN_MANIPULATION = 33; + + // T1134.001 + TOKEN_IMPERSONATION_OR_THEFT = 39; + + // T1136 + CREATE_ACCOUNT = 79; + + // T1136.001 + LOCAL_ACCOUNT = 80; + + // T1140 + DEOBFUSCATE_DECODE_FILES_OR_INFO = 95; + + // T1190 + EXPLOIT_PUBLIC_FACING_APPLICATION = 27; + + // T1195 + SUPPLY_CHAIN_COMPROMISE = 129; + + // T1195.001 + COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS = 130; + + // T1203 + EXPLOITATION_FOR_CLIENT_EXECUTION = 134; + + // T1204 + USER_EXECUTION = 69; + + // T1222.002 + LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = 135; + + // T1484 + DOMAIN_POLICY_MODIFICATION = 30; + + // T1485 + DATA_DESTRUCTION = 29; + + // T1486 + DATA_ENCRYPTED_FOR_IMPACT = 132; + + // T1489 + SERVICE_STOP = 52; + + // T1490 + INHIBIT_SYSTEM_RECOVERY = 36; + + // T1495 + FIRMWARE_CORRUPTION = 81; + + // T1496 + RESOURCE_HIJACKING = 8; + + // T1498 + NETWORK_DENIAL_OF_SERVICE = 17; + + // T1526 + CLOUD_SERVICE_DISCOVERY = 48; + + // T1528 + STEAL_APPLICATION_ACCESS_TOKEN = 42; + + // T1531 + ACCOUNT_ACCESS_REMOVAL = 51; + + // T1537 + TRANSFER_DATA_TO_CLOUD_ACCOUNT = 91; + + // T1539 + STEAL_WEB_SESSION_COOKIE = 25; + + // T1543 + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24; + + // T1546 + EVENT_TRIGGERED_EXECUTION = 65; + + // T1547 + BOOT_OR_LOGON_AUTOSTART_EXECUTION = 82; + + // T1547.006 + KERNEL_MODULES_AND_EXTENSIONS = 83; + + // T1547.009 + SHORTCUT_MODIFICATION = 127; + + // T1548 + ABUSE_ELEVATION_CONTROL_MECHANISM = 34; + + // T1548.001 + ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID = 136; + + // T1548.003 + ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING = 109; + + // T1552 + UNSECURED_CREDENTIALS = 13; + + // T1552.001 + CREDENTIALS_IN_FILES = 105; + + // T1552.003 + BASH_HISTORY = 96; + + // T1552.004 + PRIVATE_KEYS = 97; + + // T1553 + SUBVERT_TRUST_CONTROL = 106; + + // T1553.004 + INSTALL_ROOT_CERTIFICATE = 107; + + // T1554 + COMPROMISE_HOST_SOFTWARE_BINARY = 84; + + // T1555 + CREDENTIALS_FROM_PASSWORD_STORES = 98; + + // T1556 + MODIFY_AUTHENTICATION_PROCESS = 28; + + // T1556.003 + PLUGGABLE_AUTHENTICATION_MODULES = 108; + + // T1556.006 + MULTI_FACTOR_AUTHENTICATION = 137; + + // T1562 + IMPAIR_DEFENSES = 31; + + // T1562.001 + DISABLE_OR_MODIFY_TOOLS = 55; + + // T1562.006 + INDICATOR_BLOCKING = 110; + + // T1562.012 + DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM = 111; + + // T1564 + HIDE_ARTIFACTS = 85; + + // T1564.001 + HIDDEN_FILES_AND_DIRECTORIES = 86; + + // T1564.002 + HIDDEN_USERS = 87; + + // T1567 + EXFILTRATION_OVER_WEB_SERVICE = 20; + + // T1567.002 + EXFILTRATION_TO_CLOUD_STORAGE = 21; + + // T1568 + DYNAMIC_RESOLUTION = 12; + + // T1570 + LATERAL_TOOL_TRANSFER = 41; + + // T1574 + HIJACK_EXECUTION_FLOW = 112; + + // T1574.006 + HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING = 113; + + // T1578 + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26; + + // T1578.001 + CREATE_SNAPSHOT = 54; + + // T1580 + CLOUD_INFRASTRUCTURE_DISCOVERY = 53; + + // T1587 + DEVELOP_CAPABILITIES = 99; + + // T1587.001 + DEVELOP_CAPABILITIES_MALWARE = 100; + + // T1588 + OBTAIN_CAPABILITIES = 43; + + // T1588.001 + OBTAIN_CAPABILITIES_MALWARE = 101; + + // T1588.006 + OBTAIN_CAPABILITIES_VULNERABILITIES = 133; + + // T1595 + ACTIVE_SCANNING = 1; + + // T1595.001 + SCANNING_IP_BLOCKS = 2; + + // T1608 + STAGE_CAPABILITIES = 88; + + // T1608.001 + UPLOAD_MALWARE = 102; + + // T1609 + CONTAINER_ADMINISTRATION_COMMAND = 60; + + // T1610 + DEPLOY_CONTAINER = 66; + + // T1611 + ESCAPE_TO_HOST = 61; + + // T1613 + CONTAINER_AND_RESOURCE_DISCOVERY = 57; + + // T1620 + REFLECTIVE_CODE_LOADING = 92; + + // T1649 + STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62; + + // T1657 + FINANCIAL_THEFT = 131; + } + + // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mute_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mute_config.proto new file mode 100644 index 00000000000..1fb53768c79 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mute_config.proto @@ -0,0 +1,128 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "MuteConfigProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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: "organizations/{organization}/locations/{location}/muteConfigs/{mute_config}" + pattern: "folders/{folder}/muteConfigs/{mute_config}" + pattern: "folders/{folder}/locations/{location}/muteConfigs/{mute_config}" + pattern: "projects/{project}/muteConfigs/{mute_config}" + pattern: "projects/{project}/locations/{location}/muteConfigs/{mute_config}" + plural: "muteConfigs" + singular: "muteConfig" + }; + + // The type of MuteConfig. + enum MuteConfigType { + // Unused. + MUTE_CONFIG_TYPE_UNSPECIFIED = 0; + + // A static mute config, which sets the static mute state of future matching + // findings to muted. Once the static mute state has been set, finding or + // config modifications will not affect the state. + STATIC = 1; + + // A dynamic mute config, which is applied to existing and future matching + // findings, setting their dynamic mute state to "muted". If the config is + // updated or deleted, or a matching finding is updated, such that the + // finding doesn't match the config, the config will be removed from the + // finding, and the finding's dynamic mute state may become "unmuted" + // (unless other configs still match). + DYNAMIC = 2; + } + + // Identifier. This field will be ignored if provided on config creation. The + // following list shows some examples of the format: + // + // + `organizations/{organization}/muteConfigs/{mute_config}` + // + + // `organizations/{organization}locations/{location}//muteConfigs/{mute_config}` + // + `folders/{folder}/muteConfigs/{mute_config}` + // + `folders/{folder}/locations/{location}/muteConfigs/{mute_config}` + // + `projects/{project}/muteConfigs/{mute_config}` + // + `projects/{project}/locations/{location}/muteConfigs/{mute_config}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // A description of the mute config. + string description = 2; + + // 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 = 3 [(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 = 4 + [(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 = 5 + [(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 = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the mute config, which determines what type of mute + // state the config affects. Immutable after creation. + MuteConfigType type = 8 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The expiry of the mute config. Only applicable for dynamic + // configs. If the expiry is set, when the config expires, it is removed from + // all findings. + google.protobuf.Timestamp expiry_time = 9 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/network.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/network.proto new file mode 100644 index 00000000000..bff3c6eb520 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/network.proto @@ -0,0 +1,32 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "NetworkProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains information about a VPC network associated with the finding. +message Network { + // The name of the VPC network resource, for example, + // `//compute.googleapis.com/projects/my-project/global/networks/my-network`. + string name = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notebook.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notebook.proto new file mode 100644 index 00000000000..9a1814d51c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notebook.proto @@ -0,0 +1,44 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise +// notebook](https://cloud.google.com/colab/docs/introduction) file, that is +// associated with a finding. +message Notebook { + // The name of the notebook. + string name = 1; + + // The source notebook service, for example, "Colab Enterprise". + string service = 2; + + // The user ID of the latest author to modify the notebook. + string last_author = 3; + + // The most recent time the notebook was updated. + google.protobuf.Timestamp notebook_update_time = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_config.proto new file mode 100644 index 00000000000..f83d79254b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_config.proto @@ -0,0 +1,110 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "NotificationConfigProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; +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}/locations/{location}/notificationConfigs/{notification_config}" + pattern: "folders/{folder}/locations/{location}/notificationConfigs/{notification_config}" + pattern: "projects/{project}/locations/{location}/notificationConfigs/{notification_config}" + plural: "notificationConfigs" + singular: "notificationConfig" + }; + + // 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; + } + + // Identifier. The relative resource name of this notification config. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // The following list shows some examples: + // + + // `organizations/{organization_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` + // + + // `folders/{folder_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` + // + + // `projects/{project_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The description of the notification config (max of 1024 characters). + string description = 2; + + // 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" } + ]; + + // Output only. The service account that needs "pubsub.topics.publish" + // permission to publish to the Pub/Sub 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; + } + + // Output only. The timestamp of when the notification config was last + // updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_message.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_message.proto new file mode 100644 index 00000000000..370d8bfd493 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_message.proto @@ -0,0 +1,44 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/cloud/securitycenter/v2/finding.proto"; +import "google/cloud/securitycenter/v2/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "NotificationMessageProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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; + } + + // The Cloud resource tied to this notification's Finding. + Resource resource = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/org_policy.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/org_policy.proto new file mode 100644 index 00000000000..49800942cef --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/org_policy.proto @@ -0,0 +1,43 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains information about the org policies associated with the finding. +message OrgPolicy { + option (google.api.resource) = { + type: "orgpolicy.googleapis.com/Policy" + pattern: "organizations/{organization}/policies/{constraint_name}" + pattern: "folders/{folder}/policies/{constraint_name}" + pattern: "projects/{project}/policies/{constraint_name}" + }; + + // Identifier. The resource name of the org policy. + // Example: + // "organizations/{organization_id}/policies/{constraint_name}" + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/process.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/process.proto new file mode 100644 index 00000000000..decd87b106f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/process.proto @@ -0,0 +1,78 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/cloud/securitycenter/v2/file.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ProcessProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Represents an operating system process. +message Process { + // The process name, as displayed in utilities like `top` and `ps`. This name + // can be accessed through `/proc/[pid]/comm` and changed with + // `prctl(PR_SET_NAME)`. + string name = 1; + + // File information for the process executable. + File binary = 2; + + // File information for libraries loaded by the process. + repeated File libraries = 3; + + // 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 = 4; + + // Process arguments as JSON encoded strings. + repeated string args = 5; + + // True if `args` is incomplete. + bool arguments_truncated = 6; + + // Process environment variables. + repeated EnvironmentVariable env_variables = 7; + + // True if `env_variables` is incomplete. + bool env_variables_truncated = 8; + + // The process ID. + int64 pid = 9; + + // The parent process ID. + int64 parent_pid = 10; + + // The ID of the user that executed the process. E.g. If this is the root user + // this will always be 0. + int64 user_id = 11; +} + +// A name-value pair representing an environment variable used in an operating +// system 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource.proto new file mode 100644 index 00000000000..8dcbb8b4d63 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource.proto @@ -0,0 +1,275 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v2/folder.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourceProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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 human readable name of the resource. + string display_name = 2; + + // The full resource type of the resource. + string type = 3; + + // Indicates which cloud provider the finding is from. + CloudProvider cloud_provider = 4; + + // The service or resource provider associated with the resource. + string service = 5; + + // The region or location of the service (if applicable). + string location = 6; + + // The metadata associated with the cloud provider. + oneof cloud_provider_metadata { + // The GCP metadata associated with the finding. + GcpMetadata gcp_metadata = 7; + + // The AWS metadata associated with the finding. + AwsMetadata aws_metadata = 8; + + // The Azure metadata associated with the finding. + AzureMetadata azure_metadata = 9; + } + + // Provides the path to the resource within the resource hierarchy. + ResourcePath resource_path = 10; + + // A string representation of the resource path. + // For Google Cloud, it has the format of + // `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` + // where there can be any number of folders. + // For AWS, it has the format of + // `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` + // where there can be any number of organizational units. + // For Azure, it has the format of + // `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` + // where there can be any number of management groups. + string resource_path_string = 11; +} + +// The cloud provider the finding pertains to. +enum CloudProvider { + // The cloud provider is unspecified. + CLOUD_PROVIDER_UNSPECIFIED = 0; + + // The cloud provider is Google Cloud. + GOOGLE_CLOUD_PLATFORM = 1; + + // The cloud provider is Amazon Web Services. + AMAZON_WEB_SERVICES = 2; + + // The cloud provider is Microsoft Azure. + MICROSOFT_AZURE = 3; +} + +// Google Cloud metadata associated with the resource. Only applicable if the +// finding's cloud provider is Google Cloud. +message GcpMetadata { + // The full resource name of project that the resource belongs to. + string project = 1; + + // The project ID that the resource belongs to. + string project_display_name = 2; + + // The full resource name of resource's parent. + string parent = 3; + + // The human readable name of resource's parent. + string parent_display_name = 4; + + // 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 = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The name of the organization that the resource belongs to. + string organization = 6; +} + +// AWS metadata associated with the resource, only applicable if the finding's +// cloud provider is Amazon Web Services. +message AwsMetadata { + // An organization is a collection of accounts that are centrally managed + // together using consolidated billing, organized hierarchically with + // organizational units (OUs), and controlled with policies. + message AwsOrganization { + // The unique identifier (ID) for the organization. The regex pattern for an + // organization ID string requires "o-" followed by from 10 to 32 lowercase + // letters or digits. + string id = 1; + } + + // An Organizational Unit (OU) is a container of AWS accounts within a root of + // an organization. Policies that are attached to an OU apply to all accounts + // contained in that OU and in any child OUs. + message AwsOrganizationalUnit { + // The unique identifier (ID) associated with this OU. The regex pattern for + // an organizational unit ID string requires "ou-" followed by from 4 to 32 + // lowercase letters or digits (the ID of the root that contains the OU). + // This string is followed by a second "-" dash and from 8 to 32 additional + // lowercase letters or digits. For example, "ou-ab12-cd34ef56". + string id = 1; + + // The friendly name of the OU. + string name = 2; + } + + // An AWS account that is a member of an organization. + message AwsAccount { + // The unique identifier (ID) of the account, containing exactly 12 digits. + string id = 1; + + // The friendly name of this account. + string name = 2; + } + + // The AWS organization associated with the resource. + AwsOrganization organization = 1; + + // A list of AWS organizational units associated with the resource, ordered + // from lowest level (closest to the account) to highest level. + repeated AwsOrganizationalUnit organizational_units = 2; + + // The AWS account associated with the resource. + AwsAccount account = 3; +} + +// Azure metadata associated with the resource, only applicable if the finding's +// cloud provider is Microsoft Azure. +message AzureMetadata { + // Represents an Azure management group. + message AzureManagementGroup { + // The UUID of the Azure management group, for example, + // `20000000-0001-0000-0000-000000000000`. + string id = 1; + + // The display name of the Azure management group. + string display_name = 2; + } + + // Represents an Azure subscription. + message AzureSubscription { + // The UUID of the Azure subscription, for example, + // `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`. + string id = 1; + + // The display name of the Azure subscription. + string display_name = 2; + } + + // Represents an Azure resource group. + message AzureResourceGroup { + // The ID of the Azure resource group. + string id = 2; + + // The name of the Azure resource group. This is not a UUID. + string name = 1; + } + + // Represents a Microsoft Entra tenant. + message AzureTenant { + // The ID of the Microsoft Entra tenant, for example, + // "a11aaa11-aa11-1aa1-11aa-1aaa11a". + string id = 1; + + // The display name of the Azure tenant. + string display_name = 2; + } + + // A list of Azure management groups associated with the resource, ordered + // from lowest level (closest to the subscription) to highest level. + repeated AzureManagementGroup management_groups = 1; + + // The Azure subscription associated with the resource. + AzureSubscription subscription = 2; + + // The Azure resource group associated with the resource. + AzureResourceGroup resource_group = 3; + + // The Azure Entra tenant associated with the resource. + AzureTenant tenant = 7; +} + +// Represents the path of resources leading up to the resource this finding is +// about. +message ResourcePath { + // The type of resource the node represents. + enum ResourcePathNodeType { + // Node type is unspecified. + RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0; + + // The node represents a Google Cloud organization. + GCP_ORGANIZATION = 1; + + // The node represents a Google Cloud folder. + GCP_FOLDER = 2; + + // The node represents a Google Cloud project. + GCP_PROJECT = 3; + + // The node represents an AWS organization. + AWS_ORGANIZATION = 4; + + // The node represents an AWS organizational unit. + AWS_ORGANIZATIONAL_UNIT = 5; + + // The node represents an AWS account. + AWS_ACCOUNT = 6; + + // The node represents an Azure management group. + AZURE_MANAGEMENT_GROUP = 7; + + // The node represents an Azure subscription. + AZURE_SUBSCRIPTION = 8; + + // The node represents an Azure resource group. + AZURE_RESOURCE_GROUP = 9; + } + + // A node within the resource path. Each node represents a resource within the + // resource hierarchy. + message ResourcePathNode { + // The type of resource this node represents. + ResourcePathNodeType node_type = 1; + + // The ID of the resource this node represents. + string id = 2; + + // The display name of the resource this node represents. + string display_name = 3; + } + + // The list of nodes that make the up resource path, ordered from lowest + // level to highest level. + repeated ResourcePathNode nodes = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource_value_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource_value_config.proto new file mode 100644 index 00000000000..c65e3538190 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource_value_config.proto @@ -0,0 +1,126 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v2/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourceValueConfigProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// A resource value configuration (RVC) is a mapping configuration of user's +// resources to resource values. Used in Attack path simulations. +message ResourceValueConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/ResourceValueConfig" + pattern: "organizations/{organization}/resourceValueConfigs/{resource_value_config}" + pattern: "organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}" + plural: "resourceValueConfigs" + singular: "resourceValueConfig" + }; + + // Resource value mapping for Sensitive Data Protection findings + // If any of these mappings have a resource value that is not unspecified, + // the resource_value field will be ignored when reading this configuration. + message SensitiveDataProtectionMapping { + // Resource value mapping for high-sensitivity Sensitive Data Protection + // findings + ResourceValue high_sensitivity_mapping = 1; + + // Resource value mapping for medium-sensitivity Sensitive Data Protection + // findings + ResourceValue medium_sensitivity_mapping = 2; + } + + // Identifier. Name for the resource value configuration + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Resource value level this expression represents + // Only required when there is no Sensitive Data Protection mapping in the + // request + ResourceValue resource_value = 2; + + // Tag values combined with `AND` to check against. + // For Google Cloud resources, they are tag value IDs in the form of + // "tagValues/123". Example: `[ "tagValues/123", "tagValues/456", + // "tagValues/789" ]` + // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing + repeated string tag_values = 3; + + // Apply resource_value only to resources that match resource_type. + // resource_type will be checked with `AND` of other resources. + // For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" + // will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. + string resource_type = 4; + + // Project or folder to scope this configuration to. + // For example, "project/456" would apply this configuration only to resources + // in "project/456" scope and will be checked with `AND` of other resources. + string scope = 5; + + // List of resource labels to search for, evaluated with `AND`. + // For example, "resource_labels_selector": {"key": "value", "env": "prod"} + // will match resources with labels "key": "value" `AND` "env": + // "prod" + // https://cloud.google.com/resource-manager/docs/creating-managing-labels + map resource_labels_selector = 6; + + // Description of the resource value configuration. + string description = 7; + + // Output only. Timestamp this resource value configuration was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp this resource value configuration was last updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud provider this configuration applies to + CloudProvider cloud_provider = 10; + + // A mapping of the sensitivity on Sensitive Data Protection finding to + // resource values. This mapping can only be used in combination with a + // resource_type that is related to BigQuery, e.g. + // "bigquery.googleapis.com/Dataset". + SensitiveDataProtectionMapping sensitive_data_protection_mapping = 11; +} + +// Value enum to map to a resource +enum ResourceValue { + // Unspecific value + RESOURCE_VALUE_UNSPECIFIED = 0; + + // High resource value + HIGH = 1; + + // Medium resource value + MEDIUM = 2; + + // Low resource value + LOW = 3; + + // No resource value, e.g. ignore these resources + NONE = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_marks.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_marks.proto new file mode 100644 index 00000000000..c6d8b820d4a --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_marks.proto @@ -0,0 +1,86 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityMarksProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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) = { + type: "securitycenter.googleapis.com/SecurityMarks" + pattern: "organizations/{organization}/assets/{asset}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks" + pattern: "folders/{folder}/assets/{asset}/securityMarks" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/securityMarks" + pattern: "folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks" + pattern: "projects/{project}/assets/{asset}/securityMarks" + pattern: "projects/{project}/sources/{source}/findings/{finding}/securityMarks" + pattern: "projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks" + }; + + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // The following list shows some examples: + // + // + `organizations/{organization_id}/assets/{asset_id}/securityMarks` + // + + // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks` + // + + // `organizations/{organization_id}/sources/{source_id}/locations/{location}/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; + + // The canonical name of the marks. The following list shows some examples: + // + // + `organizations/{organization_id}/assets/{asset_id}/securityMarks` + // + + // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks` + // + + // `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` + // + `folders/{folder_id}/assets/{asset_id}/securityMarks` + // + + // `folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks` + // + + // `folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` + // + `projects/{project_number}/assets/{asset_id}/securityMarks` + // + + // `projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks` + // + + // `projects/{project_number}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` + string canonical_name = 3; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_posture.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_posture.proto new file mode 100644 index 00000000000..8537663e54b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_posture.proto @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityPostureProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Represents a posture that is deployed on Google Cloud by the +// Security Command Center Posture Management service. +// A posture contains one or more policy sets. A policy set is a +// group of policies that enforce a set of security rules on Google +// Cloud. +message SecurityPosture { + // The policy field that violates the deployed posture and its expected and + // detected values. + message PolicyDriftDetails { + // The name of the updated field, for example + // constraint.implementation.policy_rules[0].enforce + string field = 1; + + // The value of this field that was configured in a posture, for example, + // `true` or `allowed_values={"projects/29831892"}`. + string expected_value = 2; + + // The detected value that violates the deployed posture, for example, + // `false` or `allowed_values={"projects/22831892"}`. + string detected_value = 3; + } + + // Name of the posture, for example, `CIS-Posture`. + string name = 1; + + // The version of the posture, for example, `c7cfa2a8`. + string revision_id = 2; + + // The project, folder, or organization on which the posture is deployed, + // for example, `projects/{project_number}`. + string posture_deployment_resource = 3; + + // The name of the posture deployment, for example, + // `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. + string posture_deployment = 4; + + // The name of the updated policy, for example, + // `projects/{project_id}/policies/{constraint_name}`. + string changed_policy = 5; + + // The name of the updated policy set, for example, `cis-policyset`. + string policy_set = 6; + + // The ID of the updated policy, for example, `compute-policy-1`. + string policy = 7; + + // The details about a change in an updated policy that violates the deployed + // posture. + repeated PolicyDriftDetails policy_drift_details = 8; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/securitycenter_service.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/securitycenter_service.proto new file mode 100644 index 00000000000..fd9206aedb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/securitycenter_service.proto @@ -0,0 +1,2076 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/cloud/securitycenter/v2/attack_path.proto"; +import "google/cloud/securitycenter/v2/bigquery_export.proto"; +import "google/cloud/securitycenter/v2/external_system.proto"; +import "google/cloud/securitycenter/v2/finding.proto"; +import "google/cloud/securitycenter/v2/mute_config.proto"; +import "google/cloud/securitycenter/v2/notification_config.proto"; +import "google/cloud/securitycenter/v2/resource.proto"; +import "google/cloud/securitycenter/v2/resource_value_config.proto"; +import "google/cloud/securitycenter/v2/security_marks.proto"; +import "google/cloud/securitycenter/v2/simulation.proto"; +import "google/cloud/securitycenter/v2/source.proto"; +import "google/cloud/securitycenter/v2/valued_resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.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.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SecuritycenterServiceProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; +option (google.api.resource_definition) = { + type: "securitycenter.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; +option (google.api.resource_definition) = { + type: "securitycenter.googleapis.com/FolderLocation" + pattern: "folders/{folder}/locations/{location}" +}; +option (google.api.resource_definition) = { + type: "securitycenter.googleapis.com/OrganizationValuedResource" + pattern: "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}" +}; + +// V2 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 ResourceValueConfig for an organization. Maps user's tags to + // difference resource values for use by the attack path simulation. + rpc BatchCreateResourceValueConfigs(BatchCreateResourceValueConfigsRequest) + returns (BatchCreateResourceValueConfigsResponse) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate" + body: "*" + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate" + body: "*" + } + }; + option (google.api.method_signature) = "parent,requests"; + } + + // Kicks off an LRO to bulk mute findings for a parent based on a filter. If + // no location is specified, findings are muted in global. 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: "/v2/{parent=organizations/*}/findings:bulkMute" + body: "*" + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/findings:bulkMute" + body: "*" + } + additional_bindings { + post: "/v2/{parent=folders/*}/findings:bulkMute" + body: "*" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*}/findings:bulkMute" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*}/findings:bulkMute" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/findings:bulkMute" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v2.BulkMuteFindingsResponse" + metadata_type: "google.protobuf.Empty" + }; + } + + // Creates a BigQuery export. + rpc CreateBigQueryExport(CreateBigQueryExportRequest) + returns (BigQueryExport) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*/locations/*}/bigQueryExports" + body: "big_query_export" + additional_bindings { + post: "/v2/{parent=folders/*/locations/*}/bigQueryExports" + body: "big_query_export" + } + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/bigQueryExports" + body: "big_query_export" + } + }; + option (google.api.method_signature) = + "parent,big_query_export,big_query_export_id"; + } + + // Creates a finding in a location. The corresponding source must exist for + // finding creation to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*/sources/*/locations/*}/findings" + body: "finding" + additional_bindings { + post: "/v2/{parent=organizations/*/sources/*}/findings" + body: "finding" + } + }; + option (google.api.method_signature) = "parent,finding,finding_id"; + } + + // Creates a mute config. + rpc CreateMuteConfig(CreateMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*/locations/*}/muteConfigs" + body: "mute_config" + additional_bindings { + post: "/v2/{parent=folders/*/locations/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v2/{parent=organizations/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v2/{parent=folders/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v2/{parent=projects/*}/muteConfigs" + body: "mute_config" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + routing_parameters { + field: "parent" + path_template: "organizations/*/locations/{location=*}" + } + routing_parameters { + field: "parent" + path_template: "folders/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent,mute_config,mute_config_id"; + } + + // Creates a notification config. + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*/locations/*}/notificationConfigs" + body: "notification_config" + additional_bindings { + post: "/v2/{parent=folders/*/locations/*}/notificationConfigs" + body: "notification_config" + } + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/notificationConfigs" + body: "notification_config" + } + }; + option (google.api.method_signature) = + "parent,notification_config,config_id"; + } + + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*}/sources" + body: "source" + }; + option (google.api.method_signature) = "parent,source"; + } + + // Deletes an existing BigQuery export. + rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=organizations/*/locations/*/bigQueryExports/*}" + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/bigQueryExports/*}" + } + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/bigQueryExports/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes an existing mute config. If no location is specified, default is + // global. + rpc DeleteMuteConfig(DeleteMuteConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=organizations/*/muteConfigs/*}" + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/muteConfigs/*}" + } + additional_bindings { delete: "/v2/{name=folders/*/muteConfigs/*}" } + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/muteConfigs/*}" + } + additional_bindings { delete: "/v2/{name=projects/*/muteConfigs/*}" } + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/muteConfigs/*}" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/muteConfigs/*" + } + routing_parameters { + field: "name" + path_template: "organizations/*/locations/{location=*}/muteConfigs/*" + } + routing_parameters { + field: "name" + path_template: "folders/*/locations/{location=*}/muteConfigs/*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a notification config. + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=organizations/*/locations/*/notificationConfigs/*}" + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/notificationConfigs/*}" + } + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/notificationConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a ResourceValueConfig. + rpc DeleteResourceValueConfig(DeleteResourceValueConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=organizations/*/resourceValueConfigs/*}" + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a BigQuery export. + rpc GetBigQueryExport(GetBigQueryExportRequest) returns (BigQueryExport) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/locations/*/bigQueryExports/*}" + additional_bindings { + get: "/v2/{name=folders/*/locations/*/bigQueryExports/*}" + } + additional_bindings { + get: "/v2/{name=projects/*/locations/*/bigQueryExports/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Get the simulation by name or the latest simulation for the given + // organization. + rpc GetSimulation(GetSimulationRequest) returns (Simulation) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/simulations/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/simulations/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Get the valued resource by name + rpc GetValuedResource(GetValuedResourceRequest) returns (ValuedResource) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/simulations/*/valuedResources/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/simulations/*/valuedResources/*}" + } + }; + 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: "/v2/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Gets a mute config. If no location is specified, default is + // global. + rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/muteConfigs/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/muteConfigs/*}" + } + additional_bindings { get: "/v2/{name=folders/*/muteConfigs/*}" } + additional_bindings { + get: "/v2/{name=folders/*/locations/*/muteConfigs/*}" + } + additional_bindings { get: "/v2/{name=projects/*/muteConfigs/*}" } + additional_bindings { + get: "/v2/{name=projects/*/locations/*/muteConfigs/*}" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/muteConfigs/*" + } + routing_parameters { + field: "name" + path_template: "organizations/*/locations/{location=*}/muteConfigs/*" + } + routing_parameters { + field: "name" + path_template: "folders/*/locations/{location=*}/muteConfigs/*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a notification config. + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/locations/*/notificationConfigs/*}" + additional_bindings { + get: "/v2/{name=folders/*/locations/*/notificationConfigs/*}" + } + additional_bindings { + get: "/v2/{name=projects/*/locations/*/notificationConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a ResourceValueConfig. + rpc GetResourceValueConfig(GetResourceValueConfigRequest) + returns (ResourceValueConfig) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/resourceValueConfigs/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/sources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Filters an organization or source's findings and groups them by their + // specified properties in a location. If no location is specified, findings + // are assumed to be in global + // + // To group across all sources provide a `-` as the source id. + // The following list shows some examples: + // + // + `/v2/organizations/{organization_id}/sources/-/findings` + // + + // `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + // + `/v2/folders/{folder_id}/sources/-/findings` + // + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` + // + `/v2/projects/{project_id}/sources/-/findings` + // + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*/sources/*}/findings:group" + body: "*" + additional_bindings { + post: "/v2/{parent=organizations/*/sources/*/locations/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v2/{parent=folders/*/sources/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v2/{parent=folders/*/sources/*/locations/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*/sources/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v2/{parent=projects/*/sources/*/locations/*}/findings:group" + body: "*" + } + }; + option (google.api.method_signature) = "parent,group_by"; + } + + // Lists the attack paths for a set of simulation results or valued resources + // and filter. + rpc ListAttackPaths(ListAttackPathsRequest) + returns (ListAttackPathsResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*/simulations/*}/attackPaths" + additional_bindings { get: "/v2/{parent=organizations/*}/attackPaths" } + additional_bindings { + get: "/v2/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/simulations/*/valuedResources/*}/attackPaths" + } + additional_bindings { + get: "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/simulations/*/attackExposureResults/*}/attackPaths" + } + }; + option (google.api.method_signature) = "parent"; + } + + // 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: "/v2/{parent=organizations/*/locations/*}/bigQueryExports" + additional_bindings { + get: "/v2/{parent=folders/*/locations/*}/bigQueryExports" + } + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/bigQueryExports" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists an organization or source's findings. + // + // To list across all sources for a given location provide a `-` as the source + // id. If no location is specified, finding are assumed to be in global. + // The following list shows some examples: + // + // + `/v2/organizations/{organization_id}/sources/-/findings` + // + + // `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*/sources/*}/findings" + additional_bindings { + get: "/v2/{parent=organizations/*/sources/*/locations/*}/findings" + } + additional_bindings { get: "/v2/{parent=folders/*/sources/*}/findings" } + additional_bindings { + get: "/v2/{parent=folders/*/sources/*/locations/*}/findings" + } + additional_bindings { get: "/v2/{parent=projects/*/sources/*}/findings" } + additional_bindings { + get: "/v2/{parent=projects/*/sources/*/locations/*}/findings" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists mute configs. If no location is specified, default is + // global. + rpc ListMuteConfigs(ListMuteConfigsRequest) + returns (ListMuteConfigsResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*}/muteConfigs" + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/muteConfigs" + } + additional_bindings { get: "/v2/{parent=folders/*}/muteConfigs" } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*}/muteConfigs" + } + additional_bindings { get: "/v2/{parent=projects/*}/muteConfigs" } + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/muteConfigs" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}/muteConfigs" + } + routing_parameters { + field: "parent" + path_template: "organizations/*/locations/{location=*}/muteConfigs" + } + routing_parameters { + field: "parent" + path_template: "folders/*/locations/{location=*}/muteConfigs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists notification configs. + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*/locations/*}/notificationConfigs" + additional_bindings { + get: "/v2/{parent=folders/*/locations/*}/notificationConfigs" + } + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/notificationConfigs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all ResourceValueConfigs. + rpc ListResourceValueConfigs(ListResourceValueConfigsRequest) + returns (ListResourceValueConfigsResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*}/resourceValueConfigs" + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*}/sources" + additional_bindings { get: "/v2/{parent=folders/*}/sources" } + additional_bindings { get: "/v2/{parent=projects/*}/sources" } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists the valued resources for a set of simulation results and filter. + rpc ListValuedResources(ListValuedResourcesRequest) + returns (ListValuedResourcesResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*/simulations/*}/valuedResources" + additional_bindings { + get: "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources" + } + additional_bindings { + get: "/v2/{parent=organizations/*}/valuedResources" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the state of a finding. If no location is specified, finding is + // assumed to be in global + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v2/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + additional_bindings { + post: "/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v2/{name=folders/*/sources/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v2/{name=folders/*/sources/*/locations/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v2/{name=projects/*/sources/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setState" + body: "*" + } + }; + option (google.api.method_signature) = "name,state"; + } + + // 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: "/v2/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Updates the mute state of a finding. If no location is specified, finding + // is assumed to be in global + rpc SetMute(SetMuteRequest) returns (Finding) { + option (google.api.http) = { + post: "/v2/{name=organizations/*/sources/*/findings/*}:setMute" + body: "*" + additional_bindings { + post: "/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setMute" + body: "*" + } + additional_bindings { + post: "/v2/{name=folders/*/sources/*/findings/*}:setMute" + body: "*" + } + additional_bindings { + post: "/v2/{name=folders/*/sources/*/locations/*/findings/*}:setMute" + body: "*" + } + additional_bindings { + post: "/v2/{name=projects/*/sources/*/findings/*}:setMute" + body: "*" + } + additional_bindings { + post: "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setMute" + body: "*" + } + }; + option (google.api.method_signature) = "name,mute"; + } + + // 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: "/v2/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Updates a BigQuery export. + rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) + returns (BigQueryExport) { + option (google.api.http) = { + patch: "/v2/{big_query_export.name=organizations/*/locations/*/bigQueryExports/*}" + body: "big_query_export" + additional_bindings { + patch: "/v2/{big_query_export.name=folders/*/locations/*/bigQueryExports/*}" + body: "big_query_export" + } + additional_bindings { + patch: "/v2/{big_query_export.name=projects/*/locations/*/bigQueryExports/*}" + body: "big_query_export" + } + }; + option (google.api.method_signature) = "big_query_export,update_mask"; + } + + // Updates external system. This is for a given finding. If no location is + // specified, finding is assumed to be in global + rpc UpdateExternalSystem(UpdateExternalSystemRequest) + returns (ExternalSystem) { + option (google.api.http) = { + patch: "/v2/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + additional_bindings { + patch: "/v2/{external_system.name=organizations/*/sources/*/locations/*/findings/*/externalSystems/*}" + body: "external_system" + } + additional_bindings { + patch: "/v2/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + } + additional_bindings { + patch: "/v2/{external_system.name=folders/*/sources/*/locations/*/findings/*/externalSystems/*}" + body: "external_system" + } + additional_bindings { + patch: "/v2/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + } + additional_bindings { + patch: "/v2/{external_system.name=projects/*/sources/*/locations/*/findings/*/externalSystems/*}" + body: "external_system" + } + }; + option (google.api.method_signature) = "external_system,update_mask"; + } + + // Creates or updates a finding. If no location is specified, finding is + // assumed to be in global. The corresponding source must exist for a finding + // creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v2/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + additional_bindings { + patch: "/v2/{finding.name=organizations/*/sources/*/locations/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v2/{finding.name=folders/*/sources/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v2/{finding.name=folders/*/sources/*/locations/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v2/{finding.name=projects/*/sources/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v2/{finding.name=projects/*/sources/*/locations/*/findings/*}" + body: "finding" + } + }; + option (google.api.method_signature) = "finding,update_mask"; + } + + // Updates a mute config. If no location is specified, default is + // global. + rpc UpdateMuteConfig(UpdateMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + patch: "/v2/{mute_config.name=organizations/*/muteConfigs/*}" + body: "mute_config" + additional_bindings { + patch: "/v2/{mute_config.name=organizations/*/locations/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v2/{mute_config.name=folders/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v2/{mute_config.name=folders/*/locations/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v2/{mute_config.name=projects/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v2/{mute_config.name=projects/*/locations/*/muteConfigs/*}" + body: "mute_config" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "mute_config.name" + path_template: "projects/*/locations/{location=*}/muteConfigs/*" + } + routing_parameters { + field: "mute_config.name" + path_template: "organizations/*/locations/{location=*}/muteConfigs/*" + } + routing_parameters { + field: "mute_config.name" + path_template: "folders/*/locations/{location=*}/muteConfigs/*" + } + }; + 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 + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + patch: "/v2/{notification_config.name=organizations/*/locations/*/notificationConfigs/*}" + body: "notification_config" + additional_bindings { + patch: "/v2/{notification_config.name=folders/*/locations/*/notificationConfigs/*}" + body: "notification_config" + } + additional_bindings { + patch: "/v2/{notification_config.name=projects/*/locations/*/notificationConfigs/*}" + body: "notification_config" + } + }; + option (google.api.method_signature) = "notification_config,update_mask"; + } + + // Updates an existing ResourceValueConfigs with new rules. + rpc UpdateResourceValueConfig(UpdateResourceValueConfigRequest) + returns (ResourceValueConfig) { + option (google.api.http) = { + patch: "/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}" + body: "resource_value_config" + additional_bindings { + patch: "/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}" + body: "resource_value_config" + } + }; + option (google.api.method_signature) = "resource_value_config,update_mask"; + } + + // Updates security marks. For Finding Security marks, if no location is + // specified, finding is assumed to be in global. Assets Security Marks can + // only be accessed through global endpoint. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v2/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v2/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v2/{security_marks.name=organizations/*/sources/*/locations/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v2/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v2/{security_marks.name=folders/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v2/{security_marks.name=folders/*/sources/*/locations/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v2/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v2/{security_marks.name=projects/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v2/{security_marks.name=projects/*/sources/*/locations/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + option (google.api.method_signature) = "security_marks,update_mask"; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v2/{source.name=organizations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "source,update_mask"; + } +} + +// Request message to create multiple resource value configs +message BatchCreateResourceValueConfigsRequest { + // Required. Resource name of the new ResourceValueConfig's parent. + // The parent field in the CreateResourceValueConfigRequest + // messages must either be empty or match this field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; + + // Required. The resource value configs to be created. + repeated CreateResourceValueConfigRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for BatchCreateResourceValueConfigs +message BatchCreateResourceValueConfigsResponse { + // The resource value configs created + repeated ResourceValueConfig resource_value_configs = 1; +} + +// 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 { + // The mute state. + enum MuteState { + // Unused. + MUTE_STATE_UNSPECIFIED = 0; + + // Matching findings will be muted (default). + MUTED = 1; + + // Matching findings will have their mute state cleared. + UNDEFINED = 2; + } + + // Required. The parent, at which bulk action needs to be applied. If no + // location is specified, findings are updated in global. The following list + // shows some examples: + // + // + `organizations/[organization_id]` + // + `organizations/[organization_id]/locations/[location_id]` + // + `folders/[folder_id]` + // + `folders/[folder_id]/locations/[location_id]` + // + `projects/[project_id]` + // + `projects/[project_id]/locations/[location_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; + + // Optional. All findings matching the given filter will have their mute state + // set to this value. The default value is `MUTED`. Setting this to + // `UNDEFINED` will clear the mute state on all matching findings. + MuteState mute_state = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response to a BulkMute request. Contains the LRO information. +message BulkMuteFindingsResponse {} + +// Request message for creating a BigQuery export. +message CreateBigQueryExportRequest { + // Required. The name of the parent resource of the new BigQuery export. Its + // format is `organizations/[organization_id]/locations/[location_id]`, + // `folders/[folder_id]/locations/[location_id]`, or + // `projects/[project_id]/locations/[location_id]`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; + + // Required. The BigQuery 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 only lowercase letters, numbers, and hyphens, must start + // with a letter, must end with either a letter or a number, and must be 63 + // characters or less. + string big_query_export_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a finding. +message CreateFindingRequest { + // Required. Resource name of the new finding's parent. The following list + // shows some examples of the format: + // + + // `organizations/[organization_id]/sources/[source_id]` + // + + // `organizations/[organization_id]/sources/[source_id]/locations/[location_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 mute config. +message CreateMuteConfigRequest { + // Required. Resource name of the new mute configs's parent. Its format is + // `organizations/[organization_id]/locations/[location_id]`, + // `folders/[folder_id]/locations/[location_id]`, or + // `projects/[project_id]/locations/[location_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 only lowercase letters, numbers, and hyphens, must start + // with a letter, must end with either a letter or a number, and must be 63 + // characters or less. + 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 `organizations/[organization_id]/locations/[location_id]`, + // `folders/[folder_id]/locations/[location_id]`, or + // `projects/[project_id]/locations/[location_id]`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; + + // Required. + // Unique identifier provided by the client within the parent scope. + // It must be between 1 and 128 characters and contain 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 to create single resource value config +message CreateResourceValueConfigRequest { + // Required. Resource name of the new ResourceValueConfig's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; + + // Required. The resource value config being created. + ResourceValueConfig resource_value_config = 2 + [(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 BigQuery export. +message DeleteBigQueryExportRequest { + // Required. The name of the BigQuery export to delete. The following list + // shows some examples of the format: + // + // + + // `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + // + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + // + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; +} + +// Request message for deleting a mute config. If no location is specified, +// default is global. +message DeleteMuteConfigRequest { + // Required. Name of the mute config to delete. The following list shows some + // examples of the format: + // + // + `organizations/{organization}/muteConfigs/{config_id}` + // + + // `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + // + `folders/{folder}/muteConfigs/{config_id}` + // + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + // + `projects/{project}/muteConfigs/{config_id}` + // + `projects/{project}/locations/{location}/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. The following list + // shows some examples of the format: + // + // + + // `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + // + + // `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` + // + + // `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message to delete resource value config +message DeleteResourceValueConfigRequest { + // Required. Name of the ResourceValueConfig to delete + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; +} + +// The destination big query dataset to export findings to. +message BigQueryDestination { + // Required. The relative resource name of the destination dataset, in the + // form projects/{projectId}/datasets/{datasetId}. + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The LRO metadata for a ExportFindings request. +message ExportFindingsMetadata { + // Optional. Timestamp at which export was started + google.protobuf.Timestamp export_start_time = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // The destination to export findings to. + oneof destination { + // Required. The destination big query dataset to export findings to. + BigQueryDestination big_query_destination = 2 + [(google.api.field_behavior) = REQUIRED]; + } +} + +// The response to a ExportFindings request. Contains the LRO information. +message ExportFindingsResponse {} + +// Request message for retrieving a BigQuery export. +message GetBigQueryExportRequest { + // Required. Name of the BigQuery export to retrieve. The following list shows + // some examples of the format: + // + // + + // `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + // + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + // + `projects/{project}locations/{location}//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. If no location is specified, +// default is global. +message GetMuteConfigRequest { + // Required. Name of the mute config to retrieve. The following list shows + // some examples of the format: + // + // + `organizations/{organization}/muteConfigs/{config_id}` + // + + // `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + // + `folders/{folder}/muteConfigs/{config_id}` + // + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + // + `projects/{project}/muteConfigs/{config_id}` + // + `projects/{project}/locations/{location}/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. The following list shows + // some examples of the format: + // + // + + // `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + // + + // `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` + // + + // `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message to get resource value config +message GetResourceValueConfigRequest { + // Required. Name of the resource value config to retrieve. Its format is + // organizations/{organization}/resourceValueConfigs/{config_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; +} + +// 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 findings. +message GroupFindingsRequest { + // Required. Name of the source to groupBy. If no location is specified, + // finding is assumed to be in global. + // The following list shows some examples: + // + // + `organizations/[organization_id]/sources/[source_id]` + // + + // `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + // + `folders/[folder_id]/sources/[source_id]` + // + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + // + `projects/[project_id]/sources/[source_id]` + // + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + // + // To groupBy across all sources provide a source_id of `-`. The following + // list shows some examples: + // + // + `organizations/{organization_id}/sources/-` + // + `organizations/{organization_id}/sources/-/locations/[location_id]` + // + `folders/{folder_id}/sources/-` + // + `folders/{folder_id}/sources/-/locations/[location_id]` + // + `projects/{project_id}/sources/-` + // + `projects/{project_id}/sources/-/locations/[location_id]` + 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 + // * 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: `=`, `:` + // * security_marks.marks: `=`, `:` + // * 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. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: "parent,resource_name". + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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; + + // 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 the attack paths for a given simulation or valued +// resource. +message ListAttackPathsRequest { + // Required. Name of parent to list attack paths. + // + // Valid formats: + // `organizations/{organization}`, + // `organizations/{organization}/simulations/{simulation}` + // `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + // `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/AttackPath" + } + ]; + + // The filter expression that filters the attack path in the response. + // Supported fields: + // + // * `valued_resources` supports = + string filter = 2; + + // The value returned by the last `ListAttackPathsResponse`; indicates + // that this is a continuation of a prior `ListAttackPaths` call, and + // that the system should return the next page of data. + string page_token = 3; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 4; +} + +// Response message for listing the attack paths for a given simulation or +// valued resource. +message ListAttackPathsResponse { + // The attack paths that the attack path simulation identified. + repeated AttackPath attack_paths = 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 getting simulation. +// Simulation name can include "latest" to retrieve the latest simulation +// For example, "organizations/123/simulations/latest" +message GetSimulationRequest { + // Required. The organization name or simulation name of this simulation + // + // Valid format: + // `organizations/{organization}/simulations/latest` + // `organizations/{organization}/simulations/{simulation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Simulation" + } + ]; +} + +// Request message for getting a valued resource. +message GetValuedResourceRequest { + // Required. The name of this valued resource + // + // Valid format: + // `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/ValuedResource" + } + ]; +} + +// 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]/locations/[location_id]`, + // `folders/[folder_id]/locations/[location_id]`, or + // `projects/[project_id]/locations/[location_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 listing findings. +message ListFindingsRequest { + // Required. Name of the source the findings belong to. If no location is + // specified, the default is global. The following list shows some examples: + // + // + `organizations/[organization_id]/sources/[source_id]` + // + + // `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + // + `folders/[folder_id]/sources/[source_id]` + // + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + // + `projects/[project_id]/sources/[source_id]` + // + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + // + // To list across all sources provide a source_id of `-`. The following + // list shows some examples: + // + // + `organizations/{organization_id}/sources/-` + // + `organizations/{organization_id}/sources/-/locations/{location_id}` + // + `folders/{folder_id}/sources/-` + // + `folders/{folder_id}/sources/-locations/{location_id}` + // + `projects/{projects_id}/sources/-` + // + `projects/{projects_id}/sources/-/locations/{location_id}` + 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 + // * 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: `=`, `:` + // * security_marks.marks: `=`, `:` + // * resource: + // * resource.name: `=`, `:` + // * resource.parent_name: `=`, `:` + // * resource.parent_display_name: `=`, `:` + // * resource.project_name: `=`, `:` + // * 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 + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,parent". 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,parent". Redundant space characters in the + // syntax are insignificant. "name desc,parent" and " + // name desc , parent " are equivalent. + // + // The following fields are supported: + // name + // parent + // state + // category + // resource_name + // event_time + // security_marks.marks + string order_by = 3; + + // 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. + message ListFindingsResult { + // Information related to the Google Cloud 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 human readable name of the resource. + string display_name = 2; + + // The full resource type of the resource. + string type = 3; + + // Indicates which cloud provider the finding is from. + CloudProvider cloud_provider = 4; + + // The service or resource provider associated with the resource. + string service = 5; + + // The region or location of the service (if applicable). + string location = 6; + + // The metadata associated with the cloud provider. + oneof cloud_provider_metadata { + // The GCP metadata associated with the finding. + GcpMetadata gcp_metadata = 7; + + // The AWS metadata associated with the finding. + AwsMetadata aws_metadata = 8; + + // The Azure metadata associated with the finding. + AzureMetadata azure_metadata = 9; + } + + // Provides the path to the resource within the resource hierarchy. + ResourcePath resource_path = 10; + + // A string representation of the resource path. + // For Google Cloud, it has the format of + // `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` + // where there can be any number of folders. + // For AWS, it has the format of + // `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` + // where there can be any number of organizational units. + // For Azure, it has the format of + // `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` + // where there can be any number of management groups. + string resource_path_string = 11; + } + + // Finding matching the search request. + Finding finding = 1; + + // Output only. Resource that is associated with this finding. + Resource resource = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Findings matching the list request. + repeated ListFindingsResult list_findings_results = 1; + + // 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 listing mute configs at a given scope e.g. organization, +// folder or project. If no location is specified, default is +// global. +message ListMuteConfigsRequest { + // Required. The parent, which owns the collection of mute configs. Its format + // is `organizations/[organization_id]", "folders/[folder_id]`, + // `projects/[project_id]`, + // `organizations/[organization_id]/locations/[location_id]`, + // `folders/[folder_id]/locations/[location_id]`, + // `projects/[project_id]/locations/[location_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. The name of the parent in which to list the notification + // configurations. Its format is + // "organizations/[organization_id]/locations/[location_id]", + // "folders/[folder_id]/locations/[location_id]", or + // "projects/[project_id]/locations/[location_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; + + // 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 to list resource value configs of a parent +message ListResourceValueConfigsRequest { + // Required. The parent, which owns the collection of resource value configs. + // Its format is + // `organizations/[organization_id]` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/ResourceValueConfig" + } + ]; + + // 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 `ListResourceValueConfigs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListResourceValueConfigs` must match the call that provided the + // page token. + // + // page_size can be specified, and the new page_size will be used. + string page_token = 3; +} + +// Response message to list resource value configs +message ListResourceValueConfigsResponse { + // The resource value configs from the specified parent. + repeated ResourceValueConfig resource_value_configs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is empty, there are no subsequent pages. + 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]`, `folders/[folder_id]`, or + // `projects/[project_id]`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Source" + } + ]; + + // 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 the valued resources for a given simulation. +message ListValuedResourcesRequest { + // Required. Name of parent to list exposed resources. + // + // Valid formats: + // `organizations/{organization}`, + // `organizations/{organization}/simulations/{simulation}` + // `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/ValuedResource" + } + ]; + + // The filter expression that filters the valued resources in the response. + // Supported fields: + // + // * `resource_value` supports = + // * `resource_type` supports = + string filter = 2; + + // The value returned by the last `ListValuedResourcesResponse`; indicates + // that this is a continuation of a prior `ListValuedResources` call, and + // that the system should return the next page of data. + string page_token = 3; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 4; + + // Optional. The fields by which to order the valued resources response. + // + // Supported fields: + // + // * `exposed_score` + // + // * `resource_value` + // + // * `resource_type` + // + // Values should be a comma separated list of fields. For example: + // `exposed_score,resource_value`. + // + // The default sorting order is descending. To specify ascending or descending + // order for a field, append a " ASC" or a " DESC" suffix, respectively; for + // example: `exposed_score DESC`. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing the valued resources for a given simulation. +message ListValuedResourcesResponse { + // The valued resources that the attack path simulation identified. + repeated ValuedResource valued_resources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; + + // The estimated total number of results matching the query. + int32 total_size = 3; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // Required. The [relative resource + // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + // of the finding. If no location is specified, finding is assumed to be in + // global. The following list shows some examples: + // + // + + // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + // + + // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + // + + // `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + // + + // `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{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]; +} + +// Request message for updating a finding's mute status. +message SetMuteRequest { + // Required. The [relative resource + // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + // of the finding. If no location is specified, finding is assumed to be in + // global. The following list shows some examples: + // + // + + // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + // + + // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + // + + // `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + // + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + // + + // `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{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 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 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. 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 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. + 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 to update resource value config +message UpdateResourceValueConfigRequest { + // Required. The resource value config being updated. + ResourceValueConfig resource_value_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If empty all mutable fields will be updated. + // + // To update nested fields, include the top level field in the mask + // For example, to update gcp_metadata.resource_type, include the + // "gcp_metadata" field mask + 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; +} + +// 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; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/simulation.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/simulation.proto new file mode 100644 index 00000000000..41112bfc882 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/simulation.proto @@ -0,0 +1,57 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v2/resource.proto"; +import "google/cloud/securitycenter/v2/valued_resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SimulationProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Attack path simulation +message Simulation { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Simulation" + pattern: "organizations/{organization}/simulations/{simulation}" + pattern: "organizations/{organization}/locations/{location}/simulations/{simluation}" + plural: "simulations" + singular: "simulation" + }; + + // Full resource name of the Simulation: + // `organizations/123/simulations/456` + string name = 1; + + // Output only. Time simulation was created + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource value configurations' metadata used in this simulation. Maximum of + // 100. + repeated ResourceValueConfigMetadata resource_value_configs_metadata = 3; + + // Indicates which cloud provider was used in this simulation. + CloudProvider cloud_provider = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/source.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/source.proto new file mode 100644 index 00000000000..d1d0230b795 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/source.proto @@ -0,0 +1,70 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "SourceProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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. +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: + // 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: + // "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." + string description = 3; + + // The canonical name of the finding source. 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 = 4; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto new file mode 100644 index 00000000000..d5455f05012 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto @@ -0,0 +1,42 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ToxicCombinationProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains details about a group of security issues that, when the issues +// occur together, represent a greater risk than when the issues occur +// independently. A group of such issues is referred to as a toxic +// combination. +message ToxicCombination { + // The + // [Attack exposure + // score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) + // of this toxic combination. The score is a measure of how much this toxic + // combination exposes one or more high-value resources to potential attack. + double attack_exposure_score = 1; + + // List of resource names of findings associated with this toxic combination. + // For example, `organizations/123/sources/456/findings/789`. + repeated string related_findings = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/valued_resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/valued_resource.proto new file mode 100644 index 00000000000..efa14bbbf78 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/valued_resource.proto @@ -0,0 +1,89 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ValuedResourceProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// A resource that is determined to have value to a user's system +message ValuedResource { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/ValuedResource" + pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}" + pattern: "organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}" + plural: "valuedResources" + singular: "valuedResource" + }; + + // How valuable the resource is. + enum ResourceValue { + // The resource value isn't specified. + RESOURCE_VALUE_UNSPECIFIED = 0; + + // This is a low-value resource. + RESOURCE_VALUE_LOW = 1; + + // This is a medium-value resource. + RESOURCE_VALUE_MEDIUM = 2; + + // This is a high-value resource. + RESOURCE_VALUE_HIGH = 3; + } + + // Valued resource name, for example, + // e.g.: + // `organizations/123/simulations/456/valuedResources/789` + string name = 1; + + // The + // [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // of the valued resource. + string resource = 2; + + // The [resource + // type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // of the valued resource. + string resource_type = 3; + + // Human-readable name of the valued resource. + string display_name = 4; + + // How valuable this resource is. + ResourceValue resource_value = 5; + + // Exposed score for this valued resource. A value of 0 means no exposure was + // detected exposure. + double exposed_score = 6; + + // List of resource value configurations' metadata used to determine the value + // of this resource. Maximum of 100. + repeated ResourceValueConfigMetadata resource_value_configs_used = 7; +} + +// Metadata about a ResourceValueConfig. For example, id and name. +message ResourceValueConfigMetadata { + // Resource value config name + string name = 1; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vertex_ai.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vertex_ai.proto new file mode 100644 index 00000000000..93628aaee43 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vertex_ai.proto @@ -0,0 +1,58 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "VertexAiProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Vertex AI-related information associated with the finding. +message VertexAi { + // Vertex AI dataset associated with the finding. + message Dataset { + // Resource name of the dataset, e.g. + // projects/{project}/locations/{location}/datasets/2094040236064505856 + string name = 1; + + // The user defined display name of dataset, e.g. plants-dataset + string display_name = 2; + + // Data source, such as a BigQuery source URI, e.g. + // bq://scc-nexus-test.AIPPtest.gsod + string source = 3; + } + + // Vertex AI training pipeline associated with the finding. + message Pipeline { + // Resource name of the pipeline, e.g. + // projects/{project}/locations/{location}/trainingPipelines/5253428229225578496 + string name = 1; + + // The user-defined display name of pipeline, e.g. plants-classification + string display_name = 2; + } + + // Datasets associated with the finding. + repeated Dataset datasets = 1; + + // Pipelines associated with the finding. + repeated Pipeline pipelines = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vulnerability.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vulnerability.proto new file mode 100644 index 00000000000..ffb3d390c13 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vulnerability.proto @@ -0,0 +1,345 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// 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; + + // The offending package is relevant to the finding. + Package offending_package = 2; + + // The fixed package is relevant to the finding. + Package fixed_package = 3; + + // The security bulletin is relevant to this finding. + SecurityBulletin security_bulletin = 4; + + // Provider provided risk_score based on multiple factors. The higher the risk + // score, the more risky the vulnerability is. + int64 provider_risk_score = 5; + + // Represents whether the vulnerability is reachable (detected via static + // analysis) + bool reachable = 6; + + // Represents one or more Common Weakness Enumeration (CWE) information on + // this vulnerability. + repeated Cwe cwes = 7; +} + +// CVE stands for Common Vulnerabilities and Exposures. +// Information from the [CVE +// record](https://www.cve.org/ResourcesSupport/Glossary) that describes this +// vulnerability. +message Cve { + // The possible values of impact of the vulnerability if it was to be + // exploited. + enum RiskRating { + // Invalid or empty value. + RISK_RATING_UNSPECIFIED = 0; + + // Exploitation would have little to no security impact. + LOW = 1; + + // Exploitation would enable attackers to perform activities, or could allow + // attackers to have a direct impact, but would require additional steps. + MEDIUM = 2; + + // Exploitation would enable attackers to have a notable direct impact + // without needing to overcome any major mitigating factors. + HIGH = 3; + + // Exploitation would fundamentally undermine the security of affected + // systems, enable actors to perform significant attacks with minimal + // effort, with little to no mitigating factors to overcome. + CRITICAL = 4; + } + + // The possible values of exploitation activity of the vulnerability in the + // wild. + enum ExploitationActivity { + // Invalid or empty value. + EXPLOITATION_ACTIVITY_UNSPECIFIED = 0; + + // Exploitation has been reported or confirmed to widely occur. + WIDE = 1; + + // Limited reported or confirmed exploitation activities. + CONFIRMED = 2; + + // Exploit is publicly available. + AVAILABLE = 3; + + // No known exploitation activity, but has a high potential for + // exploitation. + ANTICIPATED = 4; + + // No known exploitation activity. + NO_KNOWN = 5; + } + + // 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; + + // Whether upstream fix is available for the CVE. + bool upstream_fix_available = 4; + + // The potential impact of the vulnerability if it was to be exploited. + RiskRating impact = 5; + + // The exploitation activity of the vulnerability in the wild. + ExploitationActivity exploitation_activity = 6; + + // Whether or not the vulnerability has been observed in the wild. + bool observed_in_the_wild = 7; + + // Whether or not the vulnerability was zero day when the finding was + // published. + bool zero_day = 8; + + // Date the first publicly available exploit or PoC was released. + google.protobuf.Timestamp exploit_release_date = 9; + + // Date of the earliest known exploitation. + google.protobuf.Timestamp first_exploitation_date = 10; +} + +// 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 = 2; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 3; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 4; + + // 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 = 5; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 6; + + // 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 = 7; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 8; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 9; +} + +// Package is a generic definition of a package. +message Package { + // The name of the package where the vulnerability was detected. + string package_name = 1; + + // The CPE URI where the vulnerability was detected. + string cpe_uri = 2; + + // Type of package, for example, os, maven, or go. + string package_type = 3; + + // The version of the package. + string package_version = 4; +} + +// SecurityBulletin are notifications of vulnerabilities of Google products. +message SecurityBulletin { + // ID of the bulletin corresponding to the vulnerability. + string bulletin_id = 1; + + // Submission time of this Security Bulletin. + google.protobuf.Timestamp submission_time = 2; + + // This represents a version that the cluster receiving this notification + // should be upgraded to, based on its current version. For example, 1.15.0 + string suggested_upgrade_version = 3; +} + +// CWE stands for Common Weakness Enumeration. Information about this weakness, +// as described by [CWE](https://cwe.mitre.org/). +message Cwe { + // The CWE identifier, e.g. CWE-94 + string id = 1; + + // Any reference to the details on the CWE, for example, + // https://cwe.mitre.org/data/definitions/94.html + repeated Reference references = 2; +} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/protos.d.ts b/owl-bot-staging/google-cloud-securitycenter/protos/protos.d.ts new file mode 100644 index 00000000000..bbdfb0c6859 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/protos.d.ts @@ -0,0 +1,64568 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace securitycenter. */ + namespace securitycenter { + + /** 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 userAgent */ + userAgent?: (string|null); + + /** Access serviceName */ + serviceName?: (string|null); + + /** Access methodName */ + methodName?: (string|null); + + /** Access principalSubject */ + principalSubject?: (string|null); + + /** Access serviceAccountKeyName */ + serviceAccountKeyName?: (string|null); + + /** Access serviceAccountDelegationInfo */ + serviceAccountDelegationInfo?: (google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]|null); + + /** Access userName */ + userName?: (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 userAgent. */ + public userAgent: string; + + /** Access serviceName. */ + public serviceName: string; + + /** Access methodName. */ + public methodName: string; + + /** Access principalSubject. */ + public principalSubject: string; + + /** Access serviceAccountKeyName. */ + public serviceAccountKeyName: string; + + /** Access serviceAccountDelegationInfo. */ + public serviceAccountDelegationInfo: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]; + + /** Access userName. */ + public userName: 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 }; + + /** + * 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 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 { + + /** 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 }; + + /** + * 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 Application. */ + interface IApplication { + + /** Application baseUri */ + baseUri?: (string|null); + + /** Application fullUri */ + fullUri?: (string|null); + } + + /** Represents an Application. */ + class Application implements IApplication { + + /** + * Constructs a new Application. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IApplication); + + /** Application baseUri. */ + public baseUri: string; + + /** Application fullUri. */ + public fullUri: string; + + /** + * Creates a new Application instance using the specified properties. + * @param [properties] Properties to set + * @returns Application instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IApplication): google.cloud.securitycenter.v1.Application; + + /** + * Encodes the specified Application message. Does not implicitly {@link google.cloud.securitycenter.v1.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Application message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Application + * @throws {Error} If the payload is not a reader 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.Application; + + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Application + * @throws {Error} If the payload is not 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.Application; + + /** + * Verifies an Application message. + * @param message Plain 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 Application message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Application + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Application; + + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @param message Application + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Application, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Application to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Application + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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); + + /** Asset canonicalName */ + canonicalName?: (string|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); + + /** Asset canonicalName. */ + public canonicalName: string; + + /** + * 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 }; + + /** + * 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 { + + /** 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); + + /** SecurityCenterProperties folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|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[]; + + /** SecurityCenterProperties resourceDisplayName. */ + public resourceDisplayName: string; + + /** SecurityCenterProperties resourceParentDisplayName. */ + public resourceParentDisplayName: string; + + /** 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 + * @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 }; + + /** + * 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. */ + 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + + /** SecurityMarks canonicalName */ + canonicalName?: (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 }; + + /** SecurityMarks canonicalName. */ + public canonicalName: 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 }; + + /** + * 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 an AttackExposure. */ + interface IAttackExposure { + + /** AttackExposure score */ + score?: (number|null); + + /** AttackExposure latestCalculationTime */ + latestCalculationTime?: (google.protobuf.ITimestamp|null); + + /** AttackExposure attackExposureResult */ + attackExposureResult?: (string|null); + + /** AttackExposure state */ + state?: (google.cloud.securitycenter.v1.AttackExposure.State|keyof typeof google.cloud.securitycenter.v1.AttackExposure.State|null); + + /** AttackExposure exposedHighValueResourcesCount */ + exposedHighValueResourcesCount?: (number|null); + + /** AttackExposure exposedMediumValueResourcesCount */ + exposedMediumValueResourcesCount?: (number|null); + + /** AttackExposure exposedLowValueResourcesCount */ + exposedLowValueResourcesCount?: (number|null); + } + + /** Represents an AttackExposure. */ + class AttackExposure implements IAttackExposure { + + /** + * Constructs a new AttackExposure. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAttackExposure); + + /** AttackExposure score. */ + public score: number; + + /** AttackExposure latestCalculationTime. */ + public latestCalculationTime?: (google.protobuf.ITimestamp|null); + + /** AttackExposure attackExposureResult. */ + public attackExposureResult: string; + + /** AttackExposure state. */ + public state: (google.cloud.securitycenter.v1.AttackExposure.State|keyof typeof google.cloud.securitycenter.v1.AttackExposure.State); + + /** AttackExposure exposedHighValueResourcesCount. */ + public exposedHighValueResourcesCount: number; + + /** AttackExposure exposedMediumValueResourcesCount. */ + public exposedMediumValueResourcesCount: number; + + /** AttackExposure exposedLowValueResourcesCount. */ + public exposedLowValueResourcesCount: number; + + /** + * Creates a new AttackExposure instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackExposure instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAttackExposure): google.cloud.securitycenter.v1.AttackExposure; + + /** + * Encodes the specified AttackExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackExposure.verify|verify} messages. + * @param message AttackExposure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAttackExposure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackExposure.verify|verify} messages. + * @param message AttackExposure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAttackExposure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackExposure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackExposure + * @throws {Error} If the payload is not a reader 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.AttackExposure; + + /** + * Decodes an AttackExposure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackExposure + * @throws {Error} If the payload is not 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.AttackExposure; + + /** + * Verifies an AttackExposure message. + * @param message Plain 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 AttackExposure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackExposure + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackExposure; + + /** + * Creates a plain object from an AttackExposure message. Also converts values to other types if specified. + * @param message AttackExposure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AttackExposure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackExposure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackExposure + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttackExposure { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CALCULATED = 1, + NOT_CALCULATED = 2 + } + } + + /** Properties of an AttackPath. */ + interface IAttackPath { + + /** AttackPath name */ + name?: (string|null); + + /** AttackPath pathNodes */ + pathNodes?: (google.cloud.securitycenter.v1.AttackPath.IAttackPathNode[]|null); + + /** AttackPath edges */ + edges?: (google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge[]|null); + } + + /** Represents an AttackPath. */ + class AttackPath implements IAttackPath { + + /** + * Constructs a new AttackPath. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAttackPath); + + /** AttackPath name. */ + public name: string; + + /** AttackPath pathNodes. */ + public pathNodes: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode[]; + + /** AttackPath edges. */ + public edges: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge[]; + + /** + * Creates a new AttackPath instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackPath instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAttackPath): google.cloud.securitycenter.v1.AttackPath; + + /** + * Encodes the specified AttackPath message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.verify|verify} messages. + * @param message AttackPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAttackPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.verify|verify} messages. + * @param message AttackPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAttackPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackPath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackPath + * @throws {Error} If the payload is not a reader 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.AttackPath; + + /** + * Decodes an AttackPath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackPath + * @throws {Error} If the payload is not 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.AttackPath; + + /** + * Verifies an AttackPath message. + * @param message Plain 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 AttackPath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackPath + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath; + + /** + * Creates a plain object from an AttackPath message. Also converts values to other types if specified. + * @param message AttackPath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AttackPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackPath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackPath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttackPath { + + /** Properties of an AttackPathNode. */ + interface IAttackPathNode { + + /** AttackPathNode resource */ + resource?: (string|null); + + /** AttackPathNode resourceType */ + resourceType?: (string|null); + + /** AttackPathNode displayName */ + displayName?: (string|null); + + /** AttackPathNode associatedFindings */ + associatedFindings?: (google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding[]|null); + + /** AttackPathNode uuid */ + uuid?: (string|null); + + /** AttackPathNode attackSteps */ + attackSteps?: (google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode[]|null); + } + + /** Represents an AttackPathNode. */ + class AttackPathNode implements IAttackPathNode { + + /** + * Constructs a new AttackPathNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode); + + /** AttackPathNode resource. */ + public resource: string; + + /** AttackPathNode resourceType. */ + public resourceType: string; + + /** AttackPathNode displayName. */ + public displayName: string; + + /** AttackPathNode associatedFindings. */ + public associatedFindings: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding[]; + + /** AttackPathNode uuid. */ + public uuid: string; + + /** AttackPathNode attackSteps. */ + public attackSteps: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode[]; + + /** + * Creates a new AttackPathNode instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackPathNode instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode): google.cloud.securitycenter.v1.AttackPath.AttackPathNode; + + /** + * Encodes the specified AttackPathNode message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify|verify} messages. + * @param message AttackPathNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackPathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify|verify} messages. + * @param message AttackPathNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackPathNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackPathNode + * @throws {Error} If the payload is not a reader 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.AttackPath.AttackPathNode; + + /** + * Decodes an AttackPathNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackPathNode + * @throws {Error} If the payload is not 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.AttackPath.AttackPathNode; + + /** + * Verifies an AttackPathNode message. + * @param message Plain 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 AttackPathNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackPathNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath.AttackPathNode; + + /** + * Creates a plain object from an AttackPathNode message. Also converts values to other types if specified. + * @param message AttackPathNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackPathNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackPathNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttackPathNode { + + /** Properties of a PathNodeAssociatedFinding. */ + interface IPathNodeAssociatedFinding { + + /** PathNodeAssociatedFinding canonicalFinding */ + canonicalFinding?: (string|null); + + /** PathNodeAssociatedFinding findingCategory */ + findingCategory?: (string|null); + + /** PathNodeAssociatedFinding name */ + name?: (string|null); + } + + /** Represents a PathNodeAssociatedFinding. */ + class PathNodeAssociatedFinding implements IPathNodeAssociatedFinding { + + /** + * Constructs a new PathNodeAssociatedFinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding); + + /** PathNodeAssociatedFinding canonicalFinding. */ + public canonicalFinding: string; + + /** PathNodeAssociatedFinding findingCategory. */ + public findingCategory: string; + + /** PathNodeAssociatedFinding name. */ + public name: string; + + /** + * Creates a new PathNodeAssociatedFinding instance using the specified properties. + * @param [properties] Properties to set + * @returns PathNodeAssociatedFinding instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding): google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding; + + /** + * Encodes the specified PathNodeAssociatedFinding message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. + * @param message PathNodeAssociatedFinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PathNodeAssociatedFinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. + * @param message PathNodeAssociatedFinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PathNodeAssociatedFinding + * @throws {Error} If the payload is not a reader 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.AttackPath.AttackPathNode.PathNodeAssociatedFinding; + + /** + * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PathNodeAssociatedFinding + * @throws {Error} If the payload is not 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.AttackPath.AttackPathNode.PathNodeAssociatedFinding; + + /** + * Verifies a PathNodeAssociatedFinding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PathNodeAssociatedFinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PathNodeAssociatedFinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding; + + /** + * Creates a plain object from a PathNodeAssociatedFinding message. Also converts values to other types if specified. + * @param message PathNodeAssociatedFinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PathNodeAssociatedFinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PathNodeAssociatedFinding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NodeType enum. */ + enum NodeType { + NODE_TYPE_UNSPECIFIED = 0, + NODE_TYPE_AND = 1, + NODE_TYPE_OR = 2, + NODE_TYPE_DEFENSE = 3, + NODE_TYPE_ATTACKER = 4 + } + + /** Properties of an AttackStepNode. */ + interface IAttackStepNode { + + /** AttackStepNode uuid */ + uuid?: (string|null); + + /** AttackStepNode type */ + type?: (google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType|keyof typeof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType|null); + + /** AttackStepNode displayName */ + displayName?: (string|null); + + /** AttackStepNode labels */ + labels?: ({ [k: string]: string }|null); + + /** AttackStepNode description */ + description?: (string|null); + } + + /** Represents an AttackStepNode. */ + class AttackStepNode implements IAttackStepNode { + + /** + * Constructs a new AttackStepNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode); + + /** AttackStepNode uuid. */ + public uuid: string; + + /** AttackStepNode type. */ + public type: (google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType|keyof typeof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType); + + /** AttackStepNode displayName. */ + public displayName: string; + + /** AttackStepNode labels. */ + public labels: { [k: string]: string }; + + /** AttackStepNode description. */ + public description: string; + + /** + * Creates a new AttackStepNode instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackStepNode instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode): google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode; + + /** + * Encodes the specified AttackStepNode message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. + * @param message AttackStepNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackStepNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. + * @param message AttackStepNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackStepNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackStepNode + * @throws {Error} If the payload is not a reader 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.AttackPath.AttackPathNode.AttackStepNode; + + /** + * Decodes an AttackStepNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackStepNode + * @throws {Error} If the payload is not 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.AttackPath.AttackPathNode.AttackStepNode; + + /** + * Verifies an AttackStepNode message. + * @param message Plain 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 AttackStepNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackStepNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode; + + /** + * Creates a plain object from an AttackStepNode message. Also converts values to other types if specified. + * @param message AttackStepNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackStepNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackStepNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AttackPathEdge. */ + interface IAttackPathEdge { + + /** AttackPathEdge source */ + source?: (string|null); + + /** AttackPathEdge destination */ + destination?: (string|null); + } + + /** Represents an AttackPathEdge. */ + class AttackPathEdge implements IAttackPathEdge { + + /** + * Constructs a new AttackPathEdge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge); + + /** AttackPathEdge source. */ + public source: string; + + /** AttackPathEdge destination. */ + public destination: string; + + /** + * Creates a new AttackPathEdge instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackPathEdge instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge): google.cloud.securitycenter.v1.AttackPath.AttackPathEdge; + + /** + * Encodes the specified AttackPathEdge message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify|verify} messages. + * @param message AttackPathEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackPathEdge message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify|verify} messages. + * @param message AttackPathEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackPathEdge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackPathEdge + * @throws {Error} If the payload is not a reader 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.AttackPath.AttackPathEdge; + + /** + * Decodes an AttackPathEdge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackPathEdge + * @throws {Error} If the payload is not 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.AttackPath.AttackPathEdge; + + /** + * Verifies an AttackPathEdge message. + * @param message Plain 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 AttackPathEdge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackPathEdge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath.AttackPathEdge; + + /** + * Creates a plain object from an AttackPathEdge message. Also converts values to other types if specified. + * @param message AttackPathEdge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AttackPath.AttackPathEdge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackPathEdge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackPathEdge + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BackupDisasterRecovery. */ + interface IBackupDisasterRecovery { + + /** BackupDisasterRecovery backupTemplate */ + backupTemplate?: (string|null); + + /** BackupDisasterRecovery policies */ + policies?: (string[]|null); + + /** BackupDisasterRecovery host */ + host?: (string|null); + + /** BackupDisasterRecovery applications */ + applications?: (string[]|null); + + /** BackupDisasterRecovery storagePool */ + storagePool?: (string|null); + + /** BackupDisasterRecovery policyOptions */ + policyOptions?: (string[]|null); + + /** BackupDisasterRecovery profile */ + profile?: (string|null); + + /** BackupDisasterRecovery appliance */ + appliance?: (string|null); + + /** BackupDisasterRecovery backupType */ + backupType?: (string|null); + + /** BackupDisasterRecovery backupCreateTime */ + backupCreateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupDisasterRecovery. */ + class BackupDisasterRecovery implements IBackupDisasterRecovery { + + /** + * Constructs a new BackupDisasterRecovery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBackupDisasterRecovery); + + /** BackupDisasterRecovery backupTemplate. */ + public backupTemplate: string; + + /** BackupDisasterRecovery policies. */ + public policies: string[]; + + /** BackupDisasterRecovery host. */ + public host: string; + + /** BackupDisasterRecovery applications. */ + public applications: string[]; + + /** BackupDisasterRecovery storagePool. */ + public storagePool: string; + + /** BackupDisasterRecovery policyOptions. */ + public policyOptions: string[]; + + /** BackupDisasterRecovery profile. */ + public profile: string; + + /** BackupDisasterRecovery appliance. */ + public appliance: string; + + /** BackupDisasterRecovery backupType. */ + public backupType: string; + + /** BackupDisasterRecovery backupCreateTime. */ + public backupCreateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BackupDisasterRecovery instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupDisasterRecovery instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBackupDisasterRecovery): google.cloud.securitycenter.v1.BackupDisasterRecovery; + + /** + * Encodes the specified BackupDisasterRecovery message. Does not implicitly {@link google.cloud.securitycenter.v1.BackupDisasterRecovery.verify|verify} messages. + * @param message BackupDisasterRecovery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBackupDisasterRecovery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupDisasterRecovery message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BackupDisasterRecovery.verify|verify} messages. + * @param message BackupDisasterRecovery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBackupDisasterRecovery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupDisasterRecovery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupDisasterRecovery + * @throws {Error} If the payload is not a reader 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.BackupDisasterRecovery; + + /** + * Decodes a BackupDisasterRecovery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupDisasterRecovery + * @throws {Error} If the payload is not 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.BackupDisasterRecovery; + + /** + * Verifies a BackupDisasterRecovery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupDisasterRecovery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupDisasterRecovery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BackupDisasterRecovery; + + /** + * Creates a plain object from a BackupDisasterRecovery message. Also converts values to other types if specified. + * @param message BackupDisasterRecovery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BackupDisasterRecovery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupDisasterRecovery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupDisasterRecovery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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 Chokepoint. */ + interface IChokepoint { + + /** Chokepoint relatedFindings */ + relatedFindings?: (string[]|null); + } + + /** Represents a Chokepoint. */ + class Chokepoint implements IChokepoint { + + /** + * Constructs a new Chokepoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IChokepoint); + + /** Chokepoint relatedFindings. */ + public relatedFindings: string[]; + + /** + * Creates a new Chokepoint instance using the specified properties. + * @param [properties] Properties to set + * @returns Chokepoint instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IChokepoint): google.cloud.securitycenter.v1.Chokepoint; + + /** + * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. + * @param message Chokepoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. + * @param message Chokepoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chokepoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chokepoint + * @throws {Error} If the payload is not a reader 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.Chokepoint; + + /** + * Decodes a Chokepoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chokepoint + * @throws {Error} If the payload is not 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.Chokepoint; + + /** + * Verifies a Chokepoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chokepoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Chokepoint; + + /** + * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. + * @param message Chokepoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Chokepoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chokepoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chokepoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudArmor. */ + interface ICloudArmor { + + /** CloudArmor securityPolicy */ + securityPolicy?: (google.cloud.securitycenter.v1.ISecurityPolicy|null); + + /** CloudArmor requests */ + requests?: (google.cloud.securitycenter.v1.IRequests|null); + + /** CloudArmor adaptiveProtection */ + adaptiveProtection?: (google.cloud.securitycenter.v1.IAdaptiveProtection|null); + + /** CloudArmor attack */ + attack?: (google.cloud.securitycenter.v1.IAttack|null); + + /** CloudArmor threatVector */ + threatVector?: (string|null); + + /** CloudArmor duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a CloudArmor. */ + class CloudArmor implements ICloudArmor { + + /** + * Constructs a new CloudArmor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICloudArmor); + + /** CloudArmor securityPolicy. */ + public securityPolicy?: (google.cloud.securitycenter.v1.ISecurityPolicy|null); + + /** CloudArmor requests. */ + public requests?: (google.cloud.securitycenter.v1.IRequests|null); + + /** CloudArmor adaptiveProtection. */ + public adaptiveProtection?: (google.cloud.securitycenter.v1.IAdaptiveProtection|null); + + /** CloudArmor attack. */ + public attack?: (google.cloud.securitycenter.v1.IAttack|null); + + /** CloudArmor threatVector. */ + public threatVector: string; + + /** CloudArmor duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new CloudArmor instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudArmor instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICloudArmor): google.cloud.securitycenter.v1.CloudArmor; + + /** + * Encodes the specified CloudArmor message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudArmor.verify|verify} messages. + * @param message CloudArmor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICloudArmor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudArmor message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudArmor.verify|verify} messages. + * @param message CloudArmor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICloudArmor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudArmor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudArmor + * @throws {Error} If the payload is not a reader 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.CloudArmor; + + /** + * Decodes a CloudArmor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudArmor + * @throws {Error} If the payload is not 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.CloudArmor; + + /** + * Verifies a CloudArmor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudArmor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudArmor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CloudArmor; + + /** + * Creates a plain object from a CloudArmor message. Also converts values to other types if specified. + * @param message CloudArmor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CloudArmor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudArmor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudArmor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecurityPolicy. */ + interface ISecurityPolicy { + + /** SecurityPolicy name */ + name?: (string|null); + + /** SecurityPolicy type */ + type?: (string|null); + + /** SecurityPolicy preview */ + preview?: (boolean|null); + } + + /** Represents a SecurityPolicy. */ + class SecurityPolicy implements ISecurityPolicy { + + /** + * Constructs a new SecurityPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISecurityPolicy); + + /** SecurityPolicy name. */ + public name: string; + + /** SecurityPolicy type. */ + public type: string; + + /** SecurityPolicy preview. */ + public preview: boolean; + + /** + * Creates a new SecurityPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISecurityPolicy): google.cloud.securitycenter.v1.SecurityPolicy; + + /** + * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPolicy.verify|verify} messages. + * @param message SecurityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPolicy.verify|verify} messages. + * @param message SecurityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPolicy + * @throws {Error} If the payload is not a reader 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.SecurityPolicy; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPolicy + * @throws {Error} If the payload is not 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.SecurityPolicy; + + /** + * Verifies a SecurityPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityPolicy; + + /** + * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. + * @param message SecurityPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SecurityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Requests. */ + interface IRequests { + + /** Requests ratio */ + ratio?: (number|null); + + /** Requests shortTermAllowed */ + shortTermAllowed?: (number|null); + + /** Requests longTermAllowed */ + longTermAllowed?: (number|null); + + /** Requests longTermDenied */ + longTermDenied?: (number|null); + } + + /** Represents a Requests. */ + class Requests implements IRequests { + + /** + * Constructs a new Requests. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IRequests); + + /** Requests ratio. */ + public ratio: number; + + /** Requests shortTermAllowed. */ + public shortTermAllowed: number; + + /** Requests longTermAllowed. */ + public longTermAllowed: number; + + /** Requests longTermDenied. */ + public longTermDenied: number; + + /** + * Creates a new Requests instance using the specified properties. + * @param [properties] Properties to set + * @returns Requests instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IRequests): google.cloud.securitycenter.v1.Requests; + + /** + * Encodes the specified Requests message. Does not implicitly {@link google.cloud.securitycenter.v1.Requests.verify|verify} messages. + * @param message Requests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Requests message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Requests.verify|verify} messages. + * @param message Requests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Requests message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Requests + * @throws {Error} If the payload is not a reader 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.Requests; + + /** + * Decodes a Requests message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Requests + * @throws {Error} If the payload is not 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.Requests; + + /** + * Verifies a Requests message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Requests message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Requests + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Requests; + + /** + * Creates a plain object from a Requests message. Also converts values to other types if specified. + * @param message Requests + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Requests, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Requests to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Requests + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdaptiveProtection. */ + interface IAdaptiveProtection { + + /** AdaptiveProtection confidence */ + confidence?: (number|null); + } + + /** Represents an AdaptiveProtection. */ + class AdaptiveProtection implements IAdaptiveProtection { + + /** + * Constructs a new AdaptiveProtection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAdaptiveProtection); + + /** AdaptiveProtection confidence. */ + public confidence: number; + + /** + * Creates a new AdaptiveProtection instance using the specified properties. + * @param [properties] Properties to set + * @returns AdaptiveProtection instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAdaptiveProtection): google.cloud.securitycenter.v1.AdaptiveProtection; + + /** + * Encodes the specified AdaptiveProtection message. Does not implicitly {@link google.cloud.securitycenter.v1.AdaptiveProtection.verify|verify} messages. + * @param message AdaptiveProtection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAdaptiveProtection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdaptiveProtection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AdaptiveProtection.verify|verify} messages. + * @param message AdaptiveProtection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAdaptiveProtection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdaptiveProtection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdaptiveProtection + * @throws {Error} If the payload is not a reader 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.AdaptiveProtection; + + /** + * Decodes an AdaptiveProtection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdaptiveProtection + * @throws {Error} If the payload is not 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.AdaptiveProtection; + + /** + * Verifies an AdaptiveProtection message. + * @param message Plain 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 AdaptiveProtection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdaptiveProtection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AdaptiveProtection; + + /** + * Creates a plain object from an AdaptiveProtection message. Also converts values to other types if specified. + * @param message AdaptiveProtection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AdaptiveProtection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdaptiveProtection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdaptiveProtection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Attack. */ + interface IAttack { + + /** Attack volumePps */ + volumePps?: (number|null); + + /** Attack volumeBps */ + volumeBps?: (number|null); + + /** Attack classification */ + classification?: (string|null); + } + + /** Represents an Attack. */ + class Attack implements IAttack { + + /** + * Constructs a new Attack. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAttack); + + /** Attack volumePps. */ + public volumePps: number; + + /** Attack volumeBps. */ + public volumeBps: number; + + /** Attack classification. */ + public classification: string; + + /** + * Creates a new Attack instance using the specified properties. + * @param [properties] Properties to set + * @returns Attack instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAttack): google.cloud.securitycenter.v1.Attack; + + /** + * Encodes the specified Attack message. Does not implicitly {@link google.cloud.securitycenter.v1.Attack.verify|verify} messages. + * @param message Attack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Attack.verify|verify} messages. + * @param message Attack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attack message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attack + * @throws {Error} If the payload is not a reader 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.Attack; + + /** + * Decodes an Attack message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attack + * @throws {Error} If the payload is not 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.Attack; + + /** + * Verifies an Attack message. + * @param message Plain 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 Attack message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attack + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Attack; + + /** + * Creates a plain object from an Attack message. Also converts values to other types if specified. + * @param message Attack + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Attack, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attack to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attack + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudDlpDataProfile. */ + interface ICloudDlpDataProfile { + + /** CloudDlpDataProfile dataProfile */ + dataProfile?: (string|null); + + /** CloudDlpDataProfile parentType */ + parentType?: (google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|null); + + /** CloudDlpDataProfile infoTypes */ + infoTypes?: (google.cloud.securitycenter.v1.IInfoType[]|null); + } + + /** Represents a CloudDlpDataProfile. */ + class CloudDlpDataProfile implements ICloudDlpDataProfile { + + /** + * Constructs a new CloudDlpDataProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICloudDlpDataProfile); + + /** CloudDlpDataProfile dataProfile. */ + public dataProfile: string; + + /** CloudDlpDataProfile parentType. */ + public parentType: (google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType); + + /** CloudDlpDataProfile infoTypes. */ + public infoTypes: google.cloud.securitycenter.v1.IInfoType[]; + + /** + * Creates a new CloudDlpDataProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudDlpDataProfile instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICloudDlpDataProfile): google.cloud.securitycenter.v1.CloudDlpDataProfile; + + /** + * Encodes the specified CloudDlpDataProfile message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpDataProfile.verify|verify} messages. + * @param message CloudDlpDataProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICloudDlpDataProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudDlpDataProfile message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpDataProfile.verify|verify} messages. + * @param message CloudDlpDataProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICloudDlpDataProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudDlpDataProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudDlpDataProfile + * @throws {Error} If the payload is not a reader 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.CloudDlpDataProfile; + + /** + * Decodes a CloudDlpDataProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudDlpDataProfile + * @throws {Error} If the payload is not 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.CloudDlpDataProfile; + + /** + * Verifies a CloudDlpDataProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudDlpDataProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudDlpDataProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CloudDlpDataProfile; + + /** + * Creates a plain object from a CloudDlpDataProfile message. Also converts values to other types if specified. + * @param message CloudDlpDataProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CloudDlpDataProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudDlpDataProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudDlpDataProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudDlpDataProfile { + + /** ParentType enum. */ + enum ParentType { + PARENT_TYPE_UNSPECIFIED = 0, + ORGANIZATION = 1, + PROJECT = 2 + } + } + + /** Properties of an InfoType. */ + interface IInfoType { + + /** InfoType name */ + name?: (string|null); + + /** InfoType version */ + version?: (string|null); + + /** InfoType sensitivityScore */ + sensitivityScore?: (google.cloud.securitycenter.v1.ISensitivityScore|null); + } + + /** Represents an InfoType. */ + class InfoType implements IInfoType { + + /** + * Constructs a new InfoType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IInfoType); + + /** InfoType name. */ + public name: string; + + /** InfoType version. */ + public version: string; + + /** InfoType sensitivityScore. */ + public sensitivityScore?: (google.cloud.securitycenter.v1.ISensitivityScore|null); + + /** + * Creates a new InfoType instance using the specified properties. + * @param [properties] Properties to set + * @returns InfoType instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IInfoType): google.cloud.securitycenter.v1.InfoType; + + /** + * Encodes the specified InfoType message. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. + * @param message InfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfoType message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. + * @param message InfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfoType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfoType + * @throws {Error} If the payload is not a reader 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.InfoType; + + /** + * Decodes an InfoType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfoType + * @throws {Error} If the payload is not 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.InfoType; + + /** + * Verifies an InfoType message. + * @param message Plain 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 InfoType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfoType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.InfoType; + + /** + * Creates a plain object from an InfoType message. Also converts values to other types if specified. + * @param message InfoType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.InfoType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfoType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InfoType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SensitivityScore. */ + interface ISensitivityScore { + + /** SensitivityScore score */ + score?: (google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|keyof typeof google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|null); + } + + /** Represents a SensitivityScore. */ + class SensitivityScore implements ISensitivityScore { + + /** + * Constructs a new SensitivityScore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISensitivityScore); + + /** SensitivityScore score. */ + public score: (google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|keyof typeof google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel); + + /** + * Creates a new SensitivityScore instance using the specified properties. + * @param [properties] Properties to set + * @returns SensitivityScore instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISensitivityScore): google.cloud.securitycenter.v1.SensitivityScore; + + /** + * Encodes the specified SensitivityScore message. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. + * @param message SensitivityScore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISensitivityScore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SensitivityScore message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. + * @param message SensitivityScore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISensitivityScore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SensitivityScore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SensitivityScore + * @throws {Error} If the payload is not a reader 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.SensitivityScore; + + /** + * Decodes a SensitivityScore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SensitivityScore + * @throws {Error} If the payload is not 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.SensitivityScore; + + /** + * Verifies a SensitivityScore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SensitivityScore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SensitivityScore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SensitivityScore; + + /** + * Creates a plain object from a SensitivityScore message. Also converts values to other types if specified. + * @param message SensitivityScore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SensitivityScore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SensitivityScore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SensitivityScore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SensitivityScore { + + /** SensitivityScoreLevel enum. */ + enum SensitivityScoreLevel { + SENSITIVITY_SCORE_LEVEL_UNSPECIFIED = 0, + SENSITIVITY_LOW = 10, + SENSITIVITY_UNKNOWN = 12, + SENSITIVITY_MODERATE = 20, + SENSITIVITY_HIGH = 30 + } + } + + /** Properties of a CloudDlpInspection. */ + interface ICloudDlpInspection { + + /** CloudDlpInspection inspectJob */ + inspectJob?: (string|null); + + /** CloudDlpInspection infoType */ + infoType?: (string|null); + + /** CloudDlpInspection infoTypeCount */ + infoTypeCount?: (number|Long|string|null); + + /** CloudDlpInspection fullScan */ + fullScan?: (boolean|null); + } + + /** Represents a CloudDlpInspection. */ + class CloudDlpInspection implements ICloudDlpInspection { + + /** + * Constructs a new CloudDlpInspection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICloudDlpInspection); + + /** CloudDlpInspection inspectJob. */ + public inspectJob: string; + + /** CloudDlpInspection infoType. */ + public infoType: string; + + /** CloudDlpInspection infoTypeCount. */ + public infoTypeCount: (number|Long|string); + + /** CloudDlpInspection fullScan. */ + public fullScan: boolean; + + /** + * Creates a new CloudDlpInspection instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudDlpInspection instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICloudDlpInspection): google.cloud.securitycenter.v1.CloudDlpInspection; + + /** + * Encodes the specified CloudDlpInspection message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpInspection.verify|verify} messages. + * @param message CloudDlpInspection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICloudDlpInspection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudDlpInspection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpInspection.verify|verify} messages. + * @param message CloudDlpInspection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICloudDlpInspection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudDlpInspection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudDlpInspection + * @throws {Error} If the payload is not a reader 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.CloudDlpInspection; + + /** + * Decodes a CloudDlpInspection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudDlpInspection + * @throws {Error} If the payload is not 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.CloudDlpInspection; + + /** + * Verifies a CloudDlpInspection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudDlpInspection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudDlpInspection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CloudDlpInspection; + + /** + * Creates a plain object from a CloudDlpInspection message. Also converts values to other types if specified. + * @param message CloudDlpInspection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CloudDlpInspection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudDlpInspection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudDlpInspection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** Protocol enum. */ + enum Protocol { + PROTOCOL_UNSPECIFIED = 0, + ICMP = 1, + TCP = 6, + UDP = 17, + GRE = 47, + ESP = 50 + } + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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); + + /** Container createTime */ + createTime?: (google.protobuf.ITimestamp|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[]; + + /** Container createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 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); + + /** Database version */ + version?: (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[]; + + /** Database version. */ + public version: 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 EffectiveEventThreatDetectionCustomModule. */ + interface IEffectiveEventThreatDetectionCustomModule { + + /** EffectiveEventThreatDetectionCustomModule name */ + name?: (string|null); + + /** EffectiveEventThreatDetectionCustomModule config */ + config?: (google.protobuf.IStruct|null); + + /** EffectiveEventThreatDetectionCustomModule enablementState */ + enablementState?: (google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState|null); + + /** EffectiveEventThreatDetectionCustomModule type */ + type?: (string|null); + + /** EffectiveEventThreatDetectionCustomModule displayName */ + displayName?: (string|null); + + /** EffectiveEventThreatDetectionCustomModule description */ + description?: (string|null); + } + + /** Represents an EffectiveEventThreatDetectionCustomModule. */ + class EffectiveEventThreatDetectionCustomModule implements IEffectiveEventThreatDetectionCustomModule { + + /** + * Constructs a new EffectiveEventThreatDetectionCustomModule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule); + + /** EffectiveEventThreatDetectionCustomModule name. */ + public name: string; + + /** EffectiveEventThreatDetectionCustomModule config. */ + public config?: (google.protobuf.IStruct|null); + + /** EffectiveEventThreatDetectionCustomModule enablementState. */ + public enablementState: (google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState); + + /** EffectiveEventThreatDetectionCustomModule type. */ + public type: string; + + /** EffectiveEventThreatDetectionCustomModule displayName. */ + public displayName: string; + + /** EffectiveEventThreatDetectionCustomModule description. */ + public description: string; + + /** + * Creates a new EffectiveEventThreatDetectionCustomModule instance using the specified properties. + * @param [properties] Properties to set + * @returns EffectiveEventThreatDetectionCustomModule instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule): google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule; + + /** + * Encodes the specified EffectiveEventThreatDetectionCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify|verify} messages. + * @param message EffectiveEventThreatDetectionCustomModule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EffectiveEventThreatDetectionCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify|verify} messages. + * @param message EffectiveEventThreatDetectionCustomModule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EffectiveEventThreatDetectionCustomModule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EffectiveEventThreatDetectionCustomModule + * @throws {Error} If the payload is not a reader 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.EffectiveEventThreatDetectionCustomModule; + + /** + * Decodes an EffectiveEventThreatDetectionCustomModule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EffectiveEventThreatDetectionCustomModule + * @throws {Error} If the payload is not 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.EffectiveEventThreatDetectionCustomModule; + + /** + * Verifies an EffectiveEventThreatDetectionCustomModule message. + * @param message Plain 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 EffectiveEventThreatDetectionCustomModule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EffectiveEventThreatDetectionCustomModule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule; + + /** + * Creates a plain object from an EffectiveEventThreatDetectionCustomModule message. Also converts values to other types if specified. + * @param message EffectiveEventThreatDetectionCustomModule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EffectiveEventThreatDetectionCustomModule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EffectiveEventThreatDetectionCustomModule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EffectiveEventThreatDetectionCustomModule { + + /** EnablementState enum. */ + enum EnablementState { + ENABLEMENT_STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2 + } + } + + /** Properties of an EffectiveSecurityHealthAnalyticsCustomModule. */ + interface IEffectiveSecurityHealthAnalyticsCustomModule { + + /** EffectiveSecurityHealthAnalyticsCustomModule name */ + name?: (string|null); + + /** EffectiveSecurityHealthAnalyticsCustomModule customConfig */ + customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); + + /** EffectiveSecurityHealthAnalyticsCustomModule enablementState */ + enablementState?: (google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState|null); + + /** EffectiveSecurityHealthAnalyticsCustomModule displayName */ + displayName?: (string|null); + } + + /** Represents an EffectiveSecurityHealthAnalyticsCustomModule. */ + class EffectiveSecurityHealthAnalyticsCustomModule implements IEffectiveSecurityHealthAnalyticsCustomModule { + + /** + * Constructs a new EffectiveSecurityHealthAnalyticsCustomModule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule); + + /** EffectiveSecurityHealthAnalyticsCustomModule name. */ + public name: string; + + /** EffectiveSecurityHealthAnalyticsCustomModule customConfig. */ + public customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); + + /** EffectiveSecurityHealthAnalyticsCustomModule enablementState. */ + public enablementState: (google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState); + + /** EffectiveSecurityHealthAnalyticsCustomModule displayName. */ + public displayName: string; + + /** + * Creates a new EffectiveSecurityHealthAnalyticsCustomModule instance using the specified properties. + * @param [properties] Properties to set + * @returns EffectiveSecurityHealthAnalyticsCustomModule instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule): google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule; + + /** + * Encodes the specified EffectiveSecurityHealthAnalyticsCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify|verify} messages. + * @param message EffectiveSecurityHealthAnalyticsCustomModule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EffectiveSecurityHealthAnalyticsCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify|verify} messages. + * @param message EffectiveSecurityHealthAnalyticsCustomModule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EffectiveSecurityHealthAnalyticsCustomModule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EffectiveSecurityHealthAnalyticsCustomModule + * @throws {Error} If the payload is not a reader 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.EffectiveSecurityHealthAnalyticsCustomModule; + + /** + * Decodes an EffectiveSecurityHealthAnalyticsCustomModule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EffectiveSecurityHealthAnalyticsCustomModule + * @throws {Error} If the payload is not 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.EffectiveSecurityHealthAnalyticsCustomModule; + + /** + * Verifies an EffectiveSecurityHealthAnalyticsCustomModule message. + * @param message Plain 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 EffectiveSecurityHealthAnalyticsCustomModule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EffectiveSecurityHealthAnalyticsCustomModule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule; + + /** + * Creates a plain object from an EffectiveSecurityHealthAnalyticsCustomModule message. Also converts values to other types if specified. + * @param message EffectiveSecurityHealthAnalyticsCustomModule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EffectiveSecurityHealthAnalyticsCustomModule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EffectiveSecurityHealthAnalyticsCustomModule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EffectiveSecurityHealthAnalyticsCustomModule { + + /** EnablementState enum. */ + enum EnablementState { + ENABLEMENT_STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2 + } + } + + /** Properties of a CustomConfig. */ + interface ICustomConfig { + + /** CustomConfig predicate */ + predicate?: (google.type.IExpr|null); + + /** CustomConfig customOutput */ + customOutput?: (google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec|null); + + /** CustomConfig resourceSelector */ + resourceSelector?: (google.cloud.securitycenter.v1.CustomConfig.IResourceSelector|null); + + /** CustomConfig severity */ + severity?: (google.cloud.securitycenter.v1.CustomConfig.Severity|keyof typeof google.cloud.securitycenter.v1.CustomConfig.Severity|null); + + /** CustomConfig description */ + description?: (string|null); + + /** CustomConfig recommendation */ + recommendation?: (string|null); + } + + /** Represents a CustomConfig. */ + class CustomConfig implements ICustomConfig { + + /** + * Constructs a new CustomConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICustomConfig); + + /** CustomConfig predicate. */ + public predicate?: (google.type.IExpr|null); + + /** CustomConfig customOutput. */ + public customOutput?: (google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec|null); + + /** CustomConfig resourceSelector. */ + public resourceSelector?: (google.cloud.securitycenter.v1.CustomConfig.IResourceSelector|null); + + /** CustomConfig severity. */ + public severity: (google.cloud.securitycenter.v1.CustomConfig.Severity|keyof typeof google.cloud.securitycenter.v1.CustomConfig.Severity); + + /** CustomConfig description. */ + public description: string; + + /** CustomConfig recommendation. */ + public recommendation: string; + + /** + * Creates a new CustomConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICustomConfig): google.cloud.securitycenter.v1.CustomConfig; + + /** + * Encodes the specified CustomConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.verify|verify} messages. + * @param message CustomConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICustomConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.verify|verify} messages. + * @param message CustomConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICustomConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomConfig + * @throws {Error} If the payload is not a reader 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.CustomConfig; + + /** + * Decodes a CustomConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomConfig + * @throws {Error} If the payload is not 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.CustomConfig; + + /** + * Verifies a CustomConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomConfig; + + /** + * Creates a plain object from a CustomConfig message. Also converts values to other types if specified. + * @param message CustomConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CustomConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomConfig { + + /** Properties of a CustomOutputSpec. */ + interface ICustomOutputSpec { + + /** CustomOutputSpec properties */ + properties?: (google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty[]|null); + } + + /** Represents a CustomOutputSpec. */ + class CustomOutputSpec implements ICustomOutputSpec { + + /** + * Constructs a new CustomOutputSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec); + + /** CustomOutputSpec properties. */ + public properties: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty[]; + + /** + * Creates a new CustomOutputSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomOutputSpec instance + */ + public static create(properties?: google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec): google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec; + + /** + * Encodes the specified CustomOutputSpec message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify|verify} messages. + * @param message CustomOutputSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomOutputSpec message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify|verify} messages. + * @param message CustomOutputSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomOutputSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomOutputSpec + * @throws {Error} If the payload is not a reader 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.CustomConfig.CustomOutputSpec; + + /** + * Decodes a CustomOutputSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomOutputSpec + * @throws {Error} If the payload is not 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.CustomConfig.CustomOutputSpec; + + /** + * Verifies a CustomOutputSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomOutputSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomOutputSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec; + + /** + * Creates a plain object from a CustomOutputSpec message. Also converts values to other types if specified. + * @param message CustomOutputSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomOutputSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomOutputSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomOutputSpec { + + /** Properties of a Property. */ + interface IProperty { + + /** Property name */ + name?: (string|null); + + /** Property valueExpression */ + valueExpression?: (google.type.IExpr|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty); + + /** Property name. */ + public name: string; + + /** Property valueExpression. */ + public valueExpression?: (google.type.IExpr|null); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty): google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Property message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Property + * @throws {Error} If the payload is not a reader 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.CustomConfig.CustomOutputSpec.Property; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Property + * @throws {Error} If the payload is not 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.CustomConfig.CustomOutputSpec.Property; + + /** + * Verifies a Property message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Property + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @param message Property + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Property to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Property + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ResourceSelector. */ + interface IResourceSelector { + + /** ResourceSelector resourceTypes */ + resourceTypes?: (string[]|null); + } + + /** Represents a ResourceSelector. */ + class ResourceSelector implements IResourceSelector { + + /** + * Constructs a new ResourceSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.CustomConfig.IResourceSelector); + + /** ResourceSelector resourceTypes. */ + public resourceTypes: string[]; + + /** + * Creates a new ResourceSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSelector instance + */ + public static create(properties?: google.cloud.securitycenter.v1.CustomConfig.IResourceSelector): google.cloud.securitycenter.v1.CustomConfig.ResourceSelector; + + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.CustomConfig.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.CustomConfig.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSelector + * @throws {Error} If the payload is not a reader 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.CustomConfig.ResourceSelector; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSelector + * @throws {Error} If the payload is not 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.CustomConfig.ResourceSelector; + + /** + * Verifies a ResourceSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomConfig.ResourceSelector; + + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @param message ResourceSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CustomConfig.ResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } + } + + /** Properties of an EventThreatDetectionCustomModule. */ + interface IEventThreatDetectionCustomModule { + + /** EventThreatDetectionCustomModule name */ + name?: (string|null); + + /** EventThreatDetectionCustomModule config */ + config?: (google.protobuf.IStruct|null); + + /** EventThreatDetectionCustomModule ancestorModule */ + ancestorModule?: (string|null); + + /** EventThreatDetectionCustomModule enablementState */ + enablementState?: (google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState|null); + + /** EventThreatDetectionCustomModule type */ + type?: (string|null); + + /** EventThreatDetectionCustomModule displayName */ + displayName?: (string|null); + + /** EventThreatDetectionCustomModule description */ + description?: (string|null); + + /** EventThreatDetectionCustomModule updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** EventThreatDetectionCustomModule lastEditor */ + lastEditor?: (string|null); + } + + /** Represents an EventThreatDetectionCustomModule. */ + class EventThreatDetectionCustomModule implements IEventThreatDetectionCustomModule { + + /** + * Constructs a new EventThreatDetectionCustomModule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule); + + /** EventThreatDetectionCustomModule name. */ + public name: string; + + /** EventThreatDetectionCustomModule config. */ + public config?: (google.protobuf.IStruct|null); + + /** EventThreatDetectionCustomModule ancestorModule. */ + public ancestorModule: string; + + /** EventThreatDetectionCustomModule enablementState. */ + public enablementState: (google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState); + + /** EventThreatDetectionCustomModule type. */ + public type: string; + + /** EventThreatDetectionCustomModule displayName. */ + public displayName: string; + + /** EventThreatDetectionCustomModule description. */ + public description: string; + + /** EventThreatDetectionCustomModule updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EventThreatDetectionCustomModule lastEditor. */ + public lastEditor: string; + + /** + * Creates a new EventThreatDetectionCustomModule instance using the specified properties. + * @param [properties] Properties to set + * @returns EventThreatDetectionCustomModule instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule): google.cloud.securitycenter.v1.EventThreatDetectionCustomModule; + + /** + * Encodes the specified EventThreatDetectionCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify|verify} messages. + * @param message EventThreatDetectionCustomModule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventThreatDetectionCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify|verify} messages. + * @param message EventThreatDetectionCustomModule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventThreatDetectionCustomModule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventThreatDetectionCustomModule + * @throws {Error} If the payload is not a reader 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.EventThreatDetectionCustomModule; + + /** + * Decodes an EventThreatDetectionCustomModule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventThreatDetectionCustomModule + * @throws {Error} If the payload is not 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.EventThreatDetectionCustomModule; + + /** + * Verifies an EventThreatDetectionCustomModule message. + * @param message Plain 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 EventThreatDetectionCustomModule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventThreatDetectionCustomModule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.EventThreatDetectionCustomModule; + + /** + * Creates a plain object from an EventThreatDetectionCustomModule message. Also converts values to other types if specified. + * @param message EventThreatDetectionCustomModule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.EventThreatDetectionCustomModule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventThreatDetectionCustomModule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventThreatDetectionCustomModule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EventThreatDetectionCustomModule { + + /** EnablementState enum. */ + enum EnablementState { + ENABLEMENT_STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + INHERITED = 3 + } + } + + /** Properties of a CustomModuleValidationErrors. */ + interface ICustomModuleValidationErrors { + + /** CustomModuleValidationErrors errors */ + errors?: (google.cloud.securitycenter.v1.ICustomModuleValidationError[]|null); + } + + /** Represents a CustomModuleValidationErrors. */ + class CustomModuleValidationErrors implements ICustomModuleValidationErrors { + + /** + * Constructs a new CustomModuleValidationErrors. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICustomModuleValidationErrors); + + /** CustomModuleValidationErrors errors. */ + public errors: google.cloud.securitycenter.v1.ICustomModuleValidationError[]; + + /** + * Creates a new CustomModuleValidationErrors instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomModuleValidationErrors instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICustomModuleValidationErrors): google.cloud.securitycenter.v1.CustomModuleValidationErrors; + + /** + * Encodes the specified CustomModuleValidationErrors message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify|verify} messages. + * @param message CustomModuleValidationErrors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICustomModuleValidationErrors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomModuleValidationErrors message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify|verify} messages. + * @param message CustomModuleValidationErrors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICustomModuleValidationErrors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomModuleValidationErrors message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomModuleValidationErrors + * @throws {Error} If the payload is not a reader 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.CustomModuleValidationErrors; + + /** + * Decodes a CustomModuleValidationErrors message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomModuleValidationErrors + * @throws {Error} If the payload is not 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.CustomModuleValidationErrors; + + /** + * Verifies a CustomModuleValidationErrors message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomModuleValidationErrors message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomModuleValidationErrors + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomModuleValidationErrors; + + /** + * Creates a plain object from a CustomModuleValidationErrors message. Also converts values to other types if specified. + * @param message CustomModuleValidationErrors + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CustomModuleValidationErrors, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomModuleValidationErrors to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomModuleValidationErrors + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomModuleValidationError. */ + interface ICustomModuleValidationError { + + /** CustomModuleValidationError description */ + description?: (string|null); + + /** CustomModuleValidationError fieldPath */ + fieldPath?: (string|null); + + /** CustomModuleValidationError start */ + start?: (google.cloud.securitycenter.v1.IPosition|null); + + /** CustomModuleValidationError end */ + end?: (google.cloud.securitycenter.v1.IPosition|null); + } + + /** Represents a CustomModuleValidationError. */ + class CustomModuleValidationError implements ICustomModuleValidationError { + + /** + * Constructs a new CustomModuleValidationError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICustomModuleValidationError); + + /** CustomModuleValidationError description. */ + public description: string; + + /** CustomModuleValidationError fieldPath. */ + public fieldPath: string; + + /** CustomModuleValidationError start. */ + public start?: (google.cloud.securitycenter.v1.IPosition|null); + + /** CustomModuleValidationError end. */ + public end?: (google.cloud.securitycenter.v1.IPosition|null); + + /** + * Creates a new CustomModuleValidationError instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomModuleValidationError instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICustomModuleValidationError): google.cloud.securitycenter.v1.CustomModuleValidationError; + + /** + * Encodes the specified CustomModuleValidationError message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationError.verify|verify} messages. + * @param message CustomModuleValidationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICustomModuleValidationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomModuleValidationError message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationError.verify|verify} messages. + * @param message CustomModuleValidationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICustomModuleValidationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomModuleValidationError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomModuleValidationError + * @throws {Error} If the payload is not a reader 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.CustomModuleValidationError; + + /** + * Decodes a CustomModuleValidationError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomModuleValidationError + * @throws {Error} If the payload is not 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.CustomModuleValidationError; + + /** + * Verifies a CustomModuleValidationError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomModuleValidationError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomModuleValidationError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomModuleValidationError; + + /** + * Creates a plain object from a CustomModuleValidationError message. Also converts values to other types if specified. + * @param message CustomModuleValidationError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CustomModuleValidationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomModuleValidationError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomModuleValidationError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Position. */ + interface IPosition { + + /** Position lineNumber */ + lineNumber?: (number|null); + + /** Position columnNumber */ + columnNumber?: (number|null); + } + + /** Represents a Position. */ + class Position implements IPosition { + + /** + * Constructs a new Position. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IPosition); + + /** Position lineNumber. */ + public lineNumber: number; + + /** Position columnNumber. */ + public columnNumber: number; + + /** + * Creates a new Position instance using the specified properties. + * @param [properties] Properties to set + * @returns Position instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IPosition): google.cloud.securitycenter.v1.Position; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.securitycenter.v1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Position message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Position + * @throws {Error} If the payload is not a reader 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.Position; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Position + * @throws {Error} If the payload is not 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.Position; + + /** + * Verifies a Position message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Position + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Position; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @param message Position + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Position, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Position to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Position + * @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 { + + /** Exfiltration sources */ + sources?: (google.cloud.securitycenter.v1.IExfilResource[]|null); + + /** Exfiltration targets */ + targets?: (google.cloud.securitycenter.v1.IExfilResource[]|null); + + /** Exfiltration totalExfiltratedBytes */ + totalExfiltratedBytes?: (number|Long|string|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[]; + + /** Exfiltration totalExfiltratedBytes. */ + public totalExfiltratedBytes: (number|Long|string); + + /** + * 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 ExternalExposure. */ + interface IExternalExposure { + + /** ExternalExposure privateIpAddress */ + privateIpAddress?: (string|null); + + /** ExternalExposure privatePort */ + privatePort?: (string|null); + + /** ExternalExposure exposedService */ + exposedService?: (string|null); + + /** ExternalExposure publicIpAddress */ + publicIpAddress?: (string|null); + + /** ExternalExposure publicPort */ + publicPort?: (string|null); + + /** ExternalExposure exposedEndpoint */ + exposedEndpoint?: (string|null); + + /** ExternalExposure loadBalancerFirewallPolicy */ + loadBalancerFirewallPolicy?: (string|null); + + /** ExternalExposure serviceFirewallPolicy */ + serviceFirewallPolicy?: (string|null); + + /** ExternalExposure forwardingRule */ + forwardingRule?: (string|null); + + /** ExternalExposure backendService */ + backendService?: (string|null); + + /** ExternalExposure instanceGroup */ + instanceGroup?: (string|null); + + /** ExternalExposure networkEndpointGroup */ + networkEndpointGroup?: (string|null); + } + + /** Represents an ExternalExposure. */ + class ExternalExposure implements IExternalExposure { + + /** + * Constructs a new ExternalExposure. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IExternalExposure); + + /** ExternalExposure privateIpAddress. */ + public privateIpAddress: string; + + /** ExternalExposure privatePort. */ + public privatePort: string; + + /** ExternalExposure exposedService. */ + public exposedService: string; + + /** ExternalExposure publicIpAddress. */ + public publicIpAddress: string; + + /** ExternalExposure publicPort. */ + public publicPort: string; + + /** ExternalExposure exposedEndpoint. */ + public exposedEndpoint: string; + + /** ExternalExposure loadBalancerFirewallPolicy. */ + public loadBalancerFirewallPolicy: string; + + /** ExternalExposure serviceFirewallPolicy. */ + public serviceFirewallPolicy: string; + + /** ExternalExposure forwardingRule. */ + public forwardingRule: string; + + /** ExternalExposure backendService. */ + public backendService: string; + + /** ExternalExposure instanceGroup. */ + public instanceGroup: string; + + /** ExternalExposure networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** + * Creates a new ExternalExposure instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalExposure instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IExternalExposure): google.cloud.securitycenter.v1.ExternalExposure; + + /** + * Encodes the specified ExternalExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. + * @param message ExternalExposure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IExternalExposure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. + * @param message ExternalExposure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IExternalExposure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalExposure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalExposure + * @throws {Error} If the payload is not a reader 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.ExternalExposure; + + /** + * Decodes an ExternalExposure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalExposure + * @throws {Error} If the payload is not 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.ExternalExposure; + + /** + * Verifies an ExternalExposure message. + * @param message Plain 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 ExternalExposure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalExposure + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExternalExposure; + + /** + * Creates a plain object from an ExternalExposure message. Also converts values to other types if specified. + * @param message ExternalExposure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ExternalExposure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalExposure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalExposure + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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); + + /** ExternalSystem caseUri */ + caseUri?: (string|null); + + /** ExternalSystem casePriority */ + casePriority?: (string|null); + + /** ExternalSystem caseSla */ + caseSla?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem caseCreateTime */ + caseCreateTime?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem caseCloseTime */ + caseCloseTime?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem ticketInfo */ + ticketInfo?: (google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo|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); + + /** ExternalSystem caseUri. */ + public caseUri: string; + + /** ExternalSystem casePriority. */ + public casePriority: string; + + /** ExternalSystem caseSla. */ + public caseSla?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem caseCreateTime. */ + public caseCreateTime?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem caseCloseTime. */ + public caseCloseTime?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem ticketInfo. */ + public ticketInfo?: (google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo|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 }; + + /** + * 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; + } + + namespace ExternalSystem { + + /** Properties of a TicketInfo. */ + interface ITicketInfo { + + /** TicketInfo id */ + id?: (string|null); + + /** TicketInfo assignee */ + assignee?: (string|null); + + /** TicketInfo description */ + description?: (string|null); + + /** TicketInfo uri */ + uri?: (string|null); + + /** TicketInfo status */ + status?: (string|null); + + /** TicketInfo updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TicketInfo. */ + class TicketInfo implements ITicketInfo { + + /** + * Constructs a new TicketInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo); + + /** TicketInfo id. */ + public id: string; + + /** TicketInfo assignee. */ + public assignee: string; + + /** TicketInfo description. */ + public description: string; + + /** TicketInfo uri. */ + public uri: string; + + /** TicketInfo status. */ + public status: string; + + /** TicketInfo updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TicketInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TicketInfo instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo): google.cloud.securitycenter.v1.ExternalSystem.TicketInfo; + + /** + * Encodes the specified TicketInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify|verify} messages. + * @param message TicketInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TicketInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify|verify} messages. + * @param message TicketInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TicketInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TicketInfo + * @throws {Error} If the payload is not a reader 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.TicketInfo; + + /** + * Decodes a TicketInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TicketInfo + * @throws {Error} If the payload is not 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.TicketInfo; + + /** + * Verifies a TicketInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TicketInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TicketInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExternalSystem.TicketInfo; + + /** + * Creates a plain object from a TicketInfo message. Also converts values to other types if specified. + * @param message TicketInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ExternalSystem.TicketInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TicketInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TicketInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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); + + /** File diskPath */ + diskPath?: (google.cloud.securitycenter.v1.File.IDiskPath|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; + + /** File diskPath. */ + public diskPath?: (google.cloud.securitycenter.v1.File.IDiskPath|null); + + /** + * 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 }; + + /** + * 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; + } + + namespace File { + + /** Properties of a DiskPath. */ + interface IDiskPath { + + /** DiskPath partitionUuid */ + partitionUuid?: (string|null); + + /** DiskPath relativePath */ + relativePath?: (string|null); + } + + /** Represents a DiskPath. */ + class DiskPath implements IDiskPath { + + /** + * Constructs a new DiskPath. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.File.IDiskPath); + + /** DiskPath partitionUuid. */ + public partitionUuid: string; + + /** DiskPath relativePath. */ + public relativePath: string; + + /** + * Creates a new DiskPath instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskPath instance + */ + public static create(properties?: google.cloud.securitycenter.v1.File.IDiskPath): google.cloud.securitycenter.v1.File.DiskPath; + + /** + * Encodes the specified DiskPath message. Does not implicitly {@link google.cloud.securitycenter.v1.File.DiskPath.verify|verify} messages. + * @param message DiskPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.File.IDiskPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.DiskPath.verify|verify} messages. + * @param message DiskPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.File.IDiskPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskPath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskPath + * @throws {Error} If the payload is not a reader 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.DiskPath; + + /** + * Decodes a DiskPath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskPath + * @throws {Error} If the payload is not 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.DiskPath; + + /** + * Verifies a DiskPath message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskPath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskPath + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.File.DiskPath; + + /** + * Creates a plain object from a DiskPath message. Also converts values to other types if specified. + * @param message DiskPath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.File.DiskPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskPath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskPath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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); + + /** Finding severity */ + severity?: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity|null); + + /** 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); + + /** Finding indicator */ + indicator?: (google.cloud.securitycenter.v1.IIndicator|null); + + /** Finding vulnerability */ + vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + + /** Finding muteUpdateTime */ + muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** 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); + + /** Finding connections */ + connections?: (google.cloud.securitycenter.v1.IConnection[]|null); + + /** Finding muteInitiator */ + muteInitiator?: (string|null); + + /** Finding muteInfo */ + muteInfo?: (google.cloud.securitycenter.v1.Finding.IMuteInfo|null); + + /** 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); + + /** Finding parentDisplayName */ + parentDisplayName?: (string|null); + + /** Finding description */ + description?: (string|null); + + /** Finding exfiltration */ + exfiltration?: (google.cloud.securitycenter.v1.IExfiltration|null); + + /** Finding iamBindings */ + iamBindings?: (google.cloud.securitycenter.v1.IIamBinding[]|null); + + /** Finding nextSteps */ + nextSteps?: (string|null); + + /** Finding moduleName */ + moduleName?: (string|null); + + /** Finding containers */ + containers?: (google.cloud.securitycenter.v1.IContainer[]|null); + + /** Finding kubernetes */ + kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + + /** Finding database */ + database?: (google.cloud.securitycenter.v1.IDatabase|null); + + /** Finding attackExposure */ + attackExposure?: (google.cloud.securitycenter.v1.IAttackExposure|null); + + /** Finding files */ + files?: (google.cloud.securitycenter.v1.IFile[]|null); + + /** Finding cloudDlpInspection */ + cloudDlpInspection?: (google.cloud.securitycenter.v1.ICloudDlpInspection|null); + + /** Finding cloudDlpDataProfile */ + cloudDlpDataProfile?: (google.cloud.securitycenter.v1.ICloudDlpDataProfile|null); + + /** Finding kernelRootkit */ + kernelRootkit?: (google.cloud.securitycenter.v1.IKernelRootkit|null); + + /** Finding orgPolicies */ + orgPolicies?: (google.cloud.securitycenter.v1.IOrgPolicy[]|null); + + /** Finding application */ + application?: (google.cloud.securitycenter.v1.IApplication|null); + + /** Finding backupDisasterRecovery */ + backupDisasterRecovery?: (google.cloud.securitycenter.v1.IBackupDisasterRecovery|null); + + /** Finding securityPosture */ + securityPosture?: (google.cloud.securitycenter.v1.ISecurityPosture|null); + + /** Finding logEntries */ + logEntries?: (google.cloud.securitycenter.v1.ILogEntry[]|null); + + /** Finding loadBalancers */ + loadBalancers?: (google.cloud.securitycenter.v1.ILoadBalancer[]|null); + + /** Finding cloudArmor */ + cloudArmor?: (google.cloud.securitycenter.v1.ICloudArmor|null); + + /** Finding notebook */ + notebook?: (google.cloud.securitycenter.v1.INotebook|null); + + /** Finding toxicCombination */ + toxicCombination?: (google.cloud.securitycenter.v1.IToxicCombination|null); + + /** Finding groupMemberships */ + groupMemberships?: (google.cloud.securitycenter.v1.IGroupMembership[]|null); + + /** Finding chokepoint */ + chokepoint?: (google.cloud.securitycenter.v1.IChokepoint|null); + + /** Finding externalExposure */ + externalExposure?: (google.cloud.securitycenter.v1.IExternalExposure|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); + + /** Finding severity. */ + public severity: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity); + + /** 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); + + /** Finding indicator. */ + public indicator?: (google.cloud.securitycenter.v1.IIndicator|null); + + /** Finding vulnerability. */ + public vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + + /** Finding muteUpdateTime. */ + public muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** 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); + + /** Finding connections. */ + public connections: google.cloud.securitycenter.v1.IConnection[]; + + /** Finding muteInitiator. */ + public muteInitiator: string; + + /** Finding muteInfo. */ + public muteInfo?: (google.cloud.securitycenter.v1.Finding.IMuteInfo|null); + + /** 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[]; + + /** Finding parentDisplayName. */ + public parentDisplayName: string; + + /** Finding description. */ + public description: string; + + /** Finding exfiltration. */ + public exfiltration?: (google.cloud.securitycenter.v1.IExfiltration|null); + + /** Finding iamBindings. */ + public iamBindings: google.cloud.securitycenter.v1.IIamBinding[]; + + /** Finding nextSteps. */ + public nextSteps: string; + + /** Finding moduleName. */ + public moduleName: string; + + /** Finding containers. */ + public containers: google.cloud.securitycenter.v1.IContainer[]; + + /** Finding kubernetes. */ + public kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + + /** Finding database. */ + public database?: (google.cloud.securitycenter.v1.IDatabase|null); + + /** Finding attackExposure. */ + public attackExposure?: (google.cloud.securitycenter.v1.IAttackExposure|null); + + /** Finding files. */ + public files: google.cloud.securitycenter.v1.IFile[]; + + /** Finding cloudDlpInspection. */ + public cloudDlpInspection?: (google.cloud.securitycenter.v1.ICloudDlpInspection|null); + + /** Finding cloudDlpDataProfile. */ + public cloudDlpDataProfile?: (google.cloud.securitycenter.v1.ICloudDlpDataProfile|null); + + /** Finding kernelRootkit. */ + public kernelRootkit?: (google.cloud.securitycenter.v1.IKernelRootkit|null); + + /** Finding orgPolicies. */ + public orgPolicies: google.cloud.securitycenter.v1.IOrgPolicy[]; + + /** Finding application. */ + public application?: (google.cloud.securitycenter.v1.IApplication|null); + + /** Finding backupDisasterRecovery. */ + public backupDisasterRecovery?: (google.cloud.securitycenter.v1.IBackupDisasterRecovery|null); + + /** Finding securityPosture. */ + public securityPosture?: (google.cloud.securitycenter.v1.ISecurityPosture|null); + + /** Finding logEntries. */ + public logEntries: google.cloud.securitycenter.v1.ILogEntry[]; + + /** Finding loadBalancers. */ + public loadBalancers: google.cloud.securitycenter.v1.ILoadBalancer[]; + + /** Finding cloudArmor. */ + public cloudArmor?: (google.cloud.securitycenter.v1.ICloudArmor|null); + + /** Finding notebook. */ + public notebook?: (google.cloud.securitycenter.v1.INotebook|null); + + /** Finding toxicCombination. */ + public toxicCombination?: (google.cloud.securitycenter.v1.IToxicCombination|null); + + /** Finding groupMemberships. */ + public groupMemberships: google.cloud.securitycenter.v1.IGroupMembership[]; + + /** Finding chokepoint. */ + public chokepoint?: (google.cloud.securitycenter.v1.IChokepoint|null); + + /** Finding externalExposure. */ + public externalExposure?: (google.cloud.securitycenter.v1.IExternalExposure|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 }; + + /** + * 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 { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } + + /** Mute enum. */ + enum Mute { + MUTE_UNSPECIFIED = 0, + MUTED = 1, + UNMUTED = 2, + UNDEFINED = 4 + } + + /** FindingClass enum. */ + enum FindingClass { + FINDING_CLASS_UNSPECIFIED = 0, + THREAT = 1, + VULNERABILITY = 2, + MISCONFIGURATION = 3, + OBSERVATION = 4, + SCC_ERROR = 5, + POSTURE_VIOLATION = 6, + TOXIC_COMBINATION = 7, + SENSITIVE_DATA_RISK = 8, + CHOKEPOINT = 9, + EXTERNAL_EXPOSURE = 10 + } + + /** Properties of a MuteInfo. */ + interface IMuteInfo { + + /** MuteInfo staticMute */ + staticMute?: (google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute|null); + + /** MuteInfo dynamicMuteRecords */ + dynamicMuteRecords?: (google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord[]|null); + } + + /** Represents a MuteInfo. */ + class MuteInfo implements IMuteInfo { + + /** + * Constructs a new MuteInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Finding.IMuteInfo); + + /** MuteInfo staticMute. */ + public staticMute?: (google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute|null); + + /** MuteInfo dynamicMuteRecords. */ + public dynamicMuteRecords: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord[]; + + /** + * Creates a new MuteInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns MuteInfo instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Finding.IMuteInfo): google.cloud.securitycenter.v1.Finding.MuteInfo; + + /** + * Encodes the specified MuteInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.verify|verify} messages. + * @param message MuteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Finding.IMuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuteInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.verify|verify} messages. + * @param message MuteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Finding.IMuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MuteInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MuteInfo + * @throws {Error} If the payload is not a reader 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.MuteInfo; + + /** + * Decodes a MuteInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MuteInfo + * @throws {Error} If the payload is not 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.MuteInfo; + + /** + * Verifies a MuteInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MuteInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MuteInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding.MuteInfo; + + /** + * Creates a plain object from a MuteInfo message. Also converts values to other types if specified. + * @param message MuteInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Finding.MuteInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MuteInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MuteInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MuteInfo { + + /** Properties of a StaticMute. */ + interface IStaticMute { + + /** StaticMute state */ + state?: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute|null); + + /** StaticMute applyTime */ + applyTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StaticMute. */ + class StaticMute implements IStaticMute { + + /** + * Constructs a new StaticMute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute); + + /** StaticMute state. */ + public state: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute); + + /** StaticMute applyTime. */ + public applyTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new StaticMute instance using the specified properties. + * @param [properties] Properties to set + * @returns StaticMute instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute): google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute; + + /** + * Encodes the specified StaticMute message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify|verify} messages. + * @param message StaticMute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StaticMute message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify|verify} messages. + * @param message StaticMute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StaticMute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StaticMute + * @throws {Error} If the payload is not a reader 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.MuteInfo.StaticMute; + + /** + * Decodes a StaticMute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StaticMute + * @throws {Error} If the payload is not 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.MuteInfo.StaticMute; + + /** + * Verifies a StaticMute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StaticMute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StaticMute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute; + + /** + * Creates a plain object from a StaticMute message. Also converts values to other types if specified. + * @param message StaticMute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StaticMute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StaticMute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DynamicMuteRecord. */ + interface IDynamicMuteRecord { + + /** DynamicMuteRecord muteConfig */ + muteConfig?: (string|null); + + /** DynamicMuteRecord matchTime */ + matchTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DynamicMuteRecord. */ + class DynamicMuteRecord implements IDynamicMuteRecord { + + /** + * Constructs a new DynamicMuteRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord); + + /** DynamicMuteRecord muteConfig. */ + public muteConfig: string; + + /** DynamicMuteRecord matchTime. */ + public matchTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DynamicMuteRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns DynamicMuteRecord instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord): google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord; + + /** + * Encodes the specified DynamicMuteRecord message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. + * @param message DynamicMuteRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DynamicMuteRecord message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. + * @param message DynamicMuteRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DynamicMuteRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DynamicMuteRecord + * @throws {Error} If the payload is not a reader 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.MuteInfo.DynamicMuteRecord; + + /** + * Decodes a DynamicMuteRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DynamicMuteRecord + * @throws {Error} If the payload is not 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.MuteInfo.DynamicMuteRecord; + + /** + * Verifies a DynamicMuteRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DynamicMuteRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DynamicMuteRecord + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord; + + /** + * Creates a plain object from a DynamicMuteRecord message. Also converts values to other types if specified. + * @param message DynamicMuteRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DynamicMuteRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DynamicMuteRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a GroupMembership. */ + interface IGroupMembership { + + /** GroupMembership groupType */ + groupType?: (google.cloud.securitycenter.v1.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v1.GroupMembership.GroupType|null); + + /** GroupMembership groupId */ + groupId?: (string|null); + } + + /** Represents a GroupMembership. */ + class GroupMembership implements IGroupMembership { + + /** + * Constructs a new GroupMembership. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupMembership); + + /** GroupMembership groupType. */ + public groupType: (google.cloud.securitycenter.v1.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v1.GroupMembership.GroupType); + + /** GroupMembership groupId. */ + public groupId: string; + + /** + * Creates a new GroupMembership instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupMembership instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupMembership): google.cloud.securitycenter.v1.GroupMembership; + + /** + * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. + * @param message GroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. + * @param message GroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupMembership message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupMembership + * @throws {Error} If the payload is not a reader 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.GroupMembership; + + /** + * Decodes a GroupMembership message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupMembership + * @throws {Error} If the payload is not 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.GroupMembership; + + /** + * Verifies a GroupMembership message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupMembership + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupMembership; + + /** + * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. + * @param message GroupMembership + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupMembership to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupMembership + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GroupMembership { + + /** GroupType enum. */ + enum GroupType { + GROUP_TYPE_UNSPECIFIED = 0, + GROUP_TYPE_TOXIC_COMBINATION = 1, + GROUP_TYPE_CHOKEPOINT = 3 + } + } + + /** 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 }; + + /** + * 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 { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an Indicator. */ + interface IIndicator { + + /** Indicator ipAddresses */ + ipAddresses?: (string[]|null); + + /** Indicator domains */ + domains?: (string[]|null); + + /** Indicator signatures */ + signatures?: (google.cloud.securitycenter.v1.Indicator.IProcessSignature[]|null); + + /** Indicator uris */ + uris?: (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[]; + + /** 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 + * @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 }; + + /** + * 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 { + + /** 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); + + /** ProcessSignature signatureType */ + signatureType?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType|keyof typeof google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType|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 signatureType. */ + public signatureType: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType|keyof typeof google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType); + + /** 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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; + } + + /** SignatureType enum. */ + enum SignatureType { + SIGNATURE_TYPE_UNSPECIFIED = 0, + SIGNATURE_TYPE_PROCESS = 1, + SIGNATURE_TYPE_FILE = 2 + } + } + } + + /** Properties of a KernelRootkit. */ + interface IKernelRootkit { + + /** KernelRootkit name */ + name?: (string|null); + + /** KernelRootkit unexpectedCodeModification */ + unexpectedCodeModification?: (boolean|null); + + /** KernelRootkit unexpectedReadOnlyDataModification */ + unexpectedReadOnlyDataModification?: (boolean|null); + + /** KernelRootkit unexpectedFtraceHandler */ + unexpectedFtraceHandler?: (boolean|null); + + /** KernelRootkit unexpectedKprobeHandler */ + unexpectedKprobeHandler?: (boolean|null); + + /** KernelRootkit unexpectedKernelCodePages */ + unexpectedKernelCodePages?: (boolean|null); + + /** KernelRootkit unexpectedSystemCallHandler */ + unexpectedSystemCallHandler?: (boolean|null); + + /** KernelRootkit unexpectedInterruptHandler */ + unexpectedInterruptHandler?: (boolean|null); + + /** KernelRootkit unexpectedProcessesInRunqueue */ + unexpectedProcessesInRunqueue?: (boolean|null); + } + + /** Represents a KernelRootkit. */ + class KernelRootkit implements IKernelRootkit { + + /** + * Constructs a new KernelRootkit. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IKernelRootkit); + + /** KernelRootkit name. */ + public name: string; + + /** KernelRootkit unexpectedCodeModification. */ + public unexpectedCodeModification: boolean; + + /** KernelRootkit unexpectedReadOnlyDataModification. */ + public unexpectedReadOnlyDataModification: boolean; + + /** KernelRootkit unexpectedFtraceHandler. */ + public unexpectedFtraceHandler: boolean; + + /** KernelRootkit unexpectedKprobeHandler. */ + public unexpectedKprobeHandler: boolean; + + /** KernelRootkit unexpectedKernelCodePages. */ + public unexpectedKernelCodePages: boolean; + + /** KernelRootkit unexpectedSystemCallHandler. */ + public unexpectedSystemCallHandler: boolean; + + /** KernelRootkit unexpectedInterruptHandler. */ + public unexpectedInterruptHandler: boolean; + + /** KernelRootkit unexpectedProcessesInRunqueue. */ + public unexpectedProcessesInRunqueue: boolean; + + /** + * Creates a new KernelRootkit instance using the specified properties. + * @param [properties] Properties to set + * @returns KernelRootkit instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IKernelRootkit): google.cloud.securitycenter.v1.KernelRootkit; + + /** + * Encodes the specified KernelRootkit message. Does not implicitly {@link google.cloud.securitycenter.v1.KernelRootkit.verify|verify} messages. + * @param message KernelRootkit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IKernelRootkit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KernelRootkit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.KernelRootkit.verify|verify} messages. + * @param message KernelRootkit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IKernelRootkit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KernelRootkit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KernelRootkit + * @throws {Error} If the payload is not a reader 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.KernelRootkit; + + /** + * Decodes a KernelRootkit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KernelRootkit + * @throws {Error} If the payload is not 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.KernelRootkit; + + /** + * Verifies a KernelRootkit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KernelRootkit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KernelRootkit + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.KernelRootkit; + + /** + * Creates a plain object from a KernelRootkit message. Also converts values to other types if specified. + * @param message KernelRootkit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.KernelRootkit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KernelRootkit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KernelRootkit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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); + + /** Kubernetes objects */ + objects?: (google.cloud.securitycenter.v1.Kubernetes.IObject[]|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[]; + + /** Kubernetes objects. */ + public objects: google.cloud.securitycenter.v1.Kubernetes.IObject[]; + + /** + * 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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; + } + + /** Properties of an Object. */ + interface IObject { + + /** Object group */ + group?: (string|null); + + /** Object kind */ + kind?: (string|null); + + /** Object ns */ + ns?: (string|null); + + /** Object name */ + name?: (string|null); + + /** Object containers */ + containers?: (google.cloud.securitycenter.v1.IContainer[]|null); + } + + /** Represents an Object. */ + class Object implements IObject { + + /** + * Constructs a new Object. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IObject); + + /** Object group. */ + public group: string; + + /** Object kind. */ + public kind: string; + + /** Object ns. */ + public ns: string; + + /** Object name. */ + public name: string; + + /** Object containers. */ + public containers: google.cloud.securitycenter.v1.IContainer[]; + + /** + * Creates a new Object instance using the specified properties. + * @param [properties] Properties to set + * @returns Object instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IObject): google.cloud.securitycenter.v1.Kubernetes.object; + + /** + * Encodes the specified Object message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Object.verify|verify} messages. + * @param message Object message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Object message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Object.verify|verify} messages. + * @param message Object message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Object message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Object + * @throws {Error} If the payload is not a reader 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.object; + + /** + * Decodes an Object message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Object + * @throws {Error} If the payload is not 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.object; + + /** + * Verifies an Object message. + * @param message Plain 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 Object message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Object + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.object; + + /** + * Creates a plain object from an Object message. Also converts values to other types if specified. + * @param message Object + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.object, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Object to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Object + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LoadBalancer. */ + interface ILoadBalancer { + + /** LoadBalancer name */ + name?: (string|null); + } + + /** Represents a LoadBalancer. */ + class LoadBalancer implements ILoadBalancer { + + /** + * Constructs a new LoadBalancer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ILoadBalancer); + + /** LoadBalancer name. */ + public name: string; + + /** + * Creates a new LoadBalancer instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadBalancer instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ILoadBalancer): google.cloud.securitycenter.v1.LoadBalancer; + + /** + * Encodes the specified LoadBalancer message. Does not implicitly {@link google.cloud.securitycenter.v1.LoadBalancer.verify|verify} messages. + * @param message LoadBalancer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ILoadBalancer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoadBalancer message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.LoadBalancer.verify|verify} messages. + * @param message LoadBalancer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ILoadBalancer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoadBalancer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadBalancer + * @throws {Error} If the payload is not a reader 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.LoadBalancer; + + /** + * Decodes a LoadBalancer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadBalancer + * @throws {Error} If the payload is not 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.LoadBalancer; + + /** + * Verifies a LoadBalancer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoadBalancer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadBalancer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.LoadBalancer; + + /** + * Creates a plain object from a LoadBalancer message. Also converts values to other types if specified. + * @param message LoadBalancer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.LoadBalancer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoadBalancer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoadBalancer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogEntry. */ + interface ILogEntry { + + /** LogEntry cloudLoggingEntry */ + cloudLoggingEntry?: (google.cloud.securitycenter.v1.ICloudLoggingEntry|null); + } + + /** Represents a LogEntry. */ + class LogEntry implements ILogEntry { + + /** + * Constructs a new LogEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ILogEntry); + + /** LogEntry cloudLoggingEntry. */ + public cloudLoggingEntry?: (google.cloud.securitycenter.v1.ICloudLoggingEntry|null); + + /** LogEntry logEntry. */ + public logEntry?: "cloudLoggingEntry"; + + /** + * Creates a new LogEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns LogEntry instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ILogEntry): google.cloud.securitycenter.v1.LogEntry; + + /** + * Encodes the specified LogEntry message. Does not implicitly {@link google.cloud.securitycenter.v1.LogEntry.verify|verify} messages. + * @param message LogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.LogEntry.verify|verify} messages. + * @param message LogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogEntry + * @throws {Error} If the payload is not a reader 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.LogEntry; + + /** + * Decodes a LogEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogEntry + * @throws {Error} If the payload is not 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.LogEntry; + + /** + * Verifies a LogEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.LogEntry; + + /** + * Creates a plain object from a LogEntry message. Also converts values to other types if specified. + * @param message LogEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.LogEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudLoggingEntry. */ + interface ICloudLoggingEntry { + + /** CloudLoggingEntry insertId */ + insertId?: (string|null); + + /** CloudLoggingEntry logId */ + logId?: (string|null); + + /** CloudLoggingEntry resourceContainer */ + resourceContainer?: (string|null); + + /** CloudLoggingEntry timestamp */ + timestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CloudLoggingEntry. */ + class CloudLoggingEntry implements ICloudLoggingEntry { + + /** + * Constructs a new CloudLoggingEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICloudLoggingEntry); + + /** CloudLoggingEntry insertId. */ + public insertId: string; + + /** CloudLoggingEntry logId. */ + public logId: string; + + /** CloudLoggingEntry resourceContainer. */ + public resourceContainer: string; + + /** CloudLoggingEntry timestamp. */ + public timestamp?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CloudLoggingEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingEntry instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICloudLoggingEntry): google.cloud.securitycenter.v1.CloudLoggingEntry; + + /** + * Encodes the specified CloudLoggingEntry message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudLoggingEntry.verify|verify} messages. + * @param message CloudLoggingEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICloudLoggingEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudLoggingEntry.verify|verify} messages. + * @param message CloudLoggingEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICloudLoggingEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingEntry + * @throws {Error} If the payload is not a reader 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.CloudLoggingEntry; + + /** + * Decodes a CloudLoggingEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingEntry + * @throws {Error} If the payload is not 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.CloudLoggingEntry; + + /** + * Verifies a CloudLoggingEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CloudLoggingEntry; + + /** + * Creates a plain object from a CloudLoggingEntry message. Also converts values to other types if specified. + * @param message CloudLoggingEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CloudLoggingEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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 { + + /** 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, + MASQUERADING = 49, + MATCH_LEGITIMATE_NAME_OR_LOCATION = 50, + BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37, + STARTUP_ITEMS = 38, + NETWORK_SERVICE_DISCOVERY = 32, + PROCESS_DISCOVERY = 56, + COMMAND_AND_SCRIPTING_INTERPRETER = 6, + UNIX_SHELL = 7, + PYTHON = 59, + EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63, + PERMISSION_GROUPS_DISCOVERY = 18, + CLOUD_GROUPS = 19, + INDICATOR_REMOVAL_FILE_DELETION = 64, + APPLICATION_LAYER_PROTOCOL = 45, + DNS = 46, + SOFTWARE_DEPLOYMENT_TOOLS = 47, + VALID_ACCOUNTS = 14, + DEFAULT_ACCOUNTS = 35, + LOCAL_ACCOUNTS = 15, + CLOUD_ACCOUNTS = 16, + PROXY = 9, + EXTERNAL_PROXY = 10, + MULTI_HOP_PROXY = 11, + ACCOUNT_MANIPULATION = 22, + ADDITIONAL_CLOUD_CREDENTIALS = 40, + SSH_AUTHORIZED_KEYS = 23, + ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58, + INGRESS_TOOL_TRANSFER = 3, + NATIVE_API = 4, + BRUTE_FORCE = 44, + SHARED_MODULES = 5, + ACCESS_TOKEN_MANIPULATION = 33, + TOKEN_IMPERSONATION_OR_THEFT = 39, + EXPLOIT_PUBLIC_FACING_APPLICATION = 27, + DOMAIN_POLICY_MODIFICATION = 30, + DATA_DESTRUCTION = 29, + SERVICE_STOP = 52, + INHIBIT_SYSTEM_RECOVERY = 36, + RESOURCE_HIJACKING = 8, + NETWORK_DENIAL_OF_SERVICE = 17, + CLOUD_SERVICE_DISCOVERY = 48, + STEAL_APPLICATION_ACCESS_TOKEN = 42, + ACCOUNT_ACCESS_REMOVAL = 51, + STEAL_WEB_SESSION_COOKIE = 25, + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24, + ABUSE_ELEVATION_CONTROL_MECHANISM = 34, + UNSECURED_CREDENTIALS = 13, + MODIFY_AUTHENTICATION_PROCESS = 28, + IMPAIR_DEFENSES = 31, + DISABLE_OR_MODIFY_TOOLS = 55, + EXFILTRATION_OVER_WEB_SERVICE = 20, + EXFILTRATION_TO_CLOUD_STORAGE = 21, + DYNAMIC_RESOLUTION = 12, + LATERAL_TOOL_TRANSFER = 41, + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26, + CREATE_SNAPSHOT = 54, + CLOUD_INFRASTRUCTURE_DISCOVERY = 53, + OBTAIN_CAPABILITIES = 43, + ACTIVE_SCANNING = 1, + SCANNING_IP_BLOCKS = 2, + CONTAINER_ADMINISTRATION_COMMAND = 60, + ESCAPE_TO_HOST = 61, + CONTAINER_AND_RESOURCE_DISCOVERY = 57, + STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62 + } + } + + /** Properties of a Notebook. */ + interface INotebook { + + /** Notebook name */ + name?: (string|null); + + /** Notebook service */ + service?: (string|null); + + /** Notebook lastAuthor */ + lastAuthor?: (string|null); + + /** Notebook notebookUpdateTime */ + notebookUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Notebook. */ + class Notebook implements INotebook { + + /** + * Constructs a new Notebook. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.INotebook); + + /** Notebook name. */ + public name: string; + + /** Notebook service. */ + public service: string; + + /** Notebook lastAuthor. */ + public lastAuthor: string; + + /** Notebook notebookUpdateTime. */ + public notebookUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Notebook instance using the specified properties. + * @param [properties] Properties to set + * @returns Notebook instance + */ + public static create(properties?: google.cloud.securitycenter.v1.INotebook): google.cloud.securitycenter.v1.Notebook; + + /** + * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.securitycenter.v1.Notebook.verify|verify} messages. + * @param message Notebook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Notebook.verify|verify} messages. + * @param message Notebook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Notebook message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Notebook + * @throws {Error} If the payload is not a reader 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.Notebook; + + /** + * Decodes a Notebook message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Notebook + * @throws {Error} If the payload is not 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.Notebook; + + /** + * Verifies a Notebook message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Notebook message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Notebook + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Notebook; + + /** + * Creates a plain object from a Notebook message. Also converts values to other types if specified. + * @param message Notebook + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Notebook, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Notebook to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Notebook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrgPolicy. */ + interface IOrgPolicy { + + /** OrgPolicy name */ + name?: (string|null); + } + + /** Represents an OrgPolicy. */ + class OrgPolicy implements IOrgPolicy { + + /** + * Constructs a new OrgPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IOrgPolicy); + + /** OrgPolicy name. */ + public name: string; + + /** + * Creates a new OrgPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns OrgPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IOrgPolicy): google.cloud.securitycenter.v1.OrgPolicy; + + /** + * Encodes the specified OrgPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.OrgPolicy.verify|verify} messages. + * @param message OrgPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrgPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrgPolicy.verify|verify} messages. + * @param message OrgPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrgPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrgPolicy + * @throws {Error} If the payload is not a reader 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.OrgPolicy; + + /** + * Decodes an OrgPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrgPolicy + * @throws {Error} If the payload is not 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.OrgPolicy; + + /** + * Verifies an OrgPolicy message. + * @param message Plain 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 OrgPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrgPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrgPolicy; + + /** + * Creates a plain object from an OrgPolicy message. Also converts values to other types if specified. + * @param message OrgPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.OrgPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrgPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrgPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Process. */ + interface IProcess { + + /** Process name */ + name?: (string|null); + + /** 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 name. */ + public name: string; + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 SecurityPosture. */ + interface ISecurityPosture { + + /** SecurityPosture name */ + name?: (string|null); + + /** SecurityPosture revisionId */ + revisionId?: (string|null); + + /** SecurityPosture postureDeploymentResource */ + postureDeploymentResource?: (string|null); + + /** SecurityPosture postureDeployment */ + postureDeployment?: (string|null); + + /** SecurityPosture changedPolicy */ + changedPolicy?: (string|null); + + /** SecurityPosture policySet */ + policySet?: (string|null); + + /** SecurityPosture policy */ + policy?: (string|null); + + /** SecurityPosture policyDriftDetails */ + policyDriftDetails?: (google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails[]|null); + } + + /** Represents a SecurityPosture. */ + class SecurityPosture implements ISecurityPosture { + + /** + * Constructs a new SecurityPosture. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISecurityPosture); + + /** SecurityPosture name. */ + public name: string; + + /** SecurityPosture revisionId. */ + public revisionId: string; + + /** SecurityPosture postureDeploymentResource. */ + public postureDeploymentResource: string; + + /** SecurityPosture postureDeployment. */ + public postureDeployment: string; + + /** SecurityPosture changedPolicy. */ + public changedPolicy: string; + + /** SecurityPosture policySet. */ + public policySet: string; + + /** SecurityPosture policy. */ + public policy: string; + + /** SecurityPosture policyDriftDetails. */ + public policyDriftDetails: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails[]; + + /** + * Creates a new SecurityPosture instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPosture instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISecurityPosture): google.cloud.securitycenter.v1.SecurityPosture; + + /** + * Encodes the specified SecurityPosture message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.verify|verify} messages. + * @param message SecurityPosture message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISecurityPosture, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPosture message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.verify|verify} messages. + * @param message SecurityPosture message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityPosture, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPosture message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPosture + * @throws {Error} If the payload is not a reader 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.SecurityPosture; + + /** + * Decodes a SecurityPosture message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPosture + * @throws {Error} If the payload is not 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.SecurityPosture; + + /** + * Verifies a SecurityPosture message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPosture message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPosture + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityPosture; + + /** + * Creates a plain object from a SecurityPosture message. Also converts values to other types if specified. + * @param message SecurityPosture + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SecurityPosture, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPosture to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityPosture + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecurityPosture { + + /** Properties of a PolicyDriftDetails. */ + interface IPolicyDriftDetails { + + /** PolicyDriftDetails field */ + field?: (string|null); + + /** PolicyDriftDetails expectedValue */ + expectedValue?: (string|null); + + /** PolicyDriftDetails detectedValue */ + detectedValue?: (string|null); + } + + /** Represents a PolicyDriftDetails. */ + class PolicyDriftDetails implements IPolicyDriftDetails { + + /** + * Constructs a new PolicyDriftDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails); + + /** PolicyDriftDetails field. */ + public field: string; + + /** PolicyDriftDetails expectedValue. */ + public expectedValue: string; + + /** PolicyDriftDetails detectedValue. */ + public detectedValue: string; + + /** + * Creates a new PolicyDriftDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDriftDetails instance + */ + public static create(properties?: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails): google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails; + + /** + * Encodes the specified PolicyDriftDetails message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify|verify} messages. + * @param message PolicyDriftDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDriftDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify|verify} messages. + * @param message PolicyDriftDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDriftDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDriftDetails + * @throws {Error} If the payload is not a reader 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.SecurityPosture.PolicyDriftDetails; + + /** + * Decodes a PolicyDriftDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDriftDetails + * @throws {Error} If the payload is not 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.SecurityPosture.PolicyDriftDetails; + + /** + * Verifies a PolicyDriftDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDriftDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDriftDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails; + + /** + * Creates a plain object from a PolicyDriftDetails message. Also converts values to other types if specified. + * @param message PolicyDriftDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDriftDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDriftDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToxicCombination. */ + interface IToxicCombination { + + /** ToxicCombination attackExposureScore */ + attackExposureScore?: (number|null); + + /** ToxicCombination relatedFindings */ + relatedFindings?: (string[]|null); + } + + /** Represents a ToxicCombination. */ + class ToxicCombination implements IToxicCombination { + + /** + * Constructs a new ToxicCombination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IToxicCombination); + + /** ToxicCombination attackExposureScore. */ + public attackExposureScore: number; + + /** ToxicCombination relatedFindings. */ + public relatedFindings: string[]; + + /** + * Creates a new ToxicCombination instance using the specified properties. + * @param [properties] Properties to set + * @returns ToxicCombination instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IToxicCombination): google.cloud.securitycenter.v1.ToxicCombination; + + /** + * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. + * @param message ToxicCombination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. + * @param message ToxicCombination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToxicCombination + * @throws {Error} If the payload is not a reader 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.ToxicCombination; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToxicCombination + * @throws {Error} If the payload is not 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.ToxicCombination; + + /** + * Verifies a ToxicCombination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToxicCombination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ToxicCombination; + + /** + * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. + * @param message ToxicCombination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ToxicCombination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToxicCombination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToxicCombination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Vulnerability. */ + interface IVulnerability { + + /** Vulnerability cve */ + cve?: (google.cloud.securitycenter.v1.ICve|null); + + /** Vulnerability offendingPackage */ + offendingPackage?: (google.cloud.securitycenter.v1.IPackage|null); + + /** Vulnerability fixedPackage */ + fixedPackage?: (google.cloud.securitycenter.v1.IPackage|null); + + /** Vulnerability securityBulletin */ + securityBulletin?: (google.cloud.securitycenter.v1.ISecurityBulletin|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); + + /** Vulnerability offendingPackage. */ + public offendingPackage?: (google.cloud.securitycenter.v1.IPackage|null); + + /** Vulnerability fixedPackage. */ + public fixedPackage?: (google.cloud.securitycenter.v1.IPackage|null); + + /** Vulnerability securityBulletin. */ + public securityBulletin?: (google.cloud.securitycenter.v1.ISecurityBulletin|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 }; + + /** + * 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. */ + 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); + + /** Cve upstreamFixAvailable */ + upstreamFixAvailable?: (boolean|null); + + /** Cve impact */ + impact?: (google.cloud.securitycenter.v1.Cve.RiskRating|keyof typeof google.cloud.securitycenter.v1.Cve.RiskRating|null); + + /** Cve exploitationActivity */ + exploitationActivity?: (google.cloud.securitycenter.v1.Cve.ExploitationActivity|keyof typeof google.cloud.securitycenter.v1.Cve.ExploitationActivity|null); + + /** Cve observedInTheWild */ + observedInTheWild?: (boolean|null); + + /** Cve zeroDay */ + zeroDay?: (boolean|null); + + /** Cve exploitReleaseDate */ + exploitReleaseDate?: (google.protobuf.ITimestamp|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); + + /** Cve upstreamFixAvailable. */ + public upstreamFixAvailable: boolean; + + /** Cve impact. */ + public impact: (google.cloud.securitycenter.v1.Cve.RiskRating|keyof typeof google.cloud.securitycenter.v1.Cve.RiskRating); + + /** Cve exploitationActivity. */ + public exploitationActivity: (google.cloud.securitycenter.v1.Cve.ExploitationActivity|keyof typeof google.cloud.securitycenter.v1.Cve.ExploitationActivity); + + /** Cve observedInTheWild. */ + public observedInTheWild: boolean; + + /** Cve zeroDay. */ + public zeroDay: boolean; + + /** Cve exploitReleaseDate. */ + public exploitReleaseDate?: (google.protobuf.ITimestamp|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 }; + + /** + * 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; + } + + namespace Cve { + + /** RiskRating enum. */ + enum RiskRating { + RISK_RATING_UNSPECIFIED = 0, + LOW = 1, + MEDIUM = 2, + HIGH = 3, + CRITICAL = 4 + } + + /** ExploitationActivity enum. */ + enum ExploitationActivity { + EXPLOITATION_ACTIVITY_UNSPECIFIED = 0, + WIDE = 1, + CONFIRMED = 2, + AVAILABLE = 3, + ANTICIPATED = 4, + NO_KNOWN = 5 + } + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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 Package. */ + interface IPackage { + + /** Package packageName */ + packageName?: (string|null); + + /** Package cpeUri */ + cpeUri?: (string|null); + + /** Package packageType */ + packageType?: (string|null); + + /** Package packageVersion */ + packageVersion?: (string|null); + } + + /** Represents a Package. */ + class Package implements IPackage { + + /** + * Constructs a new Package. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IPackage); + + /** Package packageName. */ + public packageName: string; + + /** Package cpeUri. */ + public cpeUri: string; + + /** Package packageType. */ + public packageType: string; + + /** Package packageVersion. */ + public packageVersion: string; + + /** + * Creates a new Package instance using the specified properties. + * @param [properties] Properties to set + * @returns Package instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IPackage): google.cloud.securitycenter.v1.Package; + + /** + * Encodes the specified Package message. Does not implicitly {@link google.cloud.securitycenter.v1.Package.verify|verify} messages. + * @param message Package message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Package message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Package.verify|verify} messages. + * @param message Package message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Package message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Package + * @throws {Error} If the payload is not a reader 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.Package; + + /** + * Decodes a Package message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Package + * @throws {Error} If the payload is not 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.Package; + + /** + * Verifies a Package message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Package message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Package + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Package; + + /** + * Creates a plain object from a Package message. Also converts values to other types if specified. + * @param message Package + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Package, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Package to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Package + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecurityBulletin. */ + interface ISecurityBulletin { + + /** SecurityBulletin bulletinId */ + bulletinId?: (string|null); + + /** SecurityBulletin submissionTime */ + submissionTime?: (google.protobuf.ITimestamp|null); + + /** SecurityBulletin suggestedUpgradeVersion */ + suggestedUpgradeVersion?: (string|null); + } + + /** Represents a SecurityBulletin. */ + class SecurityBulletin implements ISecurityBulletin { + + /** + * Constructs a new SecurityBulletin. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISecurityBulletin); + + /** SecurityBulletin bulletinId. */ + public bulletinId: string; + + /** SecurityBulletin submissionTime. */ + public submissionTime?: (google.protobuf.ITimestamp|null); + + /** SecurityBulletin suggestedUpgradeVersion. */ + public suggestedUpgradeVersion: string; + + /** + * Creates a new SecurityBulletin instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityBulletin instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISecurityBulletin): google.cloud.securitycenter.v1.SecurityBulletin; + + /** + * Encodes the specified SecurityBulletin message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityBulletin.verify|verify} messages. + * @param message SecurityBulletin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISecurityBulletin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityBulletin message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityBulletin.verify|verify} messages. + * @param message SecurityBulletin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityBulletin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityBulletin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityBulletin + * @throws {Error} If the payload is not a reader 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.SecurityBulletin; + + /** + * Decodes a SecurityBulletin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityBulletin + * @throws {Error} If the payload is not 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.SecurityBulletin; + + /** + * Verifies a SecurityBulletin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityBulletin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityBulletin + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityBulletin; + + /** + * Creates a plain object from a SecurityBulletin message. Also converts values to other types if specified. + * @param message SecurityBulletin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SecurityBulletin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityBulletin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityBulletin + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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); + + /** MuteConfig type */ + type?: (google.cloud.securitycenter.v1.MuteConfig.MuteConfigType|keyof typeof google.cloud.securitycenter.v1.MuteConfig.MuteConfigType|null); + + /** MuteConfig expiryTime */ + expiryTime?: (google.protobuf.ITimestamp|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; + + /** MuteConfig type. */ + public type: (google.cloud.securitycenter.v1.MuteConfig.MuteConfigType|keyof typeof google.cloud.securitycenter.v1.MuteConfig.MuteConfigType); + + /** MuteConfig expiryTime. */ + public expiryTime?: (google.protobuf.ITimestamp|null); + + /** + * 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 }; + + /** + * 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; + } + + namespace MuteConfig { + + /** MuteConfigType enum. */ + enum MuteConfigType { + MUTE_CONFIG_TYPE_UNSPECIFIED = 0, + STATIC = 1, + DYNAMIC = 2 + } + } + + /** Properties of a NotificationConfig. */ + interface INotificationConfig { + + /** NotificationConfig name */ + name?: (string|null); + + /** NotificationConfig description */ + description?: (string|null); + + /** NotificationConfig pubsubTopic */ + pubsubTopic?: (string|null); + + /** NotificationConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NotificationConfig streamingConfig */ + streamingConfig?: (google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null); + } + + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { + + /** + * Constructs a new NotificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.INotificationConfig); + + /** NotificationConfig name. */ + public name: string; + + /** NotificationConfig description. */ + public description: string; + + /** 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 NotificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.INotificationConfig): google.cloud.securitycenter.v1.NotificationConfig; + + /** + * 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.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.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.v1.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.v1.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.v1.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.v1.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationConfig to JSON. + * @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 { + + /** 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.v1.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.v1.NotificationConfig.IStreamingConfig): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; + + /** + * 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.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.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.v1.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.v1.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.v1.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.v1.NotificationConfig.StreamingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingConfig to JSON. + * @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; + } + } + + /** Properties of a NotificationMessage. */ + interface INotificationMessage { + + /** NotificationMessage notificationConfigName */ + notificationConfigName?: (string|null); + + /** NotificationMessage finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** NotificationMessage resource */ + resource?: (google.cloud.securitycenter.v1.IResource|null); + } + + /** Represents a NotificationMessage. */ + class NotificationMessage implements INotificationMessage { + + /** + * Constructs a new NotificationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.INotificationMessage); + + /** NotificationMessage notificationConfigName. */ + public notificationConfigName: string; + + /** 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"; + + /** + * Creates a new NotificationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationMessage instance + */ + public static create(properties?: google.cloud.securitycenter.v1.INotificationMessage): google.cloud.securitycenter.v1.NotificationMessage; + + /** + * 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.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.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.v1.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.v1.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.v1.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.v1.NotificationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationMessage to JSON. + * @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. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource displayName */ + displayName?: (string|null); + + /** Resource type */ + type?: (string|null); + + /** Resource project */ + project?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); + + /** Resource cloudProvider */ + cloudProvider?: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider|null); + + /** Resource organization */ + organization?: (string|null); + + /** Resource service */ + service?: (string|null); + + /** Resource location */ + location?: (string|null); + + /** Resource awsMetadata */ + awsMetadata?: (google.cloud.securitycenter.v1.IAwsMetadata|null); + + /** Resource azureMetadata */ + azureMetadata?: (google.cloud.securitycenter.v1.IAzureMetadata|null); + + /** Resource resourcePath */ + resourcePath?: (google.cloud.securitycenter.v1.IResourcePath|null); + + /** Resource resourcePathString */ + resourcePathString?: (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 displayName. */ + public displayName: string; + + /** Resource type. */ + public type: string; + + /** Resource project. */ + public project: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parent. */ + public parent: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + + /** Resource cloudProvider. */ + public cloudProvider: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider); + + /** Resource organization. */ + public organization: string; + + /** Resource service. */ + public service: string; + + /** Resource location. */ + public location: string; + + /** Resource awsMetadata. */ + public awsMetadata?: (google.cloud.securitycenter.v1.IAwsMetadata|null); + + /** Resource azureMetadata. */ + public azureMetadata?: (google.cloud.securitycenter.v1.IAzureMetadata|null); + + /** Resource resourcePath. */ + public resourcePath?: (google.cloud.securitycenter.v1.IResourcePath|null); + + /** Resource resourcePathString. */ + public resourcePathString: string; + + /** Resource cloudProviderMetadata. */ + public cloudProviderMetadata?: ("awsMetadata"|"azureMetadata"); + + /** + * 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 }; + + /** + * 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; + } + + /** CloudProvider enum. */ + enum CloudProvider { + CLOUD_PROVIDER_UNSPECIFIED = 0, + GOOGLE_CLOUD_PLATFORM = 1, + AMAZON_WEB_SERVICES = 2, + MICROSOFT_AZURE = 3 + } + + /** Properties of an AwsMetadata. */ + interface IAwsMetadata { + + /** AwsMetadata organization */ + organization?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization|null); + + /** AwsMetadata organizationalUnits */ + organizationalUnits?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit[]|null); + + /** AwsMetadata account */ + account?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount|null); + } + + /** Represents an AwsMetadata. */ + class AwsMetadata implements IAwsMetadata { + + /** + * Constructs a new AwsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAwsMetadata); + + /** AwsMetadata organization. */ + public organization?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization|null); + + /** AwsMetadata organizationalUnits. */ + public organizationalUnits: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit[]; + + /** AwsMetadata account. */ + public account?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount|null); + + /** + * Creates a new AwsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsMetadata instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAwsMetadata): google.cloud.securitycenter.v1.AwsMetadata; + + /** + * Encodes the specified AwsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.verify|verify} messages. + * @param message AwsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAwsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.verify|verify} messages. + * @param message AwsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAwsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsMetadata + * @throws {Error} If the payload is not a reader 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.AwsMetadata; + + /** + * Decodes an AwsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsMetadata + * @throws {Error} If the payload is not 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.AwsMetadata; + + /** + * Verifies an AwsMetadata message. + * @param message Plain 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 AwsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AwsMetadata; + + /** + * Creates a plain object from an AwsMetadata message. Also converts values to other types if specified. + * @param message AwsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AwsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AwsMetadata { + + /** Properties of an AwsOrganization. */ + interface IAwsOrganization { + + /** AwsOrganization id */ + id?: (string|null); + } + + /** Represents an AwsOrganization. */ + class AwsOrganization implements IAwsOrganization { + + /** + * Constructs a new AwsOrganization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization); + + /** AwsOrganization id. */ + public id: string; + + /** + * Creates a new AwsOrganization instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsOrganization instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization): google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization; + + /** + * Encodes the specified AwsOrganization message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify|verify} messages. + * @param message AwsOrganization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsOrganization message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify|verify} messages. + * @param message AwsOrganization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsOrganization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsOrganization + * @throws {Error} If the payload is not a reader 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.AwsMetadata.AwsOrganization; + + /** + * Decodes an AwsOrganization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsOrganization + * @throws {Error} If the payload is not 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.AwsMetadata.AwsOrganization; + + /** + * Verifies an AwsOrganization message. + * @param message Plain 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 AwsOrganization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsOrganization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization; + + /** + * Creates a plain object from an AwsOrganization message. Also converts values to other types if specified. + * @param message AwsOrganization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsOrganization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsOrganization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsOrganizationalUnit. */ + interface IAwsOrganizationalUnit { + + /** AwsOrganizationalUnit id */ + id?: (string|null); + + /** AwsOrganizationalUnit name */ + name?: (string|null); + } + + /** Represents an AwsOrganizationalUnit. */ + class AwsOrganizationalUnit implements IAwsOrganizationalUnit { + + /** + * Constructs a new AwsOrganizationalUnit. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit); + + /** AwsOrganizationalUnit id. */ + public id: string; + + /** AwsOrganizationalUnit name. */ + public name: string; + + /** + * Creates a new AwsOrganizationalUnit instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsOrganizationalUnit instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit): google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit; + + /** + * Encodes the specified AwsOrganizationalUnit message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. + * @param message AwsOrganizationalUnit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsOrganizationalUnit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. + * @param message AwsOrganizationalUnit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsOrganizationalUnit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsOrganizationalUnit + * @throws {Error} If the payload is not a reader 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.AwsMetadata.AwsOrganizationalUnit; + + /** + * Decodes an AwsOrganizationalUnit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsOrganizationalUnit + * @throws {Error} If the payload is not 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.AwsMetadata.AwsOrganizationalUnit; + + /** + * Verifies an AwsOrganizationalUnit message. + * @param message Plain 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 AwsOrganizationalUnit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsOrganizationalUnit + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit; + + /** + * Creates a plain object from an AwsOrganizationalUnit message. Also converts values to other types if specified. + * @param message AwsOrganizationalUnit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsOrganizationalUnit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsOrganizationalUnit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsAccount. */ + interface IAwsAccount { + + /** AwsAccount id */ + id?: (string|null); + + /** AwsAccount name */ + name?: (string|null); + } + + /** Represents an AwsAccount. */ + class AwsAccount implements IAwsAccount { + + /** + * Constructs a new AwsAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount); + + /** AwsAccount id. */ + public id: string; + + /** AwsAccount name. */ + public name: string; + + /** + * Creates a new AwsAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsAccount instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount): google.cloud.securitycenter.v1.AwsMetadata.AwsAccount; + + /** + * Encodes the specified AwsAccount message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify|verify} messages. + * @param message AwsAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsAccount message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify|verify} messages. + * @param message AwsAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsAccount + * @throws {Error} If the payload is not a reader 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.AwsMetadata.AwsAccount; + + /** + * Decodes an AwsAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsAccount + * @throws {Error} If the payload is not 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.AwsMetadata.AwsAccount; + + /** + * Verifies an AwsAccount message. + * @param message Plain 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 AwsAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AwsMetadata.AwsAccount; + + /** + * Creates a plain object from an AwsAccount message. Also converts values to other types if specified. + * @param message AwsAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AwsMetadata.AwsAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AzureMetadata. */ + interface IAzureMetadata { + + /** AzureMetadata managementGroups */ + managementGroups?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup[]|null); + + /** AzureMetadata subscription */ + subscription?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription|null); + + /** AzureMetadata resourceGroup */ + resourceGroup?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup|null); + } + + /** Represents an AzureMetadata. */ + class AzureMetadata implements IAzureMetadata { + + /** + * Constructs a new AzureMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAzureMetadata); + + /** AzureMetadata managementGroups. */ + public managementGroups: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup[]; + + /** AzureMetadata subscription. */ + public subscription?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription|null); + + /** AzureMetadata resourceGroup. */ + public resourceGroup?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup|null); + + /** + * Creates a new AzureMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureMetadata instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAzureMetadata): google.cloud.securitycenter.v1.AzureMetadata; + + /** + * Encodes the specified AzureMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.verify|verify} messages. + * @param message AzureMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAzureMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.verify|verify} messages. + * @param message AzureMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAzureMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureMetadata + * @throws {Error} If the payload is not a reader 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.AzureMetadata; + + /** + * Decodes an AzureMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureMetadata + * @throws {Error} If the payload is not 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.AzureMetadata; + + /** + * Verifies an AzureMetadata message. + * @param message Plain 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 AzureMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AzureMetadata; + + /** + * Creates a plain object from an AzureMetadata message. Also converts values to other types if specified. + * @param message AzureMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AzureMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AzureMetadata { + + /** Properties of an AzureManagementGroup. */ + interface IAzureManagementGroup { + + /** AzureManagementGroup id */ + id?: (string|null); + + /** AzureManagementGroup displayName */ + displayName?: (string|null); + } + + /** Represents an AzureManagementGroup. */ + class AzureManagementGroup implements IAzureManagementGroup { + + /** + * Constructs a new AzureManagementGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup); + + /** AzureManagementGroup id. */ + public id: string; + + /** AzureManagementGroup displayName. */ + public displayName: string; + + /** + * Creates a new AzureManagementGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureManagementGroup instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup): google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup; + + /** + * Encodes the specified AzureManagementGroup message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify|verify} messages. + * @param message AzureManagementGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureManagementGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify|verify} messages. + * @param message AzureManagementGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureManagementGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureManagementGroup + * @throws {Error} If the payload is not a reader 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.AzureMetadata.AzureManagementGroup; + + /** + * Decodes an AzureManagementGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureManagementGroup + * @throws {Error} If the payload is not 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.AzureMetadata.AzureManagementGroup; + + /** + * Verifies an AzureManagementGroup message. + * @param message Plain 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 AzureManagementGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureManagementGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup; + + /** + * Creates a plain object from an AzureManagementGroup message. Also converts values to other types if specified. + * @param message AzureManagementGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureManagementGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureManagementGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AzureSubscription. */ + interface IAzureSubscription { + + /** AzureSubscription id */ + id?: (string|null); + + /** AzureSubscription displayName */ + displayName?: (string|null); + } + + /** Represents an AzureSubscription. */ + class AzureSubscription implements IAzureSubscription { + + /** + * Constructs a new AzureSubscription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription); + + /** AzureSubscription id. */ + public id: string; + + /** AzureSubscription displayName. */ + public displayName: string; + + /** + * Creates a new AzureSubscription instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureSubscription instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription): google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription; + + /** + * Encodes the specified AzureSubscription message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify|verify} messages. + * @param message AzureSubscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureSubscription message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify|verify} messages. + * @param message AzureSubscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureSubscription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureSubscription + * @throws {Error} If the payload is not a reader 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.AzureMetadata.AzureSubscription; + + /** + * Decodes an AzureSubscription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureSubscription + * @throws {Error} If the payload is not 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.AzureMetadata.AzureSubscription; + + /** + * Verifies an AzureSubscription message. + * @param message Plain 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 AzureSubscription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureSubscription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription; + + /** + * Creates a plain object from an AzureSubscription message. Also converts values to other types if specified. + * @param message AzureSubscription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureSubscription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureSubscription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AzureResourceGroup. */ + interface IAzureResourceGroup { + + /** AzureResourceGroup name */ + name?: (string|null); + } + + /** Represents an AzureResourceGroup. */ + class AzureResourceGroup implements IAzureResourceGroup { + + /** + * Constructs a new AzureResourceGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup); + + /** AzureResourceGroup name. */ + public name: string; + + /** + * Creates a new AzureResourceGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureResourceGroup instance + */ + public static create(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup): google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup; + + /** + * Encodes the specified AzureResourceGroup message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify|verify} messages. + * @param message AzureResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureResourceGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify|verify} messages. + * @param message AzureResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureResourceGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureResourceGroup + * @throws {Error} If the payload is not a reader 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.AzureMetadata.AzureResourceGroup; + + /** + * Decodes an AzureResourceGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureResourceGroup + * @throws {Error} If the payload is not 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.AzureMetadata.AzureResourceGroup; + + /** + * Verifies an AzureResourceGroup message. + * @param message Plain 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 AzureResourceGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureResourceGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup; + + /** + * Creates a plain object from an AzureResourceGroup message. Also converts values to other types if specified. + * @param message AzureResourceGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureResourceGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureResourceGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ResourcePath. */ + interface IResourcePath { + + /** ResourcePath nodes */ + nodes?: (google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode[]|null); + } + + /** Represents a ResourcePath. */ + class ResourcePath implements IResourcePath { + + /** + * Constructs a new ResourcePath. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IResourcePath); + + /** ResourcePath nodes. */ + public nodes: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode[]; + + /** + * Creates a new ResourcePath instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePath instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IResourcePath): google.cloud.securitycenter.v1.ResourcePath; + + /** + * Encodes the specified ResourcePath message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.verify|verify} messages. + * @param message ResourcePath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IResourcePath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.verify|verify} messages. + * @param message ResourcePath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IResourcePath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePath + * @throws {Error} If the payload is not a reader 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.ResourcePath; + + /** + * Decodes a ResourcePath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePath + * @throws {Error} If the payload is not 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.ResourcePath; + + /** + * Verifies a ResourcePath message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePath + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourcePath; + + /** + * Creates a plain object from a ResourcePath message. Also converts values to other types if specified. + * @param message ResourcePath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ResourcePath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourcePath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourcePath { + + /** ResourcePathNodeType enum. */ + enum ResourcePathNodeType { + RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0, + GCP_ORGANIZATION = 1, + GCP_FOLDER = 2, + GCP_PROJECT = 3, + AWS_ORGANIZATION = 4, + AWS_ORGANIZATIONAL_UNIT = 5, + AWS_ACCOUNT = 6, + AZURE_MANAGEMENT_GROUP = 7, + AZURE_SUBSCRIPTION = 8, + AZURE_RESOURCE_GROUP = 9 + } + + /** Properties of a ResourcePathNode. */ + interface IResourcePathNode { + + /** ResourcePathNode nodeType */ + nodeType?: (google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType|keyof typeof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType|null); + + /** ResourcePathNode id */ + id?: (string|null); + + /** ResourcePathNode displayName */ + displayName?: (string|null); + } + + /** Represents a ResourcePathNode. */ + class ResourcePathNode implements IResourcePathNode { + + /** + * Constructs a new ResourcePathNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode); + + /** ResourcePathNode nodeType. */ + public nodeType: (google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType|keyof typeof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType); + + /** ResourcePathNode id. */ + public id: string; + + /** ResourcePathNode displayName. */ + public displayName: string; + + /** + * Creates a new ResourcePathNode instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePathNode instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode): google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode; + + /** + * Encodes the specified ResourcePathNode message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.verify|verify} messages. + * @param message ResourcePathNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.verify|verify} messages. + * @param message ResourcePathNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePathNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePathNode + * @throws {Error} If the payload is not a reader 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.ResourcePath.ResourcePathNode; + + /** + * Decodes a ResourcePathNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePathNode + * @throws {Error} If the payload is not 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.ResourcePath.ResourcePathNode; + + /** + * Verifies a ResourcePathNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePathNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePathNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode; + + /** + * Creates a plain object from a ResourcePathNode message. Also converts values to other types if specified. + * @param message ResourcePathNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePathNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourcePathNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * 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 { + + /** 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); + + /** AssetDiscoveryConfig folderIds */ + folderIds?: (string[]|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); + + /** AssetDiscoveryConfig folderIds. */ + public folderIds: 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; + + /** + * 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 }; + + /** + * 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 { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Properties of a ResourceValueConfig. */ + interface IResourceValueConfig { + + /** ResourceValueConfig name */ + name?: (string|null); + + /** ResourceValueConfig resourceValue */ + resourceValue?: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue|null); + + /** ResourceValueConfig tagValues */ + tagValues?: (string[]|null); + + /** ResourceValueConfig resourceType */ + resourceType?: (string|null); + + /** ResourceValueConfig scope */ + scope?: (string|null); + + /** ResourceValueConfig resourceLabelsSelector */ + resourceLabelsSelector?: ({ [k: string]: string }|null); + + /** ResourceValueConfig description */ + description?: (string|null); + + /** ResourceValueConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceValueConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceValueConfig cloudProvider */ + cloudProvider?: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider|null); + + /** ResourceValueConfig sensitiveDataProtectionMapping */ + sensitiveDataProtectionMapping?: (google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping|null); + } + + /** Represents a ResourceValueConfig. */ + class ResourceValueConfig implements IResourceValueConfig { + + /** + * Constructs a new ResourceValueConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IResourceValueConfig); + + /** ResourceValueConfig name. */ + public name: string; + + /** ResourceValueConfig resourceValue. */ + public resourceValue: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue); + + /** ResourceValueConfig tagValues. */ + public tagValues: string[]; + + /** ResourceValueConfig resourceType. */ + public resourceType: string; + + /** ResourceValueConfig scope. */ + public scope: string; + + /** ResourceValueConfig resourceLabelsSelector. */ + public resourceLabelsSelector: { [k: string]: string }; + + /** ResourceValueConfig description. */ + public description: string; + + /** ResourceValueConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceValueConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceValueConfig cloudProvider. */ + public cloudProvider: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider); + + /** ResourceValueConfig sensitiveDataProtectionMapping. */ + public sensitiveDataProtectionMapping?: (google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping|null); + + /** + * Creates a new ResourceValueConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceValueConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IResourceValueConfig): google.cloud.securitycenter.v1.ResourceValueConfig; + + /** + * Encodes the specified ResourceValueConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.verify|verify} messages. + * @param message ResourceValueConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IResourceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceValueConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.verify|verify} messages. + * @param message ResourceValueConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IResourceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceValueConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceValueConfig + * @throws {Error} If the payload is not a reader 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.ResourceValueConfig; + + /** + * Decodes a ResourceValueConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceValueConfig + * @throws {Error} If the payload is not 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.ResourceValueConfig; + + /** + * Verifies a ResourceValueConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceValueConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceValueConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourceValueConfig; + + /** + * Creates a plain object from a ResourceValueConfig message. Also converts values to other types if specified. + * @param message ResourceValueConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ResourceValueConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceValueConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceValueConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceValueConfig { + + /** Properties of a SensitiveDataProtectionMapping. */ + interface ISensitiveDataProtectionMapping { + + /** SensitiveDataProtectionMapping highSensitivityMapping */ + highSensitivityMapping?: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue|null); + + /** SensitiveDataProtectionMapping mediumSensitivityMapping */ + mediumSensitivityMapping?: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue|null); + } + + /** Represents a SensitiveDataProtectionMapping. */ + class SensitiveDataProtectionMapping implements ISensitiveDataProtectionMapping { + + /** + * Constructs a new SensitiveDataProtectionMapping. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping); + + /** SensitiveDataProtectionMapping highSensitivityMapping. */ + public highSensitivityMapping: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue); + + /** SensitiveDataProtectionMapping mediumSensitivityMapping. */ + public mediumSensitivityMapping: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue); + + /** + * Creates a new SensitiveDataProtectionMapping instance using the specified properties. + * @param [properties] Properties to set + * @returns SensitiveDataProtectionMapping instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping): google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping; + + /** + * Encodes the specified SensitiveDataProtectionMapping message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. + * @param message SensitiveDataProtectionMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SensitiveDataProtectionMapping message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. + * @param message SensitiveDataProtectionMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SensitiveDataProtectionMapping + * @throws {Error} If the payload is not a reader 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.ResourceValueConfig.SensitiveDataProtectionMapping; + + /** + * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SensitiveDataProtectionMapping + * @throws {Error} If the payload is not 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.ResourceValueConfig.SensitiveDataProtectionMapping; + + /** + * Verifies a SensitiveDataProtectionMapping message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SensitiveDataProtectionMapping message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SensitiveDataProtectionMapping + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping; + + /** + * Creates a plain object from a SensitiveDataProtectionMapping message. Also converts values to other types if specified. + * @param message SensitiveDataProtectionMapping + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SensitiveDataProtectionMapping to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SensitiveDataProtectionMapping + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ResourceValue enum. */ + enum ResourceValue { + RESOURCE_VALUE_UNSPECIFIED = 0, + HIGH = 1, + MEDIUM = 2, + LOW = 3, + NONE = 4 + } + + /** 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 }; + + /** + * 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 { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + + /** Properties of a SecurityHealthAnalyticsCustomModule. */ + interface ISecurityHealthAnalyticsCustomModule { + + /** SecurityHealthAnalyticsCustomModule name */ + name?: (string|null); + + /** SecurityHealthAnalyticsCustomModule displayName */ + displayName?: (string|null); + + /** SecurityHealthAnalyticsCustomModule enablementState */ + enablementState?: (google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState|null); + + /** SecurityHealthAnalyticsCustomModule updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** SecurityHealthAnalyticsCustomModule lastEditor */ + lastEditor?: (string|null); + + /** SecurityHealthAnalyticsCustomModule ancestorModule */ + ancestorModule?: (string|null); + + /** SecurityHealthAnalyticsCustomModule customConfig */ + customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); + } + + /** Represents a SecurityHealthAnalyticsCustomModule. */ + class SecurityHealthAnalyticsCustomModule implements ISecurityHealthAnalyticsCustomModule { + + /** + * Constructs a new SecurityHealthAnalyticsCustomModule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule); + + /** SecurityHealthAnalyticsCustomModule name. */ + public name: string; + + /** SecurityHealthAnalyticsCustomModule displayName. */ + public displayName: string; + + /** SecurityHealthAnalyticsCustomModule enablementState. */ + public enablementState: (google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState); + + /** SecurityHealthAnalyticsCustomModule updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** SecurityHealthAnalyticsCustomModule lastEditor. */ + public lastEditor: string; + + /** SecurityHealthAnalyticsCustomModule ancestorModule. */ + public ancestorModule: string; + + /** SecurityHealthAnalyticsCustomModule customConfig. */ + public customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); + + /** + * Creates a new SecurityHealthAnalyticsCustomModule instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityHealthAnalyticsCustomModule instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule): google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule; + + /** + * Encodes the specified SecurityHealthAnalyticsCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify|verify} messages. + * @param message SecurityHealthAnalyticsCustomModule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityHealthAnalyticsCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify|verify} messages. + * @param message SecurityHealthAnalyticsCustomModule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityHealthAnalyticsCustomModule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityHealthAnalyticsCustomModule + * @throws {Error} If the payload is not a reader 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.SecurityHealthAnalyticsCustomModule; + + /** + * Decodes a SecurityHealthAnalyticsCustomModule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityHealthAnalyticsCustomModule + * @throws {Error} If the payload is not 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.SecurityHealthAnalyticsCustomModule; + + /** + * Verifies a SecurityHealthAnalyticsCustomModule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityHealthAnalyticsCustomModule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityHealthAnalyticsCustomModule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule; + + /** + * Creates a plain object from a SecurityHealthAnalyticsCustomModule message. Also converts values to other types if specified. + * @param message SecurityHealthAnalyticsCustomModule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityHealthAnalyticsCustomModule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityHealthAnalyticsCustomModule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecurityHealthAnalyticsCustomModule { + + /** EnablementState enum. */ + enum EnablementState { + ENABLEMENT_STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + INHERITED = 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 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 CreateSecurityHealthAnalyticsCustomModule. + * @param request CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule + */ + public createSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModuleCallback): void; + + /** + * Calls CreateSecurityHealthAnalyticsCustomModule. + * @param request CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns Promise + */ + public createSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest): Promise; + + /** + * 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 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 + * @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 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 + * @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 DeleteSecurityHealthAnalyticsCustomModule. + * @param request DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModuleCallback): void; + + /** + * Calls DeleteSecurityHealthAnalyticsCustomModule. + * @param request DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns Promise + */ + public deleteSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest): Promise; + + /** + * Calls GetSimulation. + * @param request GetSimulationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Simulation + */ + public getSimulation(request: google.cloud.securitycenter.v1.IGetSimulationRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSimulationCallback): void; + + /** + * Calls GetSimulation. + * @param request GetSimulationRequest message or plain object + * @returns Promise + */ + public getSimulation(request: google.cloud.securitycenter.v1.IGetSimulationRequest): Promise; + + /** + * Calls GetValuedResource. + * @param request GetValuedResourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ValuedResource + */ + public getValuedResource(request: google.cloud.securitycenter.v1.IGetValuedResourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetValuedResourceCallback): void; + + /** + * Calls GetValuedResource. + * @param request GetValuedResourceRequest message or plain object + * @returns Promise + */ + public getValuedResource(request: google.cloud.securitycenter.v1.IGetValuedResourceRequest): 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 + * @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 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 + * @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 GetEffectiveSecurityHealthAnalyticsCustomModule. + * @param request GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EffectiveSecurityHealthAnalyticsCustomModule + */ + public getEffectiveSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModuleCallback): void; + + /** + * Calls GetEffectiveSecurityHealthAnalyticsCustomModule. + * @param request GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns Promise + */ + public getEffectiveSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest): Promise; + + /** + * Calls GetSecurityHealthAnalyticsCustomModule. + * @param request GetSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule + */ + public getSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModuleCallback): void; + + /** + * Calls GetSecurityHealthAnalyticsCustomModule. + * @param request GetSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns Promise + */ + public getSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest): 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 ListDescendantSecurityHealthAnalyticsCustomModules. + * @param request ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDescendantSecurityHealthAnalyticsCustomModulesResponse + */ + public listDescendantSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModulesCallback): void; + + /** + * Calls ListDescendantSecurityHealthAnalyticsCustomModules. + * @param request ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @returns Promise + */ + public listDescendantSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest): 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 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 + * @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 ListEffectiveSecurityHealthAnalyticsCustomModules. + * @param request ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + */ + public listEffectiveSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModulesCallback): void; + + /** + * Calls ListEffectiveSecurityHealthAnalyticsCustomModules. + * @param request ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @returns Promise + */ + public listEffectiveSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest): Promise; + + /** + * Calls ListSecurityHealthAnalyticsCustomModules. + * @param request ListSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSecurityHealthAnalyticsCustomModulesResponse + */ + public listSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModulesCallback): void; + + /** + * Calls ListSecurityHealthAnalyticsCustomModules. + * @param request ListSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @returns Promise + */ + public listSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest): 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 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 + * @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 SimulateSecurityHealthAnalyticsCustomModule. + * @param request SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SimulateSecurityHealthAnalyticsCustomModuleResponse + */ + public simulateSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModuleCallback): void; + + /** + * Calls SimulateSecurityHealthAnalyticsCustomModule. + * @param request SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns Promise + */ + public simulateSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest): 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 + * @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 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 + * @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 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 UpdateSecurityHealthAnalyticsCustomModule. + * @param request UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule + */ + public updateSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModuleCallback): void; + + /** + * Calls UpdateSecurityHealthAnalyticsCustomModule. + * @param request UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns Promise + */ + public updateSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest): 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; + + /** + * 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; + + /** + * Calls CreateEventThreatDetectionCustomModule. + * @param request CreateEventThreatDetectionCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule + */ + public createEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModuleCallback): void; + + /** + * Calls CreateEventThreatDetectionCustomModule. + * @param request CreateEventThreatDetectionCustomModuleRequest message or plain object + * @returns Promise + */ + public createEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest): Promise; + + /** + * Calls DeleteEventThreatDetectionCustomModule. + * @param request DeleteEventThreatDetectionCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModuleCallback): void; + + /** + * Calls DeleteEventThreatDetectionCustomModule. + * @param request DeleteEventThreatDetectionCustomModuleRequest message or plain object + * @returns Promise + */ + public deleteEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest): Promise; + + /** + * Calls GetEventThreatDetectionCustomModule. + * @param request GetEventThreatDetectionCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule + */ + public getEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModuleCallback): void; + + /** + * Calls GetEventThreatDetectionCustomModule. + * @param request GetEventThreatDetectionCustomModuleRequest message or plain object + * @returns Promise + */ + public getEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest): Promise; + + /** + * Calls ListDescendantEventThreatDetectionCustomModules. + * @param request ListDescendantEventThreatDetectionCustomModulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDescendantEventThreatDetectionCustomModulesResponse + */ + public listDescendantEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModulesCallback): void; + + /** + * Calls ListDescendantEventThreatDetectionCustomModules. + * @param request ListDescendantEventThreatDetectionCustomModulesRequest message or plain object + * @returns Promise + */ + public listDescendantEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest): Promise; + + /** + * Calls ListEventThreatDetectionCustomModules. + * @param request ListEventThreatDetectionCustomModulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEventThreatDetectionCustomModulesResponse + */ + public listEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModulesCallback): void; + + /** + * Calls ListEventThreatDetectionCustomModules. + * @param request ListEventThreatDetectionCustomModulesRequest message or plain object + * @returns Promise + */ + public listEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest): Promise; + + /** + * Calls UpdateEventThreatDetectionCustomModule. + * @param request UpdateEventThreatDetectionCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule + */ + public updateEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModuleCallback): void; + + /** + * Calls UpdateEventThreatDetectionCustomModule. + * @param request UpdateEventThreatDetectionCustomModuleRequest message or plain object + * @returns Promise + */ + public updateEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest): Promise; + + /** + * Calls ValidateEventThreatDetectionCustomModule. + * @param request ValidateEventThreatDetectionCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ValidateEventThreatDetectionCustomModuleResponse + */ + public validateEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModuleCallback): void; + + /** + * Calls ValidateEventThreatDetectionCustomModule. + * @param request ValidateEventThreatDetectionCustomModuleRequest message or plain object + * @returns Promise + */ + public validateEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest): Promise; + + /** + * Calls GetEffectiveEventThreatDetectionCustomModule. + * @param request GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EffectiveEventThreatDetectionCustomModule + */ + public getEffectiveEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModuleCallback): void; + + /** + * Calls GetEffectiveEventThreatDetectionCustomModule. + * @param request GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object + * @returns Promise + */ + public getEffectiveEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest): Promise; + + /** + * Calls ListEffectiveEventThreatDetectionCustomModules. + * @param request ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEffectiveEventThreatDetectionCustomModulesResponse + */ + public listEffectiveEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModulesCallback): void; + + /** + * Calls ListEffectiveEventThreatDetectionCustomModules. + * @param request ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object + * @returns Promise + */ + public listEffectiveEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest): Promise; + + /** + * Calls BatchCreateResourceValueConfigs. + * @param request BatchCreateResourceValueConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateResourceValueConfigsResponse + */ + public batchCreateResourceValueConfigs(request: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigsCallback): void; + + /** + * Calls BatchCreateResourceValueConfigs. + * @param request BatchCreateResourceValueConfigsRequest message or plain object + * @returns Promise + */ + public batchCreateResourceValueConfigs(request: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest): Promise; + + /** + * Calls DeleteResourceValueConfig. + * @param request DeleteResourceValueConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteResourceValueConfig(request: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfigCallback): void; + + /** + * Calls DeleteResourceValueConfig. + * @param request DeleteResourceValueConfigRequest message or plain object + * @returns Promise + */ + public deleteResourceValueConfig(request: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest): Promise; + + /** + * Calls GetResourceValueConfig. + * @param request GetResourceValueConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceValueConfig + */ + public getResourceValueConfig(request: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfigCallback): void; + + /** + * Calls GetResourceValueConfig. + * @param request GetResourceValueConfigRequest message or plain object + * @returns Promise + */ + public getResourceValueConfig(request: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest): Promise; + + /** + * Calls ListResourceValueConfigs. + * @param request ListResourceValueConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListResourceValueConfigsResponse + */ + public listResourceValueConfigs(request: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigsCallback): void; + + /** + * Calls ListResourceValueConfigs. + * @param request ListResourceValueConfigsRequest message or plain object + * @returns Promise + */ + public listResourceValueConfigs(request: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest): Promise; + + /** + * Calls UpdateResourceValueConfig. + * @param request UpdateResourceValueConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceValueConfig + */ + public updateResourceValueConfig(request: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfigCallback): void; + + /** + * Calls UpdateResourceValueConfig. + * @param request UpdateResourceValueConfigRequest message or plain object + * @returns Promise + */ + public updateResourceValueConfig(request: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest): Promise; + + /** + * Calls ListValuedResources. + * @param request ListValuedResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListValuedResourcesResponse + */ + public listValuedResources(request: google.cloud.securitycenter.v1.IListValuedResourcesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListValuedResourcesCallback): void; + + /** + * Calls ListValuedResources. + * @param request ListValuedResourcesRequest message or plain object + * @returns Promise + */ + public listValuedResources(request: google.cloud.securitycenter.v1.IListValuedResourcesRequest): Promise; + + /** + * Calls ListAttackPaths. + * @param request ListAttackPathsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAttackPathsResponse + */ + public listAttackPaths(request: google.cloud.securitycenter.v1.IListAttackPathsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListAttackPathsCallback): void; + + /** + * Calls ListAttackPaths. + * @param request ListAttackPathsRequest message or plain object + * @returns Promise + */ + public listAttackPaths(request: google.cloud.securitycenter.v1.IListAttackPathsRequest): Promise; + } + + 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|createSecurityHealthAnalyticsCustomModule}. + * @param error Error, if any + * @param [response] SecurityHealthAnalyticsCustomModule + */ + type CreateSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => void; + + /** + * 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|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 + * @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}. + * @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 + * @param [response] Empty + */ + type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteSecurityHealthAnalyticsCustomModule}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSimulation}. + * @param error Error, if any + * @param [response] Simulation + */ + type GetSimulationCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Simulation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getValuedResource}. + * @param error Error, if any + * @param [response] ValuedResource + */ + type GetValuedResourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ValuedResource) => 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 + * @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}. + * @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 + * @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|getEffectiveSecurityHealthAnalyticsCustomModule}. + * @param error Error, if any + * @param [response] EffectiveSecurityHealthAnalyticsCustomModule + */ + type GetEffectiveSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSecurityHealthAnalyticsCustomModule}. + * @param error Error, if any + * @param [response] SecurityHealthAnalyticsCustomModule + */ + type GetSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => 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|listDescendantSecurityHealthAnalyticsCustomModules}. + * @param error Error, if any + * @param [response] ListDescendantSecurityHealthAnalyticsCustomModulesResponse + */ + type ListDescendantSecurityHealthAnalyticsCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse) => 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|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 + * @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|listEffectiveSecurityHealthAnalyticsCustomModules}. + * @param error Error, if any + * @param [response] ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + */ + type ListEffectiveSecurityHealthAnalyticsCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listSecurityHealthAnalyticsCustomModules}. + * @param error Error, if any + * @param [response] ListSecurityHealthAnalyticsCustomModulesResponse + */ + type ListSecurityHealthAnalyticsCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse) => 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|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 + * @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|simulateSecurityHealthAnalyticsCustomModule}. + * @param error Error, if any + * @param [response] SimulateSecurityHealthAnalyticsCustomModuleResponse + */ + type SimulateSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse) => 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 + * @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}. + * @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 + * @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}. + * @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|updateSecurityHealthAnalyticsCustomModule}. + * @param error Error, if any + * @param [response] SecurityHealthAnalyticsCustomModule + */ + type UpdateSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => 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; + + /** + * 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; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createEventThreatDetectionCustomModule}. + * @param error Error, if any + * @param [response] EventThreatDetectionCustomModule + */ + type CreateEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteEventThreatDetectionCustomModule}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getEventThreatDetectionCustomModule}. + * @param error Error, if any + * @param [response] EventThreatDetectionCustomModule + */ + type GetEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listDescendantEventThreatDetectionCustomModules}. + * @param error Error, if any + * @param [response] ListDescendantEventThreatDetectionCustomModulesResponse + */ + type ListDescendantEventThreatDetectionCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listEventThreatDetectionCustomModules}. + * @param error Error, if any + * @param [response] ListEventThreatDetectionCustomModulesResponse + */ + type ListEventThreatDetectionCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateEventThreatDetectionCustomModule}. + * @param error Error, if any + * @param [response] EventThreatDetectionCustomModule + */ + type UpdateEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|validateEventThreatDetectionCustomModule}. + * @param error Error, if any + * @param [response] ValidateEventThreatDetectionCustomModuleResponse + */ + type ValidateEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getEffectiveEventThreatDetectionCustomModule}. + * @param error Error, if any + * @param [response] EffectiveEventThreatDetectionCustomModule + */ + type GetEffectiveEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listEffectiveEventThreatDetectionCustomModules}. + * @param error Error, if any + * @param [response] ListEffectiveEventThreatDetectionCustomModulesResponse + */ + type ListEffectiveEventThreatDetectionCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|batchCreateResourceValueConfigs}. + * @param error Error, if any + * @param [response] BatchCreateResourceValueConfigsResponse + */ + type BatchCreateResourceValueConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteResourceValueConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteResourceValueConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getResourceValueConfig}. + * @param error Error, if any + * @param [response] ResourceValueConfig + */ + type GetResourceValueConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ResourceValueConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listResourceValueConfigs}. + * @param error Error, if any + * @param [response] ListResourceValueConfigsResponse + */ + type ListResourceValueConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListResourceValueConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateResourceValueConfig}. + * @param error Error, if any + * @param [response] ResourceValueConfig + */ + type UpdateResourceValueConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ResourceValueConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listValuedResources}. + * @param error Error, if any + * @param [response] ListValuedResourcesResponse + */ + type ListValuedResourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListValuedResourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listAttackPaths}. + * @param error Error, if any + * @param [response] ListAttackPathsResponse + */ + type ListAttackPathsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAttackPathsResponse) => void; + } + + /** Properties of a BulkMuteFindingsRequest. */ + interface IBulkMuteFindingsRequest { + + /** BulkMuteFindingsRequest parent */ + parent?: (string|null); + + /** BulkMuteFindingsRequest filter */ + filter?: (string|null); + + /** BulkMuteFindingsRequest muteAnnotation */ + muteAnnotation?: (string|null); + + /** BulkMuteFindingsRequest muteState */ + muteState?: (google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState|keyof typeof google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState|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; + + /** BulkMuteFindingsRequest muteState. */ + public muteState: (google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState|keyof typeof google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState); + + /** + * 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 }; + + /** + * 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; + } + + namespace BulkMuteFindingsRequest { + + /** MuteState enum. */ + enum MuteState { + MUTE_STATE_UNSPECIFIED = 0, + MUTED = 1, + UNDEFINED = 2 + } + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 CreateResourceValueConfigRequest. */ + interface ICreateResourceValueConfigRequest { + + /** CreateResourceValueConfigRequest parent */ + parent?: (string|null); + + /** CreateResourceValueConfigRequest resourceValueConfig */ + resourceValueConfig?: (google.cloud.securitycenter.v1.IResourceValueConfig|null); + } + + /** Represents a CreateResourceValueConfigRequest. */ + class CreateResourceValueConfigRequest implements ICreateResourceValueConfigRequest { + + /** + * Constructs a new CreateResourceValueConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest); + + /** CreateResourceValueConfigRequest parent. */ + public parent: string; + + /** CreateResourceValueConfigRequest resourceValueConfig. */ + public resourceValueConfig?: (google.cloud.securitycenter.v1.IResourceValueConfig|null); + + /** + * Creates a new CreateResourceValueConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateResourceValueConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest): google.cloud.securitycenter.v1.CreateResourceValueConfigRequest; + + /** + * Encodes the specified CreateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify|verify} messages. + * @param message CreateResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify|verify} messages. + * @param message CreateResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader 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.CreateResourceValueConfigRequest; + + /** + * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateResourceValueConfigRequest + * @throws {Error} If the payload is not 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.CreateResourceValueConfigRequest; + + /** + * Verifies a CreateResourceValueConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateResourceValueConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateResourceValueConfigRequest; + + /** + * Creates a plain object from a CreateResourceValueConfigRequest message. Also converts values to other types if specified. + * @param message CreateResourceValueConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateResourceValueConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateResourceValueConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateResourceValueConfigsRequest. */ + interface IBatchCreateResourceValueConfigsRequest { + + /** BatchCreateResourceValueConfigsRequest parent */ + parent?: (string|null); + + /** BatchCreateResourceValueConfigsRequest requests */ + requests?: (google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest[]|null); + } + + /** Represents a BatchCreateResourceValueConfigsRequest. */ + class BatchCreateResourceValueConfigsRequest implements IBatchCreateResourceValueConfigsRequest { + + /** + * Constructs a new BatchCreateResourceValueConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest); + + /** BatchCreateResourceValueConfigsRequest parent. */ + public parent: string; + + /** BatchCreateResourceValueConfigsRequest requests. */ + public requests: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest[]; + + /** + * Creates a new BatchCreateResourceValueConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateResourceValueConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest): google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest; + + /** + * Encodes the specified BatchCreateResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.verify|verify} messages. + * @param message BatchCreateResourceValueConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.verify|verify} messages. + * @param message BatchCreateResourceValueConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader 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.BatchCreateResourceValueConfigsRequest; + + /** + * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateResourceValueConfigsRequest + * @throws {Error} If the payload is not 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.BatchCreateResourceValueConfigsRequest; + + /** + * Verifies a BatchCreateResourceValueConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateResourceValueConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest; + + /** + * Creates a plain object from a BatchCreateResourceValueConfigsRequest message. Also converts values to other types if specified. + * @param message BatchCreateResourceValueConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateResourceValueConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateResourceValueConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateResourceValueConfigsResponse. */ + interface IBatchCreateResourceValueConfigsResponse { + + /** BatchCreateResourceValueConfigsResponse resourceValueConfigs */ + resourceValueConfigs?: (google.cloud.securitycenter.v1.IResourceValueConfig[]|null); + } + + /** Represents a BatchCreateResourceValueConfigsResponse. */ + class BatchCreateResourceValueConfigsResponse implements IBatchCreateResourceValueConfigsResponse { + + /** + * Constructs a new BatchCreateResourceValueConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse); + + /** BatchCreateResourceValueConfigsResponse resourceValueConfigs. */ + public resourceValueConfigs: google.cloud.securitycenter.v1.IResourceValueConfig[]; + + /** + * Creates a new BatchCreateResourceValueConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateResourceValueConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse): google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse; + + /** + * Encodes the specified BatchCreateResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.verify|verify} messages. + * @param message BatchCreateResourceValueConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.verify|verify} messages. + * @param message BatchCreateResourceValueConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader 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.BatchCreateResourceValueConfigsResponse; + + /** + * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateResourceValueConfigsResponse + * @throws {Error} If the payload is not 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.BatchCreateResourceValueConfigsResponse; + + /** + * Verifies a BatchCreateResourceValueConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateResourceValueConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse; + + /** + * Creates a plain object from a BatchCreateResourceValueConfigsResponse message. Also converts values to other types if specified. + * @param message BatchCreateResourceValueConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateResourceValueConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateResourceValueConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteResourceValueConfigRequest. */ + interface IDeleteResourceValueConfigRequest { + + /** DeleteResourceValueConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteResourceValueConfigRequest. */ + class DeleteResourceValueConfigRequest implements IDeleteResourceValueConfigRequest { + + /** + * Constructs a new DeleteResourceValueConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest); + + /** DeleteResourceValueConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteResourceValueConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteResourceValueConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest): google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest; + + /** + * Encodes the specified DeleteResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest.verify|verify} messages. + * @param message DeleteResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest.verify|verify} messages. + * @param message DeleteResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteResourceValueConfigRequest + * @throws {Error} If the payload is not a reader 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.DeleteResourceValueConfigRequest; + + /** + * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteResourceValueConfigRequest + * @throws {Error} If the payload is not 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.DeleteResourceValueConfigRequest; + + /** + * Verifies a DeleteResourceValueConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteResourceValueConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest; + + /** + * Creates a plain object from a DeleteResourceValueConfigRequest message. Also converts values to other types if specified. + * @param message DeleteResourceValueConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteResourceValueConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteResourceValueConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetResourceValueConfigRequest. */ + interface IGetResourceValueConfigRequest { + + /** GetResourceValueConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetResourceValueConfigRequest. */ + class GetResourceValueConfigRequest implements IGetResourceValueConfigRequest { + + /** + * Constructs a new GetResourceValueConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest); + + /** GetResourceValueConfigRequest name. */ + public name: string; + + /** + * Creates a new GetResourceValueConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetResourceValueConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest): google.cloud.securitycenter.v1.GetResourceValueConfigRequest; + + /** + * Encodes the specified GetResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetResourceValueConfigRequest.verify|verify} messages. + * @param message GetResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetResourceValueConfigRequest.verify|verify} messages. + * @param message GetResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetResourceValueConfigRequest + * @throws {Error} If the payload is not a reader 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.GetResourceValueConfigRequest; + + /** + * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetResourceValueConfigRequest + * @throws {Error} If the payload is not 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.GetResourceValueConfigRequest; + + /** + * Verifies a GetResourceValueConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetResourceValueConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetResourceValueConfigRequest; + + /** + * Creates a plain object from a GetResourceValueConfigRequest message. Also converts values to other types if specified. + * @param message GetResourceValueConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetResourceValueConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetResourceValueConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceValueConfigsRequest. */ + interface IListResourceValueConfigsRequest { + + /** ListResourceValueConfigsRequest parent */ + parent?: (string|null); + + /** ListResourceValueConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListResourceValueConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListResourceValueConfigsRequest. */ + class ListResourceValueConfigsRequest implements IListResourceValueConfigsRequest { + + /** + * Constructs a new ListResourceValueConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest); + + /** ListResourceValueConfigsRequest parent. */ + public parent: string; + + /** ListResourceValueConfigsRequest pageSize. */ + public pageSize: number; + + /** ListResourceValueConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListResourceValueConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceValueConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest): google.cloud.securitycenter.v1.ListResourceValueConfigsRequest; + + /** + * Encodes the specified ListResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsRequest.verify|verify} messages. + * @param message ListResourceValueConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsRequest.verify|verify} messages. + * @param message ListResourceValueConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader 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.ListResourceValueConfigsRequest; + + /** + * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceValueConfigsRequest + * @throws {Error} If the payload is not 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.ListResourceValueConfigsRequest; + + /** + * Verifies a ListResourceValueConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceValueConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListResourceValueConfigsRequest; + + /** + * Creates a plain object from a ListResourceValueConfigsRequest message. Also converts values to other types if specified. + * @param message ListResourceValueConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListResourceValueConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceValueConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceValueConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceValueConfigsResponse. */ + interface IListResourceValueConfigsResponse { + + /** ListResourceValueConfigsResponse resourceValueConfigs */ + resourceValueConfigs?: (google.cloud.securitycenter.v1.IResourceValueConfig[]|null); + + /** ListResourceValueConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListResourceValueConfigsResponse. */ + class ListResourceValueConfigsResponse implements IListResourceValueConfigsResponse { + + /** + * Constructs a new ListResourceValueConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListResourceValueConfigsResponse); + + /** ListResourceValueConfigsResponse resourceValueConfigs. */ + public resourceValueConfigs: google.cloud.securitycenter.v1.IResourceValueConfig[]; + + /** ListResourceValueConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListResourceValueConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceValueConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListResourceValueConfigsResponse): google.cloud.securitycenter.v1.ListResourceValueConfigsResponse; + + /** + * Encodes the specified ListResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.verify|verify} messages. + * @param message ListResourceValueConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.verify|verify} messages. + * @param message ListResourceValueConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader 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.ListResourceValueConfigsResponse; + + /** + * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceValueConfigsResponse + * @throws {Error} If the payload is not 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.ListResourceValueConfigsResponse; + + /** + * Verifies a ListResourceValueConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceValueConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListResourceValueConfigsResponse; + + /** + * Creates a plain object from a ListResourceValueConfigsResponse message. Also converts values to other types if specified. + * @param message ListResourceValueConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListResourceValueConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceValueConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceValueConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateResourceValueConfigRequest. */ + interface IUpdateResourceValueConfigRequest { + + /** UpdateResourceValueConfigRequest resourceValueConfig */ + resourceValueConfig?: (google.cloud.securitycenter.v1.IResourceValueConfig|null); + + /** UpdateResourceValueConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateResourceValueConfigRequest. */ + class UpdateResourceValueConfigRequest implements IUpdateResourceValueConfigRequest { + + /** + * Constructs a new UpdateResourceValueConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest); + + /** UpdateResourceValueConfigRequest resourceValueConfig. */ + public resourceValueConfig?: (google.cloud.securitycenter.v1.IResourceValueConfig|null); + + /** UpdateResourceValueConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateResourceValueConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateResourceValueConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest): google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest; + + /** + * Encodes the specified UpdateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.verify|verify} messages. + * @param message UpdateResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.verify|verify} messages. + * @param message UpdateResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader 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.UpdateResourceValueConfigRequest; + + /** + * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateResourceValueConfigRequest + * @throws {Error} If the payload is not 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.UpdateResourceValueConfigRequest; + + /** + * Verifies an UpdateResourceValueConfigRequest message. + * @param message Plain 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 UpdateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateResourceValueConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest; + + /** + * Creates a plain object from an UpdateResourceValueConfigRequest message. Also converts values to other types if specified. + * @param message UpdateResourceValueConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateResourceValueConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateResourceValueConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 { + + /** + * Constructs a new CreateNotificationConfigRequest. + * @param [properties] Properties to set + */ + 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); + + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; + + /** + * 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 static encode(message: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.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.v1.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.v1.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.v1.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.v1.CreateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @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 CreateSecurityHealthAnalyticsCustomModuleRequest. */ + interface ICreateSecurityHealthAnalyticsCustomModuleRequest { + + /** CreateSecurityHealthAnalyticsCustomModuleRequest parent */ + parent?: (string|null); + + /** CreateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule */ + securityHealthAnalyticsCustomModule?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null); + } + + /** Represents a CreateSecurityHealthAnalyticsCustomModuleRequest. */ + class CreateSecurityHealthAnalyticsCustomModuleRequest implements ICreateSecurityHealthAnalyticsCustomModuleRequest { + + /** + * Constructs a new CreateSecurityHealthAnalyticsCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest); + + /** CreateSecurityHealthAnalyticsCustomModuleRequest parent. */ + public parent: string; + + /** CreateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule. */ + public securityHealthAnalyticsCustomModule?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null); + + /** + * Creates a new CreateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecurityHealthAnalyticsCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Encodes the specified CreateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.CreateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Decodes a CreateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not 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.CreateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Verifies a CreateSecurityHealthAnalyticsCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecurityHealthAnalyticsCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Creates a plain object from a CreateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @param message CreateSecurityHealthAnalyticsCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecurityHealthAnalyticsCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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.v1.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.v1.IDeleteNotificationConfigRequest): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + + /** + * 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.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.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.v1.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.v1.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.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 }; + + /** + * 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 DeleteSecurityHealthAnalyticsCustomModuleRequest. */ + interface IDeleteSecurityHealthAnalyticsCustomModuleRequest { + + /** DeleteSecurityHealthAnalyticsCustomModuleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSecurityHealthAnalyticsCustomModuleRequest. */ + class DeleteSecurityHealthAnalyticsCustomModuleRequest implements IDeleteSecurityHealthAnalyticsCustomModuleRequest { + + /** + * Constructs a new DeleteSecurityHealthAnalyticsCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest); + + /** DeleteSecurityHealthAnalyticsCustomModuleRequest name. */ + public name: string; + + /** + * Creates a new DeleteSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSecurityHealthAnalyticsCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Encodes the specified DeleteSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.DeleteSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Decodes a DeleteSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not 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.DeleteSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Verifies a DeleteSecurityHealthAnalyticsCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSecurityHealthAnalyticsCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Creates a plain object from a DeleteSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @param message DeleteSecurityHealthAnalyticsCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSecurityHealthAnalyticsCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBigQueryExportRequest. */ + interface IGetBigQueryExportRequest { + + /** GetBigQueryExportRequest name */ + name?: (string|null); + } + + /** Represents a GetBigQueryExportRequest. */ + class GetBigQueryExportRequest implements IGetBigQueryExportRequest { + + /** + * Constructs a new GetBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetBigQueryExportRequest); + + /** GetBigQueryExportRequest name. */ + public name: string; + + /** + * Creates a new GetBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetBigQueryExportRequest): google.cloud.securitycenter.v1.GetBigQueryExportRequest; + + /** + * 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.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.GetBigQueryExportRequest; + + /** + * Decodes a GetBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.GetBigQueryExportRequest; + + /** + * 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 GetBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetBigQueryExportRequest; + + /** + * 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.GetBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBigQueryExportRequest to JSON. + * @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. */ + 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.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 }; + + /** + * 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. */ + 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); + + /** 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.v1.IGetNotificationConfigRequest): google.cloud.securitycenter.v1.GetNotificationConfigRequest; + + /** + * 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.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.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.v1.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.v1.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.v1.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.v1.GetNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNotificationConfigRequest to JSON. + * @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. */ + 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 }; + + /** + * 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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. */ + interface IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest { + + /** GetEffectiveSecurityHealthAnalyticsCustomModuleRequest name */ + name?: (string|null); + } + + /** Represents a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. */ + class GetEffectiveSecurityHealthAnalyticsCustomModuleRequest implements IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest { + + /** + * Constructs a new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest); + + /** GetEffectiveSecurityHealthAnalyticsCustomModuleRequest name. */ + public name: string; + + /** + * Creates a new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEffectiveSecurityHealthAnalyticsCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Encodes the specified GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Decodes a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not 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.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Verifies a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Creates a plain object from a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @param message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEffectiveSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSecurityHealthAnalyticsCustomModuleRequest. */ + interface IGetSecurityHealthAnalyticsCustomModuleRequest { + + /** GetSecurityHealthAnalyticsCustomModuleRequest name */ + name?: (string|null); + } + + /** Represents a GetSecurityHealthAnalyticsCustomModuleRequest. */ + class GetSecurityHealthAnalyticsCustomModuleRequest implements IGetSecurityHealthAnalyticsCustomModuleRequest { + + /** + * Constructs a new GetSecurityHealthAnalyticsCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest); + + /** GetSecurityHealthAnalyticsCustomModuleRequest name. */ + public name: string; + + /** + * Creates a new GetSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSecurityHealthAnalyticsCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Encodes the specified GetSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message GetSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message GetSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.GetSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Decodes a GetSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not 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.GetSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Verifies a GetSecurityHealthAnalyticsCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSecurityHealthAnalyticsCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Creates a plain object from a GetSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @param message GetSecurityHealthAnalyticsCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSecurityHealthAnalyticsCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 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 }; + + /** + * 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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest. */ + interface IListDescendantSecurityHealthAnalyticsCustomModulesRequest { + + /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest parent */ + parent?: (string|null); + + /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageSize */ + pageSize?: (number|null); + + /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDescendantSecurityHealthAnalyticsCustomModulesRequest. */ + class ListDescendantSecurityHealthAnalyticsCustomModulesRequest implements IListDescendantSecurityHealthAnalyticsCustomModulesRequest { + + /** + * Constructs a new ListDescendantSecurityHealthAnalyticsCustomModulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest); + + /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest parent. */ + public parent: string; + + /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageSize. */ + public pageSize: number; + + /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDescendantSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDescendantSecurityHealthAnalyticsCustomModulesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest): google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @param message ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @param message ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader 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.ListDescendantSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not 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.ListDescendantSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Verifies a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDescendantSecurityHealthAnalyticsCustomModulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Creates a plain object from a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. + * @param message ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDescendantSecurityHealthAnalyticsCustomModulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDescendantSecurityHealthAnalyticsCustomModulesResponse. */ + interface IListDescendantSecurityHealthAnalyticsCustomModulesResponse { + + /** ListDescendantSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules */ + securityHealthAnalyticsCustomModules?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]|null); + + /** ListDescendantSecurityHealthAnalyticsCustomModulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDescendantSecurityHealthAnalyticsCustomModulesResponse. */ + class ListDescendantSecurityHealthAnalyticsCustomModulesResponse implements IListDescendantSecurityHealthAnalyticsCustomModulesResponse { + + /** + * Constructs a new ListDescendantSecurityHealthAnalyticsCustomModulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse); + + /** ListDescendantSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules. */ + public securityHealthAnalyticsCustomModules: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]; + + /** ListDescendantSecurityHealthAnalyticsCustomModulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDescendantSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDescendantSecurityHealthAnalyticsCustomModulesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse): google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @param message ListDescendantSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @param message ListDescendantSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader 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.ListDescendantSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not 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.ListDescendantSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Verifies a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDescendantSecurityHealthAnalyticsCustomModulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Creates a plain object from a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. + * @param message ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDescendantSecurityHealthAnalyticsCustomModulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListValuedResourcesRequest. */ + interface IListValuedResourcesRequest { + + /** ListValuedResourcesRequest parent */ + parent?: (string|null); + + /** ListValuedResourcesRequest filter */ + filter?: (string|null); + + /** ListValuedResourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListValuedResourcesRequest pageSize */ + pageSize?: (number|null); + + /** ListValuedResourcesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListValuedResourcesRequest. */ + class ListValuedResourcesRequest implements IListValuedResourcesRequest { + + /** + * Constructs a new ListValuedResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListValuedResourcesRequest); + + /** ListValuedResourcesRequest parent. */ + public parent: string; + + /** ListValuedResourcesRequest filter. */ + public filter: string; + + /** ListValuedResourcesRequest pageToken. */ + public pageToken: string; + + /** ListValuedResourcesRequest pageSize. */ + public pageSize: number; + + /** ListValuedResourcesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListValuedResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValuedResourcesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListValuedResourcesRequest): google.cloud.securitycenter.v1.ListValuedResourcesRequest; + + /** + * Encodes the specified ListValuedResourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesRequest.verify|verify} messages. + * @param message ListValuedResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListValuedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValuedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesRequest.verify|verify} messages. + * @param message ListValuedResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListValuedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValuedResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValuedResourcesRequest + * @throws {Error} If the payload is not a reader 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.ListValuedResourcesRequest; + + /** + * Decodes a ListValuedResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValuedResourcesRequest + * @throws {Error} If the payload is not 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.ListValuedResourcesRequest; + + /** + * Verifies a ListValuedResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValuedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValuedResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListValuedResourcesRequest; + + /** + * Creates a plain object from a ListValuedResourcesRequest message. Also converts values to other types if specified. + * @param message ListValuedResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListValuedResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValuedResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValuedResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListValuedResourcesResponse. */ + interface IListValuedResourcesResponse { + + /** ListValuedResourcesResponse valuedResources */ + valuedResources?: (google.cloud.securitycenter.v1.IValuedResource[]|null); + + /** ListValuedResourcesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListValuedResourcesResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListValuedResourcesResponse. */ + class ListValuedResourcesResponse implements IListValuedResourcesResponse { + + /** + * Constructs a new ListValuedResourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListValuedResourcesResponse); + + /** ListValuedResourcesResponse valuedResources. */ + public valuedResources: google.cloud.securitycenter.v1.IValuedResource[]; + + /** ListValuedResourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListValuedResourcesResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListValuedResourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValuedResourcesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListValuedResourcesResponse): google.cloud.securitycenter.v1.ListValuedResourcesResponse; + + /** + * Encodes the specified ListValuedResourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesResponse.verify|verify} messages. + * @param message ListValuedResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListValuedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValuedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesResponse.verify|verify} messages. + * @param message ListValuedResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListValuedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValuedResourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValuedResourcesResponse + * @throws {Error} If the payload is not a reader 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.ListValuedResourcesResponse; + + /** + * Decodes a ListValuedResourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValuedResourcesResponse + * @throws {Error} If the payload is not 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.ListValuedResourcesResponse; + + /** + * Verifies a ListValuedResourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValuedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValuedResourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListValuedResourcesResponse; + + /** + * Creates a plain object from a ListValuedResourcesResponse message. Also converts values to other types if specified. + * @param message ListValuedResourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListValuedResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValuedResourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValuedResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttackPathsRequest. */ + interface IListAttackPathsRequest { + + /** ListAttackPathsRequest parent */ + parent?: (string|null); + + /** ListAttackPathsRequest filter */ + filter?: (string|null); + + /** ListAttackPathsRequest pageToken */ + pageToken?: (string|null); + + /** ListAttackPathsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAttackPathsRequest. */ + class ListAttackPathsRequest implements IListAttackPathsRequest { + + /** + * Constructs a new ListAttackPathsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListAttackPathsRequest); + + /** ListAttackPathsRequest parent. */ + public parent: string; + + /** ListAttackPathsRequest filter. */ + public filter: string; + + /** ListAttackPathsRequest pageToken. */ + public pageToken: string; + + /** ListAttackPathsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListAttackPathsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttackPathsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListAttackPathsRequest): google.cloud.securitycenter.v1.ListAttackPathsRequest; + + /** + * Encodes the specified ListAttackPathsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsRequest.verify|verify} messages. + * @param message ListAttackPathsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListAttackPathsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttackPathsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsRequest.verify|verify} messages. + * @param message ListAttackPathsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAttackPathsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttackPathsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttackPathsRequest + * @throws {Error} If the payload is not a reader 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.ListAttackPathsRequest; + + /** + * Decodes a ListAttackPathsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttackPathsRequest + * @throws {Error} If the payload is not 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.ListAttackPathsRequest; + + /** + * Verifies a ListAttackPathsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttackPathsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttackPathsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAttackPathsRequest; + + /** + * Creates a plain object from a ListAttackPathsRequest message. Also converts values to other types if specified. + * @param message ListAttackPathsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListAttackPathsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttackPathsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttackPathsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttackPathsResponse. */ + interface IListAttackPathsResponse { + + /** ListAttackPathsResponse attackPaths */ + attackPaths?: (google.cloud.securitycenter.v1.IAttackPath[]|null); + + /** ListAttackPathsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAttackPathsResponse. */ + class ListAttackPathsResponse implements IListAttackPathsResponse { + + /** + * Constructs a new ListAttackPathsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListAttackPathsResponse); + + /** ListAttackPathsResponse attackPaths. */ + public attackPaths: google.cloud.securitycenter.v1.IAttackPath[]; + + /** ListAttackPathsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAttackPathsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttackPathsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListAttackPathsResponse): google.cloud.securitycenter.v1.ListAttackPathsResponse; + + /** + * Encodes the specified ListAttackPathsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsResponse.verify|verify} messages. + * @param message ListAttackPathsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListAttackPathsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttackPathsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsResponse.verify|verify} messages. + * @param message ListAttackPathsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAttackPathsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttackPathsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttackPathsResponse + * @throws {Error} If the payload is not a reader 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.ListAttackPathsResponse; + + /** + * Decodes a ListAttackPathsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttackPathsResponse + * @throws {Error} If the payload is not 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.ListAttackPathsResponse; + + /** + * Verifies a ListAttackPathsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttackPathsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttackPathsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAttackPathsResponse; + + /** + * Creates a plain object from a ListAttackPathsResponse message. Also converts values to other types if specified. + * @param message ListAttackPathsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListAttackPathsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttackPathsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttackPathsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSimulationRequest. */ + interface IGetSimulationRequest { + + /** GetSimulationRequest name */ + name?: (string|null); + } + + /** Represents a GetSimulationRequest. */ + class GetSimulationRequest implements IGetSimulationRequest { + + /** + * Constructs a new GetSimulationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetSimulationRequest); + + /** GetSimulationRequest name. */ + public name: string; + + /** + * Creates a new GetSimulationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSimulationRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetSimulationRequest): google.cloud.securitycenter.v1.GetSimulationRequest; + + /** + * Encodes the specified GetSimulationRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSimulationRequest.verify|verify} messages. + * @param message GetSimulationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetSimulationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSimulationRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSimulationRequest.verify|verify} messages. + * @param message GetSimulationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetSimulationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSimulationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSimulationRequest + * @throws {Error} If the payload is not a reader 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.GetSimulationRequest; + + /** + * Decodes a GetSimulationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSimulationRequest + * @throws {Error} If the payload is not 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.GetSimulationRequest; + + /** + * Verifies a GetSimulationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSimulationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSimulationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetSimulationRequest; + + /** + * Creates a plain object from a GetSimulationRequest message. Also converts values to other types if specified. + * @param message GetSimulationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetSimulationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSimulationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSimulationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetValuedResourceRequest. */ + interface IGetValuedResourceRequest { + + /** GetValuedResourceRequest name */ + name?: (string|null); + } + + /** Represents a GetValuedResourceRequest. */ + class GetValuedResourceRequest implements IGetValuedResourceRequest { + + /** + * Constructs a new GetValuedResourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetValuedResourceRequest); + + /** GetValuedResourceRequest name. */ + public name: string; + + /** + * Creates a new GetValuedResourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetValuedResourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetValuedResourceRequest): google.cloud.securitycenter.v1.GetValuedResourceRequest; + + /** + * Encodes the specified GetValuedResourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetValuedResourceRequest.verify|verify} messages. + * @param message GetValuedResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetValuedResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetValuedResourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetValuedResourceRequest.verify|verify} messages. + * @param message GetValuedResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetValuedResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetValuedResourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetValuedResourceRequest + * @throws {Error} If the payload is not a reader 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.GetValuedResourceRequest; + + /** + * Decodes a GetValuedResourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetValuedResourceRequest + * @throws {Error} If the payload is not 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.GetValuedResourceRequest; + + /** + * Verifies a GetValuedResourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetValuedResourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetValuedResourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetValuedResourceRequest; + + /** + * Creates a plain object from a GetValuedResourceRequest message. Also converts values to other types if specified. + * @param message GetValuedResourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetValuedResourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetValuedResourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetValuedResourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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.v1.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.v1.IListNotificationConfigsRequest): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; + + /** + * 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.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.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.v1.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.v1.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.v1.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.v1.ListNotificationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsRequest to JSON. + * @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. */ + interface IListNotificationConfigsResponse { + + /** ListNotificationConfigsResponse notificationConfigs */ + notificationConfigs?: (google.cloud.securitycenter.v1.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.v1.IListNotificationConfigsResponse); + + /** ListNotificationConfigsResponse notificationConfigs. */ + public notificationConfigs: google.cloud.securitycenter.v1.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.v1.IListNotificationConfigsResponse): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; + + /** + * 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.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.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.v1.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.v1.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.v1.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.v1.ListNotificationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. */ + interface IListEffectiveSecurityHealthAnalyticsCustomModulesRequest { + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest parent */ + parent?: (string|null); + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageSize */ + pageSize?: (number|null); + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. */ + class ListEffectiveSecurityHealthAnalyticsCustomModulesRequest implements IListEffectiveSecurityHealthAnalyticsCustomModulesRequest { + + /** + * Constructs a new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest); + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest parent. */ + public parent: string; + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageSize. */ + public pageSize: number; + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest): google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader 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.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not 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.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Verifies a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Creates a plain object from a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. + * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEffectiveSecurityHealthAnalyticsCustomModulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. */ + interface IListEffectiveSecurityHealthAnalyticsCustomModulesResponse { + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesResponse effectiveSecurityHealthAnalyticsCustomModules */ + effectiveSecurityHealthAnalyticsCustomModules?: (google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[]|null); + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. */ + class ListEffectiveSecurityHealthAnalyticsCustomModulesResponse implements IListEffectiveSecurityHealthAnalyticsCustomModulesResponse { + + /** + * Constructs a new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse); + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesResponse effectiveSecurityHealthAnalyticsCustomModules. */ + public effectiveSecurityHealthAnalyticsCustomModules: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[]; + + /** ListEffectiveSecurityHealthAnalyticsCustomModulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse): google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader 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.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not 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.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Verifies a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Creates a plain object from a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. + * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEffectiveSecurityHealthAnalyticsCustomModulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecurityHealthAnalyticsCustomModulesRequest. */ + interface IListSecurityHealthAnalyticsCustomModulesRequest { + + /** ListSecurityHealthAnalyticsCustomModulesRequest parent */ + parent?: (string|null); + + /** ListSecurityHealthAnalyticsCustomModulesRequest pageSize */ + pageSize?: (number|null); + + /** ListSecurityHealthAnalyticsCustomModulesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSecurityHealthAnalyticsCustomModulesRequest. */ + class ListSecurityHealthAnalyticsCustomModulesRequest implements IListSecurityHealthAnalyticsCustomModulesRequest { + + /** + * Constructs a new ListSecurityHealthAnalyticsCustomModulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest); + + /** ListSecurityHealthAnalyticsCustomModulesRequest parent. */ + public parent: string; + + /** ListSecurityHealthAnalyticsCustomModulesRequest pageSize. */ + public pageSize: number; + + /** ListSecurityHealthAnalyticsCustomModulesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecurityHealthAnalyticsCustomModulesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest): google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Encodes the specified ListSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @param message ListSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @param message ListSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader 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.ListSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Decodes a ListSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not 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.ListSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Verifies a ListSecurityHealthAnalyticsCustomModulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecurityHealthAnalyticsCustomModulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest; + + /** + * Creates a plain object from a ListSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. + * @param message ListSecurityHealthAnalyticsCustomModulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecurityHealthAnalyticsCustomModulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecurityHealthAnalyticsCustomModulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecurityHealthAnalyticsCustomModulesResponse. */ + interface IListSecurityHealthAnalyticsCustomModulesResponse { + + /** ListSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules */ + securityHealthAnalyticsCustomModules?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]|null); + + /** ListSecurityHealthAnalyticsCustomModulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSecurityHealthAnalyticsCustomModulesResponse. */ + class ListSecurityHealthAnalyticsCustomModulesResponse implements IListSecurityHealthAnalyticsCustomModulesResponse { + + /** + * Constructs a new ListSecurityHealthAnalyticsCustomModulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse); + + /** ListSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules. */ + public securityHealthAnalyticsCustomModules: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]; + + /** ListSecurityHealthAnalyticsCustomModulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecurityHealthAnalyticsCustomModulesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse): google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Encodes the specified ListSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @param message ListSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @param message ListSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader 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.ListSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Decodes a ListSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not 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.ListSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Verifies a ListSecurityHealthAnalyticsCustomModulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecurityHealthAnalyticsCustomModulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse; + + /** + * Creates a plain object from a ListSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. + * @param message ListSecurityHealthAnalyticsCustomModulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecurityHealthAnalyticsCustomModulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecurityHealthAnalyticsCustomModulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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|keyof typeof 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|keyof typeof 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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|keyof typeof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null); + + /** ListFindingsResult resource */ + resource?: (google.cloud.securitycenter.v1.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.v1.ListFindingsResponse.IListFindingsResult); + + /** ListFindingsResult finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** 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); + + /** + * 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 }; + + /** + * 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 { + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + CHANGED = 1, + UNCHANGED = 2, + ADDED = 3, + REMOVED = 4 + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource displayName */ + displayName?: (string|null); + + /** Resource type */ + type?: (string|null); + + /** Resource projectName */ + projectName?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parentName */ + parentName?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); + + /** Resource cloudProvider */ + cloudProvider?: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider|null); + + /** Resource organization */ + organization?: (string|null); + + /** Resource service */ + service?: (string|null); + + /** Resource location */ + location?: (string|null); + + /** Resource awsMetadata */ + awsMetadata?: (google.cloud.securitycenter.v1.IAwsMetadata|null); + + /** Resource azureMetadata */ + azureMetadata?: (google.cloud.securitycenter.v1.IAzureMetadata|null); + + /** Resource resourcePath */ + resourcePath?: (google.cloud.securitycenter.v1.IResourcePath|null); + + /** Resource resourcePathString */ + resourcePathString?: (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 displayName. */ + public displayName: string; + + /** Resource type. */ + public type: string; + + /** Resource projectName. */ + public projectName: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parentName. */ + public parentName: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + + /** Resource cloudProvider. */ + public cloudProvider: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider); + + /** Resource organization. */ + public organization: string; + + /** Resource service. */ + public service: string; + + /** Resource location. */ + public location: string; + + /** Resource awsMetadata. */ + public awsMetadata?: (google.cloud.securitycenter.v1.IAwsMetadata|null); + + /** Resource azureMetadata. */ + public azureMetadata?: (google.cloud.securitycenter.v1.IAzureMetadata|null); + + /** Resource resourcePath. */ + public resourcePath?: (google.cloud.securitycenter.v1.IResourcePath|null); + + /** Resource resourcePathString. */ + public resourcePathString: string; + + /** Resource cloudProviderMetadata. */ + public cloudProviderMetadata?: ("awsMetadata"|"azureMetadata"); + + /** + * 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 }; + + /** + * 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 a SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1.Finding.State|keyof typeof 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|keyof typeof 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 a SimulateSecurityHealthAnalyticsCustomModuleRequest. */ + interface ISimulateSecurityHealthAnalyticsCustomModuleRequest { + + /** SimulateSecurityHealthAnalyticsCustomModuleRequest parent */ + parent?: (string|null); + + /** SimulateSecurityHealthAnalyticsCustomModuleRequest customConfig */ + customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); + + /** SimulateSecurityHealthAnalyticsCustomModuleRequest resource */ + resource?: (google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource|null); + } + + /** Represents a SimulateSecurityHealthAnalyticsCustomModuleRequest. */ + class SimulateSecurityHealthAnalyticsCustomModuleRequest implements ISimulateSecurityHealthAnalyticsCustomModuleRequest { + + /** + * Constructs a new SimulateSecurityHealthAnalyticsCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest); + + /** SimulateSecurityHealthAnalyticsCustomModuleRequest parent. */ + public parent: string; + + /** SimulateSecurityHealthAnalyticsCustomModuleRequest customConfig. */ + public customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); + + /** SimulateSecurityHealthAnalyticsCustomModuleRequest resource. */ + public resource?: (google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource|null); + + /** + * Creates a new SimulateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SimulateSecurityHealthAnalyticsCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SimulateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimulateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.SimulateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Decodes a SimulateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimulateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not 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.SimulateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Verifies a SimulateSecurityHealthAnalyticsCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SimulateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimulateSecurityHealthAnalyticsCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Creates a plain object from a SimulateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @param message SimulateSecurityHealthAnalyticsCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SimulateSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SimulateSecurityHealthAnalyticsCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SimulateSecurityHealthAnalyticsCustomModuleRequest { + + /** Properties of a SimulatedResource. */ + interface ISimulatedResource { + + /** SimulatedResource resourceType */ + resourceType?: (string|null); + + /** SimulatedResource resourceData */ + resourceData?: (google.protobuf.IStruct|null); + + /** SimulatedResource iamPolicyData */ + iamPolicyData?: (google.iam.v1.IPolicy|null); + } + + /** Represents a SimulatedResource. */ + class SimulatedResource implements ISimulatedResource { + + /** + * Constructs a new SimulatedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource); + + /** SimulatedResource resourceType. */ + public resourceType: string; + + /** SimulatedResource resourceData. */ + public resourceData?: (google.protobuf.IStruct|null); + + /** SimulatedResource iamPolicyData. */ + public iamPolicyData?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new SimulatedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns SimulatedResource instance + */ + public static create(properties?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource; + + /** + * Encodes the specified SimulatedResource message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify|verify} messages. + * @param message SimulatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SimulatedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify|verify} messages. + * @param message SimulatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SimulatedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimulatedResource + * @throws {Error} If the payload is not a reader 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.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource; + + /** + * Decodes a SimulatedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimulatedResource + * @throws {Error} If the payload is not 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.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource; + + /** + * Verifies a SimulatedResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SimulatedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimulatedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource; + + /** + * Creates a plain object from a SimulatedResource message. Also converts values to other types if specified. + * @param message SimulatedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SimulatedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SimulatedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SimulateSecurityHealthAnalyticsCustomModuleResponse. */ + interface ISimulateSecurityHealthAnalyticsCustomModuleResponse { + + /** SimulateSecurityHealthAnalyticsCustomModuleResponse result */ + result?: (google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult|null); + } + + /** Represents a SimulateSecurityHealthAnalyticsCustomModuleResponse. */ + class SimulateSecurityHealthAnalyticsCustomModuleResponse implements ISimulateSecurityHealthAnalyticsCustomModuleResponse { + + /** + * Constructs a new SimulateSecurityHealthAnalyticsCustomModuleResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse); + + /** SimulateSecurityHealthAnalyticsCustomModuleResponse result. */ + public result?: (google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult|null); + + /** + * Creates a new SimulateSecurityHealthAnalyticsCustomModuleResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SimulateSecurityHealthAnalyticsCustomModuleResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse; + + /** + * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.verify|verify} messages. + * @param message SimulateSecurityHealthAnalyticsCustomModuleResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.verify|verify} messages. + * @param message SimulateSecurityHealthAnalyticsCustomModuleResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SimulateSecurityHealthAnalyticsCustomModuleResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimulateSecurityHealthAnalyticsCustomModuleResponse + * @throws {Error} If the payload is not a reader 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.SimulateSecurityHealthAnalyticsCustomModuleResponse; + + /** + * Decodes a SimulateSecurityHealthAnalyticsCustomModuleResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimulateSecurityHealthAnalyticsCustomModuleResponse + * @throws {Error} If the payload is not 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.SimulateSecurityHealthAnalyticsCustomModuleResponse; + + /** + * Verifies a SimulateSecurityHealthAnalyticsCustomModuleResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SimulateSecurityHealthAnalyticsCustomModuleResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimulateSecurityHealthAnalyticsCustomModuleResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse; + + /** + * Creates a plain object from a SimulateSecurityHealthAnalyticsCustomModuleResponse message. Also converts values to other types if specified. + * @param message SimulateSecurityHealthAnalyticsCustomModuleResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SimulateSecurityHealthAnalyticsCustomModuleResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SimulateSecurityHealthAnalyticsCustomModuleResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SimulateSecurityHealthAnalyticsCustomModuleResponse { + + /** Properties of a SimulatedResult. */ + interface ISimulatedResult { + + /** SimulatedResult finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** SimulatedResult noViolation */ + noViolation?: (google.protobuf.IEmpty|null); + + /** SimulatedResult error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a SimulatedResult. */ + class SimulatedResult implements ISimulatedResult { + + /** + * Constructs a new SimulatedResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult); + + /** SimulatedResult finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** SimulatedResult noViolation. */ + public noViolation?: (google.protobuf.IEmpty|null); + + /** SimulatedResult error. */ + public error?: (google.rpc.IStatus|null); + + /** SimulatedResult result. */ + public result?: ("finding"|"noViolation"|"error"); + + /** + * Creates a new SimulatedResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SimulatedResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult; + + /** + * Encodes the specified SimulatedResult message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify|verify} messages. + * @param message SimulatedResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SimulatedResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify|verify} messages. + * @param message SimulatedResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SimulatedResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimulatedResult + * @throws {Error} If the payload is not a reader 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.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult; + + /** + * Decodes a SimulatedResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimulatedResult + * @throws {Error} If the payload is not 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.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult; + + /** + * Verifies a SimulatedResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SimulatedResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimulatedResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult; + + /** + * Creates a plain object from a SimulatedResult message. Also converts values to other types if specified. + * @param message SimulatedResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SimulatedResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SimulatedResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 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.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.v1.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.v1.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.v1.UpdateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateNotificationConfigRequest to JSON. + * @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 { + + /** 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 }; + + /** + * 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 UpdateSecurityHealthAnalyticsCustomModuleRequest. */ + interface IUpdateSecurityHealthAnalyticsCustomModuleRequest { + + /** UpdateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule */ + securityHealthAnalyticsCustomModule?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null); + + /** UpdateSecurityHealthAnalyticsCustomModuleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSecurityHealthAnalyticsCustomModuleRequest. */ + class UpdateSecurityHealthAnalyticsCustomModuleRequest implements IUpdateSecurityHealthAnalyticsCustomModuleRequest { + + /** + * Constructs a new UpdateSecurityHealthAnalyticsCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest); + + /** UpdateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule. */ + public securityHealthAnalyticsCustomModule?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null); + + /** UpdateSecurityHealthAnalyticsCustomModuleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityHealthAnalyticsCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Encodes the specified UpdateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @param message UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.UpdateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Decodes an UpdateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not 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.UpdateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Verifies an UpdateSecurityHealthAnalyticsCustomModuleRequest message. + * @param message Plain 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 UpdateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityHealthAnalyticsCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest; + + /** + * Creates a plain object from an UpdateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityHealthAnalyticsCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecurityHealthAnalyticsCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + interface ICreateBigQueryExportRequest { + + /** CreateBigQueryExportRequest parent */ + parent?: (string|null); + + /** CreateBigQueryExportRequest bigQueryExport */ + bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); + + /** CreateBigQueryExportRequest bigQueryExportId */ + bigQueryExportId?: (string|null); + } + + /** Represents a CreateBigQueryExportRequest. */ + class CreateBigQueryExportRequest implements ICreateBigQueryExportRequest { + + /** + * Constructs a new CreateBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest); + + /** CreateBigQueryExportRequest parent. */ + public parent: string; + + /** CreateBigQueryExportRequest bigQueryExport. */ + public bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); + + /** CreateBigQueryExportRequest bigQueryExportId. */ + public bigQueryExportId: string; + + /** + * Creates a new CreateBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; + + /** + * 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.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.CreateBigQueryExportRequest; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.CreateBigQueryExportRequest; + + /** + * 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 CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; + + /** + * 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.CreateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBigQueryExportRequest to JSON. + * @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. */ + interface IUpdateBigQueryExportRequest { + + /** UpdateBigQueryExportRequest bigQueryExport */ + bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); + + /** UpdateBigQueryExportRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBigQueryExportRequest. */ + class UpdateBigQueryExportRequest implements IUpdateBigQueryExportRequest { + + /** + * Constructs a new UpdateBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest); + + /** UpdateBigQueryExportRequest bigQueryExport. */ + public bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); + + /** UpdateBigQueryExportRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; + + /** + * 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.v1.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.v1.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.v1.UpdateBigQueryExportRequest; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.v1.UpdateBigQueryExportRequest; + + /** + * 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 UpdateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; + + /** + * 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.v1.UpdateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBigQueryExportRequest to JSON. + * @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. */ + interface IListBigQueryExportsRequest { + + /** ListBigQueryExportsRequest parent */ + parent?: (string|null); + + /** ListBigQueryExportsRequest pageSize */ + pageSize?: (number|null); + + /** ListBigQueryExportsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBigQueryExportsRequest. */ + class ListBigQueryExportsRequest implements IListBigQueryExportsRequest { + + /** + * Constructs a new ListBigQueryExportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsRequest); + + /** ListBigQueryExportsRequest parent. */ + public parent: string; + + /** ListBigQueryExportsRequest pageSize. */ + public pageSize: number; + + /** ListBigQueryExportsRequest pageToken. */ + public pageToken: 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 CreateEventThreatDetectionCustomModuleRequest. */ + interface ICreateEventThreatDetectionCustomModuleRequest { + + /** CreateEventThreatDetectionCustomModuleRequest parent */ + parent?: (string|null); + + /** CreateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule */ + eventThreatDetectionCustomModule?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null); + } + + /** Represents a CreateEventThreatDetectionCustomModuleRequest. */ + class CreateEventThreatDetectionCustomModuleRequest implements ICreateEventThreatDetectionCustomModuleRequest { + + /** + * Constructs a new CreateEventThreatDetectionCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest); + + /** CreateEventThreatDetectionCustomModuleRequest parent. */ + public parent: string; + + /** CreateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule. */ + public eventThreatDetectionCustomModule?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null); + + /** + * Creates a new CreateEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEventThreatDetectionCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest; + + /** + * Encodes the specified CreateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message CreateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message CreateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.CreateEventThreatDetectionCustomModuleRequest; + + /** + * Decodes a CreateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not 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.CreateEventThreatDetectionCustomModuleRequest; + + /** + * Verifies a CreateEventThreatDetectionCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEventThreatDetectionCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest; + + /** + * Creates a plain object from a CreateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @param message CreateEventThreatDetectionCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEventThreatDetectionCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEventThreatDetectionCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateEventThreatDetectionCustomModuleRequest. */ + interface IValidateEventThreatDetectionCustomModuleRequest { + + /** ValidateEventThreatDetectionCustomModuleRequest parent */ + parent?: (string|null); + + /** ValidateEventThreatDetectionCustomModuleRequest rawText */ + rawText?: (string|null); + + /** ValidateEventThreatDetectionCustomModuleRequest type */ + type?: (string|null); + } + + /** Represents a ValidateEventThreatDetectionCustomModuleRequest. */ + class ValidateEventThreatDetectionCustomModuleRequest implements IValidateEventThreatDetectionCustomModuleRequest { + + /** + * Constructs a new ValidateEventThreatDetectionCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest); + + /** ValidateEventThreatDetectionCustomModuleRequest parent. */ + public parent: string; + + /** ValidateEventThreatDetectionCustomModuleRequest rawText. */ + public rawText: string; + + /** ValidateEventThreatDetectionCustomModuleRequest type. */ + public type: string; + + /** + * Creates a new ValidateEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateEventThreatDetectionCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest; + + /** + * Encodes the specified ValidateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message ValidateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message ValidateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.ValidateEventThreatDetectionCustomModuleRequest; + + /** + * Decodes a ValidateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not 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.ValidateEventThreatDetectionCustomModuleRequest; + + /** + * Verifies a ValidateEventThreatDetectionCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateEventThreatDetectionCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest; + + /** + * Creates a plain object from a ValidateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @param message ValidateEventThreatDetectionCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateEventThreatDetectionCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateEventThreatDetectionCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateEventThreatDetectionCustomModuleResponse. */ + interface IValidateEventThreatDetectionCustomModuleResponse { + + /** ValidateEventThreatDetectionCustomModuleResponse errors */ + errors?: (google.cloud.securitycenter.v1.ICustomModuleValidationErrors|null); + } + + /** Represents a ValidateEventThreatDetectionCustomModuleResponse. */ + class ValidateEventThreatDetectionCustomModuleResponse implements IValidateEventThreatDetectionCustomModuleResponse { + + /** + * Constructs a new ValidateEventThreatDetectionCustomModuleResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse); + + /** ValidateEventThreatDetectionCustomModuleResponse errors. */ + public errors?: (google.cloud.securitycenter.v1.ICustomModuleValidationErrors|null); + + /** + * Creates a new ValidateEventThreatDetectionCustomModuleResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateEventThreatDetectionCustomModuleResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse): google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse; + + /** + * Encodes the specified ValidateEventThreatDetectionCustomModuleResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.verify|verify} messages. + * @param message ValidateEventThreatDetectionCustomModuleResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateEventThreatDetectionCustomModuleResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.verify|verify} messages. + * @param message ValidateEventThreatDetectionCustomModuleResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateEventThreatDetectionCustomModuleResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateEventThreatDetectionCustomModuleResponse + * @throws {Error} If the payload is not a reader 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.ValidateEventThreatDetectionCustomModuleResponse; + + /** + * Decodes a ValidateEventThreatDetectionCustomModuleResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateEventThreatDetectionCustomModuleResponse + * @throws {Error} If the payload is not 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.ValidateEventThreatDetectionCustomModuleResponse; + + /** + * Verifies a ValidateEventThreatDetectionCustomModuleResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidateEventThreatDetectionCustomModuleResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateEventThreatDetectionCustomModuleResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse; + + /** + * Creates a plain object from a ValidateEventThreatDetectionCustomModuleResponse message. Also converts values to other types if specified. + * @param message ValidateEventThreatDetectionCustomModuleResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateEventThreatDetectionCustomModuleResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateEventThreatDetectionCustomModuleResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEventThreatDetectionCustomModuleRequest. */ + interface IDeleteEventThreatDetectionCustomModuleRequest { + + /** DeleteEventThreatDetectionCustomModuleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEventThreatDetectionCustomModuleRequest. */ + class DeleteEventThreatDetectionCustomModuleRequest implements IDeleteEventThreatDetectionCustomModuleRequest { + + /** + * Constructs a new DeleteEventThreatDetectionCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest); + + /** DeleteEventThreatDetectionCustomModuleRequest name. */ + public name: string; + + /** + * Creates a new DeleteEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEventThreatDetectionCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest; + + /** + * Encodes the specified DeleteEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message DeleteEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message DeleteEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.DeleteEventThreatDetectionCustomModuleRequest; + + /** + * Decodes a DeleteEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not 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.DeleteEventThreatDetectionCustomModuleRequest; + + /** + * Verifies a DeleteEventThreatDetectionCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEventThreatDetectionCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest; + + /** + * Creates a plain object from a DeleteEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @param message DeleteEventThreatDetectionCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEventThreatDetectionCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEventThreatDetectionCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEventThreatDetectionCustomModuleRequest. */ + interface IGetEventThreatDetectionCustomModuleRequest { + + /** GetEventThreatDetectionCustomModuleRequest name */ + name?: (string|null); + } + + /** Represents a GetEventThreatDetectionCustomModuleRequest. */ + class GetEventThreatDetectionCustomModuleRequest implements IGetEventThreatDetectionCustomModuleRequest { + + /** + * Constructs a new GetEventThreatDetectionCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest); + + /** GetEventThreatDetectionCustomModuleRequest name. */ + public name: string; + + /** + * Creates a new GetEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEventThreatDetectionCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest; + + /** + * Encodes the specified GetEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message GetEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message GetEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.GetEventThreatDetectionCustomModuleRequest; + + /** + * Decodes a GetEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not 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.GetEventThreatDetectionCustomModuleRequest; + + /** + * Verifies a GetEventThreatDetectionCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEventThreatDetectionCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest; + + /** + * Creates a plain object from a GetEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @param message GetEventThreatDetectionCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEventThreatDetectionCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEventThreatDetectionCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDescendantEventThreatDetectionCustomModulesRequest. */ + interface IListDescendantEventThreatDetectionCustomModulesRequest { + + /** ListDescendantEventThreatDetectionCustomModulesRequest parent */ + parent?: (string|null); + + /** ListDescendantEventThreatDetectionCustomModulesRequest pageToken */ + pageToken?: (string|null); + + /** ListDescendantEventThreatDetectionCustomModulesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListDescendantEventThreatDetectionCustomModulesRequest. */ + class ListDescendantEventThreatDetectionCustomModulesRequest implements IListDescendantEventThreatDetectionCustomModulesRequest { + + /** + * Constructs a new ListDescendantEventThreatDetectionCustomModulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest); + + /** ListDescendantEventThreatDetectionCustomModulesRequest parent. */ + public parent: string; + + /** ListDescendantEventThreatDetectionCustomModulesRequest pageToken. */ + public pageToken: string; + + /** ListDescendantEventThreatDetectionCustomModulesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListDescendantEventThreatDetectionCustomModulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDescendantEventThreatDetectionCustomModulesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest): google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest; + + /** + * Encodes the specified ListDescendantEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @param message ListDescendantEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDescendantEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @param message ListDescendantEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDescendantEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDescendantEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader 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.ListDescendantEventThreatDetectionCustomModulesRequest; + + /** + * Decodes a ListDescendantEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDescendantEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not 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.ListDescendantEventThreatDetectionCustomModulesRequest; + + /** + * Verifies a ListDescendantEventThreatDetectionCustomModulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDescendantEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDescendantEventThreatDetectionCustomModulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest; + + /** + * Creates a plain object from a ListDescendantEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. + * @param message ListDescendantEventThreatDetectionCustomModulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDescendantEventThreatDetectionCustomModulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDescendantEventThreatDetectionCustomModulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDescendantEventThreatDetectionCustomModulesResponse. */ + interface IListDescendantEventThreatDetectionCustomModulesResponse { + + /** ListDescendantEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules */ + eventThreatDetectionCustomModules?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]|null); + + /** ListDescendantEventThreatDetectionCustomModulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDescendantEventThreatDetectionCustomModulesResponse. */ + class ListDescendantEventThreatDetectionCustomModulesResponse implements IListDescendantEventThreatDetectionCustomModulesResponse { + + /** + * Constructs a new ListDescendantEventThreatDetectionCustomModulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse); + + /** ListDescendantEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules. */ + public eventThreatDetectionCustomModules: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]; + + /** ListDescendantEventThreatDetectionCustomModulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDescendantEventThreatDetectionCustomModulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDescendantEventThreatDetectionCustomModulesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse): google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse; + + /** + * Encodes the specified ListDescendantEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @param message ListDescendantEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDescendantEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @param message ListDescendantEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDescendantEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDescendantEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader 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.ListDescendantEventThreatDetectionCustomModulesResponse; + + /** + * Decodes a ListDescendantEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDescendantEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not 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.ListDescendantEventThreatDetectionCustomModulesResponse; + + /** + * Verifies a ListDescendantEventThreatDetectionCustomModulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDescendantEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDescendantEventThreatDetectionCustomModulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse; + + /** + * Creates a plain object from a ListDescendantEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. + * @param message ListDescendantEventThreatDetectionCustomModulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDescendantEventThreatDetectionCustomModulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDescendantEventThreatDetectionCustomModulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEventThreatDetectionCustomModulesRequest. */ + interface IListEventThreatDetectionCustomModulesRequest { + + /** ListEventThreatDetectionCustomModulesRequest parent */ + parent?: (string|null); + + /** ListEventThreatDetectionCustomModulesRequest pageToken */ + pageToken?: (string|null); + + /** ListEventThreatDetectionCustomModulesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListEventThreatDetectionCustomModulesRequest. */ + class ListEventThreatDetectionCustomModulesRequest implements IListEventThreatDetectionCustomModulesRequest { + + /** + * Constructs a new ListEventThreatDetectionCustomModulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest); + + /** ListEventThreatDetectionCustomModulesRequest parent. */ + public parent: string; + + /** ListEventThreatDetectionCustomModulesRequest pageToken. */ + public pageToken: string; + + /** ListEventThreatDetectionCustomModulesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListEventThreatDetectionCustomModulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEventThreatDetectionCustomModulesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest): google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest; + + /** + * Encodes the specified ListEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @param message ListEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @param message ListEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader 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.ListEventThreatDetectionCustomModulesRequest; + + /** + * Decodes a ListEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not 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.ListEventThreatDetectionCustomModulesRequest; + + /** + * Verifies a ListEventThreatDetectionCustomModulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEventThreatDetectionCustomModulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest; + + /** + * Creates a plain object from a ListEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. + * @param message ListEventThreatDetectionCustomModulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEventThreatDetectionCustomModulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEventThreatDetectionCustomModulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEventThreatDetectionCustomModulesResponse. */ + interface IListEventThreatDetectionCustomModulesResponse { + + /** ListEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules */ + eventThreatDetectionCustomModules?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]|null); + + /** ListEventThreatDetectionCustomModulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEventThreatDetectionCustomModulesResponse. */ + class ListEventThreatDetectionCustomModulesResponse implements IListEventThreatDetectionCustomModulesResponse { + + /** + * Constructs a new ListEventThreatDetectionCustomModulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse); + + /** ListEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules. */ + public eventThreatDetectionCustomModules: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]; + + /** ListEventThreatDetectionCustomModulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEventThreatDetectionCustomModulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEventThreatDetectionCustomModulesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse): google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse; + + /** + * Encodes the specified ListEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @param message ListEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @param message ListEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader 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.ListEventThreatDetectionCustomModulesResponse; + + /** + * Decodes a ListEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not 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.ListEventThreatDetectionCustomModulesResponse; + + /** + * Verifies a ListEventThreatDetectionCustomModulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEventThreatDetectionCustomModulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse; + + /** + * Creates a plain object from a ListEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. + * @param message ListEventThreatDetectionCustomModulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEventThreatDetectionCustomModulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEventThreatDetectionCustomModulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEventThreatDetectionCustomModuleRequest. */ + interface IUpdateEventThreatDetectionCustomModuleRequest { + + /** UpdateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule */ + eventThreatDetectionCustomModule?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null); + + /** UpdateEventThreatDetectionCustomModuleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEventThreatDetectionCustomModuleRequest. */ + class UpdateEventThreatDetectionCustomModuleRequest implements IUpdateEventThreatDetectionCustomModuleRequest { + + /** + * Constructs a new UpdateEventThreatDetectionCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest); + + /** UpdateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule. */ + public eventThreatDetectionCustomModule?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null); + + /** UpdateEventThreatDetectionCustomModuleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEventThreatDetectionCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest; + + /** + * Encodes the specified UpdateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message UpdateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message UpdateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.UpdateEventThreatDetectionCustomModuleRequest; + + /** + * Decodes an UpdateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not 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.UpdateEventThreatDetectionCustomModuleRequest; + + /** + * Verifies an UpdateEventThreatDetectionCustomModuleRequest message. + * @param message Plain 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 UpdateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEventThreatDetectionCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest; + + /** + * Creates a plain object from an UpdateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @param message UpdateEventThreatDetectionCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEventThreatDetectionCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEventThreatDetectionCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEffectiveEventThreatDetectionCustomModuleRequest. */ + interface IGetEffectiveEventThreatDetectionCustomModuleRequest { + + /** GetEffectiveEventThreatDetectionCustomModuleRequest name */ + name?: (string|null); + } + + /** Represents a GetEffectiveEventThreatDetectionCustomModuleRequest. */ + class GetEffectiveEventThreatDetectionCustomModuleRequest implements IGetEffectiveEventThreatDetectionCustomModuleRequest { + + /** + * Constructs a new GetEffectiveEventThreatDetectionCustomModuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest); + + /** GetEffectiveEventThreatDetectionCustomModuleRequest name. */ + public name: string; + + /** + * Creates a new GetEffectiveEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEffectiveEventThreatDetectionCustomModuleRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest; + + /** + * Encodes the specified GetEffectiveEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEffectiveEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @param message GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEffectiveEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEffectiveEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader 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.GetEffectiveEventThreatDetectionCustomModuleRequest; + + /** + * Decodes a GetEffectiveEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEffectiveEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not 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.GetEffectiveEventThreatDetectionCustomModuleRequest; + + /** + * Verifies a GetEffectiveEventThreatDetectionCustomModuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEffectiveEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEffectiveEventThreatDetectionCustomModuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest; + + /** + * Creates a plain object from a GetEffectiveEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @param message GetEffectiveEventThreatDetectionCustomModuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEffectiveEventThreatDetectionCustomModuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEffectiveEventThreatDetectionCustomModuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEffectiveEventThreatDetectionCustomModulesRequest. */ + interface IListEffectiveEventThreatDetectionCustomModulesRequest { + + /** ListEffectiveEventThreatDetectionCustomModulesRequest parent */ + parent?: (string|null); + + /** ListEffectiveEventThreatDetectionCustomModulesRequest pageToken */ + pageToken?: (string|null); + + /** ListEffectiveEventThreatDetectionCustomModulesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListEffectiveEventThreatDetectionCustomModulesRequest. */ + class ListEffectiveEventThreatDetectionCustomModulesRequest implements IListEffectiveEventThreatDetectionCustomModulesRequest { + + /** + * Constructs a new ListEffectiveEventThreatDetectionCustomModulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest); + + /** ListEffectiveEventThreatDetectionCustomModulesRequest parent. */ + public parent: string; + + /** ListEffectiveEventThreatDetectionCustomModulesRequest pageToken. */ + public pageToken: string; + + /** ListEffectiveEventThreatDetectionCustomModulesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListEffectiveEventThreatDetectionCustomModulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEffectiveEventThreatDetectionCustomModulesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest): google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest; + + /** + * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @param message ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @param message ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEffectiveEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEffectiveEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader 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.ListEffectiveEventThreatDetectionCustomModulesRequest; + + /** + * Decodes a ListEffectiveEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEffectiveEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not 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.ListEffectiveEventThreatDetectionCustomModulesRequest; + + /** + * Verifies a ListEffectiveEventThreatDetectionCustomModulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEffectiveEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEffectiveEventThreatDetectionCustomModulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest; + + /** + * Creates a plain object from a ListEffectiveEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. + * @param message ListEffectiveEventThreatDetectionCustomModulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEffectiveEventThreatDetectionCustomModulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEffectiveEventThreatDetectionCustomModulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEffectiveEventThreatDetectionCustomModulesResponse. */ + interface IListEffectiveEventThreatDetectionCustomModulesResponse { + + /** ListEffectiveEventThreatDetectionCustomModulesResponse effectiveEventThreatDetectionCustomModules */ + effectiveEventThreatDetectionCustomModules?: (google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[]|null); + + /** ListEffectiveEventThreatDetectionCustomModulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEffectiveEventThreatDetectionCustomModulesResponse. */ + class ListEffectiveEventThreatDetectionCustomModulesResponse implements IListEffectiveEventThreatDetectionCustomModulesResponse { + + /** + * Constructs a new ListEffectiveEventThreatDetectionCustomModulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse); + + /** ListEffectiveEventThreatDetectionCustomModulesResponse effectiveEventThreatDetectionCustomModules. */ + public effectiveEventThreatDetectionCustomModules: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[]; + + /** ListEffectiveEventThreatDetectionCustomModulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEffectiveEventThreatDetectionCustomModulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEffectiveEventThreatDetectionCustomModulesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse): google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse; + + /** + * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @param message ListEffectiveEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @param message ListEffectiveEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEffectiveEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEffectiveEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader 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.ListEffectiveEventThreatDetectionCustomModulesResponse; + + /** + * Decodes a ListEffectiveEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEffectiveEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not 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.ListEffectiveEventThreatDetectionCustomModulesResponse; + + /** + * Verifies a ListEffectiveEventThreatDetectionCustomModulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEffectiveEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEffectiveEventThreatDetectionCustomModulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse; + + /** + * Creates a plain object from a ListEffectiveEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. + * @param message ListEffectiveEventThreatDetectionCustomModulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEffectiveEventThreatDetectionCustomModulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEffectiveEventThreatDetectionCustomModulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Simulation. */ + interface ISimulation { + + /** Simulation name */ + name?: (string|null); + + /** Simulation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Simulation resourceValueConfigsMetadata */ + resourceValueConfigsMetadata?: (google.cloud.securitycenter.v1.IResourceValueConfigMetadata[]|null); + + /** Simulation cloudProvider */ + cloudProvider?: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider|null); + } + + /** Represents a Simulation. */ + class Simulation implements ISimulation { + + /** + * Constructs a new Simulation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISimulation); + + /** Simulation name. */ + public name: string; + + /** Simulation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Simulation resourceValueConfigsMetadata. */ + public resourceValueConfigsMetadata: google.cloud.securitycenter.v1.IResourceValueConfigMetadata[]; + + /** Simulation cloudProvider. */ + public cloudProvider: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider); + + /** + * Creates a new Simulation instance using the specified properties. + * @param [properties] Properties to set + * @returns Simulation instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISimulation): google.cloud.securitycenter.v1.Simulation; + + /** + * Encodes the specified Simulation message. Does not implicitly {@link google.cloud.securitycenter.v1.Simulation.verify|verify} messages. + * @param message Simulation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISimulation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Simulation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Simulation.verify|verify} messages. + * @param message Simulation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISimulation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Simulation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Simulation + * @throws {Error} If the payload is not a reader 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.Simulation; + + /** + * Decodes a Simulation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Simulation + * @throws {Error} If the payload is not 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.Simulation; + + /** + * Verifies a Simulation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Simulation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Simulation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Simulation; + + /** + * Creates a plain object from a Simulation message. Also converts values to other types if specified. + * @param message Simulation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Simulation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Simulation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Simulation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValuedResource. */ + interface IValuedResource { + + /** ValuedResource name */ + name?: (string|null); + + /** ValuedResource resource */ + resource?: (string|null); + + /** ValuedResource resourceType */ + resourceType?: (string|null); + + /** ValuedResource displayName */ + displayName?: (string|null); + + /** ValuedResource resourceValue */ + resourceValue?: (google.cloud.securitycenter.v1.ValuedResource.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ValuedResource.ResourceValue|null); + + /** ValuedResource exposedScore */ + exposedScore?: (number|null); + + /** ValuedResource resourceValueConfigsUsed */ + resourceValueConfigsUsed?: (google.cloud.securitycenter.v1.IResourceValueConfigMetadata[]|null); + } + + /** Represents a ValuedResource. */ + class ValuedResource implements IValuedResource { + + /** + * Constructs a new ValuedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IValuedResource); + + /** ValuedResource name. */ + public name: string; + + /** ValuedResource resource. */ + public resource: string; + + /** ValuedResource resourceType. */ + public resourceType: string; + + /** ValuedResource displayName. */ + public displayName: string; + + /** ValuedResource resourceValue. */ + public resourceValue: (google.cloud.securitycenter.v1.ValuedResource.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ValuedResource.ResourceValue); + + /** ValuedResource exposedScore. */ + public exposedScore: number; + + /** ValuedResource resourceValueConfigsUsed. */ + public resourceValueConfigsUsed: google.cloud.securitycenter.v1.IResourceValueConfigMetadata[]; + + /** + * Creates a new ValuedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ValuedResource instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IValuedResource): google.cloud.securitycenter.v1.ValuedResource; + + /** + * Encodes the specified ValuedResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ValuedResource.verify|verify} messages. + * @param message ValuedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IValuedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValuedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValuedResource.verify|verify} messages. + * @param message ValuedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IValuedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValuedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValuedResource + * @throws {Error} If the payload is not a reader 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.ValuedResource; + + /** + * Decodes a ValuedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValuedResource + * @throws {Error} If the payload is not 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.ValuedResource; + + /** + * Verifies a ValuedResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValuedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValuedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ValuedResource; + + /** + * Creates a plain object from a ValuedResource message. Also converts values to other types if specified. + * @param message ValuedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ValuedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValuedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValuedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ValuedResource { + + /** ResourceValue enum. */ + enum ResourceValue { + RESOURCE_VALUE_UNSPECIFIED = 0, + RESOURCE_VALUE_LOW = 1, + RESOURCE_VALUE_MEDIUM = 2, + RESOURCE_VALUE_HIGH = 3 + } + } + + /** Properties of a ResourceValueConfigMetadata. */ + interface IResourceValueConfigMetadata { + + /** ResourceValueConfigMetadata name */ + name?: (string|null); + } + + /** Represents a ResourceValueConfigMetadata. */ + class ResourceValueConfigMetadata implements IResourceValueConfigMetadata { + + /** + * Constructs a new ResourceValueConfigMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IResourceValueConfigMetadata); + + /** ResourceValueConfigMetadata name. */ + public name: string; + + /** + * Creates a new ResourceValueConfigMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceValueConfigMetadata instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IResourceValueConfigMetadata): google.cloud.securitycenter.v1.ResourceValueConfigMetadata; + + /** + * Encodes the specified ResourceValueConfigMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify|verify} messages. + * @param message ResourceValueConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IResourceValueConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceValueConfigMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify|verify} messages. + * @param message ResourceValueConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IResourceValueConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceValueConfigMetadata + * @throws {Error} If the payload is not a reader 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.ResourceValueConfigMetadata; + + /** + * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceValueConfigMetadata + * @throws {Error} If the payload is not 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.ResourceValueConfigMetadata; + + /** + * Verifies a ResourceValueConfigMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceValueConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceValueConfigMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourceValueConfigMetadata; + + /** + * Creates a plain object from a ResourceValueConfigMetadata message. Also converts values to other types if specified. + * @param message ResourceValueConfigMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ResourceValueConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceValueConfigMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceValueConfigMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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 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 }; + + /** + * 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. */ + 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|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 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|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 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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 { + + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { + + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); + + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof 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|keyof typeof 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 }; + + /** + * 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 { + + /** 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.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 }; + + /** + * 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 { + + /** 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.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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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.v1beta1.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.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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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|keyof typeof 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|keyof typeof 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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; + } + } + + /** 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); + + /** Asset canonicalName */ + canonicalName?: (string|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); + + /** Asset canonicalName. */ + public canonicalName: string; + + /** + * 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 }; + + /** + * 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 { + + /** 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); + + /** SecurityCenterProperties folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|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; + + /** SecurityCenterProperties folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + + /** + * 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + + /** SecurityMarks canonicalName */ + canonicalName?: (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 }; + + /** SecurityMarks canonicalName. */ + public canonicalName: 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 }; + + /** + * 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. */ + 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); + + /** 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. */ + 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); + + /** 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 + * @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 }; + + /** + * 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 { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } + } + + /** 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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. */ + 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); + + /** NotificationMessage resource */ + resource?: (google.cloud.securitycenter.v1p1beta1.IResource|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 resource. */ + public resource?: (google.cloud.securitycenter.v1p1beta1.IResource|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 }; + + /** + * 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. */ + 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); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|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; + + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + + /** + * 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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); + + /** AssetDiscoveryConfig folderIds */ + folderIds?: (string[]|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); + + /** AssetDiscoveryConfig folderIds. */ + public folderIds: 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.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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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.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 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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.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 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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.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 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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 { + + /** 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.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 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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 { + + /** 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); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|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; + + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + + /** + * 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 }; + + /** + * 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. */ + 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); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest 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); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + 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.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.v1p1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @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. */ + 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.v1p1beta1.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.v1p1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; + + /** + * 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.v1p1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @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. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; + + /** + * 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.v1p1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @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. */ + 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 }; + + /** + * 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 { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; + + /** + * 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.v1p1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @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. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; + + /** + * 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.v1p1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @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. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; + + /** + * 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.v1p1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @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. */ + 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.v1p1beta1.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.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 }; + + /** + * 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; + } + } + + /** Namespace v2. */ + namespace v2 { + + /** Properties of an Access. */ + interface IAccess { + + /** Access principalEmail */ + principalEmail?: (string|null); + + /** Access callerIp */ + callerIp?: (string|null); + + /** Access callerIpGeo */ + callerIpGeo?: (google.cloud.securitycenter.v2.IGeolocation|null); + + /** Access userAgentFamily */ + userAgentFamily?: (string|null); + + /** Access userAgent */ + userAgent?: (string|null); + + /** Access serviceName */ + serviceName?: (string|null); + + /** Access methodName */ + methodName?: (string|null); + + /** Access principalSubject */ + principalSubject?: (string|null); + + /** Access serviceAccountKeyName */ + serviceAccountKeyName?: (string|null); + + /** Access serviceAccountDelegationInfo */ + serviceAccountDelegationInfo?: (google.cloud.securitycenter.v2.IServiceAccountDelegationInfo[]|null); + + /** Access userName */ + userName?: (string|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAccess); + + /** Access principalEmail. */ + public principalEmail: string; + + /** Access callerIp. */ + public callerIp: string; + + /** Access callerIpGeo. */ + public callerIpGeo?: (google.cloud.securitycenter.v2.IGeolocation|null); + + /** Access userAgentFamily. */ + public userAgentFamily: string; + + /** Access userAgent. */ + public userAgent: string; + + /** Access serviceName. */ + public serviceName: string; + + /** Access methodName. */ + public methodName: string; + + /** Access principalSubject. */ + public principalSubject: string; + + /** Access serviceAccountKeyName. */ + public serviceAccountKeyName: string; + + /** Access serviceAccountDelegationInfo. */ + public serviceAccountDelegationInfo: google.cloud.securitycenter.v2.IServiceAccountDelegationInfo[]; + + /** Access userName. */ + public userName: 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.v2.IAccess): google.cloud.securitycenter.v2.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @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 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.v2.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.v2.IServiceAccountDelegationInfo): google.cloud.securitycenter.v2.ServiceAccountDelegationInfo; + + /** + * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IServiceAccountDelegationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountDelegationInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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 { + + /** 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.v2.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.v2.IGeolocation): google.cloud.securitycenter.v2.Geolocation; + + /** + * Encodes the specified Geolocation message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGeolocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Geolocation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Geolocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Geolocation to JSON. + * @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 AffectedResources. */ + interface IAffectedResources { + + /** AffectedResources count */ + count?: (number|Long|string|null); + } + + /** Represents an AffectedResources. */ + class AffectedResources implements IAffectedResources { + + /** + * Constructs a new AffectedResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAffectedResources); + + /** AffectedResources count. */ + public count: (number|Long|string); + + /** + * Creates a new AffectedResources instance using the specified properties. + * @param [properties] Properties to set + * @returns AffectedResources instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAffectedResources): google.cloud.securitycenter.v2.AffectedResources; + + /** + * Encodes the specified AffectedResources message. Does not implicitly {@link google.cloud.securitycenter.v2.AffectedResources.verify|verify} messages. + * @param message AffectedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAffectedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AffectedResources message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AffectedResources.verify|verify} messages. + * @param message AffectedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAffectedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AffectedResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AffectedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AffectedResources; + + /** + * Decodes an AffectedResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AffectedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AffectedResources; + + /** + * Verifies an AffectedResources message. + * @param message Plain 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 AffectedResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AffectedResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AffectedResources; + + /** + * Creates a plain object from an AffectedResources message. Also converts values to other types if specified. + * @param message AffectedResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AffectedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AffectedResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AffectedResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AiModel. */ + interface IAiModel { + + /** AiModel name */ + name?: (string|null); + + /** AiModel domain */ + domain?: (string|null); + + /** AiModel library */ + library?: (string|null); + + /** AiModel location */ + location?: (string|null); + + /** AiModel publisher */ + publisher?: (string|null); + + /** AiModel deploymentPlatform */ + deploymentPlatform?: (google.cloud.securitycenter.v2.AiModel.DeploymentPlatform|keyof typeof google.cloud.securitycenter.v2.AiModel.DeploymentPlatform|null); + + /** AiModel displayName */ + displayName?: (string|null); + } + + /** Represents an AiModel. */ + class AiModel implements IAiModel { + + /** + * Constructs a new AiModel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAiModel); + + /** AiModel name. */ + public name: string; + + /** AiModel domain. */ + public domain: string; + + /** AiModel library. */ + public library: string; + + /** AiModel location. */ + public location: string; + + /** AiModel publisher. */ + public publisher: string; + + /** AiModel deploymentPlatform. */ + public deploymentPlatform: (google.cloud.securitycenter.v2.AiModel.DeploymentPlatform|keyof typeof google.cloud.securitycenter.v2.AiModel.DeploymentPlatform); + + /** AiModel displayName. */ + public displayName: string; + + /** + * Creates a new AiModel instance using the specified properties. + * @param [properties] Properties to set + * @returns AiModel instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAiModel): google.cloud.securitycenter.v2.AiModel; + + /** + * Encodes the specified AiModel message. Does not implicitly {@link google.cloud.securitycenter.v2.AiModel.verify|verify} messages. + * @param message AiModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAiModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AiModel message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AiModel.verify|verify} messages. + * @param message AiModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAiModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AiModel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AiModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AiModel; + + /** + * Decodes an AiModel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AiModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AiModel; + + /** + * Verifies an AiModel message. + * @param message Plain 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 AiModel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AiModel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AiModel; + + /** + * Creates a plain object from an AiModel message. Also converts values to other types if specified. + * @param message AiModel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AiModel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AiModel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AiModel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AiModel { + + /** DeploymentPlatform enum. */ + enum DeploymentPlatform { + DEPLOYMENT_PLATFORM_UNSPECIFIED = 0, + VERTEX_AI = 1, + GKE = 2, + GCE = 3, + FINE_TUNED_MODEL = 4 + } + } + + /** Properties of an Application. */ + interface IApplication { + + /** Application baseUri */ + baseUri?: (string|null); + + /** Application fullUri */ + fullUri?: (string|null); + } + + /** Represents an Application. */ + class Application implements IApplication { + + /** + * Constructs a new Application. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IApplication); + + /** Application baseUri. */ + public baseUri: string; + + /** Application fullUri. */ + public fullUri: string; + + /** + * Creates a new Application instance using the specified properties. + * @param [properties] Properties to set + * @returns Application instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IApplication): google.cloud.securitycenter.v2.Application; + + /** + * Encodes the specified Application message. Does not implicitly {@link google.cloud.securitycenter.v2.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Application message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Application; + + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Application; + + /** + * Verifies an Application message. + * @param message Plain 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 Application message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Application + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Application; + + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @param message Application + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Application, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Application to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Application + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttackExposure. */ + interface IAttackExposure { + + /** AttackExposure score */ + score?: (number|null); + + /** AttackExposure latestCalculationTime */ + latestCalculationTime?: (google.protobuf.ITimestamp|null); + + /** AttackExposure attackExposureResult */ + attackExposureResult?: (string|null); + + /** AttackExposure state */ + state?: (google.cloud.securitycenter.v2.AttackExposure.State|keyof typeof google.cloud.securitycenter.v2.AttackExposure.State|null); + + /** AttackExposure exposedHighValueResourcesCount */ + exposedHighValueResourcesCount?: (number|null); + + /** AttackExposure exposedMediumValueResourcesCount */ + exposedMediumValueResourcesCount?: (number|null); + + /** AttackExposure exposedLowValueResourcesCount */ + exposedLowValueResourcesCount?: (number|null); + } + + /** Represents an AttackExposure. */ + class AttackExposure implements IAttackExposure { + + /** + * Constructs a new AttackExposure. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAttackExposure); + + /** AttackExposure score. */ + public score: number; + + /** AttackExposure latestCalculationTime. */ + public latestCalculationTime?: (google.protobuf.ITimestamp|null); + + /** AttackExposure attackExposureResult. */ + public attackExposureResult: string; + + /** AttackExposure state. */ + public state: (google.cloud.securitycenter.v2.AttackExposure.State|keyof typeof google.cloud.securitycenter.v2.AttackExposure.State); + + /** AttackExposure exposedHighValueResourcesCount. */ + public exposedHighValueResourcesCount: number; + + /** AttackExposure exposedMediumValueResourcesCount. */ + public exposedMediumValueResourcesCount: number; + + /** AttackExposure exposedLowValueResourcesCount. */ + public exposedLowValueResourcesCount: number; + + /** + * Creates a new AttackExposure instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackExposure instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAttackExposure): google.cloud.securitycenter.v2.AttackExposure; + + /** + * Encodes the specified AttackExposure message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackExposure.verify|verify} messages. + * @param message AttackExposure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAttackExposure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackExposure.verify|verify} messages. + * @param message AttackExposure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAttackExposure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackExposure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackExposure; + + /** + * Decodes an AttackExposure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackExposure; + + /** + * Verifies an AttackExposure message. + * @param message Plain 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 AttackExposure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackExposure + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackExposure; + + /** + * Creates a plain object from an AttackExposure message. Also converts values to other types if specified. + * @param message AttackExposure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AttackExposure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackExposure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackExposure + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttackExposure { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CALCULATED = 1, + NOT_CALCULATED = 2 + } + } + + /** Properties of an AttackPath. */ + interface IAttackPath { + + /** AttackPath name */ + name?: (string|null); + + /** AttackPath pathNodes */ + pathNodes?: (google.cloud.securitycenter.v2.AttackPath.IAttackPathNode[]|null); + + /** AttackPath edges */ + edges?: (google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge[]|null); + } + + /** Represents an AttackPath. */ + class AttackPath implements IAttackPath { + + /** + * Constructs a new AttackPath. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAttackPath); + + /** AttackPath name. */ + public name: string; + + /** AttackPath pathNodes. */ + public pathNodes: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode[]; + + /** AttackPath edges. */ + public edges: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge[]; + + /** + * Creates a new AttackPath instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackPath instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAttackPath): google.cloud.securitycenter.v2.AttackPath; + + /** + * Encodes the specified AttackPath message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.verify|verify} messages. + * @param message AttackPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAttackPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.verify|verify} messages. + * @param message AttackPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAttackPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackPath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath; + + /** + * Decodes an AttackPath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath; + + /** + * Verifies an AttackPath message. + * @param message Plain 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 AttackPath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackPath + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath; + + /** + * Creates a plain object from an AttackPath message. Also converts values to other types if specified. + * @param message AttackPath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AttackPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackPath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackPath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttackPath { + + /** Properties of an AttackPathNode. */ + interface IAttackPathNode { + + /** AttackPathNode resource */ + resource?: (string|null); + + /** AttackPathNode resourceType */ + resourceType?: (string|null); + + /** AttackPathNode displayName */ + displayName?: (string|null); + + /** AttackPathNode associatedFindings */ + associatedFindings?: (google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding[]|null); + + /** AttackPathNode uuid */ + uuid?: (string|null); + + /** AttackPathNode attackSteps */ + attackSteps?: (google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode[]|null); + } + + /** Represents an AttackPathNode. */ + class AttackPathNode implements IAttackPathNode { + + /** + * Constructs a new AttackPathNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode); + + /** AttackPathNode resource. */ + public resource: string; + + /** AttackPathNode resourceType. */ + public resourceType: string; + + /** AttackPathNode displayName. */ + public displayName: string; + + /** AttackPathNode associatedFindings. */ + public associatedFindings: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding[]; + + /** AttackPathNode uuid. */ + public uuid: string; + + /** AttackPathNode attackSteps. */ + public attackSteps: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode[]; + + /** + * Creates a new AttackPathNode instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackPathNode instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode): google.cloud.securitycenter.v2.AttackPath.AttackPathNode; + + /** + * Encodes the specified AttackPathNode message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify|verify} messages. + * @param message AttackPathNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackPathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify|verify} messages. + * @param message AttackPathNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackPathNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackPathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath.AttackPathNode; + + /** + * Decodes an AttackPathNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackPathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath.AttackPathNode; + + /** + * Verifies an AttackPathNode message. + * @param message Plain 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 AttackPathNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackPathNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath.AttackPathNode; + + /** + * Creates a plain object from an AttackPathNode message. Also converts values to other types if specified. + * @param message AttackPathNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackPathNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackPathNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttackPathNode { + + /** Properties of a PathNodeAssociatedFinding. */ + interface IPathNodeAssociatedFinding { + + /** PathNodeAssociatedFinding canonicalFinding */ + canonicalFinding?: (string|null); + + /** PathNodeAssociatedFinding findingCategory */ + findingCategory?: (string|null); + + /** PathNodeAssociatedFinding name */ + name?: (string|null); + } + + /** Represents a PathNodeAssociatedFinding. */ + class PathNodeAssociatedFinding implements IPathNodeAssociatedFinding { + + /** + * Constructs a new PathNodeAssociatedFinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding); + + /** PathNodeAssociatedFinding canonicalFinding. */ + public canonicalFinding: string; + + /** PathNodeAssociatedFinding findingCategory. */ + public findingCategory: string; + + /** PathNodeAssociatedFinding name. */ + public name: string; + + /** + * Creates a new PathNodeAssociatedFinding instance using the specified properties. + * @param [properties] Properties to set + * @returns PathNodeAssociatedFinding instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding; + + /** + * Encodes the specified PathNodeAssociatedFinding message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. + * @param message PathNodeAssociatedFinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PathNodeAssociatedFinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. + * @param message PathNodeAssociatedFinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PathNodeAssociatedFinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding; + + /** + * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PathNodeAssociatedFinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding; + + /** + * Verifies a PathNodeAssociatedFinding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PathNodeAssociatedFinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PathNodeAssociatedFinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding; + + /** + * Creates a plain object from a PathNodeAssociatedFinding message. Also converts values to other types if specified. + * @param message PathNodeAssociatedFinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PathNodeAssociatedFinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PathNodeAssociatedFinding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NodeType enum. */ + enum NodeType { + NODE_TYPE_UNSPECIFIED = 0, + NODE_TYPE_AND = 1, + NODE_TYPE_OR = 2, + NODE_TYPE_DEFENSE = 3, + NODE_TYPE_ATTACKER = 4 + } + + /** Properties of an AttackStepNode. */ + interface IAttackStepNode { + + /** AttackStepNode uuid */ + uuid?: (string|null); + + /** AttackStepNode type */ + type?: (google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType|keyof typeof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType|null); + + /** AttackStepNode displayName */ + displayName?: (string|null); + + /** AttackStepNode labels */ + labels?: ({ [k: string]: string }|null); + + /** AttackStepNode description */ + description?: (string|null); + } + + /** Represents an AttackStepNode. */ + class AttackStepNode implements IAttackStepNode { + + /** + * Constructs a new AttackStepNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode); + + /** AttackStepNode uuid. */ + public uuid: string; + + /** AttackStepNode type. */ + public type: (google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType|keyof typeof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType); + + /** AttackStepNode displayName. */ + public displayName: string; + + /** AttackStepNode labels. */ + public labels: { [k: string]: string }; + + /** AttackStepNode description. */ + public description: string; + + /** + * Creates a new AttackStepNode instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackStepNode instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode; + + /** + * Encodes the specified AttackStepNode message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. + * @param message AttackStepNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackStepNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. + * @param message AttackStepNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackStepNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackStepNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode; + + /** + * Decodes an AttackStepNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackStepNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode; + + /** + * Verifies an AttackStepNode message. + * @param message Plain 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 AttackStepNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackStepNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode; + + /** + * Creates a plain object from an AttackStepNode message. Also converts values to other types if specified. + * @param message AttackStepNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackStepNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackStepNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AttackPathEdge. */ + interface IAttackPathEdge { + + /** AttackPathEdge source */ + source?: (string|null); + + /** AttackPathEdge destination */ + destination?: (string|null); + } + + /** Represents an AttackPathEdge. */ + class AttackPathEdge implements IAttackPathEdge { + + /** + * Constructs a new AttackPathEdge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge); + + /** AttackPathEdge source. */ + public source: string; + + /** AttackPathEdge destination. */ + public destination: string; + + /** + * Creates a new AttackPathEdge instance using the specified properties. + * @param [properties] Properties to set + * @returns AttackPathEdge instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge): google.cloud.securitycenter.v2.AttackPath.AttackPathEdge; + + /** + * Encodes the specified AttackPathEdge message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify|verify} messages. + * @param message AttackPathEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttackPathEdge message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify|verify} messages. + * @param message AttackPathEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttackPathEdge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttackPathEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath.AttackPathEdge; + + /** + * Decodes an AttackPathEdge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttackPathEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath.AttackPathEdge; + + /** + * Verifies an AttackPathEdge message. + * @param message Plain 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 AttackPathEdge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttackPathEdge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath.AttackPathEdge; + + /** + * Creates a plain object from an AttackPathEdge message. Also converts values to other types if specified. + * @param message AttackPathEdge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AttackPath.AttackPathEdge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttackPathEdge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttackPathEdge + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BackupDisasterRecovery. */ + interface IBackupDisasterRecovery { + + /** BackupDisasterRecovery backupTemplate */ + backupTemplate?: (string|null); + + /** BackupDisasterRecovery policies */ + policies?: (string[]|null); + + /** BackupDisasterRecovery host */ + host?: (string|null); + + /** BackupDisasterRecovery applications */ + applications?: (string[]|null); + + /** BackupDisasterRecovery storagePool */ + storagePool?: (string|null); + + /** BackupDisasterRecovery policyOptions */ + policyOptions?: (string[]|null); + + /** BackupDisasterRecovery profile */ + profile?: (string|null); + + /** BackupDisasterRecovery appliance */ + appliance?: (string|null); + + /** BackupDisasterRecovery backupType */ + backupType?: (string|null); + + /** BackupDisasterRecovery backupCreateTime */ + backupCreateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupDisasterRecovery. */ + class BackupDisasterRecovery implements IBackupDisasterRecovery { + + /** + * Constructs a new BackupDisasterRecovery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IBackupDisasterRecovery); + + /** BackupDisasterRecovery backupTemplate. */ + public backupTemplate: string; + + /** BackupDisasterRecovery policies. */ + public policies: string[]; + + /** BackupDisasterRecovery host. */ + public host: string; + + /** BackupDisasterRecovery applications. */ + public applications: string[]; + + /** BackupDisasterRecovery storagePool. */ + public storagePool: string; + + /** BackupDisasterRecovery policyOptions. */ + public policyOptions: string[]; + + /** BackupDisasterRecovery profile. */ + public profile: string; + + /** BackupDisasterRecovery appliance. */ + public appliance: string; + + /** BackupDisasterRecovery backupType. */ + public backupType: string; + + /** BackupDisasterRecovery backupCreateTime. */ + public backupCreateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BackupDisasterRecovery instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupDisasterRecovery instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IBackupDisasterRecovery): google.cloud.securitycenter.v2.BackupDisasterRecovery; + + /** + * Encodes the specified BackupDisasterRecovery message. Does not implicitly {@link google.cloud.securitycenter.v2.BackupDisasterRecovery.verify|verify} messages. + * @param message BackupDisasterRecovery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IBackupDisasterRecovery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupDisasterRecovery message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BackupDisasterRecovery.verify|verify} messages. + * @param message BackupDisasterRecovery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IBackupDisasterRecovery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupDisasterRecovery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupDisasterRecovery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.BackupDisasterRecovery; + + /** + * Decodes a BackupDisasterRecovery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupDisasterRecovery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.BackupDisasterRecovery; + + /** + * Verifies a BackupDisasterRecovery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupDisasterRecovery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupDisasterRecovery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.BackupDisasterRecovery; + + /** + * Creates a plain object from a BackupDisasterRecovery message. Also converts values to other types if specified. + * @param message BackupDisasterRecovery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.BackupDisasterRecovery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupDisasterRecovery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupDisasterRecovery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v2.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.v2.IBigQueryExport): google.cloud.securitycenter.v2.BigQueryExport; + + /** + * Encodes the specified BigQueryExport message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IBigQueryExport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryExport message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.BigQueryExport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryExport to JSON. + * @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 Chokepoint. */ + interface IChokepoint { + + /** Chokepoint relatedFindings */ + relatedFindings?: (string[]|null); + } + + /** Represents a Chokepoint. */ + class Chokepoint implements IChokepoint { + + /** + * Constructs a new Chokepoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IChokepoint); + + /** Chokepoint relatedFindings. */ + public relatedFindings: string[]; + + /** + * Creates a new Chokepoint instance using the specified properties. + * @param [properties] Properties to set + * @returns Chokepoint instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IChokepoint): google.cloud.securitycenter.v2.Chokepoint; + + /** + * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v2.Chokepoint.verify|verify} messages. + * @param message Chokepoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Chokepoint.verify|verify} messages. + * @param message Chokepoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chokepoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chokepoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Chokepoint; + + /** + * Decodes a Chokepoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chokepoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Chokepoint; + + /** + * Verifies a Chokepoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chokepoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Chokepoint; + + /** + * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. + * @param message Chokepoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Chokepoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chokepoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chokepoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudArmor. */ + interface ICloudArmor { + + /** CloudArmor securityPolicy */ + securityPolicy?: (google.cloud.securitycenter.v2.ISecurityPolicy|null); + + /** CloudArmor requests */ + requests?: (google.cloud.securitycenter.v2.IRequests|null); + + /** CloudArmor adaptiveProtection */ + adaptiveProtection?: (google.cloud.securitycenter.v2.IAdaptiveProtection|null); + + /** CloudArmor attack */ + attack?: (google.cloud.securitycenter.v2.IAttack|null); + + /** CloudArmor threatVector */ + threatVector?: (string|null); + + /** CloudArmor duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a CloudArmor. */ + class CloudArmor implements ICloudArmor { + + /** + * Constructs a new CloudArmor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICloudArmor); + + /** CloudArmor securityPolicy. */ + public securityPolicy?: (google.cloud.securitycenter.v2.ISecurityPolicy|null); + + /** CloudArmor requests. */ + public requests?: (google.cloud.securitycenter.v2.IRequests|null); + + /** CloudArmor adaptiveProtection. */ + public adaptiveProtection?: (google.cloud.securitycenter.v2.IAdaptiveProtection|null); + + /** CloudArmor attack. */ + public attack?: (google.cloud.securitycenter.v2.IAttack|null); + + /** CloudArmor threatVector. */ + public threatVector: string; + + /** CloudArmor duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new CloudArmor instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudArmor instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ICloudArmor): google.cloud.securitycenter.v2.CloudArmor; + + /** + * Encodes the specified CloudArmor message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudArmor.verify|verify} messages. + * @param message CloudArmor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ICloudArmor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudArmor message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudArmor.verify|verify} messages. + * @param message CloudArmor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ICloudArmor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudArmor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudArmor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CloudArmor; + + /** + * Decodes a CloudArmor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudArmor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CloudArmor; + + /** + * Verifies a CloudArmor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudArmor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudArmor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CloudArmor; + + /** + * Creates a plain object from a CloudArmor message. Also converts values to other types if specified. + * @param message CloudArmor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.CloudArmor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudArmor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudArmor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecurityPolicy. */ + interface ISecurityPolicy { + + /** SecurityPolicy name */ + name?: (string|null); + + /** SecurityPolicy type */ + type?: (string|null); + + /** SecurityPolicy preview */ + preview?: (boolean|null); + } + + /** Represents a SecurityPolicy. */ + class SecurityPolicy implements ISecurityPolicy { + + /** + * Constructs a new SecurityPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ISecurityPolicy); + + /** SecurityPolicy name. */ + public name: string; + + /** SecurityPolicy type. */ + public type: string; + + /** SecurityPolicy preview. */ + public preview: boolean; + + /** + * Creates a new SecurityPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ISecurityPolicy): google.cloud.securitycenter.v2.SecurityPolicy; + + /** + * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPolicy.verify|verify} messages. + * @param message SecurityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPolicy.verify|verify} messages. + * @param message SecurityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.SecurityPolicy; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.SecurityPolicy; + + /** + * Verifies a SecurityPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.SecurityPolicy; + + /** + * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. + * @param message SecurityPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.SecurityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Requests. */ + interface IRequests { + + /** Requests ratio */ + ratio?: (number|null); + + /** Requests shortTermAllowed */ + shortTermAllowed?: (number|null); + + /** Requests longTermAllowed */ + longTermAllowed?: (number|null); + + /** Requests longTermDenied */ + longTermDenied?: (number|null); + } + + /** Represents a Requests. */ + class Requests implements IRequests { + + /** + * Constructs a new Requests. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IRequests); + + /** Requests ratio. */ + public ratio: number; + + /** Requests shortTermAllowed. */ + public shortTermAllowed: number; + + /** Requests longTermAllowed. */ + public longTermAllowed: number; + + /** Requests longTermDenied. */ + public longTermDenied: number; + + /** + * Creates a new Requests instance using the specified properties. + * @param [properties] Properties to set + * @returns Requests instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IRequests): google.cloud.securitycenter.v2.Requests; + + /** + * Encodes the specified Requests message. Does not implicitly {@link google.cloud.securitycenter.v2.Requests.verify|verify} messages. + * @param message Requests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Requests message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Requests.verify|verify} messages. + * @param message Requests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Requests message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Requests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Requests; + + /** + * Decodes a Requests message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Requests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Requests; + + /** + * Verifies a Requests message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Requests message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Requests + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Requests; + + /** + * Creates a plain object from a Requests message. Also converts values to other types if specified. + * @param message Requests + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Requests, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Requests to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Requests + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdaptiveProtection. */ + interface IAdaptiveProtection { + + /** AdaptiveProtection confidence */ + confidence?: (number|null); + } + + /** Represents an AdaptiveProtection. */ + class AdaptiveProtection implements IAdaptiveProtection { + + /** + * Constructs a new AdaptiveProtection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAdaptiveProtection); + + /** AdaptiveProtection confidence. */ + public confidence: number; + + /** + * Creates a new AdaptiveProtection instance using the specified properties. + * @param [properties] Properties to set + * @returns AdaptiveProtection instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAdaptiveProtection): google.cloud.securitycenter.v2.AdaptiveProtection; + + /** + * Encodes the specified AdaptiveProtection message. Does not implicitly {@link google.cloud.securitycenter.v2.AdaptiveProtection.verify|verify} messages. + * @param message AdaptiveProtection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAdaptiveProtection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdaptiveProtection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AdaptiveProtection.verify|verify} messages. + * @param message AdaptiveProtection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAdaptiveProtection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdaptiveProtection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdaptiveProtection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AdaptiveProtection; + + /** + * Decodes an AdaptiveProtection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdaptiveProtection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AdaptiveProtection; + + /** + * Verifies an AdaptiveProtection message. + * @param message Plain 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 AdaptiveProtection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdaptiveProtection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AdaptiveProtection; + + /** + * Creates a plain object from an AdaptiveProtection message. Also converts values to other types if specified. + * @param message AdaptiveProtection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AdaptiveProtection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdaptiveProtection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdaptiveProtection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Attack. */ + interface IAttack { + + /** Attack volumePpsLong */ + volumePpsLong?: (number|Long|string|null); + + /** Attack volumeBpsLong */ + volumeBpsLong?: (number|Long|string|null); + + /** Attack classification */ + classification?: (string|null); + + /** Attack volumePps */ + volumePps?: (number|null); + + /** Attack volumeBps */ + volumeBps?: (number|null); + } + + /** Represents an Attack. */ + class Attack implements IAttack { + + /** + * Constructs a new Attack. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAttack); + + /** Attack volumePpsLong. */ + public volumePpsLong: (number|Long|string); + + /** Attack volumeBpsLong. */ + public volumeBpsLong: (number|Long|string); + + /** Attack classification. */ + public classification: string; + + /** Attack volumePps. */ + public volumePps: number; + + /** Attack volumeBps. */ + public volumeBps: number; + + /** + * Creates a new Attack instance using the specified properties. + * @param [properties] Properties to set + * @returns Attack instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAttack): google.cloud.securitycenter.v2.Attack; + + /** + * Encodes the specified Attack message. Does not implicitly {@link google.cloud.securitycenter.v2.Attack.verify|verify} messages. + * @param message Attack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Attack.verify|verify} messages. + * @param message Attack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attack message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Attack; + + /** + * Decodes an Attack message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Attack; + + /** + * Verifies an Attack message. + * @param message Plain 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 Attack message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attack + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Attack; + + /** + * Creates a plain object from an Attack message. Also converts values to other types if specified. + * @param message Attack + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Attack, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attack to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attack + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudDlpDataProfile. */ + interface ICloudDlpDataProfile { + + /** CloudDlpDataProfile dataProfile */ + dataProfile?: (string|null); + + /** CloudDlpDataProfile parentType */ + parentType?: (google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType|null); + } + + /** Represents a CloudDlpDataProfile. */ + class CloudDlpDataProfile implements ICloudDlpDataProfile { + + /** + * Constructs a new CloudDlpDataProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICloudDlpDataProfile); + + /** CloudDlpDataProfile dataProfile. */ + public dataProfile: string; + + /** CloudDlpDataProfile parentType. */ + public parentType: (google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType); + + /** + * Creates a new CloudDlpDataProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudDlpDataProfile instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ICloudDlpDataProfile): google.cloud.securitycenter.v2.CloudDlpDataProfile; + + /** + * Encodes the specified CloudDlpDataProfile message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpDataProfile.verify|verify} messages. + * @param message CloudDlpDataProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ICloudDlpDataProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudDlpDataProfile message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpDataProfile.verify|verify} messages. + * @param message CloudDlpDataProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ICloudDlpDataProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudDlpDataProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudDlpDataProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CloudDlpDataProfile; + + /** + * Decodes a CloudDlpDataProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudDlpDataProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CloudDlpDataProfile; + + /** + * Verifies a CloudDlpDataProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudDlpDataProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudDlpDataProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CloudDlpDataProfile; + + /** + * Creates a plain object from a CloudDlpDataProfile message. Also converts values to other types if specified. + * @param message CloudDlpDataProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.CloudDlpDataProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudDlpDataProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudDlpDataProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudDlpDataProfile { + + /** ParentType enum. */ + enum ParentType { + PARENT_TYPE_UNSPECIFIED = 0, + ORGANIZATION = 1, + PROJECT = 2 + } + } + + /** Properties of a CloudDlpInspection. */ + interface ICloudDlpInspection { + + /** CloudDlpInspection inspectJob */ + inspectJob?: (string|null); + + /** CloudDlpInspection infoType */ + infoType?: (string|null); + + /** CloudDlpInspection infoTypeCount */ + infoTypeCount?: (number|Long|string|null); + + /** CloudDlpInspection fullScan */ + fullScan?: (boolean|null); + } + + /** Represents a CloudDlpInspection. */ + class CloudDlpInspection implements ICloudDlpInspection { + + /** + * Constructs a new CloudDlpInspection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICloudDlpInspection); + + /** CloudDlpInspection inspectJob. */ + public inspectJob: string; + + /** CloudDlpInspection infoType. */ + public infoType: string; + + /** CloudDlpInspection infoTypeCount. */ + public infoTypeCount: (number|Long|string); + + /** CloudDlpInspection fullScan. */ + public fullScan: boolean; + + /** + * Creates a new CloudDlpInspection instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudDlpInspection instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ICloudDlpInspection): google.cloud.securitycenter.v2.CloudDlpInspection; + + /** + * Encodes the specified CloudDlpInspection message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpInspection.verify|verify} messages. + * @param message CloudDlpInspection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ICloudDlpInspection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudDlpInspection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpInspection.verify|verify} messages. + * @param message CloudDlpInspection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ICloudDlpInspection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudDlpInspection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudDlpInspection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CloudDlpInspection; + + /** + * Decodes a CloudDlpInspection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudDlpInspection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CloudDlpInspection; + + /** + * Verifies a CloudDlpInspection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudDlpInspection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudDlpInspection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CloudDlpInspection; + + /** + * Creates a plain object from a CloudDlpInspection message. Also converts values to other types if specified. + * @param message CloudDlpInspection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.CloudDlpInspection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudDlpInspection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudDlpInspection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v2.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.v2.ICompliance): google.cloud.securitycenter.v2.Compliance; + + /** + * Encodes the specified Compliance message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Compliance message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Compliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Compliance to JSON. + * @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. */ + 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.v2.Connection.Protocol|keyof typeof google.cloud.securitycenter.v2.Connection.Protocol|null); + } + + /** Represents a Connection. */ + class Connection implements IConnection { + + /** + * Constructs a new Connection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.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.v2.Connection.Protocol|keyof typeof google.cloud.securitycenter.v2.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.v2.IConnection): google.cloud.securitycenter.v2.Connection; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Connection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Connection to JSON. + * @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 { + + /** Protocol enum. */ + enum Protocol { + PROTOCOL_UNSPECIFIED = 0, + ICMP = 1, + TCP = 6, + UDP = 17, + GRE = 47, + ESP = 50 + } + } + + /** Properties of a ContactDetails. */ + interface IContactDetails { + + /** ContactDetails contacts */ + contacts?: (google.cloud.securitycenter.v2.IContact[]|null); + } + + /** Represents a ContactDetails. */ + class ContactDetails implements IContactDetails { + + /** + * Constructs a new ContactDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IContactDetails); + + /** ContactDetails contacts. */ + public contacts: google.cloud.securitycenter.v2.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.v2.IContactDetails): google.cloud.securitycenter.v2.ContactDetails; + + /** + * Encodes the specified ContactDetails message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IContactDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContactDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ContactDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContactDetails to JSON. + * @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. */ + 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.v2.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.v2.IContact): google.cloud.securitycenter.v2.Contact; + + /** + * Encodes the specified Contact message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IContact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Contact message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Contact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Contact to JSON. + * @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. */ + interface IContainer { + + /** Container name */ + name?: (string|null); + + /** Container uri */ + uri?: (string|null); + + /** Container imageId */ + imageId?: (string|null); + + /** Container labels */ + labels?: (google.cloud.securitycenter.v2.ILabel[]|null); + + /** Container createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IContainer); + + /** Container name. */ + public name: string; + + /** Container uri. */ + public uri: string; + + /** Container imageId. */ + public imageId: string; + + /** Container labels. */ + public labels: google.cloud.securitycenter.v2.ILabel[]; + + /** Container createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IContainer): google.cloud.securitycenter.v2.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @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. */ + 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.v2.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.v2.ILabel): google.cloud.securitycenter.v2.Label; + + /** + * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ILabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Label message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Label, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Label to JSON. + * @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 a DataAccessEvent. */ + interface IDataAccessEvent { + + /** DataAccessEvent eventId */ + eventId?: (string|null); + + /** DataAccessEvent principalEmail */ + principalEmail?: (string|null); + + /** DataAccessEvent operation */ + operation?: (google.cloud.securitycenter.v2.DataAccessEvent.Operation|keyof typeof google.cloud.securitycenter.v2.DataAccessEvent.Operation|null); + + /** DataAccessEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DataAccessEvent. */ + class DataAccessEvent implements IDataAccessEvent { + + /** + * Constructs a new DataAccessEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IDataAccessEvent); + + /** DataAccessEvent eventId. */ + public eventId: string; + + /** DataAccessEvent principalEmail. */ + public principalEmail: string; + + /** DataAccessEvent operation. */ + public operation: (google.cloud.securitycenter.v2.DataAccessEvent.Operation|keyof typeof google.cloud.securitycenter.v2.DataAccessEvent.Operation); + + /** DataAccessEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DataAccessEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns DataAccessEvent instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IDataAccessEvent): google.cloud.securitycenter.v2.DataAccessEvent; + + /** + * Encodes the specified DataAccessEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataAccessEvent.verify|verify} messages. + * @param message DataAccessEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IDataAccessEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataAccessEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataAccessEvent.verify|verify} messages. + * @param message DataAccessEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IDataAccessEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataAccessEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataAccessEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.DataAccessEvent; + + /** + * Decodes a DataAccessEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataAccessEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.DataAccessEvent; + + /** + * Verifies a DataAccessEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataAccessEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataAccessEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.DataAccessEvent; + + /** + * Creates a plain object from a DataAccessEvent message. Also converts values to other types if specified. + * @param message DataAccessEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.DataAccessEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataAccessEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataAccessEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataAccessEvent { + + /** Operation enum. */ + enum Operation { + OPERATION_UNSPECIFIED = 0, + READ = 1, + MOVE = 2, + COPY = 3 + } + } + + /** Properties of a DataFlowEvent. */ + interface IDataFlowEvent { + + /** DataFlowEvent eventId */ + eventId?: (string|null); + + /** DataFlowEvent principalEmail */ + principalEmail?: (string|null); + + /** DataFlowEvent operation */ + operation?: (google.cloud.securitycenter.v2.DataFlowEvent.Operation|keyof typeof google.cloud.securitycenter.v2.DataFlowEvent.Operation|null); + + /** DataFlowEvent violatedLocation */ + violatedLocation?: (string|null); + + /** DataFlowEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DataFlowEvent. */ + class DataFlowEvent implements IDataFlowEvent { + + /** + * Constructs a new DataFlowEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IDataFlowEvent); + + /** DataFlowEvent eventId. */ + public eventId: string; + + /** DataFlowEvent principalEmail. */ + public principalEmail: string; + + /** DataFlowEvent operation. */ + public operation: (google.cloud.securitycenter.v2.DataFlowEvent.Operation|keyof typeof google.cloud.securitycenter.v2.DataFlowEvent.Operation); + + /** DataFlowEvent violatedLocation. */ + public violatedLocation: string; + + /** DataFlowEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DataFlowEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns DataFlowEvent instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IDataFlowEvent): google.cloud.securitycenter.v2.DataFlowEvent; + + /** + * Encodes the specified DataFlowEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataFlowEvent.verify|verify} messages. + * @param message DataFlowEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IDataFlowEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataFlowEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataFlowEvent.verify|verify} messages. + * @param message DataFlowEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IDataFlowEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataFlowEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataFlowEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.DataFlowEvent; + + /** + * Decodes a DataFlowEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataFlowEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.DataFlowEvent; + + /** + * Verifies a DataFlowEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataFlowEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataFlowEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.DataFlowEvent; + + /** + * Creates a plain object from a DataFlowEvent message. Also converts values to other types if specified. + * @param message DataFlowEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.DataFlowEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataFlowEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataFlowEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataFlowEvent { + + /** Operation enum. */ + enum Operation { + OPERATION_UNSPECIFIED = 0, + READ = 1, + MOVE = 2, + COPY = 3 + } + } + + /** Properties of a DataRetentionDeletionEvent. */ + interface IDataRetentionDeletionEvent { + + /** DataRetentionDeletionEvent eventDetectionTime */ + eventDetectionTime?: (google.protobuf.ITimestamp|null); + + /** DataRetentionDeletionEvent dataObjectCount */ + dataObjectCount?: (number|Long|string|null); + + /** DataRetentionDeletionEvent maxRetentionAllowed */ + maxRetentionAllowed?: (google.protobuf.IDuration|null); + + /** DataRetentionDeletionEvent eventType */ + eventType?: (google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType|keyof typeof google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType|null); + } + + /** Represents a DataRetentionDeletionEvent. */ + class DataRetentionDeletionEvent implements IDataRetentionDeletionEvent { + + /** + * Constructs a new DataRetentionDeletionEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent); + + /** DataRetentionDeletionEvent eventDetectionTime. */ + public eventDetectionTime?: (google.protobuf.ITimestamp|null); + + /** DataRetentionDeletionEvent dataObjectCount. */ + public dataObjectCount: (number|Long|string); + + /** DataRetentionDeletionEvent maxRetentionAllowed. */ + public maxRetentionAllowed?: (google.protobuf.IDuration|null); + + /** DataRetentionDeletionEvent eventType. */ + public eventType: (google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType|keyof typeof google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType); + + /** + * Creates a new DataRetentionDeletionEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns DataRetentionDeletionEvent instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent): google.cloud.securitycenter.v2.DataRetentionDeletionEvent; + + /** + * Encodes the specified DataRetentionDeletionEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify|verify} messages. + * @param message DataRetentionDeletionEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataRetentionDeletionEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify|verify} messages. + * @param message DataRetentionDeletionEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataRetentionDeletionEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataRetentionDeletionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.DataRetentionDeletionEvent; + + /** + * Decodes a DataRetentionDeletionEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataRetentionDeletionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.DataRetentionDeletionEvent; + + /** + * Verifies a DataRetentionDeletionEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataRetentionDeletionEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataRetentionDeletionEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.DataRetentionDeletionEvent; + + /** + * Creates a plain object from a DataRetentionDeletionEvent message. Also converts values to other types if specified. + * @param message DataRetentionDeletionEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.DataRetentionDeletionEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataRetentionDeletionEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataRetentionDeletionEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataRetentionDeletionEvent { + + /** EventType enum. */ + enum EventType { + EVENT_TYPE_UNSPECIFIED = 0, + EVENT_TYPE_MAX_TTL_EXCEEDED = 1 + } + } + + /** 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); + + /** Database version */ + version?: (string|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.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[]; + + /** Database version. */ + public version: 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.v2.IDatabase): google.cloud.securitycenter.v2.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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 a Disk. */ + interface IDisk { + + /** Disk name */ + name?: (string|null); + } + + /** Represents a Disk. */ + class Disk implements IDisk { + + /** + * Constructs a new Disk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IDisk); + + /** Disk name. */ + public name: string; + + /** + * Creates a new Disk instance using the specified properties. + * @param [properties] Properties to set + * @returns Disk instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IDisk): google.cloud.securitycenter.v2.Disk; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.securitycenter.v2.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Disk; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Disk; + + /** + * Verifies a Disk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Disk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Disk; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @param message Disk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Disk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Disk + * @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 { + + /** Exfiltration sources */ + sources?: (google.cloud.securitycenter.v2.IExfilResource[]|null); + + /** Exfiltration targets */ + targets?: (google.cloud.securitycenter.v2.IExfilResource[]|null); + + /** Exfiltration totalExfiltratedBytes */ + totalExfiltratedBytes?: (number|Long|string|null); + } + + /** Represents an Exfiltration. */ + class Exfiltration implements IExfiltration { + + /** + * Constructs a new Exfiltration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IExfiltration); + + /** Exfiltration sources. */ + public sources: google.cloud.securitycenter.v2.IExfilResource[]; + + /** Exfiltration targets. */ + public targets: google.cloud.securitycenter.v2.IExfilResource[]; + + /** Exfiltration totalExfiltratedBytes. */ + public totalExfiltratedBytes: (number|Long|string); + + /** + * Creates a new Exfiltration instance using the specified properties. + * @param [properties] Properties to set + * @returns Exfiltration instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IExfiltration): google.cloud.securitycenter.v2.Exfiltration; + + /** + * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IExfiltration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Exfiltration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Exfiltration to JSON. + * @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. */ + 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.v2.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.v2.IExfilResource): google.cloud.securitycenter.v2.ExfilResource; + + /** + * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IExfilResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ExfilResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExfilResource to JSON. + * @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. */ + 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); + + /** ExternalSystem caseUri */ + caseUri?: (string|null); + + /** ExternalSystem casePriority */ + casePriority?: (string|null); + + /** ExternalSystem caseSla */ + caseSla?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem caseCreateTime */ + caseCreateTime?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem caseCloseTime */ + caseCloseTime?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem ticketInfo */ + ticketInfo?: (google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo|null); + } + + /** Represents an ExternalSystem. */ + class ExternalSystem implements IExternalSystem { + + /** + * Constructs a new ExternalSystem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.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); + + /** ExternalSystem caseUri. */ + public caseUri: string; + + /** ExternalSystem casePriority. */ + public casePriority: string; + + /** ExternalSystem caseSla. */ + public caseSla?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem caseCreateTime. */ + public caseCreateTime?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem caseCloseTime. */ + public caseCloseTime?: (google.protobuf.ITimestamp|null); + + /** ExternalSystem ticketInfo. */ + public ticketInfo?: (google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo|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.v2.IExternalSystem): google.cloud.securitycenter.v2.ExternalSystem; + + /** + * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IExternalSystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ExternalSystem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalSystem to JSON. + * @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; + } + + namespace ExternalSystem { + + /** Properties of a TicketInfo. */ + interface ITicketInfo { + + /** TicketInfo id */ + id?: (string|null); + + /** TicketInfo assignee */ + assignee?: (string|null); + + /** TicketInfo description */ + description?: (string|null); + + /** TicketInfo uri */ + uri?: (string|null); + + /** TicketInfo status */ + status?: (string|null); + + /** TicketInfo updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TicketInfo. */ + class TicketInfo implements ITicketInfo { + + /** + * Constructs a new TicketInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo); + + /** TicketInfo id. */ + public id: string; + + /** TicketInfo assignee. */ + public assignee: string; + + /** TicketInfo description. */ + public description: string; + + /** TicketInfo uri. */ + public uri: string; + + /** TicketInfo status. */ + public status: string; + + /** TicketInfo updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TicketInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TicketInfo instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo): google.cloud.securitycenter.v2.ExternalSystem.TicketInfo; + + /** + * Encodes the specified TicketInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify|verify} messages. + * @param message TicketInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TicketInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify|verify} messages. + * @param message TicketInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TicketInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TicketInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ExternalSystem.TicketInfo; + + /** + * Decodes a TicketInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TicketInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ExternalSystem.TicketInfo; + + /** + * Verifies a TicketInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TicketInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TicketInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ExternalSystem.TicketInfo; + + /** + * Creates a plain object from a TicketInfo message. Also converts values to other types if specified. + * @param message TicketInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ExternalSystem.TicketInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TicketInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TicketInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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); + + /** File diskPath */ + diskPath?: (google.cloud.securitycenter.v2.File.IDiskPath|null); + + /** File operations */ + operations?: (google.cloud.securitycenter.v2.File.IFileOperation[]|null); + } + + /** Represents a File. */ + class File implements IFile { + + /** + * Constructs a new File. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.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; + + /** File diskPath. */ + public diskPath?: (google.cloud.securitycenter.v2.File.IDiskPath|null); + + /** File operations. */ + public operations: google.cloud.securitycenter.v2.File.IFileOperation[]; + + /** + * Creates a new File instance using the specified properties. + * @param [properties] Properties to set + * @returns File instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IFile): google.cloud.securitycenter.v2.File; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.File, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this File to JSON. + * @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; + } + + namespace File { + + /** Properties of a DiskPath. */ + interface IDiskPath { + + /** DiskPath partitionUuid */ + partitionUuid?: (string|null); + + /** DiskPath relativePath */ + relativePath?: (string|null); + } + + /** Represents a DiskPath. */ + class DiskPath implements IDiskPath { + + /** + * Constructs a new DiskPath. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.File.IDiskPath); + + /** DiskPath partitionUuid. */ + public partitionUuid: string; + + /** DiskPath relativePath. */ + public relativePath: string; + + /** + * Creates a new DiskPath instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskPath instance + */ + public static create(properties?: google.cloud.securitycenter.v2.File.IDiskPath): google.cloud.securitycenter.v2.File.DiskPath; + + /** + * Encodes the specified DiskPath message. Does not implicitly {@link google.cloud.securitycenter.v2.File.DiskPath.verify|verify} messages. + * @param message DiskPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.File.IDiskPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.DiskPath.verify|verify} messages. + * @param message DiskPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.File.IDiskPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskPath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.File.DiskPath; + + /** + * Decodes a DiskPath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.File.DiskPath; + + /** + * Verifies a DiskPath message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskPath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskPath + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.File.DiskPath; + + /** + * Creates a plain object from a DiskPath message. Also converts values to other types if specified. + * @param message DiskPath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.File.DiskPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskPath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskPath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOperation. */ + interface IFileOperation { + + /** FileOperation type */ + type?: (google.cloud.securitycenter.v2.File.FileOperation.OperationType|keyof typeof google.cloud.securitycenter.v2.File.FileOperation.OperationType|null); + } + + /** Represents a FileOperation. */ + class FileOperation implements IFileOperation { + + /** + * Constructs a new FileOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.File.IFileOperation); + + /** FileOperation type. */ + public type: (google.cloud.securitycenter.v2.File.FileOperation.OperationType|keyof typeof google.cloud.securitycenter.v2.File.FileOperation.OperationType); + + /** + * Creates a new FileOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOperation instance + */ + public static create(properties?: google.cloud.securitycenter.v2.File.IFileOperation): google.cloud.securitycenter.v2.File.FileOperation; + + /** + * Encodes the specified FileOperation message. Does not implicitly {@link google.cloud.securitycenter.v2.File.FileOperation.verify|verify} messages. + * @param message FileOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.File.IFileOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOperation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.FileOperation.verify|verify} messages. + * @param message FileOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.File.IFileOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.File.FileOperation; + + /** + * Decodes a FileOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.File.FileOperation; + + /** + * Verifies a FileOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.File.FileOperation; + + /** + * Creates a plain object from a FileOperation message. Also converts values to other types if specified. + * @param message FileOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.File.FileOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOperation { + + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + OPEN = 1, + READ = 2, + RENAME = 3, + WRITE = 4, + EXECUTE = 5 + } + } + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding canonicalName */ + canonicalName?: (string|null); + + /** Finding parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v2.Finding.State|keyof typeof google.cloud.securitycenter.v2.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.v2.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Finding severity */ + severity?: (google.cloud.securitycenter.v2.Finding.Severity|keyof typeof google.cloud.securitycenter.v2.Finding.Severity|null); + + /** Finding mute */ + mute?: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute|null); + + /** Finding muteInfo */ + muteInfo?: (google.cloud.securitycenter.v2.Finding.IMuteInfo|null); + + /** Finding findingClass */ + findingClass?: (google.cloud.securitycenter.v2.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v2.Finding.FindingClass|null); + + /** Finding indicator */ + indicator?: (google.cloud.securitycenter.v2.IIndicator|null); + + /** Finding vulnerability */ + vulnerability?: (google.cloud.securitycenter.v2.IVulnerability|null); + + /** Finding muteUpdateTime */ + muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Finding externalSystems */ + externalSystems?: ({ [k: string]: google.cloud.securitycenter.v2.IExternalSystem }|null); + + /** Finding mitreAttack */ + mitreAttack?: (google.cloud.securitycenter.v2.IMitreAttack|null); + + /** Finding access */ + access?: (google.cloud.securitycenter.v2.IAccess|null); + + /** Finding connections */ + connections?: (google.cloud.securitycenter.v2.IConnection[]|null); + + /** Finding muteInitiator */ + muteInitiator?: (string|null); + + /** Finding processes */ + processes?: (google.cloud.securitycenter.v2.IProcess[]|null); + + /** Finding contacts */ + contacts?: ({ [k: string]: google.cloud.securitycenter.v2.IContactDetails }|null); + + /** Finding compliances */ + compliances?: (google.cloud.securitycenter.v2.ICompliance[]|null); + + /** Finding parentDisplayName */ + parentDisplayName?: (string|null); + + /** Finding description */ + description?: (string|null); + + /** Finding exfiltration */ + exfiltration?: (google.cloud.securitycenter.v2.IExfiltration|null); + + /** Finding iamBindings */ + iamBindings?: (google.cloud.securitycenter.v2.IIamBinding[]|null); + + /** Finding nextSteps */ + nextSteps?: (string|null); + + /** Finding moduleName */ + moduleName?: (string|null); + + /** Finding containers */ + containers?: (google.cloud.securitycenter.v2.IContainer[]|null); + + /** Finding kubernetes */ + kubernetes?: (google.cloud.securitycenter.v2.IKubernetes|null); + + /** Finding database */ + database?: (google.cloud.securitycenter.v2.IDatabase|null); + + /** Finding attackExposure */ + attackExposure?: (google.cloud.securitycenter.v2.IAttackExposure|null); + + /** Finding files */ + files?: (google.cloud.securitycenter.v2.IFile[]|null); + + /** Finding cloudDlpInspection */ + cloudDlpInspection?: (google.cloud.securitycenter.v2.ICloudDlpInspection|null); + + /** Finding cloudDlpDataProfile */ + cloudDlpDataProfile?: (google.cloud.securitycenter.v2.ICloudDlpDataProfile|null); + + /** Finding kernelRootkit */ + kernelRootkit?: (google.cloud.securitycenter.v2.IKernelRootkit|null); + + /** Finding orgPolicies */ + orgPolicies?: (google.cloud.securitycenter.v2.IOrgPolicy[]|null); + + /** Finding job */ + job?: (google.cloud.securitycenter.v2.IJob|null); + + /** Finding application */ + application?: (google.cloud.securitycenter.v2.IApplication|null); + + /** Finding ipRules */ + ipRules?: (google.cloud.securitycenter.v2.IIpRules|null); + + /** Finding backupDisasterRecovery */ + backupDisasterRecovery?: (google.cloud.securitycenter.v2.IBackupDisasterRecovery|null); + + /** Finding securityPosture */ + securityPosture?: (google.cloud.securitycenter.v2.ISecurityPosture|null); + + /** Finding logEntries */ + logEntries?: (google.cloud.securitycenter.v2.ILogEntry[]|null); + + /** Finding loadBalancers */ + loadBalancers?: (google.cloud.securitycenter.v2.ILoadBalancer[]|null); + + /** Finding cloudArmor */ + cloudArmor?: (google.cloud.securitycenter.v2.ICloudArmor|null); + + /** Finding notebook */ + notebook?: (google.cloud.securitycenter.v2.INotebook|null); + + /** Finding toxicCombination */ + toxicCombination?: (google.cloud.securitycenter.v2.IToxicCombination|null); + + /** Finding groupMemberships */ + groupMemberships?: (google.cloud.securitycenter.v2.IGroupMembership[]|null); + + /** Finding disk */ + disk?: (google.cloud.securitycenter.v2.IDisk|null); + + /** Finding dataAccessEvents */ + dataAccessEvents?: (google.cloud.securitycenter.v2.IDataAccessEvent[]|null); + + /** Finding dataFlowEvents */ + dataFlowEvents?: (google.cloud.securitycenter.v2.IDataFlowEvent[]|null); + + /** Finding networks */ + networks?: (google.cloud.securitycenter.v2.INetwork[]|null); + + /** Finding dataRetentionDeletionEvents */ + dataRetentionDeletionEvents?: (google.cloud.securitycenter.v2.IDataRetentionDeletionEvent[]|null); + + /** Finding affectedResources */ + affectedResources?: (google.cloud.securitycenter.v2.IAffectedResources|null); + + /** Finding aiModel */ + aiModel?: (google.cloud.securitycenter.v2.IAiModel|null); + + /** Finding chokepoint */ + chokepoint?: (google.cloud.securitycenter.v2.IChokepoint|null); + + /** Finding vertexAi */ + vertexAi?: (google.cloud.securitycenter.v2.IVertexAi|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding canonicalName. */ + public canonicalName: string; + + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: (google.cloud.securitycenter.v2.Finding.State|keyof typeof google.cloud.securitycenter.v2.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.v2.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Finding severity. */ + public severity: (google.cloud.securitycenter.v2.Finding.Severity|keyof typeof google.cloud.securitycenter.v2.Finding.Severity); + + /** Finding mute. */ + public mute: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute); + + /** Finding muteInfo. */ + public muteInfo?: (google.cloud.securitycenter.v2.Finding.IMuteInfo|null); + + /** Finding findingClass. */ + public findingClass: (google.cloud.securitycenter.v2.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v2.Finding.FindingClass); + + /** Finding indicator. */ + public indicator?: (google.cloud.securitycenter.v2.IIndicator|null); + + /** Finding vulnerability. */ + public vulnerability?: (google.cloud.securitycenter.v2.IVulnerability|null); + + /** Finding muteUpdateTime. */ + public muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Finding externalSystems. */ + public externalSystems: { [k: string]: google.cloud.securitycenter.v2.IExternalSystem }; + + /** Finding mitreAttack. */ + public mitreAttack?: (google.cloud.securitycenter.v2.IMitreAttack|null); + + /** Finding access. */ + public access?: (google.cloud.securitycenter.v2.IAccess|null); + + /** Finding connections. */ + public connections: google.cloud.securitycenter.v2.IConnection[]; + + /** Finding muteInitiator. */ + public muteInitiator: string; + + /** Finding processes. */ + public processes: google.cloud.securitycenter.v2.IProcess[]; + + /** Finding contacts. */ + public contacts: { [k: string]: google.cloud.securitycenter.v2.IContactDetails }; + + /** Finding compliances. */ + public compliances: google.cloud.securitycenter.v2.ICompliance[]; + + /** Finding parentDisplayName. */ + public parentDisplayName: string; + + /** Finding description. */ + public description: string; + + /** Finding exfiltration. */ + public exfiltration?: (google.cloud.securitycenter.v2.IExfiltration|null); + + /** Finding iamBindings. */ + public iamBindings: google.cloud.securitycenter.v2.IIamBinding[]; + + /** Finding nextSteps. */ + public nextSteps: string; + + /** Finding moduleName. */ + public moduleName: string; + + /** Finding containers. */ + public containers: google.cloud.securitycenter.v2.IContainer[]; + + /** Finding kubernetes. */ + public kubernetes?: (google.cloud.securitycenter.v2.IKubernetes|null); + + /** Finding database. */ + public database?: (google.cloud.securitycenter.v2.IDatabase|null); + + /** Finding attackExposure. */ + public attackExposure?: (google.cloud.securitycenter.v2.IAttackExposure|null); + + /** Finding files. */ + public files: google.cloud.securitycenter.v2.IFile[]; + + /** Finding cloudDlpInspection. */ + public cloudDlpInspection?: (google.cloud.securitycenter.v2.ICloudDlpInspection|null); + + /** Finding cloudDlpDataProfile. */ + public cloudDlpDataProfile?: (google.cloud.securitycenter.v2.ICloudDlpDataProfile|null); + + /** Finding kernelRootkit. */ + public kernelRootkit?: (google.cloud.securitycenter.v2.IKernelRootkit|null); + + /** Finding orgPolicies. */ + public orgPolicies: google.cloud.securitycenter.v2.IOrgPolicy[]; + + /** Finding job. */ + public job?: (google.cloud.securitycenter.v2.IJob|null); + + /** Finding application. */ + public application?: (google.cloud.securitycenter.v2.IApplication|null); + + /** Finding ipRules. */ + public ipRules?: (google.cloud.securitycenter.v2.IIpRules|null); + + /** Finding backupDisasterRecovery. */ + public backupDisasterRecovery?: (google.cloud.securitycenter.v2.IBackupDisasterRecovery|null); + + /** Finding securityPosture. */ + public securityPosture?: (google.cloud.securitycenter.v2.ISecurityPosture|null); + + /** Finding logEntries. */ + public logEntries: google.cloud.securitycenter.v2.ILogEntry[]; + + /** Finding loadBalancers. */ + public loadBalancers: google.cloud.securitycenter.v2.ILoadBalancer[]; + + /** Finding cloudArmor. */ + public cloudArmor?: (google.cloud.securitycenter.v2.ICloudArmor|null); + + /** Finding notebook. */ + public notebook?: (google.cloud.securitycenter.v2.INotebook|null); + + /** Finding toxicCombination. */ + public toxicCombination?: (google.cloud.securitycenter.v2.IToxicCombination|null); + + /** Finding groupMemberships. */ + public groupMemberships: google.cloud.securitycenter.v2.IGroupMembership[]; + + /** Finding disk. */ + public disk?: (google.cloud.securitycenter.v2.IDisk|null); + + /** Finding dataAccessEvents. */ + public dataAccessEvents: google.cloud.securitycenter.v2.IDataAccessEvent[]; + + /** Finding dataFlowEvents. */ + public dataFlowEvents: google.cloud.securitycenter.v2.IDataFlowEvent[]; + + /** Finding networks. */ + public networks: google.cloud.securitycenter.v2.INetwork[]; + + /** Finding dataRetentionDeletionEvents. */ + public dataRetentionDeletionEvents: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent[]; + + /** Finding affectedResources. */ + public affectedResources?: (google.cloud.securitycenter.v2.IAffectedResources|null); + + /** Finding aiModel. */ + public aiModel?: (google.cloud.securitycenter.v2.IAiModel|null); + + /** Finding chokepoint. */ + public chokepoint?: (google.cloud.securitycenter.v2.IChokepoint|null); + + /** Finding vertexAi. */ + public vertexAi?: (google.cloud.securitycenter.v2.IVertexAi|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.v2.IFinding): google.cloud.securitycenter.v2.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Finding to JSON. + * @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 { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } + + /** Mute enum. */ + enum Mute { + MUTE_UNSPECIFIED = 0, + MUTED = 1, + UNMUTED = 2, + UNDEFINED = 3 + } + + /** Properties of a MuteInfo. */ + interface IMuteInfo { + + /** MuteInfo staticMute */ + staticMute?: (google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute|null); + + /** MuteInfo dynamicMuteRecords */ + dynamicMuteRecords?: (google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord[]|null); + } + + /** Represents a MuteInfo. */ + class MuteInfo implements IMuteInfo { + + /** + * Constructs a new MuteInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.Finding.IMuteInfo); + + /** MuteInfo staticMute. */ + public staticMute?: (google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute|null); + + /** MuteInfo dynamicMuteRecords. */ + public dynamicMuteRecords: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord[]; + + /** + * Creates a new MuteInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns MuteInfo instance + */ + public static create(properties?: google.cloud.securitycenter.v2.Finding.IMuteInfo): google.cloud.securitycenter.v2.Finding.MuteInfo; + + /** + * Encodes the specified MuteInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.verify|verify} messages. + * @param message MuteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.Finding.IMuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuteInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.verify|verify} messages. + * @param message MuteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.Finding.IMuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MuteInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Finding.MuteInfo; + + /** + * Decodes a MuteInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Finding.MuteInfo; + + /** + * Verifies a MuteInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MuteInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MuteInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Finding.MuteInfo; + + /** + * Creates a plain object from a MuteInfo message. Also converts values to other types if specified. + * @param message MuteInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Finding.MuteInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MuteInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MuteInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MuteInfo { + + /** Properties of a StaticMute. */ + interface IStaticMute { + + /** StaticMute state */ + state?: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute|null); + + /** StaticMute applyTime */ + applyTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StaticMute. */ + class StaticMute implements IStaticMute { + + /** + * Constructs a new StaticMute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute); + + /** StaticMute state. */ + public state: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute); + + /** StaticMute applyTime. */ + public applyTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new StaticMute instance using the specified properties. + * @param [properties] Properties to set + * @returns StaticMute instance + */ + public static create(properties?: google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute): google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute; + + /** + * Encodes the specified StaticMute message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify|verify} messages. + * @param message StaticMute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StaticMute message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify|verify} messages. + * @param message StaticMute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StaticMute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StaticMute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute; + + /** + * Decodes a StaticMute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StaticMute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute; + + /** + * Verifies a StaticMute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StaticMute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StaticMute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute; + + /** + * Creates a plain object from a StaticMute message. Also converts values to other types if specified. + * @param message StaticMute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StaticMute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StaticMute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DynamicMuteRecord. */ + interface IDynamicMuteRecord { + + /** DynamicMuteRecord muteConfig */ + muteConfig?: (string|null); + + /** DynamicMuteRecord matchTime */ + matchTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DynamicMuteRecord. */ + class DynamicMuteRecord implements IDynamicMuteRecord { + + /** + * Constructs a new DynamicMuteRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord); + + /** DynamicMuteRecord muteConfig. */ + public muteConfig: string; + + /** DynamicMuteRecord matchTime. */ + public matchTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DynamicMuteRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns DynamicMuteRecord instance + */ + public static create(properties?: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord): google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord; + + /** + * Encodes the specified DynamicMuteRecord message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. + * @param message DynamicMuteRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DynamicMuteRecord message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. + * @param message DynamicMuteRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DynamicMuteRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DynamicMuteRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord; + + /** + * Decodes a DynamicMuteRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DynamicMuteRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord; + + /** + * Verifies a DynamicMuteRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DynamicMuteRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DynamicMuteRecord + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord; + + /** + * Creates a plain object from a DynamicMuteRecord message. Also converts values to other types if specified. + * @param message DynamicMuteRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DynamicMuteRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DynamicMuteRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** FindingClass enum. */ + enum FindingClass { + FINDING_CLASS_UNSPECIFIED = 0, + THREAT = 1, + VULNERABILITY = 2, + MISCONFIGURATION = 3, + OBSERVATION = 4, + SCC_ERROR = 5, + POSTURE_VIOLATION = 6, + TOXIC_COMBINATION = 7, + SENSITIVE_DATA_RISK = 8, + CHOKEPOINT = 9 + } + } + + /** Properties of a GroupMembership. */ + interface IGroupMembership { + + /** GroupMembership groupType */ + groupType?: (google.cloud.securitycenter.v2.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v2.GroupMembership.GroupType|null); + + /** GroupMembership groupId */ + groupId?: (string|null); + } + + /** Represents a GroupMembership. */ + class GroupMembership implements IGroupMembership { + + /** + * Constructs a new GroupMembership. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IGroupMembership); + + /** GroupMembership groupType. */ + public groupType: (google.cloud.securitycenter.v2.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v2.GroupMembership.GroupType); + + /** GroupMembership groupId. */ + public groupId: string; + + /** + * Creates a new GroupMembership instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupMembership instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IGroupMembership): google.cloud.securitycenter.v2.GroupMembership; + + /** + * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. + * @param message GroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. + * @param message GroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupMembership message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GroupMembership; + + /** + * Decodes a GroupMembership message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GroupMembership; + + /** + * Verifies a GroupMembership message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupMembership + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GroupMembership; + + /** + * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. + * @param message GroupMembership + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.GroupMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupMembership to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupMembership + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GroupMembership { + + /** GroupType enum. */ + enum GroupType { + GROUP_TYPE_UNSPECIFIED = 0, + GROUP_TYPE_TOXIC_COMBINATION = 1, + GROUP_TYPE_CHOKEPOINT = 3 + } + } + + /** Properties of an IamBinding. */ + interface IIamBinding { + + /** IamBinding action */ + action?: (google.cloud.securitycenter.v2.IamBinding.Action|keyof typeof google.cloud.securitycenter.v2.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.v2.IIamBinding); + + /** IamBinding action. */ + public action: (google.cloud.securitycenter.v2.IamBinding.Action|keyof typeof google.cloud.securitycenter.v2.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.v2.IIamBinding): google.cloud.securitycenter.v2.IamBinding; + + /** + * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IIamBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.IamBinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamBinding to JSON. + * @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 { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an Indicator. */ + interface IIndicator { + + /** Indicator ipAddresses */ + ipAddresses?: (string[]|null); + + /** Indicator domains */ + domains?: (string[]|null); + + /** Indicator signatures */ + signatures?: (google.cloud.securitycenter.v2.Indicator.IProcessSignature[]|null); + + /** Indicator uris */ + uris?: (string[]|null); + } + + /** Represents an Indicator. */ + class Indicator implements IIndicator { + + /** + * Constructs a new Indicator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IIndicator); + + /** Indicator ipAddresses. */ + public ipAddresses: string[]; + + /** Indicator domains. */ + public domains: string[]; + + /** Indicator signatures. */ + public signatures: google.cloud.securitycenter.v2.Indicator.IProcessSignature[]; + + /** Indicator uris. */ + public uris: 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.v2.IIndicator): google.cloud.securitycenter.v2.Indicator; + + /** + * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Indicator to JSON. + * @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 { + + /** Properties of a ProcessSignature. */ + interface IProcessSignature { + + /** ProcessSignature memoryHashSignature */ + memoryHashSignature?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.IMemoryHashSignature|null); + + /** ProcessSignature yaraRuleSignature */ + yaraRuleSignature?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature|null); + + /** ProcessSignature signatureType */ + signatureType?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType|keyof typeof google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType|null); + } + + /** Represents a ProcessSignature. */ + class ProcessSignature implements IProcessSignature { + + /** + * Constructs a new ProcessSignature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.Indicator.IProcessSignature); + + /** ProcessSignature memoryHashSignature. */ + public memoryHashSignature?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.IMemoryHashSignature|null); + + /** ProcessSignature yaraRuleSignature. */ + public yaraRuleSignature?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature|null); + + /** ProcessSignature signatureType. */ + public signatureType: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType|keyof typeof google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType); + + /** 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.v2.Indicator.IProcessSignature): google.cloud.securitycenter.v2.Indicator.ProcessSignature; + + /** + * Encodes the specified ProcessSignature message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Indicator.IProcessSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessSignature to JSON. + * @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 { + + /** Properties of a MemoryHashSignature. */ + interface IMemoryHashSignature { + + /** MemoryHashSignature binaryFamily */ + binaryFamily?: (string|null); + + /** MemoryHashSignature detections */ + detections?: (google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IMemoryHashSignature); + + /** MemoryHashSignature binaryFamily. */ + public binaryFamily: string; + + /** MemoryHashSignature detections. */ + public detections: google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IMemoryHashSignature): google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Encodes the specified MemoryHashSignature message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IMemoryHashSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MemoryHashSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MemoryHashSignature to JSON. + * @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 { + + /** 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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.IDetection): google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Encodes the specified Detection message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.IDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Detection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Detection to JSON. + * @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; + } + } + + /** 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.v2.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.v2.Indicator.ProcessSignature.IYaraRuleSignature): google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Encodes the specified YaraRuleSignature message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IYaraRuleSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YaraRuleSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YaraRuleSignature to JSON. + * @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; + } + + /** SignatureType enum. */ + enum SignatureType { + SIGNATURE_TYPE_UNSPECIFIED = 0, + SIGNATURE_TYPE_PROCESS = 1, + SIGNATURE_TYPE_FILE = 2 + } + } + } + + /** Properties of an IpRules. */ + interface IIpRules { + + /** IpRules direction */ + direction?: (google.cloud.securitycenter.v2.IpRules.Direction|keyof typeof google.cloud.securitycenter.v2.IpRules.Direction|null); + + /** IpRules allowed */ + allowed?: (google.cloud.securitycenter.v2.IAllowed|null); + + /** IpRules denied */ + denied?: (google.cloud.securitycenter.v2.IDenied|null); + + /** IpRules sourceIpRanges */ + sourceIpRanges?: (string[]|null); + + /** IpRules destinationIpRanges */ + destinationIpRanges?: (string[]|null); + + /** IpRules exposedServices */ + exposedServices?: (string[]|null); + } + + /** Represents an IpRules. */ + class IpRules implements IIpRules { + + /** + * Constructs a new IpRules. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IIpRules); + + /** IpRules direction. */ + public direction: (google.cloud.securitycenter.v2.IpRules.Direction|keyof typeof google.cloud.securitycenter.v2.IpRules.Direction); + + /** IpRules allowed. */ + public allowed?: (google.cloud.securitycenter.v2.IAllowed|null); + + /** IpRules denied. */ + public denied?: (google.cloud.securitycenter.v2.IDenied|null); + + /** IpRules sourceIpRanges. */ + public sourceIpRanges: string[]; + + /** IpRules destinationIpRanges. */ + public destinationIpRanges: string[]; + + /** IpRules exposedServices. */ + public exposedServices: string[]; + + /** IpRules rules. */ + public rules?: ("allowed"|"denied"); + + /** + * Creates a new IpRules instance using the specified properties. + * @param [properties] Properties to set + * @returns IpRules instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IIpRules): google.cloud.securitycenter.v2.IpRules; + + /** + * Encodes the specified IpRules message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRules.verify|verify} messages. + * @param message IpRules message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IIpRules, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IpRules message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRules.verify|verify} messages. + * @param message IpRules message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IIpRules, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IpRules message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IpRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.IpRules; + + /** + * Decodes an IpRules message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IpRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.IpRules; + + /** + * Verifies an IpRules message. + * @param message Plain 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 IpRules message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IpRules + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.IpRules; + + /** + * Creates a plain object from an IpRules message. Also converts values to other types if specified. + * @param message IpRules + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.IpRules, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IpRules to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IpRules + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IpRules { + + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + INGRESS = 1, + EGRESS = 2 + } + } + + /** Properties of an IpRule. */ + interface IIpRule { + + /** IpRule protocol */ + protocol?: (string|null); + + /** IpRule portRanges */ + portRanges?: (google.cloud.securitycenter.v2.IpRule.IPortRange[]|null); + } + + /** Represents an IpRule. */ + class IpRule implements IIpRule { + + /** + * Constructs a new IpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IIpRule); + + /** IpRule protocol. */ + public protocol: string; + + /** IpRule portRanges. */ + public portRanges: google.cloud.securitycenter.v2.IpRule.IPortRange[]; + + /** + * Creates a new IpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns IpRule instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IIpRule): google.cloud.securitycenter.v2.IpRule; + + /** + * Encodes the specified IpRule message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.verify|verify} messages. + * @param message IpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IIpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IpRule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.verify|verify} messages. + * @param message IpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IIpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.IpRule; + + /** + * Decodes an IpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.IpRule; + + /** + * Verifies an IpRule message. + * @param message Plain 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 IpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IpRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.IpRule; + + /** + * Creates a plain object from an IpRule message. Also converts values to other types if specified. + * @param message IpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.IpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IpRule { + + /** Properties of a PortRange. */ + interface IPortRange { + + /** PortRange min */ + min?: (number|Long|string|null); + + /** PortRange max */ + max?: (number|Long|string|null); + } + + /** Represents a PortRange. */ + class PortRange implements IPortRange { + + /** + * Constructs a new PortRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IpRule.IPortRange); + + /** PortRange min. */ + public min: (number|Long|string); + + /** PortRange max. */ + public max: (number|Long|string); + + /** + * Creates a new PortRange instance using the specified properties. + * @param [properties] Properties to set + * @returns PortRange instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IpRule.IPortRange): google.cloud.securitycenter.v2.IpRule.PortRange; + + /** + * Encodes the specified PortRange message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.PortRange.verify|verify} messages. + * @param message PortRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IpRule.IPortRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PortRange message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.PortRange.verify|verify} messages. + * @param message PortRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IpRule.IPortRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PortRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PortRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.IpRule.PortRange; + + /** + * Decodes a PortRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PortRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.IpRule.PortRange; + + /** + * Verifies a PortRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PortRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PortRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.IpRule.PortRange; + + /** + * Creates a plain object from a PortRange message. Also converts values to other types if specified. + * @param message PortRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.IpRule.PortRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PortRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PortRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Allowed. */ + interface IAllowed { + + /** Allowed ipRules */ + ipRules?: (google.cloud.securitycenter.v2.IIpRule[]|null); + } + + /** Represents an Allowed. */ + class Allowed implements IAllowed { + + /** + * Constructs a new Allowed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAllowed); + + /** Allowed ipRules. */ + public ipRules: google.cloud.securitycenter.v2.IIpRule[]; + + /** + * Creates a new Allowed instance using the specified properties. + * @param [properties] Properties to set + * @returns Allowed instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAllowed): google.cloud.securitycenter.v2.Allowed; + + /** + * Encodes the specified Allowed message. Does not implicitly {@link google.cloud.securitycenter.v2.Allowed.verify|verify} messages. + * @param message Allowed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAllowed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Allowed message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Allowed.verify|verify} messages. + * @param message Allowed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAllowed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Allowed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Allowed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Allowed; + + /** + * Decodes an Allowed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Allowed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Allowed; + + /** + * Verifies an Allowed message. + * @param message Plain 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 Allowed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Allowed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Allowed; + + /** + * Creates a plain object from an Allowed message. Also converts values to other types if specified. + * @param message Allowed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Allowed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Allowed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Allowed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Denied. */ + interface IDenied { + + /** Denied ipRules */ + ipRules?: (google.cloud.securitycenter.v2.IIpRule[]|null); + } + + /** Represents a Denied. */ + class Denied implements IDenied { + + /** + * Constructs a new Denied. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IDenied); + + /** Denied ipRules. */ + public ipRules: google.cloud.securitycenter.v2.IIpRule[]; + + /** + * Creates a new Denied instance using the specified properties. + * @param [properties] Properties to set + * @returns Denied instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IDenied): google.cloud.securitycenter.v2.Denied; + + /** + * Encodes the specified Denied message. Does not implicitly {@link google.cloud.securitycenter.v2.Denied.verify|verify} messages. + * @param message Denied message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IDenied, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Denied message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Denied.verify|verify} messages. + * @param message Denied message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IDenied, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Denied message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Denied + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Denied; + + /** + * Decodes a Denied message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Denied + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Denied; + + /** + * Verifies a Denied message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Denied message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Denied + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Denied; + + /** + * Creates a plain object from a Denied message. Also converts values to other types if specified. + * @param message Denied + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Denied, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Denied to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Denied + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job state */ + state?: (google.cloud.securitycenter.v2.JobState|keyof typeof google.cloud.securitycenter.v2.JobState|null); + + /** Job errorCode */ + errorCode?: (number|null); + + /** Job location */ + location?: (string|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IJob); + + /** Job name. */ + public name: string; + + /** Job state. */ + public state: (google.cloud.securitycenter.v2.JobState|keyof typeof google.cloud.securitycenter.v2.JobState); + + /** Job errorCode. */ + public errorCode: number; + + /** Job location. */ + public location: string; + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IJob): google.cloud.securitycenter.v2.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.securitycenter.v2.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** JobState enum. */ + enum JobState { + JOB_STATE_UNSPECIFIED = 0, + PENDING = 1, + RUNNING = 2, + SUCCEEDED = 3, + FAILED = 4 + } + + /** Properties of a KernelRootkit. */ + interface IKernelRootkit { + + /** KernelRootkit name */ + name?: (string|null); + + /** KernelRootkit unexpectedCodeModification */ + unexpectedCodeModification?: (boolean|null); + + /** KernelRootkit unexpectedReadOnlyDataModification */ + unexpectedReadOnlyDataModification?: (boolean|null); + + /** KernelRootkit unexpectedFtraceHandler */ + unexpectedFtraceHandler?: (boolean|null); + + /** KernelRootkit unexpectedKprobeHandler */ + unexpectedKprobeHandler?: (boolean|null); + + /** KernelRootkit unexpectedKernelCodePages */ + unexpectedKernelCodePages?: (boolean|null); + + /** KernelRootkit unexpectedSystemCallHandler */ + unexpectedSystemCallHandler?: (boolean|null); + + /** KernelRootkit unexpectedInterruptHandler */ + unexpectedInterruptHandler?: (boolean|null); + + /** KernelRootkit unexpectedProcessesInRunqueue */ + unexpectedProcessesInRunqueue?: (boolean|null); + } + + /** Represents a KernelRootkit. */ + class KernelRootkit implements IKernelRootkit { + + /** + * Constructs a new KernelRootkit. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IKernelRootkit); + + /** KernelRootkit name. */ + public name: string; + + /** KernelRootkit unexpectedCodeModification. */ + public unexpectedCodeModification: boolean; + + /** KernelRootkit unexpectedReadOnlyDataModification. */ + public unexpectedReadOnlyDataModification: boolean; + + /** KernelRootkit unexpectedFtraceHandler. */ + public unexpectedFtraceHandler: boolean; + + /** KernelRootkit unexpectedKprobeHandler. */ + public unexpectedKprobeHandler: boolean; + + /** KernelRootkit unexpectedKernelCodePages. */ + public unexpectedKernelCodePages: boolean; + + /** KernelRootkit unexpectedSystemCallHandler. */ + public unexpectedSystemCallHandler: boolean; + + /** KernelRootkit unexpectedInterruptHandler. */ + public unexpectedInterruptHandler: boolean; + + /** KernelRootkit unexpectedProcessesInRunqueue. */ + public unexpectedProcessesInRunqueue: boolean; + + /** + * Creates a new KernelRootkit instance using the specified properties. + * @param [properties] Properties to set + * @returns KernelRootkit instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IKernelRootkit): google.cloud.securitycenter.v2.KernelRootkit; + + /** + * Encodes the specified KernelRootkit message. Does not implicitly {@link google.cloud.securitycenter.v2.KernelRootkit.verify|verify} messages. + * @param message KernelRootkit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IKernelRootkit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KernelRootkit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.KernelRootkit.verify|verify} messages. + * @param message KernelRootkit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IKernelRootkit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KernelRootkit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KernelRootkit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.KernelRootkit; + + /** + * Decodes a KernelRootkit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KernelRootkit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.KernelRootkit; + + /** + * Verifies a KernelRootkit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KernelRootkit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KernelRootkit + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.KernelRootkit; + + /** + * Creates a plain object from a KernelRootkit message. Also converts values to other types if specified. + * @param message KernelRootkit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.KernelRootkit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KernelRootkit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KernelRootkit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Kubernetes. */ + interface IKubernetes { + + /** Kubernetes pods */ + pods?: (google.cloud.securitycenter.v2.Kubernetes.IPod[]|null); + + /** Kubernetes nodes */ + nodes?: (google.cloud.securitycenter.v2.Kubernetes.INode[]|null); + + /** Kubernetes nodePools */ + nodePools?: (google.cloud.securitycenter.v2.Kubernetes.INodePool[]|null); + + /** Kubernetes roles */ + roles?: (google.cloud.securitycenter.v2.Kubernetes.IRole[]|null); + + /** Kubernetes bindings */ + bindings?: (google.cloud.securitycenter.v2.Kubernetes.IBinding[]|null); + + /** Kubernetes accessReviews */ + accessReviews?: (google.cloud.securitycenter.v2.Kubernetes.IAccessReview[]|null); + + /** Kubernetes objects */ + objects?: (google.cloud.securitycenter.v2.Kubernetes.IObject[]|null); + } + + /** Represents a Kubernetes. */ + class Kubernetes implements IKubernetes { + + /** + * Constructs a new Kubernetes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IKubernetes); + + /** Kubernetes pods. */ + public pods: google.cloud.securitycenter.v2.Kubernetes.IPod[]; + + /** Kubernetes nodes. */ + public nodes: google.cloud.securitycenter.v2.Kubernetes.INode[]; + + /** Kubernetes nodePools. */ + public nodePools: google.cloud.securitycenter.v2.Kubernetes.INodePool[]; + + /** Kubernetes roles. */ + public roles: google.cloud.securitycenter.v2.Kubernetes.IRole[]; + + /** Kubernetes bindings. */ + public bindings: google.cloud.securitycenter.v2.Kubernetes.IBinding[]; + + /** Kubernetes accessReviews. */ + public accessReviews: google.cloud.securitycenter.v2.Kubernetes.IAccessReview[]; + + /** Kubernetes objects. */ + public objects: google.cloud.securitycenter.v2.Kubernetes.IObject[]; + + /** + * Creates a new Kubernetes instance using the specified properties. + * @param [properties] Properties to set + * @returns Kubernetes instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IKubernetes): google.cloud.securitycenter.v2.Kubernetes; + + /** + * Encodes the specified Kubernetes message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IKubernetes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Kubernetes message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Kubernetes to JSON. + * @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 { + + /** Properties of a Pod. */ + interface IPod { + + /** Pod ns */ + ns?: (string|null); + + /** Pod name */ + name?: (string|null); + + /** Pod labels */ + labels?: (google.cloud.securitycenter.v2.ILabel[]|null); + + /** Pod containers */ + containers?: (google.cloud.securitycenter.v2.IContainer[]|null); + } + + /** Represents a Pod. */ + class Pod implements IPod { + + /** + * Constructs a new Pod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.Kubernetes.IPod); + + /** Pod ns. */ + public ns: string; + + /** Pod name. */ + public name: string; + + /** Pod labels. */ + public labels: google.cloud.securitycenter.v2.ILabel[]; + + /** Pod containers. */ + public containers: google.cloud.securitycenter.v2.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.v2.Kubernetes.IPod): google.cloud.securitycenter.v2.Kubernetes.Pod; + + /** + * Encodes the specified Pod message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.IPod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Pod message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Pod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Pod to JSON. + * @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. */ + 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.v2.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.v2.Kubernetes.INode): google.cloud.securitycenter.v2.Kubernetes.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @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. */ + interface INodePool { + + /** NodePool name */ + name?: (string|null); + + /** NodePool nodes */ + nodes?: (google.cloud.securitycenter.v2.Kubernetes.INode[]|null); + } + + /** Represents a NodePool. */ + class NodePool implements INodePool { + + /** + * Constructs a new NodePool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.Kubernetes.INodePool); + + /** NodePool name. */ + public name: string; + + /** NodePool nodes. */ + public nodes: google.cloud.securitycenter.v2.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.v2.Kubernetes.INodePool): google.cloud.securitycenter.v2.Kubernetes.NodePool; + + /** + * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.INodePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.NodePool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodePool to JSON. + * @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. */ + interface IRole { + + /** Role kind */ + kind?: (google.cloud.securitycenter.v2.Kubernetes.Role.Kind|keyof typeof google.cloud.securitycenter.v2.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.v2.Kubernetes.IRole); + + /** Role kind. */ + public kind: (google.cloud.securitycenter.v2.Kubernetes.Role.Kind|keyof typeof google.cloud.securitycenter.v2.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.v2.Kubernetes.IRole): google.cloud.securitycenter.v2.Kubernetes.Role; + + /** + * Encodes the specified Role message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.IRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Role message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Role, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Role to JSON. + * @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 { + + /** 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.v2.Kubernetes.IRole|null); + + /** Binding subjects */ + subjects?: (google.cloud.securitycenter.v2.Kubernetes.ISubject[]|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.Kubernetes.IBinding); + + /** Binding ns. */ + public ns: string; + + /** Binding name. */ + public name: string; + + /** Binding role. */ + public role?: (google.cloud.securitycenter.v2.Kubernetes.IRole|null); + + /** Binding subjects. */ + public subjects: google.cloud.securitycenter.v2.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.v2.Kubernetes.IBinding): google.cloud.securitycenter.v2.Kubernetes.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @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. */ + interface ISubject { + + /** Subject kind */ + kind?: (google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType|keyof typeof google.cloud.securitycenter.v2.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.v2.Kubernetes.ISubject); + + /** Subject kind. */ + public kind: (google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType|keyof typeof google.cloud.securitycenter.v2.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.v2.Kubernetes.ISubject): google.cloud.securitycenter.v2.Kubernetes.Subject; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subject to JSON. + * @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 { + + /** 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.v2.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.v2.Kubernetes.IAccessReview): google.cloud.securitycenter.v2.Kubernetes.AccessReview; + + /** + * Encodes the specified AccessReview message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.IAccessReview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessReview message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.AccessReview, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessReview to JSON. + * @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; + } + + /** Properties of an Object. */ + interface IObject { + + /** Object group */ + group?: (string|null); + + /** Object kind */ + kind?: (string|null); + + /** Object ns */ + ns?: (string|null); + + /** Object name */ + name?: (string|null); + + /** Object containers */ + containers?: (google.cloud.securitycenter.v2.IContainer[]|null); + } + + /** Represents an Object. */ + class Object implements IObject { + + /** + * Constructs a new Object. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.Kubernetes.IObject); + + /** Object group. */ + public group: string; + + /** Object kind. */ + public kind: string; + + /** Object ns. */ + public ns: string; + + /** Object name. */ + public name: string; + + /** Object containers. */ + public containers: google.cloud.securitycenter.v2.IContainer[]; + + /** + * Creates a new Object instance using the specified properties. + * @param [properties] Properties to set + * @returns Object instance + */ + public static create(properties?: google.cloud.securitycenter.v2.Kubernetes.IObject): google.cloud.securitycenter.v2.Kubernetes.object; + + /** + * Encodes the specified Object message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Object.verify|verify} messages. + * @param message Object message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.Kubernetes.IObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Object message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Object.verify|verify} messages. + * @param message Object message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.Kubernetes.IObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Object message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Kubernetes.object; + + /** + * Decodes an Object message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Kubernetes.object; + + /** + * Verifies an Object message. + * @param message Plain 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 Object message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Object + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Kubernetes.object; + + /** + * Creates a plain object from an Object message. Also converts values to other types if specified. + * @param message Object + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Kubernetes.object, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Object to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Object + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LoadBalancer. */ + interface ILoadBalancer { + + /** LoadBalancer name */ + name?: (string|null); + } + + /** Represents a LoadBalancer. */ + class LoadBalancer implements ILoadBalancer { + + /** + * Constructs a new LoadBalancer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ILoadBalancer); + + /** LoadBalancer name. */ + public name: string; + + /** + * Creates a new LoadBalancer instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadBalancer instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ILoadBalancer): google.cloud.securitycenter.v2.LoadBalancer; + + /** + * Encodes the specified LoadBalancer message. Does not implicitly {@link google.cloud.securitycenter.v2.LoadBalancer.verify|verify} messages. + * @param message LoadBalancer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ILoadBalancer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoadBalancer message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.LoadBalancer.verify|verify} messages. + * @param message LoadBalancer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ILoadBalancer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoadBalancer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadBalancer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.LoadBalancer; + + /** + * Decodes a LoadBalancer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadBalancer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.LoadBalancer; + + /** + * Verifies a LoadBalancer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoadBalancer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadBalancer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.LoadBalancer; + + /** + * Creates a plain object from a LoadBalancer message. Also converts values to other types if specified. + * @param message LoadBalancer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.LoadBalancer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoadBalancer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoadBalancer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogEntry. */ + interface ILogEntry { + + /** LogEntry cloudLoggingEntry */ + cloudLoggingEntry?: (google.cloud.securitycenter.v2.ICloudLoggingEntry|null); + } + + /** Represents a LogEntry. */ + class LogEntry implements ILogEntry { + + /** + * Constructs a new LogEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ILogEntry); + + /** LogEntry cloudLoggingEntry. */ + public cloudLoggingEntry?: (google.cloud.securitycenter.v2.ICloudLoggingEntry|null); + + /** LogEntry logEntry. */ + public logEntry?: "cloudLoggingEntry"; + + /** + * Creates a new LogEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns LogEntry instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ILogEntry): google.cloud.securitycenter.v2.LogEntry; + + /** + * Encodes the specified LogEntry message. Does not implicitly {@link google.cloud.securitycenter.v2.LogEntry.verify|verify} messages. + * @param message LogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.LogEntry.verify|verify} messages. + * @param message LogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.LogEntry; + + /** + * Decodes a LogEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.LogEntry; + + /** + * Verifies a LogEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.LogEntry; + + /** + * Creates a plain object from a LogEntry message. Also converts values to other types if specified. + * @param message LogEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.LogEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudLoggingEntry. */ + interface ICloudLoggingEntry { + + /** CloudLoggingEntry insertId */ + insertId?: (string|null); + + /** CloudLoggingEntry logId */ + logId?: (string|null); + + /** CloudLoggingEntry resourceContainer */ + resourceContainer?: (string|null); + + /** CloudLoggingEntry timestamp */ + timestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CloudLoggingEntry. */ + class CloudLoggingEntry implements ICloudLoggingEntry { + + /** + * Constructs a new CloudLoggingEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICloudLoggingEntry); + + /** CloudLoggingEntry insertId. */ + public insertId: string; + + /** CloudLoggingEntry logId. */ + public logId: string; + + /** CloudLoggingEntry resourceContainer. */ + public resourceContainer: string; + + /** CloudLoggingEntry timestamp. */ + public timestamp?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CloudLoggingEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingEntry instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ICloudLoggingEntry): google.cloud.securitycenter.v2.CloudLoggingEntry; + + /** + * Encodes the specified CloudLoggingEntry message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudLoggingEntry.verify|verify} messages. + * @param message CloudLoggingEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ICloudLoggingEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudLoggingEntry.verify|verify} messages. + * @param message CloudLoggingEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ICloudLoggingEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CloudLoggingEntry; + + /** + * Decodes a CloudLoggingEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CloudLoggingEntry; + + /** + * Verifies a CloudLoggingEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CloudLoggingEntry; + + /** + * Creates a plain object from a CloudLoggingEntry message. Also converts values to other types if specified. + * @param message CloudLoggingEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.CloudLoggingEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MitreAttack. */ + interface IMitreAttack { + + /** MitreAttack primaryTactic */ + primaryTactic?: (google.cloud.securitycenter.v2.MitreAttack.Tactic|keyof typeof google.cloud.securitycenter.v2.MitreAttack.Tactic|null); + + /** MitreAttack primaryTechniques */ + primaryTechniques?: (google.cloud.securitycenter.v2.MitreAttack.Technique[]|null); + + /** MitreAttack additionalTactics */ + additionalTactics?: (google.cloud.securitycenter.v2.MitreAttack.Tactic[]|null); + + /** MitreAttack additionalTechniques */ + additionalTechniques?: (google.cloud.securitycenter.v2.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.v2.IMitreAttack); + + /** MitreAttack primaryTactic. */ + public primaryTactic: (google.cloud.securitycenter.v2.MitreAttack.Tactic|keyof typeof google.cloud.securitycenter.v2.MitreAttack.Tactic); + + /** MitreAttack primaryTechniques. */ + public primaryTechniques: google.cloud.securitycenter.v2.MitreAttack.Technique[]; + + /** MitreAttack additionalTactics. */ + public additionalTactics: google.cloud.securitycenter.v2.MitreAttack.Tactic[]; + + /** MitreAttack additionalTechniques. */ + public additionalTechniques: google.cloud.securitycenter.v2.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.v2.IMitreAttack): google.cloud.securitycenter.v2.MitreAttack; + + /** + * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IMitreAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MitreAttack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.MitreAttack, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MitreAttack to JSON. + * @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 { + + /** 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, + DATA_OBFUSCATION = 70, + DATA_OBFUSCATION_STEGANOGRAPHY = 71, + OS_CREDENTIAL_DUMPING = 114, + OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM = 115, + OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW = 122, + DATA_FROM_LOCAL_SYSTEM = 117, + AUTOMATED_EXFILTRATION = 68, + OBFUSCATED_FILES_OR_INFO = 72, + STEGANOGRAPHY = 73, + COMPILE_AFTER_DELIVERY = 74, + COMMAND_OBFUSCATION = 75, + SCHEDULED_TRANSFER = 120, + SYSTEM_OWNER_USER_DISCOVERY = 118, + MASQUERADING = 49, + MATCH_LEGITIMATE_NAME_OR_LOCATION = 50, + BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37, + STARTUP_ITEMS = 38, + NETWORK_SERVICE_DISCOVERY = 32, + SCHEDULED_TASK_JOB = 89, + SCHEDULED_TASK_JOB_CRON = 119, + CONTAINER_ORCHESTRATION_JOB = 90, + PROCESS_INJECTION = 93, + INPUT_CAPTURE = 103, + INPUT_CAPTURE_KEYLOGGING = 104, + PROCESS_DISCOVERY = 56, + COMMAND_AND_SCRIPTING_INTERPRETER = 6, + UNIX_SHELL = 7, + PYTHON = 59, + EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63, + PERMISSION_GROUPS_DISCOVERY = 18, + CLOUD_GROUPS = 19, + INDICATOR_REMOVAL = 123, + INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS = 124, + INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY = 125, + INDICATOR_REMOVAL_FILE_DELETION = 64, + INDICATOR_REMOVAL_TIMESTOMP = 128, + INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA = 126, + APPLICATION_LAYER_PROTOCOL = 45, + DNS = 46, + SOFTWARE_DEPLOYMENT_TOOLS = 47, + VALID_ACCOUNTS = 14, + DEFAULT_ACCOUNTS = 35, + LOCAL_ACCOUNTS = 15, + CLOUD_ACCOUNTS = 16, + FILE_AND_DIRECTORY_DISCOVERY = 121, + ACCOUNT_DISCOVERY_LOCAL_ACCOUNT = 116, + PROXY = 9, + EXTERNAL_PROXY = 10, + MULTI_HOP_PROXY = 11, + ACCOUNT_MANIPULATION = 22, + ADDITIONAL_CLOUD_CREDENTIALS = 40, + ADDITIONAL_CLOUD_ROLES = 67, + SSH_AUTHORIZED_KEYS = 23, + ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58, + MULTI_STAGE_CHANNELS = 76, + INGRESS_TOOL_TRANSFER = 3, + NATIVE_API = 4, + BRUTE_FORCE = 44, + AUTOMATED_COLLECTION = 94, + SHARED_MODULES = 5, + DATA_ENCODING = 77, + STANDARD_ENCODING = 78, + ACCESS_TOKEN_MANIPULATION = 33, + TOKEN_IMPERSONATION_OR_THEFT = 39, + CREATE_ACCOUNT = 79, + LOCAL_ACCOUNT = 80, + DEOBFUSCATE_DECODE_FILES_OR_INFO = 95, + EXPLOIT_PUBLIC_FACING_APPLICATION = 27, + SUPPLY_CHAIN_COMPROMISE = 129, + COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS = 130, + EXPLOITATION_FOR_CLIENT_EXECUTION = 134, + USER_EXECUTION = 69, + LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = 135, + DOMAIN_POLICY_MODIFICATION = 30, + DATA_DESTRUCTION = 29, + DATA_ENCRYPTED_FOR_IMPACT = 132, + SERVICE_STOP = 52, + INHIBIT_SYSTEM_RECOVERY = 36, + FIRMWARE_CORRUPTION = 81, + RESOURCE_HIJACKING = 8, + NETWORK_DENIAL_OF_SERVICE = 17, + CLOUD_SERVICE_DISCOVERY = 48, + STEAL_APPLICATION_ACCESS_TOKEN = 42, + ACCOUNT_ACCESS_REMOVAL = 51, + TRANSFER_DATA_TO_CLOUD_ACCOUNT = 91, + STEAL_WEB_SESSION_COOKIE = 25, + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24, + EVENT_TRIGGERED_EXECUTION = 65, + BOOT_OR_LOGON_AUTOSTART_EXECUTION = 82, + KERNEL_MODULES_AND_EXTENSIONS = 83, + SHORTCUT_MODIFICATION = 127, + ABUSE_ELEVATION_CONTROL_MECHANISM = 34, + ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID = 136, + ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING = 109, + UNSECURED_CREDENTIALS = 13, + CREDENTIALS_IN_FILES = 105, + BASH_HISTORY = 96, + PRIVATE_KEYS = 97, + SUBVERT_TRUST_CONTROL = 106, + INSTALL_ROOT_CERTIFICATE = 107, + COMPROMISE_HOST_SOFTWARE_BINARY = 84, + CREDENTIALS_FROM_PASSWORD_STORES = 98, + MODIFY_AUTHENTICATION_PROCESS = 28, + PLUGGABLE_AUTHENTICATION_MODULES = 108, + MULTI_FACTOR_AUTHENTICATION = 137, + IMPAIR_DEFENSES = 31, + DISABLE_OR_MODIFY_TOOLS = 55, + INDICATOR_BLOCKING = 110, + DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM = 111, + HIDE_ARTIFACTS = 85, + HIDDEN_FILES_AND_DIRECTORIES = 86, + HIDDEN_USERS = 87, + EXFILTRATION_OVER_WEB_SERVICE = 20, + EXFILTRATION_TO_CLOUD_STORAGE = 21, + DYNAMIC_RESOLUTION = 12, + LATERAL_TOOL_TRANSFER = 41, + HIJACK_EXECUTION_FLOW = 112, + HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING = 113, + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26, + CREATE_SNAPSHOT = 54, + CLOUD_INFRASTRUCTURE_DISCOVERY = 53, + DEVELOP_CAPABILITIES = 99, + DEVELOP_CAPABILITIES_MALWARE = 100, + OBTAIN_CAPABILITIES = 43, + OBTAIN_CAPABILITIES_MALWARE = 101, + OBTAIN_CAPABILITIES_VULNERABILITIES = 133, + ACTIVE_SCANNING = 1, + SCANNING_IP_BLOCKS = 2, + STAGE_CAPABILITIES = 88, + UPLOAD_MALWARE = 102, + CONTAINER_ADMINISTRATION_COMMAND = 60, + DEPLOY_CONTAINER = 66, + ESCAPE_TO_HOST = 61, + CONTAINER_AND_RESOURCE_DISCOVERY = 57, + REFLECTIVE_CODE_LOADING = 92, + STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62, + FINANCIAL_THEFT = 131 + } + } + + /** Properties of a Network. */ + interface INetwork { + + /** Network name */ + name?: (string|null); + } + + /** Represents a Network. */ + class Network implements INetwork { + + /** + * Constructs a new Network. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.INetwork); + + /** Network name. */ + public name: string; + + /** + * Creates a new Network instance using the specified properties. + * @param [properties] Properties to set + * @returns Network instance + */ + public static create(properties?: google.cloud.securitycenter.v2.INetwork): google.cloud.securitycenter.v2.Network; + + /** + * Encodes the specified Network message. Does not implicitly {@link google.cloud.securitycenter.v2.Network.verify|verify} messages. + * @param message Network message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Network.verify|verify} messages. + * @param message Network message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Network message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Network; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Network; + + /** + * Verifies a Network message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Network + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Network; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @param message Network + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Network, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Network to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Network + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Notebook. */ + interface INotebook { + + /** Notebook name */ + name?: (string|null); + + /** Notebook service */ + service?: (string|null); + + /** Notebook lastAuthor */ + lastAuthor?: (string|null); + + /** Notebook notebookUpdateTime */ + notebookUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Notebook. */ + class Notebook implements INotebook { + + /** + * Constructs a new Notebook. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.INotebook); + + /** Notebook name. */ + public name: string; + + /** Notebook service. */ + public service: string; + + /** Notebook lastAuthor. */ + public lastAuthor: string; + + /** Notebook notebookUpdateTime. */ + public notebookUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Notebook instance using the specified properties. + * @param [properties] Properties to set + * @returns Notebook instance + */ + public static create(properties?: google.cloud.securitycenter.v2.INotebook): google.cloud.securitycenter.v2.Notebook; + + /** + * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.securitycenter.v2.Notebook.verify|verify} messages. + * @param message Notebook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Notebook.verify|verify} messages. + * @param message Notebook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Notebook message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Notebook; + + /** + * Decodes a Notebook message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Notebook; + + /** + * Verifies a Notebook message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Notebook message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Notebook + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Notebook; + + /** + * Creates a plain object from a Notebook message. Also converts values to other types if specified. + * @param message Notebook + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Notebook, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Notebook to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Notebook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrgPolicy. */ + interface IOrgPolicy { + + /** OrgPolicy name */ + name?: (string|null); + } + + /** Represents an OrgPolicy. */ + class OrgPolicy implements IOrgPolicy { + + /** + * Constructs a new OrgPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IOrgPolicy); + + /** OrgPolicy name. */ + public name: string; + + /** + * Creates a new OrgPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns OrgPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IOrgPolicy): google.cloud.securitycenter.v2.OrgPolicy; + + /** + * Encodes the specified OrgPolicy message. Does not implicitly {@link google.cloud.securitycenter.v2.OrgPolicy.verify|verify} messages. + * @param message OrgPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrgPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.OrgPolicy.verify|verify} messages. + * @param message OrgPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrgPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.OrgPolicy; + + /** + * Decodes an OrgPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.OrgPolicy; + + /** + * Verifies an OrgPolicy message. + * @param message Plain 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 OrgPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrgPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.OrgPolicy; + + /** + * Creates a plain object from an OrgPolicy message. Also converts values to other types if specified. + * @param message OrgPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.OrgPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrgPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrgPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Process. */ + interface IProcess { + + /** Process name */ + name?: (string|null); + + /** Process binary */ + binary?: (google.cloud.securitycenter.v2.IFile|null); + + /** Process libraries */ + libraries?: (google.cloud.securitycenter.v2.IFile[]|null); + + /** Process script */ + script?: (google.cloud.securitycenter.v2.IFile|null); + + /** Process args */ + args?: (string[]|null); + + /** Process argumentsTruncated */ + argumentsTruncated?: (boolean|null); + + /** Process envVariables */ + envVariables?: (google.cloud.securitycenter.v2.IEnvironmentVariable[]|null); + + /** Process envVariablesTruncated */ + envVariablesTruncated?: (boolean|null); + + /** Process pid */ + pid?: (number|Long|string|null); + + /** Process parentPid */ + parentPid?: (number|Long|string|null); + + /** Process userId */ + userId?: (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.v2.IProcess); + + /** Process name. */ + public name: string; + + /** Process binary. */ + public binary?: (google.cloud.securitycenter.v2.IFile|null); + + /** Process libraries. */ + public libraries: google.cloud.securitycenter.v2.IFile[]; + + /** Process script. */ + public script?: (google.cloud.securitycenter.v2.IFile|null); + + /** Process args. */ + public args: string[]; + + /** Process argumentsTruncated. */ + public argumentsTruncated: boolean; + + /** Process envVariables. */ + public envVariables: google.cloud.securitycenter.v2.IEnvironmentVariable[]; + + /** Process envVariablesTruncated. */ + public envVariablesTruncated: boolean; + + /** Process pid. */ + public pid: (number|Long|string); + + /** Process parentPid. */ + public parentPid: (number|Long|string); + + /** Process userId. */ + public userId: (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.v2.IProcess): google.cloud.securitycenter.v2.Process; + + /** + * Encodes the specified Process message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IProcess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Process message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Process, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Process to JSON. + * @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. */ + 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.v2.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.v2.IEnvironmentVariable): google.cloud.securitycenter.v2.EnvironmentVariable; + + /** + * Encodes the specified EnvironmentVariable message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IEnvironmentVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnvironmentVariable message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.EnvironmentVariable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnvironmentVariable to JSON. + * @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 SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + + /** SecurityMarks canonicalName */ + canonicalName?: (string|null); + } + + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { + + /** + * Constructs a new SecurityMarks. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ISecurityMarks); + + /** SecurityMarks name. */ + public name: string; + + /** 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 + * @returns SecurityMarks instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ISecurityMarks): google.cloud.securitycenter.v2.SecurityMarks; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityMarks to JSON. + * @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 SecurityPosture. */ + interface ISecurityPosture { + + /** SecurityPosture name */ + name?: (string|null); + + /** SecurityPosture revisionId */ + revisionId?: (string|null); + + /** SecurityPosture postureDeploymentResource */ + postureDeploymentResource?: (string|null); + + /** SecurityPosture postureDeployment */ + postureDeployment?: (string|null); + + /** SecurityPosture changedPolicy */ + changedPolicy?: (string|null); + + /** SecurityPosture policySet */ + policySet?: (string|null); + + /** SecurityPosture policy */ + policy?: (string|null); + + /** SecurityPosture policyDriftDetails */ + policyDriftDetails?: (google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails[]|null); + } + + /** Represents a SecurityPosture. */ + class SecurityPosture implements ISecurityPosture { + + /** + * Constructs a new SecurityPosture. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ISecurityPosture); + + /** SecurityPosture name. */ + public name: string; + + /** SecurityPosture revisionId. */ + public revisionId: string; + + /** SecurityPosture postureDeploymentResource. */ + public postureDeploymentResource: string; + + /** SecurityPosture postureDeployment. */ + public postureDeployment: string; + + /** SecurityPosture changedPolicy. */ + public changedPolicy: string; + + /** SecurityPosture policySet. */ + public policySet: string; + + /** SecurityPosture policy. */ + public policy: string; + + /** SecurityPosture policyDriftDetails. */ + public policyDriftDetails: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails[]; + + /** + * Creates a new SecurityPosture instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPosture instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ISecurityPosture): google.cloud.securitycenter.v2.SecurityPosture; + + /** + * Encodes the specified SecurityPosture message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.verify|verify} messages. + * @param message SecurityPosture message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ISecurityPosture, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPosture message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.verify|verify} messages. + * @param message SecurityPosture message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ISecurityPosture, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPosture message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPosture + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.SecurityPosture; + + /** + * Decodes a SecurityPosture message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPosture + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.SecurityPosture; + + /** + * Verifies a SecurityPosture message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPosture message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPosture + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.SecurityPosture; + + /** + * Creates a plain object from a SecurityPosture message. Also converts values to other types if specified. + * @param message SecurityPosture + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.SecurityPosture, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPosture to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityPosture + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecurityPosture { + + /** Properties of a PolicyDriftDetails. */ + interface IPolicyDriftDetails { + + /** PolicyDriftDetails field */ + field?: (string|null); + + /** PolicyDriftDetails expectedValue */ + expectedValue?: (string|null); + + /** PolicyDriftDetails detectedValue */ + detectedValue?: (string|null); + } + + /** Represents a PolicyDriftDetails. */ + class PolicyDriftDetails implements IPolicyDriftDetails { + + /** + * Constructs a new PolicyDriftDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails); + + /** PolicyDriftDetails field. */ + public field: string; + + /** PolicyDriftDetails expectedValue. */ + public expectedValue: string; + + /** PolicyDriftDetails detectedValue. */ + public detectedValue: string; + + /** + * Creates a new PolicyDriftDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDriftDetails instance + */ + public static create(properties?: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails): google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails; + + /** + * Encodes the specified PolicyDriftDetails message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify|verify} messages. + * @param message PolicyDriftDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDriftDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify|verify} messages. + * @param message PolicyDriftDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDriftDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDriftDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails; + + /** + * Decodes a PolicyDriftDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDriftDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails; + + /** + * Verifies a PolicyDriftDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDriftDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDriftDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails; + + /** + * Creates a plain object from a PolicyDriftDetails message. Also converts values to other types if specified. + * @param message PolicyDriftDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDriftDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDriftDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToxicCombination. */ + interface IToxicCombination { + + /** ToxicCombination attackExposureScore */ + attackExposureScore?: (number|null); + + /** ToxicCombination relatedFindings */ + relatedFindings?: (string[]|null); + } + + /** Represents a ToxicCombination. */ + class ToxicCombination implements IToxicCombination { + + /** + * Constructs a new ToxicCombination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IToxicCombination); + + /** ToxicCombination attackExposureScore. */ + public attackExposureScore: number; + + /** ToxicCombination relatedFindings. */ + public relatedFindings: string[]; + + /** + * Creates a new ToxicCombination instance using the specified properties. + * @param [properties] Properties to set + * @returns ToxicCombination instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IToxicCombination): google.cloud.securitycenter.v2.ToxicCombination; + + /** + * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. + * @param message ToxicCombination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. + * @param message ToxicCombination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ToxicCombination; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ToxicCombination; + + /** + * Verifies a ToxicCombination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToxicCombination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ToxicCombination; + + /** + * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. + * @param message ToxicCombination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ToxicCombination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToxicCombination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToxicCombination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VertexAi. */ + interface IVertexAi { + + /** VertexAi datasets */ + datasets?: (google.cloud.securitycenter.v2.VertexAi.IDataset[]|null); + + /** VertexAi pipelines */ + pipelines?: (google.cloud.securitycenter.v2.VertexAi.IPipeline[]|null); + } + + /** Represents a VertexAi. */ + class VertexAi implements IVertexAi { + + /** + * Constructs a new VertexAi. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IVertexAi); + + /** VertexAi datasets. */ + public datasets: google.cloud.securitycenter.v2.VertexAi.IDataset[]; + + /** VertexAi pipelines. */ + public pipelines: google.cloud.securitycenter.v2.VertexAi.IPipeline[]; + + /** + * Creates a new VertexAi instance using the specified properties. + * @param [properties] Properties to set + * @returns VertexAi instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IVertexAi): google.cloud.securitycenter.v2.VertexAi; + + /** + * Encodes the specified VertexAi message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.verify|verify} messages. + * @param message VertexAi message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IVertexAi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VertexAi message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.verify|verify} messages. + * @param message VertexAi message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IVertexAi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VertexAi message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VertexAi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.VertexAi; + + /** + * Decodes a VertexAi message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VertexAi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.VertexAi; + + /** + * Verifies a VertexAi message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VertexAi message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VertexAi + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.VertexAi; + + /** + * Creates a plain object from a VertexAi message. Also converts values to other types if specified. + * @param message VertexAi + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.VertexAi, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VertexAi to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VertexAi + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VertexAi { + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset name */ + name?: (string|null); + + /** Dataset displayName */ + displayName?: (string|null); + + /** Dataset source */ + source?: (string|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.VertexAi.IDataset); + + /** Dataset name. */ + public name: string; + + /** Dataset displayName. */ + public displayName: string; + + /** Dataset source. */ + public source: string; + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.securitycenter.v2.VertexAi.IDataset): google.cloud.securitycenter.v2.VertexAi.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.VertexAi.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.VertexAi.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.VertexAi.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.VertexAi.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.VertexAi.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.VertexAi.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Pipeline. */ + interface IPipeline { + + /** Pipeline name */ + name?: (string|null); + + /** Pipeline displayName */ + displayName?: (string|null); + } + + /** Represents a Pipeline. */ + class Pipeline implements IPipeline { + + /** + * Constructs a new Pipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.VertexAi.IPipeline); + + /** Pipeline name. */ + public name: string; + + /** Pipeline displayName. */ + public displayName: string; + + /** + * Creates a new Pipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns Pipeline instance + */ + public static create(properties?: google.cloud.securitycenter.v2.VertexAi.IPipeline): google.cloud.securitycenter.v2.VertexAi.Pipeline; + + /** + * Encodes the specified Pipeline message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Pipeline.verify|verify} messages. + * @param message Pipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.VertexAi.IPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Pipeline message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Pipeline.verify|verify} messages. + * @param message Pipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.VertexAi.IPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Pipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Pipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.VertexAi.Pipeline; + + /** + * Decodes a Pipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Pipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.VertexAi.Pipeline; + + /** + * Verifies a Pipeline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Pipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Pipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.VertexAi.Pipeline; + + /** + * Creates a plain object from a Pipeline message. Also converts values to other types if specified. + * @param message Pipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.VertexAi.Pipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Pipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Pipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Vulnerability. */ + interface IVulnerability { + + /** Vulnerability cve */ + cve?: (google.cloud.securitycenter.v2.ICve|null); + + /** Vulnerability offendingPackage */ + offendingPackage?: (google.cloud.securitycenter.v2.IPackage|null); + + /** Vulnerability fixedPackage */ + fixedPackage?: (google.cloud.securitycenter.v2.IPackage|null); + + /** Vulnerability securityBulletin */ + securityBulletin?: (google.cloud.securitycenter.v2.ISecurityBulletin|null); + + /** Vulnerability providerRiskScore */ + providerRiskScore?: (number|Long|string|null); + + /** Vulnerability reachable */ + reachable?: (boolean|null); + + /** Vulnerability cwes */ + cwes?: (google.cloud.securitycenter.v2.ICwe[]|null); + } + + /** Represents a Vulnerability. */ + class Vulnerability implements IVulnerability { + + /** + * Constructs a new Vulnerability. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IVulnerability); + + /** Vulnerability cve. */ + public cve?: (google.cloud.securitycenter.v2.ICve|null); + + /** Vulnerability offendingPackage. */ + public offendingPackage?: (google.cloud.securitycenter.v2.IPackage|null); + + /** Vulnerability fixedPackage. */ + public fixedPackage?: (google.cloud.securitycenter.v2.IPackage|null); + + /** Vulnerability securityBulletin. */ + public securityBulletin?: (google.cloud.securitycenter.v2.ISecurityBulletin|null); + + /** Vulnerability providerRiskScore. */ + public providerRiskScore: (number|Long|string); + + /** Vulnerability reachable. */ + public reachable: boolean; + + /** Vulnerability cwes. */ + public cwes: google.cloud.securitycenter.v2.ICwe[]; + + /** + * Creates a new Vulnerability instance using the specified properties. + * @param [properties] Properties to set + * @returns Vulnerability instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IVulnerability): google.cloud.securitycenter.v2.Vulnerability; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IVulnerability, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Vulnerability, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vulnerability to JSON. + * @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. */ + interface ICve { + + /** Cve id */ + id?: (string|null); + + /** Cve references */ + references?: (google.cloud.securitycenter.v2.IReference[]|null); + + /** Cve cvssv3 */ + cvssv3?: (google.cloud.securitycenter.v2.ICvssv3|null); + + /** Cve upstreamFixAvailable */ + upstreamFixAvailable?: (boolean|null); + + /** Cve impact */ + impact?: (google.cloud.securitycenter.v2.Cve.RiskRating|keyof typeof google.cloud.securitycenter.v2.Cve.RiskRating|null); + + /** Cve exploitationActivity */ + exploitationActivity?: (google.cloud.securitycenter.v2.Cve.ExploitationActivity|keyof typeof google.cloud.securitycenter.v2.Cve.ExploitationActivity|null); + + /** Cve observedInTheWild */ + observedInTheWild?: (boolean|null); + + /** Cve zeroDay */ + zeroDay?: (boolean|null); + + /** Cve exploitReleaseDate */ + exploitReleaseDate?: (google.protobuf.ITimestamp|null); + + /** Cve firstExploitationDate */ + firstExploitationDate?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Cve. */ + class Cve implements ICve { + + /** + * Constructs a new Cve. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICve); + + /** Cve id. */ + public id: string; + + /** Cve references. */ + public references: google.cloud.securitycenter.v2.IReference[]; + + /** Cve cvssv3. */ + public cvssv3?: (google.cloud.securitycenter.v2.ICvssv3|null); + + /** Cve upstreamFixAvailable. */ + public upstreamFixAvailable: boolean; + + /** Cve impact. */ + public impact: (google.cloud.securitycenter.v2.Cve.RiskRating|keyof typeof google.cloud.securitycenter.v2.Cve.RiskRating); + + /** Cve exploitationActivity. */ + public exploitationActivity: (google.cloud.securitycenter.v2.Cve.ExploitationActivity|keyof typeof google.cloud.securitycenter.v2.Cve.ExploitationActivity); + + /** Cve observedInTheWild. */ + public observedInTheWild: boolean; + + /** Cve zeroDay. */ + public zeroDay: boolean; + + /** Cve exploitReleaseDate. */ + public exploitReleaseDate?: (google.protobuf.ITimestamp|null); + + /** Cve firstExploitationDate. */ + public firstExploitationDate?: (google.protobuf.ITimestamp|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.v2.ICve): google.cloud.securitycenter.v2.Cve; + + /** + * Encodes the specified Cve message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICve, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cve message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Cve, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cve to JSON. + * @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; + } + + namespace Cve { + + /** RiskRating enum. */ + enum RiskRating { + RISK_RATING_UNSPECIFIED = 0, + LOW = 1, + MEDIUM = 2, + HIGH = 3, + CRITICAL = 4 + } + + /** ExploitationActivity enum. */ + enum ExploitationActivity { + EXPLOITATION_ACTIVITY_UNSPECIFIED = 0, + WIDE = 1, + CONFIRMED = 2, + AVAILABLE = 3, + ANTICIPATED = 4, + NO_KNOWN = 5 + } + } + + /** 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.v2.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.v2.IReference): google.cloud.securitycenter.v2.Reference; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Reference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reference to JSON. + * @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. */ + interface ICvssv3 { + + /** Cvssv3 baseScore */ + baseScore?: (number|null); + + /** Cvssv3 attackVector */ + attackVector?: (google.cloud.securitycenter.v2.Cvssv3.AttackVector|keyof typeof google.cloud.securitycenter.v2.Cvssv3.AttackVector|null); + + /** Cvssv3 attackComplexity */ + attackComplexity?: (google.cloud.securitycenter.v2.Cvssv3.AttackComplexity|keyof typeof google.cloud.securitycenter.v2.Cvssv3.AttackComplexity|null); + + /** Cvssv3 privilegesRequired */ + privilegesRequired?: (google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired|keyof typeof google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired|null); + + /** Cvssv3 userInteraction */ + userInteraction?: (google.cloud.securitycenter.v2.Cvssv3.UserInteraction|keyof typeof google.cloud.securitycenter.v2.Cvssv3.UserInteraction|null); + + /** Cvssv3 scope */ + scope?: (google.cloud.securitycenter.v2.Cvssv3.Scope|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Scope|null); + + /** Cvssv3 confidentialityImpact */ + confidentialityImpact?: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact|null); + + /** Cvssv3 integrityImpact */ + integrityImpact?: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact|null); + + /** Cvssv3 availabilityImpact */ + availabilityImpact?: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact|null); + } + + /** Represents a Cvssv3. */ + class Cvssv3 implements ICvssv3 { + + /** + * Constructs a new Cvssv3. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICvssv3); + + /** Cvssv3 baseScore. */ + public baseScore: number; + + /** Cvssv3 attackVector. */ + public attackVector: (google.cloud.securitycenter.v2.Cvssv3.AttackVector|keyof typeof google.cloud.securitycenter.v2.Cvssv3.AttackVector); + + /** Cvssv3 attackComplexity. */ + public attackComplexity: (google.cloud.securitycenter.v2.Cvssv3.AttackComplexity|keyof typeof google.cloud.securitycenter.v2.Cvssv3.AttackComplexity); + + /** Cvssv3 privilegesRequired. */ + public privilegesRequired: (google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired|keyof typeof google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired); + + /** Cvssv3 userInteraction. */ + public userInteraction: (google.cloud.securitycenter.v2.Cvssv3.UserInteraction|keyof typeof google.cloud.securitycenter.v2.Cvssv3.UserInteraction); + + /** Cvssv3 scope. */ + public scope: (google.cloud.securitycenter.v2.Cvssv3.Scope|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Scope); + + /** Cvssv3 confidentialityImpact. */ + public confidentialityImpact: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact); + + /** Cvssv3 integrityImpact. */ + public integrityImpact: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact); + + /** Cvssv3 availabilityImpact. */ + public availabilityImpact: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.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.v2.ICvssv3): google.cloud.securitycenter.v2.Cvssv3; + + /** + * Encodes the specified Cvssv3 message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICvssv3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cvssv3 message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Cvssv3, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cvssv3 to JSON. + * @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 { + + /** 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 Package. */ + interface IPackage { + + /** Package packageName */ + packageName?: (string|null); + + /** Package cpeUri */ + cpeUri?: (string|null); + + /** Package packageType */ + packageType?: (string|null); + + /** Package packageVersion */ + packageVersion?: (string|null); + } + + /** Represents a Package. */ + class Package implements IPackage { + + /** + * Constructs a new Package. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IPackage); + + /** Package packageName. */ + public packageName: string; + + /** Package cpeUri. */ + public cpeUri: string; + + /** Package packageType. */ + public packageType: string; + + /** Package packageVersion. */ + public packageVersion: string; + + /** + * Creates a new Package instance using the specified properties. + * @param [properties] Properties to set + * @returns Package instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IPackage): google.cloud.securitycenter.v2.Package; + + /** + * Encodes the specified Package message. Does not implicitly {@link google.cloud.securitycenter.v2.Package.verify|verify} messages. + * @param message Package message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Package message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Package.verify|verify} messages. + * @param message Package message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Package message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Package; + + /** + * Decodes a Package message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Package; + + /** + * Verifies a Package message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Package message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Package + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Package; + + /** + * Creates a plain object from a Package message. Also converts values to other types if specified. + * @param message Package + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Package, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Package to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Package + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecurityBulletin. */ + interface ISecurityBulletin { + + /** SecurityBulletin bulletinId */ + bulletinId?: (string|null); + + /** SecurityBulletin submissionTime */ + submissionTime?: (google.protobuf.ITimestamp|null); + + /** SecurityBulletin suggestedUpgradeVersion */ + suggestedUpgradeVersion?: (string|null); + } + + /** Represents a SecurityBulletin. */ + class SecurityBulletin implements ISecurityBulletin { + + /** + * Constructs a new SecurityBulletin. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ISecurityBulletin); + + /** SecurityBulletin bulletinId. */ + public bulletinId: string; + + /** SecurityBulletin submissionTime. */ + public submissionTime?: (google.protobuf.ITimestamp|null); + + /** SecurityBulletin suggestedUpgradeVersion. */ + public suggestedUpgradeVersion: string; + + /** + * Creates a new SecurityBulletin instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityBulletin instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ISecurityBulletin): google.cloud.securitycenter.v2.SecurityBulletin; + + /** + * Encodes the specified SecurityBulletin message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityBulletin.verify|verify} messages. + * @param message SecurityBulletin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ISecurityBulletin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityBulletin message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityBulletin.verify|verify} messages. + * @param message SecurityBulletin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ISecurityBulletin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityBulletin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityBulletin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.SecurityBulletin; + + /** + * Decodes a SecurityBulletin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityBulletin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.SecurityBulletin; + + /** + * Verifies a SecurityBulletin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityBulletin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityBulletin + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.SecurityBulletin; + + /** + * Creates a plain object from a SecurityBulletin message. Also converts values to other types if specified. + * @param message SecurityBulletin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.SecurityBulletin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityBulletin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityBulletin + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cwe. */ + interface ICwe { + + /** Cwe id */ + id?: (string|null); + + /** Cwe references */ + references?: (google.cloud.securitycenter.v2.IReference[]|null); + } + + /** Represents a Cwe. */ + class Cwe implements ICwe { + + /** + * Constructs a new Cwe. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICwe); + + /** Cwe id. */ + public id: string; + + /** Cwe references. */ + public references: google.cloud.securitycenter.v2.IReference[]; + + /** + * Creates a new Cwe instance using the specified properties. + * @param [properties] Properties to set + * @returns Cwe instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ICwe): google.cloud.securitycenter.v2.Cwe; + + /** + * Encodes the specified Cwe message. Does not implicitly {@link google.cloud.securitycenter.v2.Cwe.verify|verify} messages. + * @param message Cwe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ICwe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cwe message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Cwe.verify|verify} messages. + * @param message Cwe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ICwe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cwe message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cwe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Cwe; + + /** + * Decodes a Cwe message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cwe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Cwe; + + /** + * Verifies a Cwe message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cwe message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cwe + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Cwe; + + /** + * Creates a plain object from a Cwe message. Also converts values to other types if specified. + * @param message Cwe + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Cwe, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cwe to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cwe + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v2.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.v2.IFolder): google.cloud.securitycenter.v2.Folder; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Folder to JSON. + * @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 MuteConfig. */ + interface IMuteConfig { + + /** MuteConfig name */ + name?: (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); + + /** MuteConfig type */ + type?: (google.cloud.securitycenter.v2.MuteConfig.MuteConfigType|keyof typeof google.cloud.securitycenter.v2.MuteConfig.MuteConfigType|null); + + /** MuteConfig expiryTime */ + expiryTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MuteConfig. */ + class MuteConfig implements IMuteConfig { + + /** + * Constructs a new MuteConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IMuteConfig); + + /** MuteConfig name. */ + public name: 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; + + /** MuteConfig type. */ + public type: (google.cloud.securitycenter.v2.MuteConfig.MuteConfigType|keyof typeof google.cloud.securitycenter.v2.MuteConfig.MuteConfigType); + + /** MuteConfig expiryTime. */ + public expiryTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MuteConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MuteConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IMuteConfig): google.cloud.securitycenter.v2.MuteConfig; + + /** + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IMuteConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.MuteConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MuteConfig to JSON. + * @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; + } + + namespace MuteConfig { + + /** MuteConfigType enum. */ + enum MuteConfigType { + MUTE_CONFIG_TYPE_UNSPECIFIED = 0, + STATIC = 1, + DYNAMIC = 2 + } + } + + /** Properties of a NotificationConfig. */ + interface INotificationConfig { + + /** NotificationConfig name */ + name?: (string|null); + + /** NotificationConfig description */ + description?: (string|null); + + /** NotificationConfig pubsubTopic */ + pubsubTopic?: (string|null); + + /** NotificationConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NotificationConfig streamingConfig */ + streamingConfig?: (google.cloud.securitycenter.v2.NotificationConfig.IStreamingConfig|null); + + /** NotificationConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { + + /** + * Constructs a new NotificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.INotificationConfig); + + /** NotificationConfig name. */ + public name: string; + + /** NotificationConfig description. */ + public description: string; + + /** NotificationConfig pubsubTopic. */ + public pubsubTopic: string; + + /** NotificationConfig serviceAccount. */ + public serviceAccount: string; + + /** NotificationConfig streamingConfig. */ + public streamingConfig?: (google.cloud.securitycenter.v2.NotificationConfig.IStreamingConfig|null); + + /** NotificationConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|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.v2.INotificationConfig): google.cloud.securitycenter.v2.NotificationConfig; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationConfig to JSON. + * @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 { + + /** 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.v2.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.v2.NotificationConfig.IStreamingConfig): google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig; + + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.NotificationConfig.StreamingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingConfig to JSON. + * @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; + } + } + + /** Properties of a NotificationMessage. */ + interface INotificationMessage { + + /** NotificationMessage notificationConfigName */ + notificationConfigName?: (string|null); + + /** NotificationMessage finding */ + finding?: (google.cloud.securitycenter.v2.IFinding|null); + + /** NotificationMessage resource */ + resource?: (google.cloud.securitycenter.v2.IResource|null); + } + + /** Represents a NotificationMessage. */ + class NotificationMessage implements INotificationMessage { + + /** + * Constructs a new NotificationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.INotificationMessage); + + /** NotificationMessage notificationConfigName. */ + public notificationConfigName: string; + + /** NotificationMessage finding. */ + public finding?: (google.cloud.securitycenter.v2.IFinding|null); + + /** NotificationMessage resource. */ + public resource?: (google.cloud.securitycenter.v2.IResource|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.v2.INotificationMessage): google.cloud.securitycenter.v2.NotificationMessage; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.NotificationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationMessage to JSON. + * @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. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource displayName */ + displayName?: (string|null); + + /** Resource type */ + type?: (string|null); + + /** Resource cloudProvider */ + cloudProvider?: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider|null); + + /** Resource service */ + service?: (string|null); + + /** Resource location */ + location?: (string|null); + + /** Resource gcpMetadata */ + gcpMetadata?: (google.cloud.securitycenter.v2.IGcpMetadata|null); + + /** Resource awsMetadata */ + awsMetadata?: (google.cloud.securitycenter.v2.IAwsMetadata|null); + + /** Resource azureMetadata */ + azureMetadata?: (google.cloud.securitycenter.v2.IAzureMetadata|null); + + /** Resource resourcePath */ + resourcePath?: (google.cloud.securitycenter.v2.IResourcePath|null); + + /** Resource resourcePathString */ + resourcePathString?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IResource); + + /** Resource name. */ + public name: string; + + /** Resource displayName. */ + public displayName: string; + + /** Resource type. */ + public type: string; + + /** Resource cloudProvider. */ + public cloudProvider: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider); + + /** Resource service. */ + public service: string; + + /** Resource location. */ + public location: string; + + /** Resource gcpMetadata. */ + public gcpMetadata?: (google.cloud.securitycenter.v2.IGcpMetadata|null); + + /** Resource awsMetadata. */ + public awsMetadata?: (google.cloud.securitycenter.v2.IAwsMetadata|null); + + /** Resource azureMetadata. */ + public azureMetadata?: (google.cloud.securitycenter.v2.IAzureMetadata|null); + + /** Resource resourcePath. */ + public resourcePath?: (google.cloud.securitycenter.v2.IResourcePath|null); + + /** Resource resourcePathString. */ + public resourcePathString: string; + + /** Resource cloudProviderMetadata. */ + public cloudProviderMetadata?: ("gcpMetadata"|"awsMetadata"|"azureMetadata"); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IResource): google.cloud.securitycenter.v2.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @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; + } + + /** CloudProvider enum. */ + enum CloudProvider { + CLOUD_PROVIDER_UNSPECIFIED = 0, + GOOGLE_CLOUD_PLATFORM = 1, + AMAZON_WEB_SERVICES = 2, + MICROSOFT_AZURE = 3 + } + + /** Properties of a GcpMetadata. */ + interface IGcpMetadata { + + /** GcpMetadata project */ + project?: (string|null); + + /** GcpMetadata projectDisplayName */ + projectDisplayName?: (string|null); + + /** GcpMetadata parent */ + parent?: (string|null); + + /** GcpMetadata parentDisplayName */ + parentDisplayName?: (string|null); + + /** GcpMetadata folders */ + folders?: (google.cloud.securitycenter.v2.IFolder[]|null); + + /** GcpMetadata organization */ + organization?: (string|null); + } + + /** Represents a GcpMetadata. */ + class GcpMetadata implements IGcpMetadata { + + /** + * Constructs a new GcpMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IGcpMetadata); + + /** GcpMetadata project. */ + public project: string; + + /** GcpMetadata projectDisplayName. */ + public projectDisplayName: string; + + /** GcpMetadata parent. */ + public parent: string; + + /** GcpMetadata parentDisplayName. */ + public parentDisplayName: string; + + /** GcpMetadata folders. */ + public folders: google.cloud.securitycenter.v2.IFolder[]; + + /** GcpMetadata organization. */ + public organization: string; + + /** + * Creates a new GcpMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns GcpMetadata instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IGcpMetadata): google.cloud.securitycenter.v2.GcpMetadata; + + /** + * Encodes the specified GcpMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.GcpMetadata.verify|verify} messages. + * @param message GcpMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IGcpMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcpMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GcpMetadata.verify|verify} messages. + * @param message GcpMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IGcpMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcpMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcpMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GcpMetadata; + + /** + * Decodes a GcpMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcpMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GcpMetadata; + + /** + * Verifies a GcpMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcpMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcpMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GcpMetadata; + + /** + * Creates a plain object from a GcpMetadata message. Also converts values to other types if specified. + * @param message GcpMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.GcpMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcpMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcpMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsMetadata. */ + interface IAwsMetadata { + + /** AwsMetadata organization */ + organization?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization|null); + + /** AwsMetadata organizationalUnits */ + organizationalUnits?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit[]|null); + + /** AwsMetadata account */ + account?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount|null); + } + + /** Represents an AwsMetadata. */ + class AwsMetadata implements IAwsMetadata { + + /** + * Constructs a new AwsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAwsMetadata); + + /** AwsMetadata organization. */ + public organization?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization|null); + + /** AwsMetadata organizationalUnits. */ + public organizationalUnits: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit[]; + + /** AwsMetadata account. */ + public account?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount|null); + + /** + * Creates a new AwsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsMetadata instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAwsMetadata): google.cloud.securitycenter.v2.AwsMetadata; + + /** + * Encodes the specified AwsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.verify|verify} messages. + * @param message AwsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAwsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.verify|verify} messages. + * @param message AwsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAwsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AwsMetadata; + + /** + * Decodes an AwsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AwsMetadata; + + /** + * Verifies an AwsMetadata message. + * @param message Plain 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 AwsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AwsMetadata; + + /** + * Creates a plain object from an AwsMetadata message. Also converts values to other types if specified. + * @param message AwsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AwsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AwsMetadata { + + /** Properties of an AwsOrganization. */ + interface IAwsOrganization { + + /** AwsOrganization id */ + id?: (string|null); + } + + /** Represents an AwsOrganization. */ + class AwsOrganization implements IAwsOrganization { + + /** + * Constructs a new AwsOrganization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization); + + /** AwsOrganization id. */ + public id: string; + + /** + * Creates a new AwsOrganization instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsOrganization instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization; + + /** + * Encodes the specified AwsOrganization message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify|verify} messages. + * @param message AwsOrganization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsOrganization message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify|verify} messages. + * @param message AwsOrganization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsOrganization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization; + + /** + * Decodes an AwsOrganization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization; + + /** + * Verifies an AwsOrganization message. + * @param message Plain 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 AwsOrganization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsOrganization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization; + + /** + * Creates a plain object from an AwsOrganization message. Also converts values to other types if specified. + * @param message AwsOrganization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsOrganization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsOrganization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsOrganizationalUnit. */ + interface IAwsOrganizationalUnit { + + /** AwsOrganizationalUnit id */ + id?: (string|null); + + /** AwsOrganizationalUnit name */ + name?: (string|null); + } + + /** Represents an AwsOrganizationalUnit. */ + class AwsOrganizationalUnit implements IAwsOrganizationalUnit { + + /** + * Constructs a new AwsOrganizationalUnit. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit); + + /** AwsOrganizationalUnit id. */ + public id: string; + + /** AwsOrganizationalUnit name. */ + public name: string; + + /** + * Creates a new AwsOrganizationalUnit instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsOrganizationalUnit instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit; + + /** + * Encodes the specified AwsOrganizationalUnit message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. + * @param message AwsOrganizationalUnit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsOrganizationalUnit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. + * @param message AwsOrganizationalUnit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsOrganizationalUnit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsOrganizationalUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit; + + /** + * Decodes an AwsOrganizationalUnit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsOrganizationalUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit; + + /** + * Verifies an AwsOrganizationalUnit message. + * @param message Plain 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 AwsOrganizationalUnit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsOrganizationalUnit + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit; + + /** + * Creates a plain object from an AwsOrganizationalUnit message. Also converts values to other types if specified. + * @param message AwsOrganizationalUnit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsOrganizationalUnit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsOrganizationalUnit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsAccount. */ + interface IAwsAccount { + + /** AwsAccount id */ + id?: (string|null); + + /** AwsAccount name */ + name?: (string|null); + } + + /** Represents an AwsAccount. */ + class AwsAccount implements IAwsAccount { + + /** + * Constructs a new AwsAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount); + + /** AwsAccount id. */ + public id: string; + + /** AwsAccount name. */ + public name: string; + + /** + * Creates a new AwsAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsAccount instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount): google.cloud.securitycenter.v2.AwsMetadata.AwsAccount; + + /** + * Encodes the specified AwsAccount message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify|verify} messages. + * @param message AwsAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsAccount message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify|verify} messages. + * @param message AwsAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AwsMetadata.AwsAccount; + + /** + * Decodes an AwsAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AwsMetadata.AwsAccount; + + /** + * Verifies an AwsAccount message. + * @param message Plain 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 AwsAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AwsMetadata.AwsAccount; + + /** + * Creates a plain object from an AwsAccount message. Also converts values to other types if specified. + * @param message AwsAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AwsMetadata.AwsAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AzureMetadata. */ + interface IAzureMetadata { + + /** AzureMetadata managementGroups */ + managementGroups?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup[]|null); + + /** AzureMetadata subscription */ + subscription?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription|null); + + /** AzureMetadata resourceGroup */ + resourceGroup?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup|null); + + /** AzureMetadata tenant */ + tenant?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant|null); + } + + /** Represents an AzureMetadata. */ + class AzureMetadata implements IAzureMetadata { + + /** + * Constructs a new AzureMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IAzureMetadata); + + /** AzureMetadata managementGroups. */ + public managementGroups: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup[]; + + /** AzureMetadata subscription. */ + public subscription?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription|null); + + /** AzureMetadata resourceGroup. */ + public resourceGroup?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup|null); + + /** AzureMetadata tenant. */ + public tenant?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant|null); + + /** + * Creates a new AzureMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureMetadata instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IAzureMetadata): google.cloud.securitycenter.v2.AzureMetadata; + + /** + * Encodes the specified AzureMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.verify|verify} messages. + * @param message AzureMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IAzureMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.verify|verify} messages. + * @param message AzureMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IAzureMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata; + + /** + * Decodes an AzureMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata; + + /** + * Verifies an AzureMetadata message. + * @param message Plain 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 AzureMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata; + + /** + * Creates a plain object from an AzureMetadata message. Also converts values to other types if specified. + * @param message AzureMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AzureMetadata { + + /** Properties of an AzureManagementGroup. */ + interface IAzureManagementGroup { + + /** AzureManagementGroup id */ + id?: (string|null); + + /** AzureManagementGroup displayName */ + displayName?: (string|null); + } + + /** Represents an AzureManagementGroup. */ + class AzureManagementGroup implements IAzureManagementGroup { + + /** + * Constructs a new AzureManagementGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup); + + /** AzureManagementGroup id. */ + public id: string; + + /** AzureManagementGroup displayName. */ + public displayName: string; + + /** + * Creates a new AzureManagementGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureManagementGroup instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup): google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup; + + /** + * Encodes the specified AzureManagementGroup message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify|verify} messages. + * @param message AzureManagementGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureManagementGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify|verify} messages. + * @param message AzureManagementGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureManagementGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureManagementGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup; + + /** + * Decodes an AzureManagementGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureManagementGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup; + + /** + * Verifies an AzureManagementGroup message. + * @param message Plain 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 AzureManagementGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureManagementGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup; + + /** + * Creates a plain object from an AzureManagementGroup message. Also converts values to other types if specified. + * @param message AzureManagementGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureManagementGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureManagementGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AzureSubscription. */ + interface IAzureSubscription { + + /** AzureSubscription id */ + id?: (string|null); + + /** AzureSubscription displayName */ + displayName?: (string|null); + } + + /** Represents an AzureSubscription. */ + class AzureSubscription implements IAzureSubscription { + + /** + * Constructs a new AzureSubscription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription); + + /** AzureSubscription id. */ + public id: string; + + /** AzureSubscription displayName. */ + public displayName: string; + + /** + * Creates a new AzureSubscription instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureSubscription instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription): google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription; + + /** + * Encodes the specified AzureSubscription message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify|verify} messages. + * @param message AzureSubscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureSubscription message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify|verify} messages. + * @param message AzureSubscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureSubscription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureSubscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription; + + /** + * Decodes an AzureSubscription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureSubscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription; + + /** + * Verifies an AzureSubscription message. + * @param message Plain 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 AzureSubscription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureSubscription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription; + + /** + * Creates a plain object from an AzureSubscription message. Also converts values to other types if specified. + * @param message AzureSubscription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureSubscription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureSubscription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AzureResourceGroup. */ + interface IAzureResourceGroup { + + /** AzureResourceGroup id */ + id?: (string|null); + + /** AzureResourceGroup name */ + name?: (string|null); + } + + /** Represents an AzureResourceGroup. */ + class AzureResourceGroup implements IAzureResourceGroup { + + /** + * Constructs a new AzureResourceGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup); + + /** AzureResourceGroup id. */ + public id: string; + + /** AzureResourceGroup name. */ + public name: string; + + /** + * Creates a new AzureResourceGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureResourceGroup instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup): google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup; + + /** + * Encodes the specified AzureResourceGroup message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify|verify} messages. + * @param message AzureResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureResourceGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify|verify} messages. + * @param message AzureResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureResourceGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup; + + /** + * Decodes an AzureResourceGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup; + + /** + * Verifies an AzureResourceGroup message. + * @param message Plain 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 AzureResourceGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureResourceGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup; + + /** + * Creates a plain object from an AzureResourceGroup message. Also converts values to other types if specified. + * @param message AzureResourceGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureResourceGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureResourceGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AzureTenant. */ + interface IAzureTenant { + + /** AzureTenant id */ + id?: (string|null); + + /** AzureTenant displayName */ + displayName?: (string|null); + } + + /** Represents an AzureTenant. */ + class AzureTenant implements IAzureTenant { + + /** + * Constructs a new AzureTenant. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant); + + /** AzureTenant id. */ + public id: string; + + /** AzureTenant displayName. */ + public displayName: string; + + /** + * Creates a new AzureTenant instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureTenant instance + */ + public static create(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant): google.cloud.securitycenter.v2.AzureMetadata.AzureTenant; + + /** + * Encodes the specified AzureTenant message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify|verify} messages. + * @param message AzureTenant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureTenant message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify|verify} messages. + * @param message AzureTenant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureTenant message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureTenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata.AzureTenant; + + /** + * Decodes an AzureTenant message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureTenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata.AzureTenant; + + /** + * Verifies an AzureTenant message. + * @param message Plain 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 AzureTenant message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureTenant + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata.AzureTenant; + + /** + * Creates a plain object from an AzureTenant message. Also converts values to other types if specified. + * @param message AzureTenant + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata.AzureTenant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureTenant to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureTenant + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ResourcePath. */ + interface IResourcePath { + + /** ResourcePath nodes */ + nodes?: (google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode[]|null); + } + + /** Represents a ResourcePath. */ + class ResourcePath implements IResourcePath { + + /** + * Constructs a new ResourcePath. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IResourcePath); + + /** ResourcePath nodes. */ + public nodes: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode[]; + + /** + * Creates a new ResourcePath instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePath instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IResourcePath): google.cloud.securitycenter.v2.ResourcePath; + + /** + * Encodes the specified ResourcePath message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.verify|verify} messages. + * @param message ResourcePath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IResourcePath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.verify|verify} messages. + * @param message ResourcePath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IResourcePath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourcePath; + + /** + * Decodes a ResourcePath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourcePath; + + /** + * Verifies a ResourcePath message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePath + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourcePath; + + /** + * Creates a plain object from a ResourcePath message. Also converts values to other types if specified. + * @param message ResourcePath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ResourcePath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourcePath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourcePath { + + /** ResourcePathNodeType enum. */ + enum ResourcePathNodeType { + RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0, + GCP_ORGANIZATION = 1, + GCP_FOLDER = 2, + GCP_PROJECT = 3, + AWS_ORGANIZATION = 4, + AWS_ORGANIZATIONAL_UNIT = 5, + AWS_ACCOUNT = 6, + AZURE_MANAGEMENT_GROUP = 7, + AZURE_SUBSCRIPTION = 8, + AZURE_RESOURCE_GROUP = 9 + } + + /** Properties of a ResourcePathNode. */ + interface IResourcePathNode { + + /** ResourcePathNode nodeType */ + nodeType?: (google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType|keyof typeof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType|null); + + /** ResourcePathNode id */ + id?: (string|null); + + /** ResourcePathNode displayName */ + displayName?: (string|null); + } + + /** Represents a ResourcePathNode. */ + class ResourcePathNode implements IResourcePathNode { + + /** + * Constructs a new ResourcePathNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode); + + /** ResourcePathNode nodeType. */ + public nodeType: (google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType|keyof typeof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType); + + /** ResourcePathNode id. */ + public id: string; + + /** ResourcePathNode displayName. */ + public displayName: string; + + /** + * Creates a new ResourcePathNode instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePathNode instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode): google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode; + + /** + * Encodes the specified ResourcePathNode message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.verify|verify} messages. + * @param message ResourcePathNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.verify|verify} messages. + * @param message ResourcePathNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePathNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode; + + /** + * Decodes a ResourcePathNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode; + + /** + * Verifies a ResourcePathNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePathNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePathNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode; + + /** + * Creates a plain object from a ResourcePathNode message. Also converts values to other types if specified. + * @param message ResourcePathNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePathNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourcePathNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ResourceValueConfig. */ + interface IResourceValueConfig { + + /** ResourceValueConfig name */ + name?: (string|null); + + /** ResourceValueConfig resourceValue */ + resourceValue?: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue|null); + + /** ResourceValueConfig tagValues */ + tagValues?: (string[]|null); + + /** ResourceValueConfig resourceType */ + resourceType?: (string|null); + + /** ResourceValueConfig scope */ + scope?: (string|null); + + /** ResourceValueConfig resourceLabelsSelector */ + resourceLabelsSelector?: ({ [k: string]: string }|null); + + /** ResourceValueConfig description */ + description?: (string|null); + + /** ResourceValueConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceValueConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceValueConfig cloudProvider */ + cloudProvider?: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider|null); + + /** ResourceValueConfig sensitiveDataProtectionMapping */ + sensitiveDataProtectionMapping?: (google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping|null); + } + + /** Represents a ResourceValueConfig. */ + class ResourceValueConfig implements IResourceValueConfig { + + /** + * Constructs a new ResourceValueConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IResourceValueConfig); + + /** ResourceValueConfig name. */ + public name: string; + + /** ResourceValueConfig resourceValue. */ + public resourceValue: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue); + + /** ResourceValueConfig tagValues. */ + public tagValues: string[]; + + /** ResourceValueConfig resourceType. */ + public resourceType: string; + + /** ResourceValueConfig scope. */ + public scope: string; + + /** ResourceValueConfig resourceLabelsSelector. */ + public resourceLabelsSelector: { [k: string]: string }; + + /** ResourceValueConfig description. */ + public description: string; + + /** ResourceValueConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceValueConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceValueConfig cloudProvider. */ + public cloudProvider: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider); + + /** ResourceValueConfig sensitiveDataProtectionMapping. */ + public sensitiveDataProtectionMapping?: (google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping|null); + + /** + * Creates a new ResourceValueConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceValueConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IResourceValueConfig): google.cloud.securitycenter.v2.ResourceValueConfig; + + /** + * Encodes the specified ResourceValueConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.verify|verify} messages. + * @param message ResourceValueConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IResourceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceValueConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.verify|verify} messages. + * @param message ResourceValueConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IResourceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceValueConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceValueConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourceValueConfig; + + /** + * Decodes a ResourceValueConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceValueConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourceValueConfig; + + /** + * Verifies a ResourceValueConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceValueConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceValueConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourceValueConfig; + + /** + * Creates a plain object from a ResourceValueConfig message. Also converts values to other types if specified. + * @param message ResourceValueConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ResourceValueConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceValueConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceValueConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceValueConfig { + + /** Properties of a SensitiveDataProtectionMapping. */ + interface ISensitiveDataProtectionMapping { + + /** SensitiveDataProtectionMapping highSensitivityMapping */ + highSensitivityMapping?: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue|null); + + /** SensitiveDataProtectionMapping mediumSensitivityMapping */ + mediumSensitivityMapping?: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue|null); + } + + /** Represents a SensitiveDataProtectionMapping. */ + class SensitiveDataProtectionMapping implements ISensitiveDataProtectionMapping { + + /** + * Constructs a new SensitiveDataProtectionMapping. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping); + + /** SensitiveDataProtectionMapping highSensitivityMapping. */ + public highSensitivityMapping: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue); + + /** SensitiveDataProtectionMapping mediumSensitivityMapping. */ + public mediumSensitivityMapping: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue); + + /** + * Creates a new SensitiveDataProtectionMapping instance using the specified properties. + * @param [properties] Properties to set + * @returns SensitiveDataProtectionMapping instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping): google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping; + + /** + * Encodes the specified SensitiveDataProtectionMapping message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. + * @param message SensitiveDataProtectionMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SensitiveDataProtectionMapping message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. + * @param message SensitiveDataProtectionMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SensitiveDataProtectionMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping; + + /** + * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SensitiveDataProtectionMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping; + + /** + * Verifies a SensitiveDataProtectionMapping message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SensitiveDataProtectionMapping message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SensitiveDataProtectionMapping + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping; + + /** + * Creates a plain object from a SensitiveDataProtectionMapping message. Also converts values to other types if specified. + * @param message SensitiveDataProtectionMapping + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SensitiveDataProtectionMapping to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SensitiveDataProtectionMapping + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ResourceValue enum. */ + enum ResourceValue { + RESOURCE_VALUE_UNSPECIFIED = 0, + HIGH = 1, + MEDIUM = 2, + LOW = 3, + NONE = 4 + } + + /** 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 BatchCreateResourceValueConfigs. + * @param request BatchCreateResourceValueConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateResourceValueConfigsResponse + */ + public batchCreateResourceValueConfigs(request: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigsCallback): void; + + /** + * Calls BatchCreateResourceValueConfigs. + * @param request BatchCreateResourceValueConfigsRequest message or plain object + * @returns Promise + */ + public batchCreateResourceValueConfigs(request: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest): Promise; + + /** + * 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.v2.IBulkMuteFindingsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.BulkMuteFindingsCallback): void; + + /** + * Calls BulkMuteFindings. + * @param request BulkMuteFindingsRequest message or plain object + * @returns Promise + */ + public bulkMuteFindings(request: google.cloud.securitycenter.v2.IBulkMuteFindingsRequest): 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.v2.ICreateBigQueryExportRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateBigQueryExportCallback): void; + + /** + * Calls CreateBigQueryExport. + * @param request CreateBigQueryExportRequest message or plain object + * @returns Promise + */ + public createBigQueryExport(request: google.cloud.securitycenter.v2.ICreateBigQueryExportRequest): 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.v2.ICreateFindingRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateFindingCallback): void; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v2.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.v2.ICreateMuteConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateMuteConfigCallback): void; + + /** + * Calls CreateMuteConfig. + * @param request CreateMuteConfigRequest message or plain object + * @returns Promise + */ + public createMuteConfig(request: google.cloud.securitycenter.v2.ICreateMuteConfigRequest): 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.v2.ICreateNotificationConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateNotificationConfigCallback): void; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @returns Promise + */ + public createNotificationConfig(request: google.cloud.securitycenter.v2.ICreateNotificationConfigRequest): Promise; + + /** + * 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.v2.ICreateSourceRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v2.ICreateSourceRequest): 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.v2.IDeleteBigQueryExportRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.DeleteBigQueryExportCallback): void; + + /** + * Calls DeleteBigQueryExport. + * @param request DeleteBigQueryExportRequest message or plain object + * @returns Promise + */ + public deleteBigQueryExport(request: google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest): 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.v2.IDeleteMuteConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.DeleteMuteConfigCallback): void; + + /** + * Calls DeleteMuteConfig. + * @param request DeleteMuteConfigRequest message or plain object + * @returns Promise + */ + public deleteMuteConfig(request: google.cloud.securitycenter.v2.IDeleteMuteConfigRequest): 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.v2.IDeleteNotificationConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.DeleteNotificationConfigCallback): void; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @returns Promise + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest): Promise; + + /** + * Calls DeleteResourceValueConfig. + * @param request DeleteResourceValueConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteResourceValueConfig(request: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfigCallback): void; + + /** + * Calls DeleteResourceValueConfig. + * @param request DeleteResourceValueConfigRequest message or plain object + * @returns Promise + */ + public deleteResourceValueConfig(request: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest): 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.v2.IGetBigQueryExportRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetBigQueryExportCallback): void; + + /** + * Calls GetBigQueryExport. + * @param request GetBigQueryExportRequest message or plain object + * @returns Promise + */ + public getBigQueryExport(request: google.cloud.securitycenter.v2.IGetBigQueryExportRequest): Promise; + + /** + * Calls GetSimulation. + * @param request GetSimulationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Simulation + */ + public getSimulation(request: google.cloud.securitycenter.v2.IGetSimulationRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetSimulationCallback): void; + + /** + * Calls GetSimulation. + * @param request GetSimulationRequest message or plain object + * @returns Promise + */ + public getSimulation(request: google.cloud.securitycenter.v2.IGetSimulationRequest): Promise; + + /** + * Calls GetValuedResource. + * @param request GetValuedResourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ValuedResource + */ + public getValuedResource(request: google.cloud.securitycenter.v2.IGetValuedResourceRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetValuedResourceCallback): void; + + /** + * Calls GetValuedResource. + * @param request GetValuedResourceRequest message or plain object + * @returns Promise + */ + public getValuedResource(request: google.cloud.securitycenter.v2.IGetValuedResourceRequest): 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.v2.SecurityCenter.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + 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.v2.IGetMuteConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetMuteConfigCallback): void; + + /** + * Calls GetMuteConfig. + * @param request GetMuteConfigRequest message or plain object + * @returns Promise + */ + public getMuteConfig(request: google.cloud.securitycenter.v2.IGetMuteConfigRequest): 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.v2.IGetNotificationConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetNotificationConfigCallback): void; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @returns Promise + */ + public getNotificationConfig(request: google.cloud.securitycenter.v2.IGetNotificationConfigRequest): Promise; + + /** + * Calls GetResourceValueConfig. + * @param request GetResourceValueConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceValueConfig + */ + public getResourceValueConfig(request: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfigCallback): void; + + /** + * Calls GetResourceValueConfig. + * @param request GetResourceValueConfigRequest message or plain object + * @returns Promise + */ + public getResourceValueConfig(request: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest): 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.v2.IGetSourceRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v2.IGetSourceRequest): 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.v2.IGroupFindingsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GroupFindingsCallback): void; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise + */ + public groupFindings(request: google.cloud.securitycenter.v2.IGroupFindingsRequest): Promise; + + /** + * Calls ListAttackPaths. + * @param request ListAttackPathsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAttackPathsResponse + */ + public listAttackPaths(request: google.cloud.securitycenter.v2.IListAttackPathsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListAttackPathsCallback): void; + + /** + * Calls ListAttackPaths. + * @param request ListAttackPathsRequest message or plain object + * @returns Promise + */ + public listAttackPaths(request: google.cloud.securitycenter.v2.IListAttackPathsRequest): 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.v2.IListBigQueryExportsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListBigQueryExportsCallback): void; + + /** + * Calls ListBigQueryExports. + * @param request ListBigQueryExportsRequest message or plain object + * @returns Promise + */ + public listBigQueryExports(request: google.cloud.securitycenter.v2.IListBigQueryExportsRequest): 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.v2.IListFindingsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.securitycenter.v2.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.v2.IListMuteConfigsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListMuteConfigsCallback): void; + + /** + * Calls ListMuteConfigs. + * @param request ListMuteConfigsRequest message or plain object + * @returns Promise + */ + public listMuteConfigs(request: google.cloud.securitycenter.v2.IListMuteConfigsRequest): 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.v2.IListNotificationConfigsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListNotificationConfigsCallback): void; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @returns Promise + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v2.IListNotificationConfigsRequest): Promise; + + /** + * Calls ListResourceValueConfigs. + * @param request ListResourceValueConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListResourceValueConfigsResponse + */ + public listResourceValueConfigs(request: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigsCallback): void; + + /** + * Calls ListResourceValueConfigs. + * @param request ListResourceValueConfigsRequest message or plain object + * @returns Promise + */ + public listResourceValueConfigs(request: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest): 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.v2.IListSourcesRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.securitycenter.v2.IListSourcesRequest): Promise; + + /** + * Calls ListValuedResources. + * @param request ListValuedResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListValuedResourcesResponse + */ + public listValuedResources(request: google.cloud.securitycenter.v2.IListValuedResourcesRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListValuedResourcesCallback): void; + + /** + * Calls ListValuedResources. + * @param request ListValuedResourcesRequest message or plain object + * @returns Promise + */ + public listValuedResources(request: google.cloud.securitycenter.v2.IListValuedResourcesRequest): 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.v2.ISetFindingStateRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.SetFindingStateCallback): void; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise + */ + public setFindingState(request: google.cloud.securitycenter.v2.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.v2.SecurityCenter.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): 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.v2.ISetMuteRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.SetMuteCallback): void; + + /** + * Calls SetMute. + * @param request SetMuteRequest message or plain object + * @returns Promise + */ + public setMute(request: google.cloud.securitycenter.v2.ISetMuteRequest): 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.v2.SecurityCenter.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): 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.v2.IUpdateBigQueryExportRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateBigQueryExportCallback): void; + + /** + * Calls UpdateBigQueryExport. + * @param request UpdateBigQueryExportRequest message or plain object + * @returns Promise + */ + public updateBigQueryExport(request: google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest): 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.v2.IUpdateExternalSystemRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateExternalSystemCallback): void; + + /** + * Calls UpdateExternalSystem. + * @param request UpdateExternalSystemRequest message or plain object + * @returns Promise + */ + public updateExternalSystem(request: google.cloud.securitycenter.v2.IUpdateExternalSystemRequest): 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.v2.IUpdateFindingRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateFindingCallback): void; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise + */ + public updateFinding(request: google.cloud.securitycenter.v2.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.v2.IUpdateMuteConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateMuteConfigCallback): void; + + /** + * Calls UpdateMuteConfig. + * @param request UpdateMuteConfigRequest message or plain object + * @returns Promise + */ + public updateMuteConfig(request: google.cloud.securitycenter.v2.IUpdateMuteConfigRequest): 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.v2.IUpdateNotificationConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateNotificationConfigCallback): void; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @returns Promise + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest): Promise; + + /** + * Calls UpdateResourceValueConfig. + * @param request UpdateResourceValueConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceValueConfig + */ + public updateResourceValueConfig(request: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfigCallback): void; + + /** + * Calls UpdateResourceValueConfig. + * @param request UpdateResourceValueConfigRequest message or plain object + * @returns Promise + */ + public updateResourceValueConfig(request: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest): 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.v2.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateSecurityMarksCallback): void; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest): 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.v2.IUpdateSourceRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v2.IUpdateSourceRequest): Promise; + } + + namespace SecurityCenter { + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|batchCreateResourceValueConfigs}. + * @param error Error, if any + * @param [response] BatchCreateResourceValueConfigsResponse + */ + type BatchCreateResourceValueConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.SecurityCenter|createBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type CreateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.BigQueryExport) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type CreateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.MuteConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createSource}. + * @param error Error, if any + * @param [response] Source + */ + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.SecurityCenter|deleteResourceValueConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteResourceValueConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type GetBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.BigQueryExport) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getSimulation}. + * @param error Error, if any + * @param [response] Simulation + */ + type GetSimulationCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Simulation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getValuedResource}. + * @param error Error, if any + * @param [response] ValuedResource + */ + type GetValuedResourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ValuedResource) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.SecurityCenter|getMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type GetMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.MuteConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type GetNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getResourceValueConfig}. + * @param error Error, if any + * @param [response] ResourceValueConfig + */ + type GetResourceValueConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ResourceValueConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse + */ + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.GroupFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listAttackPaths}. + * @param error Error, if any + * @param [response] ListAttackPathsResponse + */ + type ListAttackPathsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListAttackPathsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listBigQueryExports}. + * @param error Error, if any + * @param [response] ListBigQueryExportsResponse + */ + type ListBigQueryExportsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListBigQueryExportsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listMuteConfigs}. + * @param error Error, if any + * @param [response] ListMuteConfigsResponse + */ + type ListMuteConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListMuteConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listNotificationConfigs}. + * @param error Error, if any + * @param [response] ListNotificationConfigsResponse + */ + type ListNotificationConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListNotificationConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listResourceValueConfigs}. + * @param error Error, if any + * @param [response] ListResourceValueConfigsResponse + */ + type ListResourceValueConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListResourceValueConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse + */ + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listValuedResources}. + * @param error Error, if any + * @param [response] ListValuedResourcesResponse + */ + type ListValuedResourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListValuedResourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|setFindingState}. + * @param error Error, if any + * @param [response] Finding + */ + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.SecurityCenter|setMute}. + * @param error Error, if any + * @param [response] Finding + */ + type SetMuteCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.SecurityCenter|updateBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type UpdateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.BigQueryExport) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateExternalSystem}. + * @param error Error, if any + * @param [response] ExternalSystem + */ + type UpdateExternalSystemCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ExternalSystem) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type UpdateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.MuteConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type UpdateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateResourceValueConfig}. + * @param error Error, if any + * @param [response] ResourceValueConfig + */ + type UpdateResourceValueConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ResourceValueConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.SecurityMarks) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Source) => void; + } + + /** Properties of a BatchCreateResourceValueConfigsRequest. */ + interface IBatchCreateResourceValueConfigsRequest { + + /** BatchCreateResourceValueConfigsRequest parent */ + parent?: (string|null); + + /** BatchCreateResourceValueConfigsRequest requests */ + requests?: (google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest[]|null); + } + + /** Represents a BatchCreateResourceValueConfigsRequest. */ + class BatchCreateResourceValueConfigsRequest implements IBatchCreateResourceValueConfigsRequest { + + /** + * Constructs a new BatchCreateResourceValueConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest); + + /** BatchCreateResourceValueConfigsRequest parent. */ + public parent: string; + + /** BatchCreateResourceValueConfigsRequest requests. */ + public requests: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest[]; + + /** + * Creates a new BatchCreateResourceValueConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateResourceValueConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest; + + /** + * Encodes the specified BatchCreateResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.verify|verify} messages. + * @param message BatchCreateResourceValueConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.verify|verify} messages. + * @param message BatchCreateResourceValueConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest; + + /** + * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest; + + /** + * Verifies a BatchCreateResourceValueConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateResourceValueConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest; + + /** + * Creates a plain object from a BatchCreateResourceValueConfigsRequest message. Also converts values to other types if specified. + * @param message BatchCreateResourceValueConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateResourceValueConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateResourceValueConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateResourceValueConfigsResponse. */ + interface IBatchCreateResourceValueConfigsResponse { + + /** BatchCreateResourceValueConfigsResponse resourceValueConfigs */ + resourceValueConfigs?: (google.cloud.securitycenter.v2.IResourceValueConfig[]|null); + } + + /** Represents a BatchCreateResourceValueConfigsResponse. */ + class BatchCreateResourceValueConfigsResponse implements IBatchCreateResourceValueConfigsResponse { + + /** + * Constructs a new BatchCreateResourceValueConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse); + + /** BatchCreateResourceValueConfigsResponse resourceValueConfigs. */ + public resourceValueConfigs: google.cloud.securitycenter.v2.IResourceValueConfig[]; + + /** + * Creates a new BatchCreateResourceValueConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateResourceValueConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; + + /** + * Encodes the specified BatchCreateResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.verify|verify} messages. + * @param message BatchCreateResourceValueConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.verify|verify} messages. + * @param message BatchCreateResourceValueConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; + + /** + * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; + + /** + * Verifies a BatchCreateResourceValueConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateResourceValueConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; + + /** + * Creates a plain object from a BatchCreateResourceValueConfigsResponse message. Also converts values to other types if specified. + * @param message BatchCreateResourceValueConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateResourceValueConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateResourceValueConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BulkMuteFindingsRequest. */ + interface IBulkMuteFindingsRequest { + + /** BulkMuteFindingsRequest parent */ + parent?: (string|null); + + /** BulkMuteFindingsRequest filter */ + filter?: (string|null); + + /** BulkMuteFindingsRequest muteState */ + muteState?: (google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState|keyof typeof google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState|null); + } + + /** Represents a BulkMuteFindingsRequest. */ + class BulkMuteFindingsRequest implements IBulkMuteFindingsRequest { + + /** + * Constructs a new BulkMuteFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IBulkMuteFindingsRequest); + + /** BulkMuteFindingsRequest parent. */ + public parent: string; + + /** BulkMuteFindingsRequest filter. */ + public filter: string; + + /** BulkMuteFindingsRequest muteState. */ + public muteState: (google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState|keyof typeof google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState); + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkMuteFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IBulkMuteFindingsRequest): google.cloud.securitycenter.v2.BulkMuteFindingsRequest; + + /** + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IBulkMuteFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.BulkMuteFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkMuteFindingsRequest to JSON. + * @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; + } + + namespace BulkMuteFindingsRequest { + + /** MuteState enum. */ + enum MuteState { + MUTE_STATE_UNSPECIFIED = 0, + MUTED = 1, + UNDEFINED = 2 + } + } + + /** 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.v2.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.v2.IBulkMuteFindingsResponse): google.cloud.securitycenter.v2.BulkMuteFindingsResponse; + + /** + * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IBulkMuteFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkMuteFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.BulkMuteFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkMuteFindingsResponse to JSON. + * @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 CreateBigQueryExportRequest. */ + interface ICreateBigQueryExportRequest { + + /** CreateBigQueryExportRequest parent */ + parent?: (string|null); + + /** CreateBigQueryExportRequest bigQueryExport */ + bigQueryExport?: (google.cloud.securitycenter.v2.IBigQueryExport|null); + + /** CreateBigQueryExportRequest bigQueryExportId */ + bigQueryExportId?: (string|null); + } + + /** Represents a CreateBigQueryExportRequest. */ + class CreateBigQueryExportRequest implements ICreateBigQueryExportRequest { + + /** + * Constructs a new CreateBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICreateBigQueryExportRequest); + + /** CreateBigQueryExportRequest parent. */ + public parent: string; + + /** CreateBigQueryExportRequest bigQueryExport. */ + public bigQueryExport?: (google.cloud.securitycenter.v2.IBigQueryExport|null); + + /** CreateBigQueryExportRequest bigQueryExportId. */ + public bigQueryExportId: string; + + /** + * Creates a new CreateBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ICreateBigQueryExportRequest): google.cloud.securitycenter.v2.CreateBigQueryExportRequest; + + /** + * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.v2.CreateBigQueryExportRequest; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.v2.CreateBigQueryExportRequest; + + /** + * 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 CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CreateBigQueryExportRequest; + + /** + * 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.v2.CreateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBigQueryExportRequest to JSON. + * @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 a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v2.IFinding|null); + } + + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { + + /** + * Constructs a new CreateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICreateFindingRequest); + + /** CreateFindingRequest parent. */ + public parent: string; + + /** CreateFindingRequest findingId. */ + public findingId: string; + + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v2.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.v2.ICreateFindingRequest): google.cloud.securitycenter.v2.CreateFindingRequest; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFindingRequest to JSON. + * @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. */ + interface ICreateMuteConfigRequest { + + /** CreateMuteConfigRequest parent */ + parent?: (string|null); + + /** CreateMuteConfigRequest muteConfig */ + muteConfig?: (google.cloud.securitycenter.v2.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.v2.ICreateMuteConfigRequest); + + /** CreateMuteConfigRequest parent. */ + public parent: string; + + /** CreateMuteConfigRequest muteConfig. */ + public muteConfig?: (google.cloud.securitycenter.v2.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.v2.ICreateMuteConfigRequest): google.cloud.securitycenter.v2.CreateMuteConfigRequest; + + /** + * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.CreateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMuteConfigRequest to JSON. + * @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. */ + interface ICreateNotificationConfigRequest { + + /** CreateNotificationConfigRequest parent */ + parent?: (string|null); + + /** CreateNotificationConfigRequest configId */ + configId?: (string|null); + + /** CreateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v2.INotificationConfig|null); + } + + /** Represents a CreateNotificationConfigRequest. */ + class CreateNotificationConfigRequest implements ICreateNotificationConfigRequest { + + /** + * Constructs a new CreateNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICreateNotificationConfigRequest); + + /** CreateNotificationConfigRequest parent. */ + public parent: string; + + /** CreateNotificationConfigRequest configId. */ + public configId: string; + + /** CreateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v2.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.v2.ICreateNotificationConfigRequest): google.cloud.securitycenter.v2.CreateNotificationConfigRequest; + + /** + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.CreateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @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 CreateResourceValueConfigRequest. */ + interface ICreateResourceValueConfigRequest { + + /** CreateResourceValueConfigRequest parent */ + parent?: (string|null); + + /** CreateResourceValueConfigRequest resourceValueConfig */ + resourceValueConfig?: (google.cloud.securitycenter.v2.IResourceValueConfig|null); + } + + /** Represents a CreateResourceValueConfigRequest. */ + class CreateResourceValueConfigRequest implements ICreateResourceValueConfigRequest { + + /** + * Constructs a new CreateResourceValueConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest); + + /** CreateResourceValueConfigRequest parent. */ + public parent: string; + + /** CreateResourceValueConfigRequest resourceValueConfig. */ + public resourceValueConfig?: (google.cloud.securitycenter.v2.IResourceValueConfig|null); + + /** + * Creates a new CreateResourceValueConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateResourceValueConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest): google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; + + /** + * Encodes the specified CreateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify|verify} messages. + * @param message CreateResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify|verify} messages. + * @param message CreateResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; + + /** + * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; + + /** + * Verifies a CreateResourceValueConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateResourceValueConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; + + /** + * Creates a plain object from a CreateResourceValueConfigRequest message. Also converts values to other types if specified. + * @param message CreateResourceValueConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.CreateResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateResourceValueConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateResourceValueConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v2.ISource|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { + + /** + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v2.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.v2.ICreateSourceRequest): google.cloud.securitycenter.v2.CreateSourceRequest; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSourceRequest to JSON. + * @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 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.v2.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.v2.IDeleteBigQueryExportRequest): google.cloud.securitycenter.v2.DeleteBigQueryExportRequest; + + /** + * Encodes the specified DeleteBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IDeleteBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.DeleteBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBigQueryExportRequest to JSON. + * @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 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.v2.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.v2.IDeleteMuteConfigRequest): google.cloud.securitycenter.v2.DeleteMuteConfigRequest; + + /** + * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IDeleteMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.DeleteMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMuteConfigRequest to JSON. + * @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. */ + 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.v2.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.v2.IDeleteNotificationConfigRequest): google.cloud.securitycenter.v2.DeleteNotificationConfigRequest; + + /** + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @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 DeleteResourceValueConfigRequest. */ + interface IDeleteResourceValueConfigRequest { + + /** DeleteResourceValueConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteResourceValueConfigRequest. */ + class DeleteResourceValueConfigRequest implements IDeleteResourceValueConfigRequest { + + /** + * Constructs a new DeleteResourceValueConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest); + + /** DeleteResourceValueConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteResourceValueConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteResourceValueConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest): google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest; + + /** + * Encodes the specified DeleteResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest.verify|verify} messages. + * @param message DeleteResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest.verify|verify} messages. + * @param message DeleteResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest; + + /** + * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest; + + /** + * Verifies a DeleteResourceValueConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteResourceValueConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest; + + /** + * Creates a plain object from a DeleteResourceValueConfigRequest message. Also converts values to other types if specified. + * @param message DeleteResourceValueConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteResourceValueConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteResourceValueConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IBigQueryDestination): google.cloud.securitycenter.v2.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.BigQueryDestination; + + /** + * Verifies a BigQueryDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportFindingsMetadata. */ + interface IExportFindingsMetadata { + + /** ExportFindingsMetadata exportStartTime */ + exportStartTime?: (google.protobuf.ITimestamp|null); + + /** ExportFindingsMetadata bigQueryDestination */ + bigQueryDestination?: (google.cloud.securitycenter.v2.IBigQueryDestination|null); + } + + /** Represents an ExportFindingsMetadata. */ + class ExportFindingsMetadata implements IExportFindingsMetadata { + + /** + * Constructs a new ExportFindingsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IExportFindingsMetadata); + + /** ExportFindingsMetadata exportStartTime. */ + public exportStartTime?: (google.protobuf.ITimestamp|null); + + /** ExportFindingsMetadata bigQueryDestination. */ + public bigQueryDestination?: (google.cloud.securitycenter.v2.IBigQueryDestination|null); + + /** ExportFindingsMetadata destination. */ + public destination?: "bigQueryDestination"; + + /** + * Creates a new ExportFindingsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportFindingsMetadata instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IExportFindingsMetadata): google.cloud.securitycenter.v2.ExportFindingsMetadata; + + /** + * Encodes the specified ExportFindingsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsMetadata.verify|verify} messages. + * @param message ExportFindingsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IExportFindingsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportFindingsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsMetadata.verify|verify} messages. + * @param message ExportFindingsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IExportFindingsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportFindingsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportFindingsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ExportFindingsMetadata; + + /** + * Decodes an ExportFindingsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportFindingsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ExportFindingsMetadata; + + /** + * Verifies an ExportFindingsMetadata message. + * @param message Plain 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 ExportFindingsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportFindingsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ExportFindingsMetadata; + + /** + * Creates a plain object from an ExportFindingsMetadata message. Also converts values to other types if specified. + * @param message ExportFindingsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ExportFindingsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportFindingsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportFindingsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportFindingsResponse. */ + interface IExportFindingsResponse { + } + + /** Represents an ExportFindingsResponse. */ + class ExportFindingsResponse implements IExportFindingsResponse { + + /** + * Constructs a new ExportFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IExportFindingsResponse); + + /** + * Creates a new ExportFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IExportFindingsResponse): google.cloud.securitycenter.v2.ExportFindingsResponse; + + /** + * Encodes the specified ExportFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsResponse.verify|verify} messages. + * @param message ExportFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IExportFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsResponse.verify|verify} messages. + * @param message ExportFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IExportFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ExportFindingsResponse; + + /** + * Decodes an ExportFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ExportFindingsResponse; + + /** + * Verifies an ExportFindingsResponse message. + * @param message Plain 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 ExportFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ExportFindingsResponse; + + /** + * Creates a plain object from an ExportFindingsResponse message. Also converts values to other types if specified. + * @param message ExportFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ExportFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBigQueryExportRequest. */ + interface IGetBigQueryExportRequest { + + /** GetBigQueryExportRequest name */ + name?: (string|null); + } + + /** Represents a GetBigQueryExportRequest. */ + class GetBigQueryExportRequest implements IGetBigQueryExportRequest { + + /** + * Constructs a new GetBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IGetBigQueryExportRequest); + + /** GetBigQueryExportRequest name. */ + public name: string; + + /** + * Creates a new GetBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IGetBigQueryExportRequest): google.cloud.securitycenter.v2.GetBigQueryExportRequest; + + /** + * Encodes the specified GetBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.v2.GetBigQueryExportRequest; + + /** + * Decodes a GetBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.v2.GetBigQueryExportRequest; + + /** + * 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 GetBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GetBigQueryExportRequest; + + /** + * 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.v2.GetBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBigQueryExportRequest to JSON. + * @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. */ + 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.v2.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.v2.IGetMuteConfigRequest): google.cloud.securitycenter.v2.GetMuteConfigRequest; + + /** + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GetMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMuteConfigRequest to JSON. + * @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. */ + 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.v2.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.v2.IGetNotificationConfigRequest): google.cloud.securitycenter.v2.GetNotificationConfigRequest; + + /** + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GetNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNotificationConfigRequest to JSON. + * @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 GetResourceValueConfigRequest. */ + interface IGetResourceValueConfigRequest { + + /** GetResourceValueConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetResourceValueConfigRequest. */ + class GetResourceValueConfigRequest implements IGetResourceValueConfigRequest { + + /** + * Constructs a new GetResourceValueConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest); + + /** GetResourceValueConfigRequest name. */ + public name: string; + + /** + * Creates a new GetResourceValueConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetResourceValueConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest): google.cloud.securitycenter.v2.GetResourceValueConfigRequest; + + /** + * Encodes the specified GetResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetResourceValueConfigRequest.verify|verify} messages. + * @param message GetResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetResourceValueConfigRequest.verify|verify} messages. + * @param message GetResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GetResourceValueConfigRequest; + + /** + * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GetResourceValueConfigRequest; + + /** + * Verifies a GetResourceValueConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetResourceValueConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GetResourceValueConfigRequest; + + /** + * Creates a plain object from a GetResourceValueConfigRequest message. Also converts values to other types if specified. + * @param message GetResourceValueConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.GetResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetResourceValueConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetResourceValueConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v2.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.v2.IGetSourceRequest): google.cloud.securitycenter.v2.GetSourceRequest; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSourceRequest to JSON. + * @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 GroupFindingsRequest. */ + interface IGroupFindingsRequest { + + /** GroupFindingsRequest parent */ + parent?: (string|null); + + /** GroupFindingsRequest filter */ + filter?: (string|null); + + /** GroupFindingsRequest groupBy */ + groupBy?: (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.v2.IGroupFindingsRequest); + + /** GroupFindingsRequest parent. */ + public parent: string; + + /** GroupFindingsRequest filter. */ + public filter: string; + + /** GroupFindingsRequest groupBy. */ + public groupBy: 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.v2.IGroupFindingsRequest): google.cloud.securitycenter.v2.GroupFindingsRequest; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @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. */ + interface IGroupFindingsResponse { + + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v2.IGroupResult[]|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.v2.IGroupFindingsResponse); + + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v2.IGroupResult[]; + + /** 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.v2.IGroupFindingsResponse): google.cloud.securitycenter.v2.GroupFindingsResponse; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @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. */ + 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.v2.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.v2.IGroupResult): google.cloud.securitycenter.v2.GroupResult; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupResult to JSON. + * @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 ListAttackPathsRequest. */ + interface IListAttackPathsRequest { + + /** ListAttackPathsRequest parent */ + parent?: (string|null); + + /** ListAttackPathsRequest filter */ + filter?: (string|null); + + /** ListAttackPathsRequest pageToken */ + pageToken?: (string|null); + + /** ListAttackPathsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAttackPathsRequest. */ + class ListAttackPathsRequest implements IListAttackPathsRequest { + + /** + * Constructs a new ListAttackPathsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IListAttackPathsRequest); + + /** ListAttackPathsRequest parent. */ + public parent: string; + + /** ListAttackPathsRequest filter. */ + public filter: string; + + /** ListAttackPathsRequest pageToken. */ + public pageToken: string; + + /** ListAttackPathsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListAttackPathsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttackPathsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IListAttackPathsRequest): google.cloud.securitycenter.v2.ListAttackPathsRequest; + + /** + * Encodes the specified ListAttackPathsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsRequest.verify|verify} messages. + * @param message ListAttackPathsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IListAttackPathsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttackPathsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsRequest.verify|verify} messages. + * @param message ListAttackPathsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IListAttackPathsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttackPathsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttackPathsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListAttackPathsRequest; + + /** + * Decodes a ListAttackPathsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttackPathsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListAttackPathsRequest; + + /** + * Verifies a ListAttackPathsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttackPathsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttackPathsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListAttackPathsRequest; + + /** + * Creates a plain object from a ListAttackPathsRequest message. Also converts values to other types if specified. + * @param message ListAttackPathsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ListAttackPathsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttackPathsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttackPathsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttackPathsResponse. */ + interface IListAttackPathsResponse { + + /** ListAttackPathsResponse attackPaths */ + attackPaths?: (google.cloud.securitycenter.v2.IAttackPath[]|null); + + /** ListAttackPathsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAttackPathsResponse. */ + class ListAttackPathsResponse implements IListAttackPathsResponse { + + /** + * Constructs a new ListAttackPathsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IListAttackPathsResponse); + + /** ListAttackPathsResponse attackPaths. */ + public attackPaths: google.cloud.securitycenter.v2.IAttackPath[]; + + /** ListAttackPathsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAttackPathsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttackPathsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IListAttackPathsResponse): google.cloud.securitycenter.v2.ListAttackPathsResponse; + + /** + * Encodes the specified ListAttackPathsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsResponse.verify|verify} messages. + * @param message ListAttackPathsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IListAttackPathsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttackPathsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsResponse.verify|verify} messages. + * @param message ListAttackPathsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IListAttackPathsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttackPathsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttackPathsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListAttackPathsResponse; + + /** + * Decodes a ListAttackPathsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttackPathsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListAttackPathsResponse; + + /** + * Verifies a ListAttackPathsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttackPathsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttackPathsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListAttackPathsResponse; + + /** + * Creates a plain object from a ListAttackPathsResponse message. Also converts values to other types if specified. + * @param message ListAttackPathsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ListAttackPathsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttackPathsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttackPathsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSimulationRequest. */ + interface IGetSimulationRequest { + + /** GetSimulationRequest name */ + name?: (string|null); + } + + /** Represents a GetSimulationRequest. */ + class GetSimulationRequest implements IGetSimulationRequest { + + /** + * Constructs a new GetSimulationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IGetSimulationRequest); + + /** GetSimulationRequest name. */ + public name: string; + + /** + * Creates a new GetSimulationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSimulationRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IGetSimulationRequest): google.cloud.securitycenter.v2.GetSimulationRequest; + + /** + * Encodes the specified GetSimulationRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetSimulationRequest.verify|verify} messages. + * @param message GetSimulationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IGetSimulationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSimulationRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetSimulationRequest.verify|verify} messages. + * @param message GetSimulationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IGetSimulationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSimulationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSimulationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GetSimulationRequest; + + /** + * Decodes a GetSimulationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSimulationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GetSimulationRequest; + + /** + * Verifies a GetSimulationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSimulationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSimulationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GetSimulationRequest; + + /** + * Creates a plain object from a GetSimulationRequest message. Also converts values to other types if specified. + * @param message GetSimulationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.GetSimulationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSimulationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSimulationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetValuedResourceRequest. */ + interface IGetValuedResourceRequest { + + /** GetValuedResourceRequest name */ + name?: (string|null); + } + + /** Represents a GetValuedResourceRequest. */ + class GetValuedResourceRequest implements IGetValuedResourceRequest { + + /** + * Constructs a new GetValuedResourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IGetValuedResourceRequest); + + /** GetValuedResourceRequest name. */ + public name: string; + + /** + * Creates a new GetValuedResourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetValuedResourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IGetValuedResourceRequest): google.cloud.securitycenter.v2.GetValuedResourceRequest; + + /** + * Encodes the specified GetValuedResourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetValuedResourceRequest.verify|verify} messages. + * @param message GetValuedResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IGetValuedResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetValuedResourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetValuedResourceRequest.verify|verify} messages. + * @param message GetValuedResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IGetValuedResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetValuedResourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetValuedResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GetValuedResourceRequest; + + /** + * Decodes a GetValuedResourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetValuedResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GetValuedResourceRequest; + + /** + * Verifies a GetValuedResourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetValuedResourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetValuedResourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GetValuedResourceRequest; + + /** + * Creates a plain object from a GetValuedResourceRequest message. Also converts values to other types if specified. + * @param message GetValuedResourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.GetValuedResourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetValuedResourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetValuedResourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBigQueryExportsRequest. */ + interface IListBigQueryExportsRequest { + + /** ListBigQueryExportsRequest parent */ + parent?: (string|null); + + /** ListBigQueryExportsRequest pageSize */ + pageSize?: (number|null); + + /** ListBigQueryExportsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBigQueryExportsRequest. */ + class ListBigQueryExportsRequest implements IListBigQueryExportsRequest { + + /** + * Constructs a new ListBigQueryExportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IListBigQueryExportsRequest); + + /** ListBigQueryExportsRequest parent. */ + public parent: string; + + /** ListBigQueryExportsRequest pageSize. */ + public pageSize: number; + + /** ListBigQueryExportsRequest pageToken. */ + public pageToken: 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.v2.IListBigQueryExportsRequest): google.cloud.securitycenter.v2.ListBigQueryExportsRequest; + + /** + * Encodes the specified ListBigQueryExportsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBigQueryExportsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.v2.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.v2.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.v2.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.v2.ListBigQueryExportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBigQueryExportsRequest to JSON. + * @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. */ + interface IListBigQueryExportsResponse { + + /** ListBigQueryExportsResponse bigQueryExports */ + bigQueryExports?: (google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsResponse); + + /** ListBigQueryExportsResponse bigQueryExports. */ + public bigQueryExports: google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsResponse): google.cloud.securitycenter.v2.ListBigQueryExportsResponse; + + /** + * Encodes the specified ListBigQueryExportsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBigQueryExportsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListBigQueryExportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBigQueryExportsResponse to JSON. + * @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 ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest orderBy */ + orderBy?: (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.v2.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest orderBy. */ + public orderBy: 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.v2.IListFindingsRequest): google.cloud.securitycenter.v2.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsRequest to JSON. + * @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. */ + interface IListFindingsResponse { + + /** ListFindingsResponse listFindingsResults */ + listFindingsResults?: (google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[]|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.v2.IListFindingsResponse); + + /** ListFindingsResponse listFindingsResults. */ + public listFindingsResults: google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[]; + + /** 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.v2.IListFindingsResponse): google.cloud.securitycenter.v2.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResponse to JSON. + * @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 { + + /** Properties of a ListFindingsResult. */ + interface IListFindingsResult { + + /** ListFindingsResult finding */ + finding?: (google.cloud.securitycenter.v2.IFinding|null); + + /** ListFindingsResult resource */ + resource?: (google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.IListFindingsResult); + + /** ListFindingsResult finding. */ + public finding?: (google.cloud.securitycenter.v2.IFinding|null); + + /** ListFindingsResult resource. */ + public resource?: (google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.IListFindingsResult): google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListFindingsResponse.ListFindingsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResult to JSON. + * @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 { + + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource displayName */ + displayName?: (string|null); + + /** Resource type */ + type?: (string|null); + + /** Resource cloudProvider */ + cloudProvider?: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider|null); + + /** Resource service */ + service?: (string|null); + + /** Resource location */ + location?: (string|null); + + /** Resource gcpMetadata */ + gcpMetadata?: (google.cloud.securitycenter.v2.IGcpMetadata|null); + + /** Resource awsMetadata */ + awsMetadata?: (google.cloud.securitycenter.v2.IAwsMetadata|null); + + /** Resource azureMetadata */ + azureMetadata?: (google.cloud.securitycenter.v2.IAzureMetadata|null); + + /** Resource resourcePath */ + resourcePath?: (google.cloud.securitycenter.v2.IResourcePath|null); + + /** Resource resourcePathString */ + resourcePathString?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource); + + /** Resource name. */ + public name: string; + + /** Resource displayName. */ + public displayName: string; + + /** Resource type. */ + public type: string; + + /** Resource cloudProvider. */ + public cloudProvider: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider); + + /** Resource service. */ + public service: string; + + /** Resource location. */ + public location: string; + + /** Resource gcpMetadata. */ + public gcpMetadata?: (google.cloud.securitycenter.v2.IGcpMetadata|null); + + /** Resource awsMetadata. */ + public awsMetadata?: (google.cloud.securitycenter.v2.IAwsMetadata|null); + + /** Resource azureMetadata. */ + public azureMetadata?: (google.cloud.securitycenter.v2.IAzureMetadata|null); + + /** Resource resourcePath. */ + public resourcePath?: (google.cloud.securitycenter.v2.IResourcePath|null); + + /** Resource resourcePathString. */ + public resourcePathString: string; + + /** Resource cloudProviderMetadata. */ + public cloudProviderMetadata?: ("gcpMetadata"|"awsMetadata"|"azureMetadata"); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource): google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListFindingsResponse.ListFindingsResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @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 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.v2.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.v2.IListMuteConfigsRequest): google.cloud.securitycenter.v2.ListMuteConfigsRequest; + + /** + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListMuteConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListMuteConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMuteConfigsRequest to JSON. + * @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. */ + interface IListMuteConfigsResponse { + + /** ListMuteConfigsResponse muteConfigs */ + muteConfigs?: (google.cloud.securitycenter.v2.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.v2.IListMuteConfigsResponse); + + /** ListMuteConfigsResponse muteConfigs. */ + public muteConfigs: google.cloud.securitycenter.v2.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.v2.IListMuteConfigsResponse): google.cloud.securitycenter.v2.ListMuteConfigsResponse; + + /** + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListMuteConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListMuteConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMuteConfigsResponse to JSON. + * @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. */ + 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.v2.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.v2.IListNotificationConfigsRequest): google.cloud.securitycenter.v2.ListNotificationConfigsRequest; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListNotificationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsRequest to JSON. + * @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. */ + interface IListNotificationConfigsResponse { + + /** ListNotificationConfigsResponse notificationConfigs */ + notificationConfigs?: (google.cloud.securitycenter.v2.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.v2.IListNotificationConfigsResponse); + + /** ListNotificationConfigsResponse notificationConfigs. */ + public notificationConfigs: google.cloud.securitycenter.v2.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.v2.IListNotificationConfigsResponse): google.cloud.securitycenter.v2.ListNotificationConfigsResponse; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListNotificationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @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 ListResourceValueConfigsRequest. */ + interface IListResourceValueConfigsRequest { + + /** ListResourceValueConfigsRequest parent */ + parent?: (string|null); + + /** ListResourceValueConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListResourceValueConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListResourceValueConfigsRequest. */ + class ListResourceValueConfigsRequest implements IListResourceValueConfigsRequest { + + /** + * Constructs a new ListResourceValueConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest); + + /** ListResourceValueConfigsRequest parent. */ + public parent: string; + + /** ListResourceValueConfigsRequest pageSize. */ + public pageSize: number; + + /** ListResourceValueConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListResourceValueConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceValueConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest): google.cloud.securitycenter.v2.ListResourceValueConfigsRequest; + + /** + * Encodes the specified ListResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsRequest.verify|verify} messages. + * @param message ListResourceValueConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsRequest.verify|verify} messages. + * @param message ListResourceValueConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListResourceValueConfigsRequest; + + /** + * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListResourceValueConfigsRequest; + + /** + * Verifies a ListResourceValueConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceValueConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListResourceValueConfigsRequest; + + /** + * Creates a plain object from a ListResourceValueConfigsRequest message. Also converts values to other types if specified. + * @param message ListResourceValueConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ListResourceValueConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceValueConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceValueConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceValueConfigsResponse. */ + interface IListResourceValueConfigsResponse { + + /** ListResourceValueConfigsResponse resourceValueConfigs */ + resourceValueConfigs?: (google.cloud.securitycenter.v2.IResourceValueConfig[]|null); + + /** ListResourceValueConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListResourceValueConfigsResponse. */ + class ListResourceValueConfigsResponse implements IListResourceValueConfigsResponse { + + /** + * Constructs a new ListResourceValueConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IListResourceValueConfigsResponse); + + /** ListResourceValueConfigsResponse resourceValueConfigs. */ + public resourceValueConfigs: google.cloud.securitycenter.v2.IResourceValueConfig[]; + + /** ListResourceValueConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListResourceValueConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceValueConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IListResourceValueConfigsResponse): google.cloud.securitycenter.v2.ListResourceValueConfigsResponse; + + /** + * Encodes the specified ListResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.verify|verify} messages. + * @param message ListResourceValueConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IListResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.verify|verify} messages. + * @param message ListResourceValueConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IListResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListResourceValueConfigsResponse; + + /** + * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListResourceValueConfigsResponse; + + /** + * Verifies a ListResourceValueConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceValueConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListResourceValueConfigsResponse; + + /** + * Creates a plain object from a ListResourceValueConfigsResponse message. Also converts values to other types if specified. + * @param message ListResourceValueConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ListResourceValueConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceValueConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceValueConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v2.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.v2.IListSourcesRequest): google.cloud.securitycenter.v2.ListSourcesRequest; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesRequest to JSON. + * @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. */ + interface IListSourcesResponse { + + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v2.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.v2.IListSourcesResponse); + + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v2.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.v2.IListSourcesResponse): google.cloud.securitycenter.v2.ListSourcesResponse; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesResponse to JSON. + * @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 ListValuedResourcesRequest. */ + interface IListValuedResourcesRequest { + + /** ListValuedResourcesRequest parent */ + parent?: (string|null); + + /** ListValuedResourcesRequest filter */ + filter?: (string|null); + + /** ListValuedResourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListValuedResourcesRequest pageSize */ + pageSize?: (number|null); + + /** ListValuedResourcesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListValuedResourcesRequest. */ + class ListValuedResourcesRequest implements IListValuedResourcesRequest { + + /** + * Constructs a new ListValuedResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IListValuedResourcesRequest); + + /** ListValuedResourcesRequest parent. */ + public parent: string; + + /** ListValuedResourcesRequest filter. */ + public filter: string; + + /** ListValuedResourcesRequest pageToken. */ + public pageToken: string; + + /** ListValuedResourcesRequest pageSize. */ + public pageSize: number; + + /** ListValuedResourcesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListValuedResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValuedResourcesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IListValuedResourcesRequest): google.cloud.securitycenter.v2.ListValuedResourcesRequest; + + /** + * Encodes the specified ListValuedResourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesRequest.verify|verify} messages. + * @param message ListValuedResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IListValuedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValuedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesRequest.verify|verify} messages. + * @param message ListValuedResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IListValuedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValuedResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValuedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListValuedResourcesRequest; + + /** + * Decodes a ListValuedResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValuedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListValuedResourcesRequest; + + /** + * Verifies a ListValuedResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValuedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValuedResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListValuedResourcesRequest; + + /** + * Creates a plain object from a ListValuedResourcesRequest message. Also converts values to other types if specified. + * @param message ListValuedResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ListValuedResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValuedResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValuedResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListValuedResourcesResponse. */ + interface IListValuedResourcesResponse { + + /** ListValuedResourcesResponse valuedResources */ + valuedResources?: (google.cloud.securitycenter.v2.IValuedResource[]|null); + + /** ListValuedResourcesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListValuedResourcesResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListValuedResourcesResponse. */ + class ListValuedResourcesResponse implements IListValuedResourcesResponse { + + /** + * Constructs a new ListValuedResourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IListValuedResourcesResponse); + + /** ListValuedResourcesResponse valuedResources. */ + public valuedResources: google.cloud.securitycenter.v2.IValuedResource[]; + + /** ListValuedResourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListValuedResourcesResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListValuedResourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValuedResourcesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IListValuedResourcesResponse): google.cloud.securitycenter.v2.ListValuedResourcesResponse; + + /** + * Encodes the specified ListValuedResourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesResponse.verify|verify} messages. + * @param message ListValuedResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IListValuedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValuedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesResponse.verify|verify} messages. + * @param message ListValuedResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IListValuedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValuedResourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValuedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListValuedResourcesResponse; + + /** + * Decodes a ListValuedResourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValuedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListValuedResourcesResponse; + + /** + * Verifies a ListValuedResourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValuedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValuedResourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListValuedResourcesResponse; + + /** + * Creates a plain object from a ListValuedResourcesResponse message. Also converts values to other types if specified. + * @param message ListValuedResourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ListValuedResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValuedResourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValuedResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v2.Finding.State|keyof typeof google.cloud.securitycenter.v2.Finding.State|null); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest state. */ + public state: (google.cloud.securitycenter.v2.Finding.State|keyof typeof google.cloud.securitycenter.v2.Finding.State); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ISetFindingStateRequest): google.cloud.securitycenter.v2.SetFindingStateRequest; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @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. */ + interface ISetMuteRequest { + + /** SetMuteRequest name */ + name?: (string|null); + + /** SetMuteRequest mute */ + mute?: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute|null); + } + + /** Represents a SetMuteRequest. */ + class SetMuteRequest implements ISetMuteRequest { + + /** + * Constructs a new SetMuteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ISetMuteRequest); + + /** SetMuteRequest name. */ + public name: string; + + /** SetMuteRequest mute. */ + public mute: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.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.v2.ISetMuteRequest): google.cloud.securitycenter.v2.SetMuteRequest; + + /** + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ISetMuteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.SetMuteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetMuteRequest to JSON. + * @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 an UpdateBigQueryExportRequest. */ + interface IUpdateBigQueryExportRequest { + + /** UpdateBigQueryExportRequest bigQueryExport */ + bigQueryExport?: (google.cloud.securitycenter.v2.IBigQueryExport|null); + + /** UpdateBigQueryExportRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBigQueryExportRequest. */ + class UpdateBigQueryExportRequest implements IUpdateBigQueryExportRequest { + + /** + * Constructs a new UpdateBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest); + + /** UpdateBigQueryExportRequest bigQueryExport. */ + public bigQueryExport?: (google.cloud.securitycenter.v2.IBigQueryExport|null); + + /** UpdateBigQueryExportRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest): google.cloud.securitycenter.v2.UpdateBigQueryExportRequest; + + /** + * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.v2.UpdateBigQueryExportRequest; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.v2.UpdateBigQueryExportRequest; + + /** + * 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 UpdateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.UpdateBigQueryExportRequest; + + /** + * 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.v2.UpdateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBigQueryExportRequest to JSON. + * @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 an UpdateExternalSystemRequest. */ + interface IUpdateExternalSystemRequest { + + /** UpdateExternalSystemRequest externalSystem */ + externalSystem?: (google.cloud.securitycenter.v2.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.v2.IUpdateExternalSystemRequest); + + /** UpdateExternalSystemRequest externalSystem. */ + public externalSystem?: (google.cloud.securitycenter.v2.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.v2.IUpdateExternalSystemRequest): google.cloud.securitycenter.v2.UpdateExternalSystemRequest; + + /** + * Encodes the specified UpdateExternalSystemRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateExternalSystemRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExternalSystemRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateExternalSystemRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExternalSystemRequest to JSON. + * @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. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v2.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.v2.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v2.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.v2.IUpdateFindingRequest): google.cloud.securitycenter.v2.UpdateFindingRequest; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @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. */ + interface IUpdateMuteConfigRequest { + + /** UpdateMuteConfigRequest muteConfig */ + muteConfig?: (google.cloud.securitycenter.v2.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.v2.IUpdateMuteConfigRequest); + + /** UpdateMuteConfigRequest muteConfig. */ + public muteConfig?: (google.cloud.securitycenter.v2.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.v2.IUpdateMuteConfigRequest): google.cloud.securitycenter.v2.UpdateMuteConfigRequest; + + /** + * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMuteConfigRequest to JSON. + * @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. */ + interface IUpdateNotificationConfigRequest { + + /** UpdateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v2.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.v2.IUpdateNotificationConfigRequest); + + /** UpdateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v2.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.v2.IUpdateNotificationConfigRequest): google.cloud.securitycenter.v2.UpdateNotificationConfigRequest; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateNotificationConfigRequest to JSON. + * @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 UpdateResourceValueConfigRequest. */ + interface IUpdateResourceValueConfigRequest { + + /** UpdateResourceValueConfigRequest resourceValueConfig */ + resourceValueConfig?: (google.cloud.securitycenter.v2.IResourceValueConfig|null); + + /** UpdateResourceValueConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateResourceValueConfigRequest. */ + class UpdateResourceValueConfigRequest implements IUpdateResourceValueConfigRequest { + + /** + * Constructs a new UpdateResourceValueConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest); + + /** UpdateResourceValueConfigRequest resourceValueConfig. */ + public resourceValueConfig?: (google.cloud.securitycenter.v2.IResourceValueConfig|null); + + /** UpdateResourceValueConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateResourceValueConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateResourceValueConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest): google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest; + + /** + * Encodes the specified UpdateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.verify|verify} messages. + * @param message UpdateResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.verify|verify} messages. + * @param message UpdateResourceValueConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest; + + /** + * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest; + + /** + * Verifies an UpdateResourceValueConfigRequest message. + * @param message Plain 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 UpdateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateResourceValueConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest; + + /** + * Creates a plain object from an UpdateResourceValueConfigRequest message. Also converts values to other types if specified. + * @param message UpdateResourceValueConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateResourceValueConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateResourceValueConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v2.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v2.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|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.v2.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v2.UpdateSecurityMarksRequest; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @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 an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v2.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.v2.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v2.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.v2.IUpdateSourceRequest): google.cloud.securitycenter.v2.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @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 a Simulation. */ + interface ISimulation { + + /** Simulation name */ + name?: (string|null); + + /** Simulation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Simulation resourceValueConfigsMetadata */ + resourceValueConfigsMetadata?: (google.cloud.securitycenter.v2.IResourceValueConfigMetadata[]|null); + + /** Simulation cloudProvider */ + cloudProvider?: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider|null); + } + + /** Represents a Simulation. */ + class Simulation implements ISimulation { + + /** + * Constructs a new Simulation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.ISimulation); + + /** Simulation name. */ + public name: string; + + /** Simulation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Simulation resourceValueConfigsMetadata. */ + public resourceValueConfigsMetadata: google.cloud.securitycenter.v2.IResourceValueConfigMetadata[]; + + /** Simulation cloudProvider. */ + public cloudProvider: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider); + + /** + * Creates a new Simulation instance using the specified properties. + * @param [properties] Properties to set + * @returns Simulation instance + */ + public static create(properties?: google.cloud.securitycenter.v2.ISimulation): google.cloud.securitycenter.v2.Simulation; + + /** + * Encodes the specified Simulation message. Does not implicitly {@link google.cloud.securitycenter.v2.Simulation.verify|verify} messages. + * @param message Simulation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.ISimulation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Simulation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Simulation.verify|verify} messages. + * @param message Simulation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.ISimulation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Simulation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Simulation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Simulation; + + /** + * Decodes a Simulation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Simulation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Simulation; + + /** + * Verifies a Simulation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Simulation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Simulation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Simulation; + + /** + * Creates a plain object from a Simulation message. Also converts values to other types if specified. + * @param message Simulation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.Simulation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Simulation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Simulation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValuedResource. */ + interface IValuedResource { + + /** ValuedResource name */ + name?: (string|null); + + /** ValuedResource resource */ + resource?: (string|null); + + /** ValuedResource resourceType */ + resourceType?: (string|null); + + /** ValuedResource displayName */ + displayName?: (string|null); + + /** ValuedResource resourceValue */ + resourceValue?: (google.cloud.securitycenter.v2.ValuedResource.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ValuedResource.ResourceValue|null); + + /** ValuedResource exposedScore */ + exposedScore?: (number|null); + + /** ValuedResource resourceValueConfigsUsed */ + resourceValueConfigsUsed?: (google.cloud.securitycenter.v2.IResourceValueConfigMetadata[]|null); + } + + /** Represents a ValuedResource. */ + class ValuedResource implements IValuedResource { + + /** + * Constructs a new ValuedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IValuedResource); + + /** ValuedResource name. */ + public name: string; + + /** ValuedResource resource. */ + public resource: string; + + /** ValuedResource resourceType. */ + public resourceType: string; + + /** ValuedResource displayName. */ + public displayName: string; + + /** ValuedResource resourceValue. */ + public resourceValue: (google.cloud.securitycenter.v2.ValuedResource.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ValuedResource.ResourceValue); + + /** ValuedResource exposedScore. */ + public exposedScore: number; + + /** ValuedResource resourceValueConfigsUsed. */ + public resourceValueConfigsUsed: google.cloud.securitycenter.v2.IResourceValueConfigMetadata[]; + + /** + * Creates a new ValuedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ValuedResource instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IValuedResource): google.cloud.securitycenter.v2.ValuedResource; + + /** + * Encodes the specified ValuedResource message. Does not implicitly {@link google.cloud.securitycenter.v2.ValuedResource.verify|verify} messages. + * @param message ValuedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IValuedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValuedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ValuedResource.verify|verify} messages. + * @param message ValuedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IValuedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValuedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValuedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ValuedResource; + + /** + * Decodes a ValuedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValuedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ValuedResource; + + /** + * Verifies a ValuedResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValuedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValuedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ValuedResource; + + /** + * Creates a plain object from a ValuedResource message. Also converts values to other types if specified. + * @param message ValuedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ValuedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValuedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValuedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ValuedResource { + + /** ResourceValue enum. */ + enum ResourceValue { + RESOURCE_VALUE_UNSPECIFIED = 0, + RESOURCE_VALUE_LOW = 1, + RESOURCE_VALUE_MEDIUM = 2, + RESOURCE_VALUE_HIGH = 3 + } + } + + /** Properties of a ResourceValueConfigMetadata. */ + interface IResourceValueConfigMetadata { + + /** ResourceValueConfigMetadata name */ + name?: (string|null); + } + + /** Represents a ResourceValueConfigMetadata. */ + class ResourceValueConfigMetadata implements IResourceValueConfigMetadata { + + /** + * Constructs a new ResourceValueConfigMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IResourceValueConfigMetadata); + + /** ResourceValueConfigMetadata name. */ + public name: string; + + /** + * Creates a new ResourceValueConfigMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceValueConfigMetadata instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IResourceValueConfigMetadata): google.cloud.securitycenter.v2.ResourceValueConfigMetadata; + + /** + * Encodes the specified ResourceValueConfigMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify|verify} messages. + * @param message ResourceValueConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IResourceValueConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceValueConfigMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify|verify} messages. + * @param message ResourceValueConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IResourceValueConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceValueConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourceValueConfigMetadata; + + /** + * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceValueConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourceValueConfigMetadata; + + /** + * Verifies a ResourceValueConfigMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceValueConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceValueConfigMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourceValueConfigMetadata; + + /** + * Creates a plain object from a ResourceValueConfigMetadata message. Also converts values to other types if specified. + * @param message ResourceValueConfigMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ResourceValueConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceValueConfigMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceValueConfigMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v2.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.v2.ISource): google.cloud.securitycenter.v2.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @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; + } + } + } + } + + /** 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 }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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, + IDENTIFIER = 8 + } + + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not 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.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload 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.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not 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.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload 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.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not 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.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload 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.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not 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.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload 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.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not 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.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload 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.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not 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.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload 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.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not 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.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload 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.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not 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.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload 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.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not 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.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload 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.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not 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.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload 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.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not 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.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload 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.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not 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.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload 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.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not 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.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload 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.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not 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.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload 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.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** Properties of a RoutingRule. */ + interface IRoutingRule { + + /** RoutingRule routingParameters */ + routingParameters?: (google.api.IRoutingParameter[]|null); + } + + /** Represents a RoutingRule. */ + class RoutingRule implements IRoutingRule { + + /** + * Constructs a new RoutingRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingRule); + + /** RoutingRule routingParameters. */ + public routingParameters: google.api.IRoutingParameter[]; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingRule instance + */ + public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingRule + * @throws {Error} If the payload is not 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.RoutingRule; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingRule + * @throws {Error} If the payload 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.RoutingRule; + + /** + * Verifies a RoutingRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingRule + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @param message RoutingRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingParameter. */ + interface IRoutingParameter { + + /** RoutingParameter field */ + field?: (string|null); + + /** RoutingParameter pathTemplate */ + pathTemplate?: (string|null); + } + + /** Represents a RoutingParameter. */ + class RoutingParameter implements IRoutingParameter { + + /** + * Constructs a new RoutingParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingParameter); + + /** RoutingParameter field. */ + public field: string; + + /** RoutingParameter pathTemplate. */ + public pathTemplate: string; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingParameter instance + */ + public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingParameter + * @throws {Error} If the payload is not 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.RoutingParameter; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingParameter + * @throws {Error} If the payload 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.RoutingParameter; + + /** + * Verifies a RoutingParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingParameter + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @param message RoutingParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * 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; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not 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.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload 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.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions 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 features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not 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.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload 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.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|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); + + /** MethodOptions .google.api.routing */ + ".google.api.routing"?: (google.api.IRoutingRule|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not 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.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload 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.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not 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.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload 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.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** 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 }; + + /** + * 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. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof 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|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|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|string); + + /** 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 }; + + /** + * 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. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|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|Buffer|string); + + /** + * 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 }; + + /** + * 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. */ + 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 }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * 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; + } + } + + /** 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); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|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); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|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 auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof 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|keyof typeof 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 }; + + /** + * 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 { + + /** 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|keyof typeof 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|keyof typeof 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 }; + + /** + * 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 { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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/owl-bot-staging/google-cloud-securitycenter/protos/protos.js b/owl-bot-staging/google-cloud-securitycenter/protos/protos.js new file mode 100644 index 00000000000..46fdeb4b05c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/protos.js @@ -0,0 +1,165024 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_security_center_protos || ($protobuf.roots._google_cloud_security_center_protos = {}); + + $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.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} [userAgent] Access userAgent + * @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 + * @property {string|null} [userName] Access userName + */ + + /** + * 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) { + this.serviceAccountDelegationInfo = []; + if (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 userAgent. + * @member {string} userAgent + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.userAgent = ""; + + /** + * 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 = ""; + + /** + * 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; + + /** + * Access userName. + * @member {string} userName + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.userName = ""; + + /** + * 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); + 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(); + if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.userName); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.userAgent); + 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, error) { + 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(); + if (tag === error) + break; + 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 12: { + message.userAgent = reader.string(); + break; + } + case 5: { + message.serviceName = reader.string(); + break; + } + case 6: { + 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; + } + case 11: { + message.userName = 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.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: 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"; + 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; + } + } + if (message.userName != null && message.hasOwnProperty("userName")) + if (!$util.isString(message.userName)) + return "userName: 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.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.serviceName != null) + 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]); + } + } + if (object.userName != null) + message.userName = String(object.userName); + 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.arrays || options.defaults) + object.serviceAccountDelegationInfo = []; + if (options.defaults) { + object.principalEmail = ""; + object.callerIp = ""; + object.callerIpGeo = null; + object.userAgentFamily = ""; + object.serviceName = ""; + object.methodName = ""; + object.principalSubject = ""; + object.serviceAccountKeyName = ""; + object.userName = ""; + object.userAgent = ""; + } + 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; + 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); + } + if (message.userName != null && message.hasOwnProperty("userName")) + object.userName = message.userName; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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() { + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.Application = (function() { + + /** + * Properties of an Application. + * @memberof google.cloud.securitycenter.v1 + * @interface IApplication + * @property {string|null} [baseUri] Application baseUri + * @property {string|null} [fullUri] Application fullUri + */ + + /** + * Constructs a new Application. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Application. + * @implements IApplication + * @constructor + * @param {google.cloud.securitycenter.v1.IApplication=} [properties] Properties to set + */ + function Application(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Application baseUri. + * @member {string} baseUri + * @memberof google.cloud.securitycenter.v1.Application + * @instance + */ + Application.prototype.baseUri = ""; + + /** + * Application fullUri. + * @member {string} fullUri + * @memberof google.cloud.securitycenter.v1.Application + * @instance + */ + Application.prototype.fullUri = ""; + + /** + * Creates a new Application instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {google.cloud.securitycenter.v1.IApplication=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Application} Application instance + */ + Application.create = function create(properties) { + return new Application(properties); + }; + + /** + * Encodes the specified Application message. Does not implicitly {@link google.cloud.securitycenter.v1.Application.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {google.cloud.securitycenter.v1.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseUri != null && Object.hasOwnProperty.call(message, "baseUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseUri); + if (message.fullUri != null && Object.hasOwnProperty.call(message, "fullUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullUri); + return writer; + }; + + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Application.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {google.cloud.securitycenter.v1.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Application message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Application(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseUri = reader.string(); + break; + } + case 2: { + message.fullUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Application message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Application.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseUri != null && message.hasOwnProperty("baseUri")) + if (!$util.isString(message.baseUri)) + return "baseUri: string expected"; + if (message.fullUri != null && message.hasOwnProperty("fullUri")) + if (!$util.isString(message.fullUri)) + return "fullUri: string expected"; + return null; + }; + + /** + * Creates an Application message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Application} Application + */ + Application.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Application) + return object; + var message = new $root.google.cloud.securitycenter.v1.Application(); + if (object.baseUri != null) + message.baseUri = String(object.baseUri); + if (object.fullUri != null) + message.fullUri = String(object.fullUri); + return message; + }; + + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {google.cloud.securitycenter.v1.Application} message Application + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Application.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseUri = ""; + object.fullUri = ""; + } + if (message.baseUri != null && message.hasOwnProperty("baseUri")) + object.baseUri = message.baseUri; + if (message.fullUri != null && message.hasOwnProperty("fullUri")) + object.fullUri = message.fullUri; + return object; + }; + + /** + * Converts this Application to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Application + * @instance + * @returns {Object.} JSON object + */ + Application.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Application + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Application + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Application.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Application"; + }; + + return Application; + })(); + + 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 + * @property {string|null} [canonicalName] Asset canonicalName + */ + + /** + * 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; + + /** + * 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 + * @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 && 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.v1.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.v1.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.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; + }; + + /** + * 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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + } + 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; + } + } + 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; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + 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); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + 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; + object.canonicalName = ""; + } + 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); + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + 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); + }; + + /** + * 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() { + + /** + * 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 + * @property {Array.|null} [folders] SecurityCenterProperties folders + */ + + /** + * 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 = []; + 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]]; + } + + /** + * 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; + + /** + * SecurityCenterProperties resourceDisplayName. + * @member {string} resourceDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceDisplayName = ""; + + /** + * SecurityCenterProperties resourceParentDisplayName. + * @member {string} resourceParentDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParentDisplayName = ""; + + /** + * SecurityCenterProperties resourceProjectDisplayName. + * @member {string} resourceProjectDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + 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 + * @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 && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + 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 && Object.hasOwnProperty.call(message, "resourceDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); + if (message.resourceParentDisplayName != null && Object.hasOwnProperty.call(message, "resourceParentDisplayName")) + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + 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"; + } + 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"; + 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; + }; + + /** + * 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); + 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; + }; + + /** + * 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 = []; + object.folders = []; + } + 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; + 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 + * @property {string|null} [canonicalName] SecurityMarks canonicalName + */ + + /** + * 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; + + /** + * 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 + * @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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + 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; + }; + + /** + * 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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + } + message.marks[key] = value; + break; + } + case 3: { + message.canonicalName = 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"; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: 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]]); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + 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 = ""; + object.canonicalName = ""; + } + 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.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + 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); + }; + + /** + * 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; + })(); + + v1.AttackExposure = (function() { + + /** + * Properties of an AttackExposure. + * @memberof google.cloud.securitycenter.v1 + * @interface IAttackExposure + * @property {number|null} [score] AttackExposure score + * @property {google.protobuf.ITimestamp|null} [latestCalculationTime] AttackExposure latestCalculationTime + * @property {string|null} [attackExposureResult] AttackExposure attackExposureResult + * @property {google.cloud.securitycenter.v1.AttackExposure.State|null} [state] AttackExposure state + * @property {number|null} [exposedHighValueResourcesCount] AttackExposure exposedHighValueResourcesCount + * @property {number|null} [exposedMediumValueResourcesCount] AttackExposure exposedMediumValueResourcesCount + * @property {number|null} [exposedLowValueResourcesCount] AttackExposure exposedLowValueResourcesCount + */ + + /** + * Constructs a new AttackExposure. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an AttackExposure. + * @implements IAttackExposure + * @constructor + * @param {google.cloud.securitycenter.v1.IAttackExposure=} [properties] Properties to set + */ + function AttackExposure(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackExposure score. + * @member {number} score + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @instance + */ + AttackExposure.prototype.score = 0; + + /** + * AttackExposure latestCalculationTime. + * @member {google.protobuf.ITimestamp|null|undefined} latestCalculationTime + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @instance + */ + AttackExposure.prototype.latestCalculationTime = null; + + /** + * AttackExposure attackExposureResult. + * @member {string} attackExposureResult + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @instance + */ + AttackExposure.prototype.attackExposureResult = ""; + + /** + * AttackExposure state. + * @member {google.cloud.securitycenter.v1.AttackExposure.State} state + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @instance + */ + AttackExposure.prototype.state = 0; + + /** + * AttackExposure exposedHighValueResourcesCount. + * @member {number} exposedHighValueResourcesCount + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @instance + */ + AttackExposure.prototype.exposedHighValueResourcesCount = 0; + + /** + * AttackExposure exposedMediumValueResourcesCount. + * @member {number} exposedMediumValueResourcesCount + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @instance + */ + AttackExposure.prototype.exposedMediumValueResourcesCount = 0; + + /** + * AttackExposure exposedLowValueResourcesCount. + * @member {number} exposedLowValueResourcesCount + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @instance + */ + AttackExposure.prototype.exposedLowValueResourcesCount = 0; + + /** + * Creates a new AttackExposure instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {google.cloud.securitycenter.v1.IAttackExposure=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AttackExposure} AttackExposure instance + */ + AttackExposure.create = function create(properties) { + return new AttackExposure(properties); + }; + + /** + * Encodes the specified AttackExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackExposure.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {google.cloud.securitycenter.v1.IAttackExposure} message AttackExposure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackExposure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.score); + if (message.latestCalculationTime != null && Object.hasOwnProperty.call(message, "latestCalculationTime")) + $root.google.protobuf.Timestamp.encode(message.latestCalculationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attackExposureResult != null && Object.hasOwnProperty.call(message, "attackExposureResult")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.attackExposureResult); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.exposedHighValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedHighValueResourcesCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.exposedHighValueResourcesCount); + if (message.exposedMediumValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedMediumValueResourcesCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.exposedMediumValueResourcesCount); + if (message.exposedLowValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedLowValueResourcesCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.exposedLowValueResourcesCount); + return writer; + }; + + /** + * Encodes the specified AttackExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackExposure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {google.cloud.securitycenter.v1.IAttackExposure} message AttackExposure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackExposure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackExposure message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AttackExposure} AttackExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackExposure.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackExposure(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.double(); + break; + } + case 2: { + message.latestCalculationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.attackExposureResult = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.exposedHighValueResourcesCount = reader.int32(); + break; + } + case 6: { + message.exposedMediumValueResourcesCount = reader.int32(); + break; + } + case 7: { + message.exposedLowValueResourcesCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackExposure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AttackExposure} AttackExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackExposure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackExposure message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackExposure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.latestCalculationTime != null && message.hasOwnProperty("latestCalculationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.latestCalculationTime); + if (error) + return "latestCalculationTime." + error; + } + if (message.attackExposureResult != null && message.hasOwnProperty("attackExposureResult")) + if (!$util.isString(message.attackExposureResult)) + return "attackExposureResult: 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.exposedHighValueResourcesCount != null && message.hasOwnProperty("exposedHighValueResourcesCount")) + if (!$util.isInteger(message.exposedHighValueResourcesCount)) + return "exposedHighValueResourcesCount: integer expected"; + if (message.exposedMediumValueResourcesCount != null && message.hasOwnProperty("exposedMediumValueResourcesCount")) + if (!$util.isInteger(message.exposedMediumValueResourcesCount)) + return "exposedMediumValueResourcesCount: integer expected"; + if (message.exposedLowValueResourcesCount != null && message.hasOwnProperty("exposedLowValueResourcesCount")) + if (!$util.isInteger(message.exposedLowValueResourcesCount)) + return "exposedLowValueResourcesCount: integer expected"; + return null; + }; + + /** + * Creates an AttackExposure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AttackExposure} AttackExposure + */ + AttackExposure.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AttackExposure) + return object; + var message = new $root.google.cloud.securitycenter.v1.AttackExposure(); + if (object.score != null) + message.score = Number(object.score); + if (object.latestCalculationTime != null) { + if (typeof object.latestCalculationTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AttackExposure.latestCalculationTime: object expected"); + message.latestCalculationTime = $root.google.protobuf.Timestamp.fromObject(object.latestCalculationTime); + } + if (object.attackExposureResult != null) + message.attackExposureResult = String(object.attackExposureResult); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CALCULATED": + case 1: + message.state = 1; + break; + case "NOT_CALCULATED": + case 2: + message.state = 2; + break; + } + if (object.exposedHighValueResourcesCount != null) + message.exposedHighValueResourcesCount = object.exposedHighValueResourcesCount | 0; + if (object.exposedMediumValueResourcesCount != null) + message.exposedMediumValueResourcesCount = object.exposedMediumValueResourcesCount | 0; + if (object.exposedLowValueResourcesCount != null) + message.exposedLowValueResourcesCount = object.exposedLowValueResourcesCount | 0; + return message; + }; + + /** + * Creates a plain object from an AttackExposure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {google.cloud.securitycenter.v1.AttackExposure} message AttackExposure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackExposure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.score = 0; + object.latestCalculationTime = null; + object.attackExposureResult = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.exposedHighValueResourcesCount = 0; + object.exposedMediumValueResourcesCount = 0; + object.exposedLowValueResourcesCount = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.latestCalculationTime != null && message.hasOwnProperty("latestCalculationTime")) + object.latestCalculationTime = $root.google.protobuf.Timestamp.toObject(message.latestCalculationTime, options); + if (message.attackExposureResult != null && message.hasOwnProperty("attackExposureResult")) + object.attackExposureResult = message.attackExposureResult; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.AttackExposure.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.AttackExposure.State[message.state] : message.state; + if (message.exposedHighValueResourcesCount != null && message.hasOwnProperty("exposedHighValueResourcesCount")) + object.exposedHighValueResourcesCount = message.exposedHighValueResourcesCount; + if (message.exposedMediumValueResourcesCount != null && message.hasOwnProperty("exposedMediumValueResourcesCount")) + object.exposedMediumValueResourcesCount = message.exposedMediumValueResourcesCount; + if (message.exposedLowValueResourcesCount != null && message.hasOwnProperty("exposedLowValueResourcesCount")) + object.exposedLowValueResourcesCount = message.exposedLowValueResourcesCount; + return object; + }; + + /** + * Converts this AttackExposure to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @instance + * @returns {Object.} JSON object + */ + AttackExposure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackExposure + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AttackExposure + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackExposure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackExposure"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.AttackExposure.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CALCULATED=1 CALCULATED value + * @property {number} NOT_CALCULATED=2 NOT_CALCULATED value + */ + AttackExposure.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CALCULATED"] = 1; + values[valuesById[2] = "NOT_CALCULATED"] = 2; + return values; + })(); + + return AttackExposure; + })(); + + v1.AttackPath = (function() { + + /** + * Properties of an AttackPath. + * @memberof google.cloud.securitycenter.v1 + * @interface IAttackPath + * @property {string|null} [name] AttackPath name + * @property {Array.|null} [pathNodes] AttackPath pathNodes + * @property {Array.|null} [edges] AttackPath edges + */ + + /** + * Constructs a new AttackPath. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an AttackPath. + * @implements IAttackPath + * @constructor + * @param {google.cloud.securitycenter.v1.IAttackPath=} [properties] Properties to set + */ + function AttackPath(properties) { + this.pathNodes = []; + this.edges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackPath name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.AttackPath + * @instance + */ + AttackPath.prototype.name = ""; + + /** + * AttackPath pathNodes. + * @member {Array.} pathNodes + * @memberof google.cloud.securitycenter.v1.AttackPath + * @instance + */ + AttackPath.prototype.pathNodes = $util.emptyArray; + + /** + * AttackPath edges. + * @member {Array.} edges + * @memberof google.cloud.securitycenter.v1.AttackPath + * @instance + */ + AttackPath.prototype.edges = $util.emptyArray; + + /** + * Creates a new AttackPath instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {google.cloud.securitycenter.v1.IAttackPath=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AttackPath} AttackPath instance + */ + AttackPath.create = function create(properties) { + return new AttackPath(properties); + }; + + /** + * Encodes the specified AttackPath message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {google.cloud.securitycenter.v1.IAttackPath} message AttackPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPath.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.pathNodes != null && message.pathNodes.length) + for (var i = 0; i < message.pathNodes.length; ++i) + $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.encode(message.pathNodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edges != null && message.edges.length) + for (var i = 0; i < message.edges.length; ++i) + $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.encode(message.edges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttackPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {google.cloud.securitycenter.v1.IAttackPath} message AttackPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackPath message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AttackPath} AttackPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPath.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.pathNodes && message.pathNodes.length)) + message.pathNodes = []; + message.pathNodes.push($root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.edges && message.edges.length)) + message.edges = []; + message.edges.push($root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackPath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AttackPath} AttackPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackPath message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackPath.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.pathNodes != null && message.hasOwnProperty("pathNodes")) { + if (!Array.isArray(message.pathNodes)) + return "pathNodes: array expected"; + for (var i = 0; i < message.pathNodes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify(message.pathNodes[i]); + if (error) + return "pathNodes." + error; + } + } + if (message.edges != null && message.hasOwnProperty("edges")) { + if (!Array.isArray(message.edges)) + return "edges: array expected"; + for (var i = 0; i < message.edges.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify(message.edges[i]); + if (error) + return "edges." + error; + } + } + return null; + }; + + /** + * Creates an AttackPath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AttackPath} AttackPath + */ + AttackPath.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath) + return object; + var message = new $root.google.cloud.securitycenter.v1.AttackPath(); + if (object.name != null) + message.name = String(object.name); + if (object.pathNodes) { + if (!Array.isArray(object.pathNodes)) + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.pathNodes: array expected"); + message.pathNodes = []; + for (var i = 0; i < object.pathNodes.length; ++i) { + if (typeof object.pathNodes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.pathNodes: object expected"); + message.pathNodes[i] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.fromObject(object.pathNodes[i]); + } + } + if (object.edges) { + if (!Array.isArray(object.edges)) + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.edges: array expected"); + message.edges = []; + for (var i = 0; i < object.edges.length; ++i) { + if (typeof object.edges[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.edges: object expected"); + message.edges[i] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.fromObject(object.edges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AttackPath message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {google.cloud.securitycenter.v1.AttackPath} message AttackPath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackPath.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pathNodes = []; + object.edges = []; + } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pathNodes && message.pathNodes.length) { + object.pathNodes = []; + for (var j = 0; j < message.pathNodes.length; ++j) + object.pathNodes[j] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.toObject(message.pathNodes[j], options); + } + if (message.edges && message.edges.length) { + object.edges = []; + for (var j = 0; j < message.edges.length; ++j) + object.edges[j] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.toObject(message.edges[j], options); + } + return object; + }; + + /** + * Converts this AttackPath to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AttackPath + * @instance + * @returns {Object.} JSON object + */ + AttackPath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackPath + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AttackPath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath"; + }; + + AttackPath.AttackPathNode = (function() { + + /** + * Properties of an AttackPathNode. + * @memberof google.cloud.securitycenter.v1.AttackPath + * @interface IAttackPathNode + * @property {string|null} [resource] AttackPathNode resource + * @property {string|null} [resourceType] AttackPathNode resourceType + * @property {string|null} [displayName] AttackPathNode displayName + * @property {Array.|null} [associatedFindings] AttackPathNode associatedFindings + * @property {string|null} [uuid] AttackPathNode uuid + * @property {Array.|null} [attackSteps] AttackPathNode attackSteps + */ + + /** + * Constructs a new AttackPathNode. + * @memberof google.cloud.securitycenter.v1.AttackPath + * @classdesc Represents an AttackPathNode. + * @implements IAttackPathNode + * @constructor + * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathNode=} [properties] Properties to set + */ + function AttackPathNode(properties) { + this.associatedFindings = []; + this.attackSteps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackPathNode resource. + * @member {string} resource + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.resource = ""; + + /** + * AttackPathNode resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.resourceType = ""; + + /** + * AttackPathNode displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.displayName = ""; + + /** + * AttackPathNode associatedFindings. + * @member {Array.} associatedFindings + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.associatedFindings = $util.emptyArray; + + /** + * AttackPathNode uuid. + * @member {string} uuid + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.uuid = ""; + + /** + * AttackPathNode attackSteps. + * @member {Array.} attackSteps + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.attackSteps = $util.emptyArray; + + /** + * Creates a new AttackPathNode instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathNode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} AttackPathNode instance + */ + AttackPathNode.create = function create(properties) { + return new AttackPathNode(properties); + }; + + /** + * Encodes the specified AttackPathNode message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathNode} message AttackPathNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPathNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.associatedFindings != null && message.associatedFindings.length) + for (var i = 0; i < message.associatedFindings.length; ++i) + $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.encode(message.associatedFindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.uuid); + if (message.attackSteps != null && message.attackSteps.length) + for (var i = 0; i < message.attackSteps.length; ++i) + $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.encode(message.attackSteps[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttackPathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathNode} message AttackPathNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPathNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackPathNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} AttackPathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPathNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + if (!(message.associatedFindings && message.associatedFindings.length)) + message.associatedFindings = []; + message.associatedFindings.push($root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.decode(reader, reader.uint32())); + break; + } + case 5: { + message.uuid = reader.string(); + break; + } + case 6: { + if (!(message.attackSteps && message.attackSteps.length)) + message.attackSteps = []; + message.attackSteps.push($root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackPathNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} AttackPathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPathNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackPathNode message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackPathNode.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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.associatedFindings != null && message.hasOwnProperty("associatedFindings")) { + if (!Array.isArray(message.associatedFindings)) + return "associatedFindings: array expected"; + for (var i = 0; i < message.associatedFindings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify(message.associatedFindings[i]); + if (error) + return "associatedFindings." + error; + } + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + if (message.attackSteps != null && message.hasOwnProperty("attackSteps")) { + if (!Array.isArray(message.attackSteps)) + return "attackSteps: array expected"; + for (var i = 0; i < message.attackSteps.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify(message.attackSteps[i]); + if (error) + return "attackSteps." + error; + } + } + return null; + }; + + /** + * Creates an AttackPathNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} AttackPathNode + */ + AttackPathNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode) + return object; + var message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.associatedFindings) { + if (!Array.isArray(object.associatedFindings)) + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.associatedFindings: array expected"); + message.associatedFindings = []; + for (var i = 0; i < object.associatedFindings.length; ++i) { + if (typeof object.associatedFindings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.associatedFindings: object expected"); + message.associatedFindings[i] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.fromObject(object.associatedFindings[i]); + } + } + if (object.uuid != null) + message.uuid = String(object.uuid); + if (object.attackSteps) { + if (!Array.isArray(object.attackSteps)) + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.attackSteps: array expected"); + message.attackSteps = []; + for (var i = 0; i < object.attackSteps.length; ++i) { + if (typeof object.attackSteps[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.attackSteps: object expected"); + message.attackSteps[i] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.fromObject(object.attackSteps[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AttackPathNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} message AttackPathNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackPathNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.associatedFindings = []; + object.attackSteps = []; + } + if (options.defaults) { + object.resource = ""; + object.resourceType = ""; + object.displayName = ""; + object.uuid = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.associatedFindings && message.associatedFindings.length) { + object.associatedFindings = []; + for (var j = 0; j < message.associatedFindings.length; ++j) + object.associatedFindings[j] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.toObject(message.associatedFindings[j], options); + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.attackSteps && message.attackSteps.length) { + object.attackSteps = []; + for (var j = 0; j < message.attackSteps.length; ++j) + object.attackSteps[j] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.toObject(message.attackSteps[j], options); + } + return object; + }; + + /** + * Converts this AttackPathNode to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @instance + * @returns {Object.} JSON object + */ + AttackPathNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackPathNode + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackPathNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath.AttackPathNode"; + }; + + AttackPathNode.PathNodeAssociatedFinding = (function() { + + /** + * Properties of a PathNodeAssociatedFinding. + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @interface IPathNodeAssociatedFinding + * @property {string|null} [canonicalFinding] PathNodeAssociatedFinding canonicalFinding + * @property {string|null} [findingCategory] PathNodeAssociatedFinding findingCategory + * @property {string|null} [name] PathNodeAssociatedFinding name + */ + + /** + * Constructs a new PathNodeAssociatedFinding. + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @classdesc Represents a PathNodeAssociatedFinding. + * @implements IPathNodeAssociatedFinding + * @constructor + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding=} [properties] Properties to set + */ + function PathNodeAssociatedFinding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PathNodeAssociatedFinding canonicalFinding. + * @member {string} canonicalFinding + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @instance + */ + PathNodeAssociatedFinding.prototype.canonicalFinding = ""; + + /** + * PathNodeAssociatedFinding findingCategory. + * @member {string} findingCategory + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @instance + */ + PathNodeAssociatedFinding.prototype.findingCategory = ""; + + /** + * PathNodeAssociatedFinding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @instance + */ + PathNodeAssociatedFinding.prototype.name = ""; + + /** + * Creates a new PathNodeAssociatedFinding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding instance + */ + PathNodeAssociatedFinding.create = function create(properties) { + return new PathNodeAssociatedFinding(properties); + }; + + /** + * Encodes the specified PathNodeAssociatedFinding message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding} message PathNodeAssociatedFinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathNodeAssociatedFinding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.canonicalFinding != null && Object.hasOwnProperty.call(message, "canonicalFinding")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.canonicalFinding); + if (message.findingCategory != null && Object.hasOwnProperty.call(message, "findingCategory")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingCategory); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified PathNodeAssociatedFinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding} message PathNodeAssociatedFinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathNodeAssociatedFinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathNodeAssociatedFinding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.canonicalFinding = reader.string(); + break; + } + case 2: { + message.findingCategory = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathNodeAssociatedFinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PathNodeAssociatedFinding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PathNodeAssociatedFinding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.canonicalFinding != null && message.hasOwnProperty("canonicalFinding")) + if (!$util.isString(message.canonicalFinding)) + return "canonicalFinding: string expected"; + if (message.findingCategory != null && message.hasOwnProperty("findingCategory")) + if (!$util.isString(message.findingCategory)) + return "findingCategory: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a PathNodeAssociatedFinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding + */ + PathNodeAssociatedFinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding) + return object; + var message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding(); + if (object.canonicalFinding != null) + message.canonicalFinding = String(object.canonicalFinding); + if (object.findingCategory != null) + message.findingCategory = String(object.findingCategory); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PathNodeAssociatedFinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} message PathNodeAssociatedFinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PathNodeAssociatedFinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.canonicalFinding = ""; + object.findingCategory = ""; + object.name = ""; + } + if (message.canonicalFinding != null && message.hasOwnProperty("canonicalFinding")) + object.canonicalFinding = message.canonicalFinding; + if (message.findingCategory != null && message.hasOwnProperty("findingCategory")) + object.findingCategory = message.findingCategory; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this PathNodeAssociatedFinding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @instance + * @returns {Object.} JSON object + */ + PathNodeAssociatedFinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PathNodeAssociatedFinding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PathNodeAssociatedFinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding"; + }; + + return PathNodeAssociatedFinding; + })(); + + /** + * NodeType enum. + * @name google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType + * @enum {number} + * @property {number} NODE_TYPE_UNSPECIFIED=0 NODE_TYPE_UNSPECIFIED value + * @property {number} NODE_TYPE_AND=1 NODE_TYPE_AND value + * @property {number} NODE_TYPE_OR=2 NODE_TYPE_OR value + * @property {number} NODE_TYPE_DEFENSE=3 NODE_TYPE_DEFENSE value + * @property {number} NODE_TYPE_ATTACKER=4 NODE_TYPE_ATTACKER value + */ + AttackPathNode.NodeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NODE_TYPE_AND"] = 1; + values[valuesById[2] = "NODE_TYPE_OR"] = 2; + values[valuesById[3] = "NODE_TYPE_DEFENSE"] = 3; + values[valuesById[4] = "NODE_TYPE_ATTACKER"] = 4; + return values; + })(); + + AttackPathNode.AttackStepNode = (function() { + + /** + * Properties of an AttackStepNode. + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @interface IAttackStepNode + * @property {string|null} [uuid] AttackStepNode uuid + * @property {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType|null} [type] AttackStepNode type + * @property {string|null} [displayName] AttackStepNode displayName + * @property {Object.|null} [labels] AttackStepNode labels + * @property {string|null} [description] AttackStepNode description + */ + + /** + * Constructs a new AttackStepNode. + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode + * @classdesc Represents an AttackStepNode. + * @implements IAttackStepNode + * @constructor + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode=} [properties] Properties to set + */ + function AttackStepNode(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackStepNode uuid. + * @member {string} uuid + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.uuid = ""; + + /** + * AttackStepNode type. + * @member {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType} type + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.type = 0; + + /** + * AttackStepNode displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.displayName = ""; + + /** + * AttackStepNode labels. + * @member {Object.} labels + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.labels = $util.emptyObject; + + /** + * AttackStepNode description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.description = ""; + + /** + * Creates a new AttackStepNode instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode instance + */ + AttackStepNode.create = function create(properties) { + return new AttackStepNode(properties); + }; + + /** + * Encodes the specified AttackStepNode message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode} message AttackStepNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackStepNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uuid); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + return writer; + }; + + /** + * Encodes the specified AttackStepNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode} message AttackStepNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackStepNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackStepNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackStepNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uuid = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackStepNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackStepNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackStepNode message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackStepNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AttackStepNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode + */ + AttackStepNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode) + return object; + var message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode(); + if (object.uuid != null) + message.uuid = String(object.uuid); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "NODE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "NODE_TYPE_AND": + case 1: + message.type = 1; + break; + case "NODE_TYPE_OR": + case 2: + message.type = 2; + break; + case "NODE_TYPE_DEFENSE": + case 3: + message.type = 3; + break; + case "NODE_TYPE_ATTACKER": + case 4: + message.type = 4; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AttackStepNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} message AttackStepNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackStepNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.uuid = ""; + object.type = options.enums === String ? "NODE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.description = ""; + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType[message.type] : message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AttackStepNode to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @instance + * @returns {Object.} JSON object + */ + AttackStepNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackStepNode + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackStepNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode"; + }; + + return AttackStepNode; + })(); + + return AttackPathNode; + })(); + + AttackPath.AttackPathEdge = (function() { + + /** + * Properties of an AttackPathEdge. + * @memberof google.cloud.securitycenter.v1.AttackPath + * @interface IAttackPathEdge + * @property {string|null} [source] AttackPathEdge source + * @property {string|null} [destination] AttackPathEdge destination + */ + + /** + * Constructs a new AttackPathEdge. + * @memberof google.cloud.securitycenter.v1.AttackPath + * @classdesc Represents an AttackPathEdge. + * @implements IAttackPathEdge + * @constructor + * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge=} [properties] Properties to set + */ + function AttackPathEdge(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackPathEdge source. + * @member {string} source + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @instance + */ + AttackPathEdge.prototype.source = ""; + + /** + * AttackPathEdge destination. + * @member {string} destination + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @instance + */ + AttackPathEdge.prototype.destination = ""; + + /** + * Creates a new AttackPathEdge instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} AttackPathEdge instance + */ + AttackPathEdge.create = function create(properties) { + return new AttackPathEdge(properties); + }; + + /** + * Encodes the specified AttackPathEdge message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge} message AttackPathEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPathEdge.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.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destination); + return writer; + }; + + /** + * Encodes the specified AttackPathEdge message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge} message AttackPathEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPathEdge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackPathEdge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} AttackPathEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPathEdge.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.source = reader.string(); + break; + } + case 2: { + message.destination = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackPathEdge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} AttackPathEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPathEdge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackPathEdge message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackPathEdge.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.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + return null; + }; + + /** + * Creates an AttackPathEdge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} AttackPathEdge + */ + AttackPathEdge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge) + return object; + var message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge(); + if (object.source != null) + message.source = String(object.source); + if (object.destination != null) + message.destination = String(object.destination); + return message; + }; + + /** + * Creates a plain object from an AttackPathEdge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} message AttackPathEdge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackPathEdge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = ""; + object.destination = ""; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + return object; + }; + + /** + * Converts this AttackPathEdge to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @instance + * @returns {Object.} JSON object + */ + AttackPathEdge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackPathEdge + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackPathEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath.AttackPathEdge"; + }; + + return AttackPathEdge; + })(); + + return AttackPath; + })(); + + v1.BackupDisasterRecovery = (function() { + + /** + * Properties of a BackupDisasterRecovery. + * @memberof google.cloud.securitycenter.v1 + * @interface IBackupDisasterRecovery + * @property {string|null} [backupTemplate] BackupDisasterRecovery backupTemplate + * @property {Array.|null} [policies] BackupDisasterRecovery policies + * @property {string|null} [host] BackupDisasterRecovery host + * @property {Array.|null} [applications] BackupDisasterRecovery applications + * @property {string|null} [storagePool] BackupDisasterRecovery storagePool + * @property {Array.|null} [policyOptions] BackupDisasterRecovery policyOptions + * @property {string|null} [profile] BackupDisasterRecovery profile + * @property {string|null} [appliance] BackupDisasterRecovery appliance + * @property {string|null} [backupType] BackupDisasterRecovery backupType + * @property {google.protobuf.ITimestamp|null} [backupCreateTime] BackupDisasterRecovery backupCreateTime + */ + + /** + * Constructs a new BackupDisasterRecovery. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BackupDisasterRecovery. + * @implements IBackupDisasterRecovery + * @constructor + * @param {google.cloud.securitycenter.v1.IBackupDisasterRecovery=} [properties] Properties to set + */ + function BackupDisasterRecovery(properties) { + this.policies = []; + this.applications = []; + this.policyOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupDisasterRecovery backupTemplate. + * @member {string} backupTemplate + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.backupTemplate = ""; + + /** + * BackupDisasterRecovery policies. + * @member {Array.} policies + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.policies = $util.emptyArray; + + /** + * BackupDisasterRecovery host. + * @member {string} host + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.host = ""; + + /** + * BackupDisasterRecovery applications. + * @member {Array.} applications + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.applications = $util.emptyArray; + + /** + * BackupDisasterRecovery storagePool. + * @member {string} storagePool + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.storagePool = ""; + + /** + * BackupDisasterRecovery policyOptions. + * @member {Array.} policyOptions + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.policyOptions = $util.emptyArray; + + /** + * BackupDisasterRecovery profile. + * @member {string} profile + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.profile = ""; + + /** + * BackupDisasterRecovery appliance. + * @member {string} appliance + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.appliance = ""; + + /** + * BackupDisasterRecovery backupType. + * @member {string} backupType + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.backupType = ""; + + /** + * BackupDisasterRecovery backupCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} backupCreateTime + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.backupCreateTime = null; + + /** + * Creates a new BackupDisasterRecovery instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {google.cloud.securitycenter.v1.IBackupDisasterRecovery=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BackupDisasterRecovery} BackupDisasterRecovery instance + */ + BackupDisasterRecovery.create = function create(properties) { + return new BackupDisasterRecovery(properties); + }; + + /** + * Encodes the specified BackupDisasterRecovery message. Does not implicitly {@link google.cloud.securitycenter.v1.BackupDisasterRecovery.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {google.cloud.securitycenter.v1.IBackupDisasterRecovery} message BackupDisasterRecovery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDisasterRecovery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupTemplate != null && Object.hasOwnProperty.call(message, "backupTemplate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupTemplate); + if (message.policies != null && message.policies.length) + for (var i = 0; i < message.policies.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.policies[i]); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.host); + if (message.applications != null && message.applications.length) + for (var i = 0; i < message.applications.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.applications[i]); + if (message.storagePool != null && Object.hasOwnProperty.call(message, "storagePool")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.storagePool); + if (message.policyOptions != null && message.policyOptions.length) + for (var i = 0; i < message.policyOptions.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.policyOptions[i]); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.profile); + if (message.appliance != null && Object.hasOwnProperty.call(message, "appliance")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.appliance); + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.backupType); + if (message.backupCreateTime != null && Object.hasOwnProperty.call(message, "backupCreateTime")) + $root.google.protobuf.Timestamp.encode(message.backupCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupDisasterRecovery message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BackupDisasterRecovery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {google.cloud.securitycenter.v1.IBackupDisasterRecovery} message BackupDisasterRecovery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDisasterRecovery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupDisasterRecovery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BackupDisasterRecovery} BackupDisasterRecovery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDisasterRecovery.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BackupDisasterRecovery(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupTemplate = reader.string(); + break; + } + case 2: { + if (!(message.policies && message.policies.length)) + message.policies = []; + message.policies.push(reader.string()); + break; + } + case 3: { + message.host = reader.string(); + break; + } + case 4: { + if (!(message.applications && message.applications.length)) + message.applications = []; + message.applications.push(reader.string()); + break; + } + case 5: { + message.storagePool = reader.string(); + break; + } + case 6: { + if (!(message.policyOptions && message.policyOptions.length)) + message.policyOptions = []; + message.policyOptions.push(reader.string()); + break; + } + case 7: { + message.profile = reader.string(); + break; + } + case 8: { + message.appliance = reader.string(); + break; + } + case 9: { + message.backupType = reader.string(); + break; + } + case 10: { + message.backupCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupDisasterRecovery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BackupDisasterRecovery} BackupDisasterRecovery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDisasterRecovery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupDisasterRecovery message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupDisasterRecovery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupTemplate != null && message.hasOwnProperty("backupTemplate")) + if (!$util.isString(message.backupTemplate)) + return "backupTemplate: string expected"; + if (message.policies != null && message.hasOwnProperty("policies")) { + if (!Array.isArray(message.policies)) + return "policies: array expected"; + for (var i = 0; i < message.policies.length; ++i) + if (!$util.isString(message.policies[i])) + return "policies: string[] expected"; + } + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.applications != null && message.hasOwnProperty("applications")) { + if (!Array.isArray(message.applications)) + return "applications: array expected"; + for (var i = 0; i < message.applications.length; ++i) + if (!$util.isString(message.applications[i])) + return "applications: string[] expected"; + } + if (message.storagePool != null && message.hasOwnProperty("storagePool")) + if (!$util.isString(message.storagePool)) + return "storagePool: string expected"; + if (message.policyOptions != null && message.hasOwnProperty("policyOptions")) { + if (!Array.isArray(message.policyOptions)) + return "policyOptions: array expected"; + for (var i = 0; i < message.policyOptions.length; ++i) + if (!$util.isString(message.policyOptions[i])) + return "policyOptions: string[] expected"; + } + if (message.profile != null && message.hasOwnProperty("profile")) + if (!$util.isString(message.profile)) + return "profile: string expected"; + if (message.appliance != null && message.hasOwnProperty("appliance")) + if (!$util.isString(message.appliance)) + return "appliance: string expected"; + if (message.backupType != null && message.hasOwnProperty("backupType")) + if (!$util.isString(message.backupType)) + return "backupType: string expected"; + if (message.backupCreateTime != null && message.hasOwnProperty("backupCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.backupCreateTime); + if (error) + return "backupCreateTime." + error; + } + return null; + }; + + /** + * Creates a BackupDisasterRecovery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BackupDisasterRecovery} BackupDisasterRecovery + */ + BackupDisasterRecovery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BackupDisasterRecovery) + return object; + var message = new $root.google.cloud.securitycenter.v1.BackupDisasterRecovery(); + if (object.backupTemplate != null) + message.backupTemplate = String(object.backupTemplate); + if (object.policies) { + if (!Array.isArray(object.policies)) + throw TypeError(".google.cloud.securitycenter.v1.BackupDisasterRecovery.policies: array expected"); + message.policies = []; + for (var i = 0; i < object.policies.length; ++i) + message.policies[i] = String(object.policies[i]); + } + if (object.host != null) + message.host = String(object.host); + if (object.applications) { + if (!Array.isArray(object.applications)) + throw TypeError(".google.cloud.securitycenter.v1.BackupDisasterRecovery.applications: array expected"); + message.applications = []; + for (var i = 0; i < object.applications.length; ++i) + message.applications[i] = String(object.applications[i]); + } + if (object.storagePool != null) + message.storagePool = String(object.storagePool); + if (object.policyOptions) { + if (!Array.isArray(object.policyOptions)) + throw TypeError(".google.cloud.securitycenter.v1.BackupDisasterRecovery.policyOptions: array expected"); + message.policyOptions = []; + for (var i = 0; i < object.policyOptions.length; ++i) + message.policyOptions[i] = String(object.policyOptions[i]); + } + if (object.profile != null) + message.profile = String(object.profile); + if (object.appliance != null) + message.appliance = String(object.appliance); + if (object.backupType != null) + message.backupType = String(object.backupType); + if (object.backupCreateTime != null) { + if (typeof object.backupCreateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.BackupDisasterRecovery.backupCreateTime: object expected"); + message.backupCreateTime = $root.google.protobuf.Timestamp.fromObject(object.backupCreateTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupDisasterRecovery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {google.cloud.securitycenter.v1.BackupDisasterRecovery} message BackupDisasterRecovery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupDisasterRecovery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policies = []; + object.applications = []; + object.policyOptions = []; + } + if (options.defaults) { + object.backupTemplate = ""; + object.host = ""; + object.storagePool = ""; + object.profile = ""; + object.appliance = ""; + object.backupType = ""; + object.backupCreateTime = null; + } + if (message.backupTemplate != null && message.hasOwnProperty("backupTemplate")) + object.backupTemplate = message.backupTemplate; + if (message.policies && message.policies.length) { + object.policies = []; + for (var j = 0; j < message.policies.length; ++j) + object.policies[j] = message.policies[j]; + } + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.applications && message.applications.length) { + object.applications = []; + for (var j = 0; j < message.applications.length; ++j) + object.applications[j] = message.applications[j]; + } + if (message.storagePool != null && message.hasOwnProperty("storagePool")) + object.storagePool = message.storagePool; + if (message.policyOptions && message.policyOptions.length) { + object.policyOptions = []; + for (var j = 0; j < message.policyOptions.length; ++j) + object.policyOptions[j] = message.policyOptions[j]; + } + if (message.profile != null && message.hasOwnProperty("profile")) + object.profile = message.profile; + if (message.appliance != null && message.hasOwnProperty("appliance")) + object.appliance = message.appliance; + if (message.backupType != null && message.hasOwnProperty("backupType")) + object.backupType = message.backupType; + if (message.backupCreateTime != null && message.hasOwnProperty("backupCreateTime")) + object.backupCreateTime = $root.google.protobuf.Timestamp.toObject(message.backupCreateTime, options); + return object; + }; + + /** + * Converts this BackupDisasterRecovery to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @instance + * @returns {Object.} JSON object + */ + BackupDisasterRecovery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupDisasterRecovery + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupDisasterRecovery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BackupDisasterRecovery"; + }; + + return BackupDisasterRecovery; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.Chokepoint = (function() { + + /** + * Properties of a Chokepoint. + * @memberof google.cloud.securitycenter.v1 + * @interface IChokepoint + * @property {Array.|null} [relatedFindings] Chokepoint relatedFindings + */ + + /** + * Constructs a new Chokepoint. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Chokepoint. + * @implements IChokepoint + * @constructor + * @param {google.cloud.securitycenter.v1.IChokepoint=} [properties] Properties to set + */ + function Chokepoint(properties) { + this.relatedFindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chokepoint relatedFindings. + * @member {Array.} relatedFindings + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @instance + */ + Chokepoint.prototype.relatedFindings = $util.emptyArray; + + /** + * Creates a new Chokepoint instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {google.cloud.securitycenter.v1.IChokepoint=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint instance + */ + Chokepoint.create = function create(properties) { + return new Chokepoint(properties); + }; + + /** + * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {google.cloud.securitycenter.v1.IChokepoint} message Chokepoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chokepoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relatedFindings != null && message.relatedFindings.length) + for (var i = 0; i < message.relatedFindings.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.relatedFindings[i]); + return writer; + }; + + /** + * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {google.cloud.securitycenter.v1.IChokepoint} message Chokepoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chokepoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chokepoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chokepoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Chokepoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.relatedFindings && message.relatedFindings.length)) + message.relatedFindings = []; + message.relatedFindings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chokepoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chokepoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chokepoint message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chokepoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { + if (!Array.isArray(message.relatedFindings)) + return "relatedFindings: array expected"; + for (var i = 0; i < message.relatedFindings.length; ++i) + if (!$util.isString(message.relatedFindings[i])) + return "relatedFindings: string[] expected"; + } + return null; + }; + + /** + * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint + */ + Chokepoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Chokepoint) + return object; + var message = new $root.google.cloud.securitycenter.v1.Chokepoint(); + if (object.relatedFindings) { + if (!Array.isArray(object.relatedFindings)) + throw TypeError(".google.cloud.securitycenter.v1.Chokepoint.relatedFindings: array expected"); + message.relatedFindings = []; + for (var i = 0; i < object.relatedFindings.length; ++i) + message.relatedFindings[i] = String(object.relatedFindings[i]); + } + return message; + }; + + /** + * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {google.cloud.securitycenter.v1.Chokepoint} message Chokepoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chokepoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedFindings = []; + if (message.relatedFindings && message.relatedFindings.length) { + object.relatedFindings = []; + for (var j = 0; j < message.relatedFindings.length; ++j) + object.relatedFindings[j] = message.relatedFindings[j]; + } + return object; + }; + + /** + * Converts this Chokepoint to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @instance + * @returns {Object.} JSON object + */ + Chokepoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chokepoint + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chokepoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Chokepoint"; + }; + + return Chokepoint; + })(); + + v1.CloudArmor = (function() { + + /** + * Properties of a CloudArmor. + * @memberof google.cloud.securitycenter.v1 + * @interface ICloudArmor + * @property {google.cloud.securitycenter.v1.ISecurityPolicy|null} [securityPolicy] CloudArmor securityPolicy + * @property {google.cloud.securitycenter.v1.IRequests|null} [requests] CloudArmor requests + * @property {google.cloud.securitycenter.v1.IAdaptiveProtection|null} [adaptiveProtection] CloudArmor adaptiveProtection + * @property {google.cloud.securitycenter.v1.IAttack|null} [attack] CloudArmor attack + * @property {string|null} [threatVector] CloudArmor threatVector + * @property {google.protobuf.IDuration|null} [duration] CloudArmor duration + */ + + /** + * Constructs a new CloudArmor. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CloudArmor. + * @implements ICloudArmor + * @constructor + * @param {google.cloud.securitycenter.v1.ICloudArmor=} [properties] Properties to set + */ + function CloudArmor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudArmor securityPolicy. + * @member {google.cloud.securitycenter.v1.ISecurityPolicy|null|undefined} securityPolicy + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @instance + */ + CloudArmor.prototype.securityPolicy = null; + + /** + * CloudArmor requests. + * @member {google.cloud.securitycenter.v1.IRequests|null|undefined} requests + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @instance + */ + CloudArmor.prototype.requests = null; + + /** + * CloudArmor adaptiveProtection. + * @member {google.cloud.securitycenter.v1.IAdaptiveProtection|null|undefined} adaptiveProtection + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @instance + */ + CloudArmor.prototype.adaptiveProtection = null; + + /** + * CloudArmor attack. + * @member {google.cloud.securitycenter.v1.IAttack|null|undefined} attack + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @instance + */ + CloudArmor.prototype.attack = null; + + /** + * CloudArmor threatVector. + * @member {string} threatVector + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @instance + */ + CloudArmor.prototype.threatVector = ""; + + /** + * CloudArmor duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @instance + */ + CloudArmor.prototype.duration = null; + + /** + * Creates a new CloudArmor instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {google.cloud.securitycenter.v1.ICloudArmor=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CloudArmor} CloudArmor instance + */ + CloudArmor.create = function create(properties) { + return new CloudArmor(properties); + }; + + /** + * Encodes the specified CloudArmor message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudArmor.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {google.cloud.securitycenter.v1.ICloudArmor} message CloudArmor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudArmor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + $root.google.cloud.securitycenter.v1.SecurityPolicy.encode(message.securityPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) + $root.google.cloud.securitycenter.v1.Requests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.adaptiveProtection != null && Object.hasOwnProperty.call(message, "adaptiveProtection")) + $root.google.cloud.securitycenter.v1.AdaptiveProtection.encode(message.adaptiveProtection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attack != null && Object.hasOwnProperty.call(message, "attack")) + $root.google.cloud.securitycenter.v1.Attack.encode(message.attack, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.threatVector != null && Object.hasOwnProperty.call(message, "threatVector")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.threatVector); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudArmor message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudArmor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {google.cloud.securitycenter.v1.ICloudArmor} message CloudArmor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudArmor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudArmor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CloudArmor} CloudArmor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudArmor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CloudArmor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.securityPolicy = $root.google.cloud.securitycenter.v1.SecurityPolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requests = $root.google.cloud.securitycenter.v1.Requests.decode(reader, reader.uint32()); + break; + } + case 3: { + message.adaptiveProtection = $root.google.cloud.securitycenter.v1.AdaptiveProtection.decode(reader, reader.uint32()); + break; + } + case 4: { + message.attack = $root.google.cloud.securitycenter.v1.Attack.decode(reader, reader.uint32()); + break; + } + case 5: { + message.threatVector = reader.string(); + break; + } + case 6: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudArmor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CloudArmor} CloudArmor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudArmor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudArmor message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudArmor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) { + var error = $root.google.cloud.securitycenter.v1.SecurityPolicy.verify(message.securityPolicy); + if (error) + return "securityPolicy." + error; + } + if (message.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.securitycenter.v1.Requests.verify(message.requests); + if (error) + return "requests." + error; + } + if (message.adaptiveProtection != null && message.hasOwnProperty("adaptiveProtection")) { + var error = $root.google.cloud.securitycenter.v1.AdaptiveProtection.verify(message.adaptiveProtection); + if (error) + return "adaptiveProtection." + error; + } + if (message.attack != null && message.hasOwnProperty("attack")) { + var error = $root.google.cloud.securitycenter.v1.Attack.verify(message.attack); + if (error) + return "attack." + error; + } + if (message.threatVector != null && message.hasOwnProperty("threatVector")) + if (!$util.isString(message.threatVector)) + return "threatVector: string expected"; + 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 CloudArmor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CloudArmor} CloudArmor + */ + CloudArmor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CloudArmor) + return object; + var message = new $root.google.cloud.securitycenter.v1.CloudArmor(); + if (object.securityPolicy != null) { + if (typeof object.securityPolicy !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.securityPolicy: object expected"); + message.securityPolicy = $root.google.cloud.securitycenter.v1.SecurityPolicy.fromObject(object.securityPolicy); + } + if (object.requests != null) { + if (typeof object.requests !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.requests: object expected"); + message.requests = $root.google.cloud.securitycenter.v1.Requests.fromObject(object.requests); + } + if (object.adaptiveProtection != null) { + if (typeof object.adaptiveProtection !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.adaptiveProtection: object expected"); + message.adaptiveProtection = $root.google.cloud.securitycenter.v1.AdaptiveProtection.fromObject(object.adaptiveProtection); + } + if (object.attack != null) { + if (typeof object.attack !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.attack: object expected"); + message.attack = $root.google.cloud.securitycenter.v1.Attack.fromObject(object.attack); + } + if (object.threatVector != null) + message.threatVector = String(object.threatVector); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a CloudArmor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {google.cloud.securitycenter.v1.CloudArmor} message CloudArmor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudArmor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = null; + object.requests = null; + object.adaptiveProtection = null; + object.attack = null; + object.threatVector = ""; + object.duration = null; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = $root.google.cloud.securitycenter.v1.SecurityPolicy.toObject(message.securityPolicy, options); + if (message.requests != null && message.hasOwnProperty("requests")) + object.requests = $root.google.cloud.securitycenter.v1.Requests.toObject(message.requests, options); + if (message.adaptiveProtection != null && message.hasOwnProperty("adaptiveProtection")) + object.adaptiveProtection = $root.google.cloud.securitycenter.v1.AdaptiveProtection.toObject(message.adaptiveProtection, options); + if (message.attack != null && message.hasOwnProperty("attack")) + object.attack = $root.google.cloud.securitycenter.v1.Attack.toObject(message.attack, options); + if (message.threatVector != null && message.hasOwnProperty("threatVector")) + object.threatVector = message.threatVector; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this CloudArmor to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @instance + * @returns {Object.} JSON object + */ + CloudArmor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudArmor + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CloudArmor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudArmor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudArmor"; + }; + + return CloudArmor; + })(); + + v1.SecurityPolicy = (function() { + + /** + * Properties of a SecurityPolicy. + * @memberof google.cloud.securitycenter.v1 + * @interface ISecurityPolicy + * @property {string|null} [name] SecurityPolicy name + * @property {string|null} [type] SecurityPolicy type + * @property {boolean|null} [preview] SecurityPolicy preview + */ + + /** + * Constructs a new SecurityPolicy. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityPolicy. + * @implements ISecurityPolicy + * @constructor + * @param {google.cloud.securitycenter.v1.ISecurityPolicy=} [properties] Properties to set + */ + function SecurityPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPolicy name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.name = ""; + + /** + * SecurityPolicy type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.type = ""; + + /** + * SecurityPolicy preview. + * @member {boolean} preview + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.preview = false; + + /** + * Creates a new SecurityPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {google.cloud.securitycenter.v1.ISecurityPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityPolicy} SecurityPolicy instance + */ + SecurityPolicy.create = function create(properties) { + return new SecurityPolicy(properties); + }; + + /** + * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {google.cloud.securitycenter.v1.ISecurityPolicy} message SecurityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.preview != null && Object.hasOwnProperty.call(message, "preview")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.preview); + return writer; + }; + + /** + * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {google.cloud.securitycenter.v1.ISecurityPolicy} message SecurityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SecurityPolicy} SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.preview = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SecurityPolicy} SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.preview != null && message.hasOwnProperty("preview")) + if (typeof message.preview !== "boolean") + return "preview: boolean expected"; + return null; + }; + + /** + * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SecurityPolicy} SecurityPolicy + */ + SecurityPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v1.SecurityPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.preview != null) + message.preview = Boolean(object.preview); + return message; + }; + + /** + * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {google.cloud.securitycenter.v1.SecurityPolicy} message SecurityPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = ""; + object.preview = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.preview != null && message.hasOwnProperty("preview")) + object.preview = message.preview; + return object; + }; + + /** + * Converts this SecurityPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @instance + * @returns {Object.} JSON object + */ + SecurityPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityPolicy + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SecurityPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityPolicy"; + }; + + return SecurityPolicy; + })(); + + v1.Requests = (function() { + + /** + * Properties of a Requests. + * @memberof google.cloud.securitycenter.v1 + * @interface IRequests + * @property {number|null} [ratio] Requests ratio + * @property {number|null} [shortTermAllowed] Requests shortTermAllowed + * @property {number|null} [longTermAllowed] Requests longTermAllowed + * @property {number|null} [longTermDenied] Requests longTermDenied + */ + + /** + * Constructs a new Requests. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Requests. + * @implements IRequests + * @constructor + * @param {google.cloud.securitycenter.v1.IRequests=} [properties] Properties to set + */ + function Requests(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Requests ratio. + * @member {number} ratio + * @memberof google.cloud.securitycenter.v1.Requests + * @instance + */ + Requests.prototype.ratio = 0; + + /** + * Requests shortTermAllowed. + * @member {number} shortTermAllowed + * @memberof google.cloud.securitycenter.v1.Requests + * @instance + */ + Requests.prototype.shortTermAllowed = 0; + + /** + * Requests longTermAllowed. + * @member {number} longTermAllowed + * @memberof google.cloud.securitycenter.v1.Requests + * @instance + */ + Requests.prototype.longTermAllowed = 0; + + /** + * Requests longTermDenied. + * @member {number} longTermDenied + * @memberof google.cloud.securitycenter.v1.Requests + * @instance + */ + Requests.prototype.longTermDenied = 0; + + /** + * Creates a new Requests instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {google.cloud.securitycenter.v1.IRequests=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Requests} Requests instance + */ + Requests.create = function create(properties) { + return new Requests(properties); + }; + + /** + * Encodes the specified Requests message. Does not implicitly {@link google.cloud.securitycenter.v1.Requests.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {google.cloud.securitycenter.v1.IRequests} message Requests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Requests.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.ratio); + if (message.shortTermAllowed != null && Object.hasOwnProperty.call(message, "shortTermAllowed")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.shortTermAllowed); + if (message.longTermAllowed != null && Object.hasOwnProperty.call(message, "longTermAllowed")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.longTermAllowed); + if (message.longTermDenied != null && Object.hasOwnProperty.call(message, "longTermDenied")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.longTermDenied); + return writer; + }; + + /** + * Encodes the specified Requests message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Requests.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {google.cloud.securitycenter.v1.IRequests} message Requests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Requests.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Requests message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Requests} Requests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Requests.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Requests(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ratio = reader.double(); + break; + } + case 2: { + message.shortTermAllowed = reader.int32(); + break; + } + case 3: { + message.longTermAllowed = reader.int32(); + break; + } + case 4: { + message.longTermDenied = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Requests message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Requests} Requests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Requests.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Requests message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Requests.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ratio != null && message.hasOwnProperty("ratio")) + if (typeof message.ratio !== "number") + return "ratio: number expected"; + if (message.shortTermAllowed != null && message.hasOwnProperty("shortTermAllowed")) + if (!$util.isInteger(message.shortTermAllowed)) + return "shortTermAllowed: integer expected"; + if (message.longTermAllowed != null && message.hasOwnProperty("longTermAllowed")) + if (!$util.isInteger(message.longTermAllowed)) + return "longTermAllowed: integer expected"; + if (message.longTermDenied != null && message.hasOwnProperty("longTermDenied")) + if (!$util.isInteger(message.longTermDenied)) + return "longTermDenied: integer expected"; + return null; + }; + + /** + * Creates a Requests message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Requests} Requests + */ + Requests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Requests) + return object; + var message = new $root.google.cloud.securitycenter.v1.Requests(); + if (object.ratio != null) + message.ratio = Number(object.ratio); + if (object.shortTermAllowed != null) + message.shortTermAllowed = object.shortTermAllowed | 0; + if (object.longTermAllowed != null) + message.longTermAllowed = object.longTermAllowed | 0; + if (object.longTermDenied != null) + message.longTermDenied = object.longTermDenied | 0; + return message; + }; + + /** + * Creates a plain object from a Requests message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {google.cloud.securitycenter.v1.Requests} message Requests + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Requests.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ratio = 0; + object.shortTermAllowed = 0; + object.longTermAllowed = 0; + object.longTermDenied = 0; + } + if (message.ratio != null && message.hasOwnProperty("ratio")) + object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; + if (message.shortTermAllowed != null && message.hasOwnProperty("shortTermAllowed")) + object.shortTermAllowed = message.shortTermAllowed; + if (message.longTermAllowed != null && message.hasOwnProperty("longTermAllowed")) + object.longTermAllowed = message.longTermAllowed; + if (message.longTermDenied != null && message.hasOwnProperty("longTermDenied")) + object.longTermDenied = message.longTermDenied; + return object; + }; + + /** + * Converts this Requests to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Requests + * @instance + * @returns {Object.} JSON object + */ + Requests.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Requests + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Requests + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Requests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Requests"; + }; + + return Requests; + })(); + + v1.AdaptiveProtection = (function() { + + /** + * Properties of an AdaptiveProtection. + * @memberof google.cloud.securitycenter.v1 + * @interface IAdaptiveProtection + * @property {number|null} [confidence] AdaptiveProtection confidence + */ + + /** + * Constructs a new AdaptiveProtection. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an AdaptiveProtection. + * @implements IAdaptiveProtection + * @constructor + * @param {google.cloud.securitycenter.v1.IAdaptiveProtection=} [properties] Properties to set + */ + function AdaptiveProtection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdaptiveProtection confidence. + * @member {number} confidence + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @instance + */ + AdaptiveProtection.prototype.confidence = 0; + + /** + * Creates a new AdaptiveProtection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {google.cloud.securitycenter.v1.IAdaptiveProtection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AdaptiveProtection} AdaptiveProtection instance + */ + AdaptiveProtection.create = function create(properties) { + return new AdaptiveProtection(properties); + }; + + /** + * Encodes the specified AdaptiveProtection message. Does not implicitly {@link google.cloud.securitycenter.v1.AdaptiveProtection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {google.cloud.securitycenter.v1.IAdaptiveProtection} message AdaptiveProtection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdaptiveProtection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.confidence); + return writer; + }; + + /** + * Encodes the specified AdaptiveProtection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AdaptiveProtection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {google.cloud.securitycenter.v1.IAdaptiveProtection} message AdaptiveProtection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdaptiveProtection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdaptiveProtection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AdaptiveProtection} AdaptiveProtection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdaptiveProtection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AdaptiveProtection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidence = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdaptiveProtection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AdaptiveProtection} AdaptiveProtection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdaptiveProtection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdaptiveProtection message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdaptiveProtection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates an AdaptiveProtection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AdaptiveProtection} AdaptiveProtection + */ + AdaptiveProtection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AdaptiveProtection) + return object; + var message = new $root.google.cloud.securitycenter.v1.AdaptiveProtection(); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from an AdaptiveProtection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {google.cloud.securitycenter.v1.AdaptiveProtection} message AdaptiveProtection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdaptiveProtection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.confidence = 0; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this AdaptiveProtection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @instance + * @returns {Object.} JSON object + */ + AdaptiveProtection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdaptiveProtection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AdaptiveProtection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdaptiveProtection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AdaptiveProtection"; + }; + + return AdaptiveProtection; + })(); + + v1.Attack = (function() { + + /** + * Properties of an Attack. + * @memberof google.cloud.securitycenter.v1 + * @interface IAttack + * @property {number|null} [volumePps] Attack volumePps + * @property {number|null} [volumeBps] Attack volumeBps + * @property {string|null} [classification] Attack classification + */ + + /** + * Constructs a new Attack. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Attack. + * @implements IAttack + * @constructor + * @param {google.cloud.securitycenter.v1.IAttack=} [properties] Properties to set + */ + function Attack(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attack volumePps. + * @member {number} volumePps + * @memberof google.cloud.securitycenter.v1.Attack + * @instance + */ + Attack.prototype.volumePps = 0; + + /** + * Attack volumeBps. + * @member {number} volumeBps + * @memberof google.cloud.securitycenter.v1.Attack + * @instance + */ + Attack.prototype.volumeBps = 0; + + /** + * Attack classification. + * @member {string} classification + * @memberof google.cloud.securitycenter.v1.Attack + * @instance + */ + Attack.prototype.classification = ""; + + /** + * Creates a new Attack instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {google.cloud.securitycenter.v1.IAttack=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Attack} Attack instance + */ + Attack.create = function create(properties) { + return new Attack(properties); + }; + + /** + * Encodes the specified Attack message. Does not implicitly {@link google.cloud.securitycenter.v1.Attack.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {google.cloud.securitycenter.v1.IAttack} message Attack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attack.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.volumePps != null && Object.hasOwnProperty.call(message, "volumePps")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.volumePps); + if (message.volumeBps != null && Object.hasOwnProperty.call(message, "volumeBps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.volumeBps); + if (message.classification != null && Object.hasOwnProperty.call(message, "classification")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.classification); + return writer; + }; + + /** + * Encodes the specified Attack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Attack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {google.cloud.securitycenter.v1.IAttack} message Attack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attack.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attack message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Attack} Attack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attack.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Attack(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.volumePps = reader.int32(); + break; + } + case 2: { + message.volumeBps = reader.int32(); + break; + } + case 3: { + message.classification = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attack message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Attack} Attack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attack.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attack message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attack.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.volumePps != null && message.hasOwnProperty("volumePps")) + if (!$util.isInteger(message.volumePps)) + return "volumePps: integer expected"; + if (message.volumeBps != null && message.hasOwnProperty("volumeBps")) + if (!$util.isInteger(message.volumeBps)) + return "volumeBps: integer expected"; + if (message.classification != null && message.hasOwnProperty("classification")) + if (!$util.isString(message.classification)) + return "classification: string expected"; + return null; + }; + + /** + * Creates an Attack message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Attack} Attack + */ + Attack.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Attack) + return object; + var message = new $root.google.cloud.securitycenter.v1.Attack(); + if (object.volumePps != null) + message.volumePps = object.volumePps | 0; + if (object.volumeBps != null) + message.volumeBps = object.volumeBps | 0; + if (object.classification != null) + message.classification = String(object.classification); + return message; + }; + + /** + * Creates a plain object from an Attack message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {google.cloud.securitycenter.v1.Attack} message Attack + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attack.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.volumePps = 0; + object.volumeBps = 0; + object.classification = ""; + } + if (message.volumePps != null && message.hasOwnProperty("volumePps")) + object.volumePps = message.volumePps; + if (message.volumeBps != null && message.hasOwnProperty("volumeBps")) + object.volumeBps = message.volumeBps; + if (message.classification != null && message.hasOwnProperty("classification")) + object.classification = message.classification; + return object; + }; + + /** + * Converts this Attack to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Attack + * @instance + * @returns {Object.} JSON object + */ + Attack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Attack + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Attack + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Attack"; + }; + + return Attack; + })(); + + v1.CloudDlpDataProfile = (function() { + + /** + * Properties of a CloudDlpDataProfile. + * @memberof google.cloud.securitycenter.v1 + * @interface ICloudDlpDataProfile + * @property {string|null} [dataProfile] CloudDlpDataProfile dataProfile + * @property {google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|null} [parentType] CloudDlpDataProfile parentType + * @property {Array.|null} [infoTypes] CloudDlpDataProfile infoTypes + */ + + /** + * Constructs a new CloudDlpDataProfile. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CloudDlpDataProfile. + * @implements ICloudDlpDataProfile + * @constructor + * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile=} [properties] Properties to set + */ + function CloudDlpDataProfile(properties) { + this.infoTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudDlpDataProfile dataProfile. + * @member {string} dataProfile + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @instance + */ + CloudDlpDataProfile.prototype.dataProfile = ""; + + /** + * CloudDlpDataProfile parentType. + * @member {google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType} parentType + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @instance + */ + CloudDlpDataProfile.prototype.parentType = 0; + + /** + * CloudDlpDataProfile infoTypes. + * @member {Array.} infoTypes + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @instance + */ + CloudDlpDataProfile.prototype.infoTypes = $util.emptyArray; + + /** + * Creates a new CloudDlpDataProfile instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CloudDlpDataProfile} CloudDlpDataProfile instance + */ + CloudDlpDataProfile.create = function create(properties) { + return new CloudDlpDataProfile(properties); + }; + + /** + * Encodes the specified CloudDlpDataProfile message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpDataProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile} message CloudDlpDataProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDlpDataProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataProfile != null && Object.hasOwnProperty.call(message, "dataProfile")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataProfile); + if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.parentType); + if (message.infoTypes != null && message.infoTypes.length) + for (var i = 0; i < message.infoTypes.length; ++i) + $root.google.cloud.securitycenter.v1.InfoType.encode(message.infoTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudDlpDataProfile message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpDataProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile} message CloudDlpDataProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDlpDataProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudDlpDataProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CloudDlpDataProfile} CloudDlpDataProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDlpDataProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CloudDlpDataProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataProfile = reader.string(); + break; + } + case 2: { + message.parentType = reader.int32(); + break; + } + case 3: { + if (!(message.infoTypes && message.infoTypes.length)) + message.infoTypes = []; + message.infoTypes.push($root.google.cloud.securitycenter.v1.InfoType.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudDlpDataProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CloudDlpDataProfile} CloudDlpDataProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDlpDataProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudDlpDataProfile message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudDlpDataProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) + if (!$util.isString(message.dataProfile)) + return "dataProfile: string expected"; + if (message.parentType != null && message.hasOwnProperty("parentType")) + switch (message.parentType) { + default: + return "parentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.infoTypes != null && message.hasOwnProperty("infoTypes")) { + if (!Array.isArray(message.infoTypes)) + return "infoTypes: array expected"; + for (var i = 0; i < message.infoTypes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.InfoType.verify(message.infoTypes[i]); + if (error) + return "infoTypes." + error; + } + } + return null; + }; + + /** + * Creates a CloudDlpDataProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CloudDlpDataProfile} CloudDlpDataProfile + */ + CloudDlpDataProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CloudDlpDataProfile) + return object; + var message = new $root.google.cloud.securitycenter.v1.CloudDlpDataProfile(); + if (object.dataProfile != null) + message.dataProfile = String(object.dataProfile); + switch (object.parentType) { + default: + if (typeof object.parentType === "number") { + message.parentType = object.parentType; + break; + } + break; + case "PARENT_TYPE_UNSPECIFIED": + case 0: + message.parentType = 0; + break; + case "ORGANIZATION": + case 1: + message.parentType = 1; + break; + case "PROJECT": + case 2: + message.parentType = 2; + break; + } + if (object.infoTypes) { + if (!Array.isArray(object.infoTypes)) + throw TypeError(".google.cloud.securitycenter.v1.CloudDlpDataProfile.infoTypes: array expected"); + message.infoTypes = []; + for (var i = 0; i < object.infoTypes.length; ++i) { + if (typeof object.infoTypes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CloudDlpDataProfile.infoTypes: object expected"); + message.infoTypes[i] = $root.google.cloud.securitycenter.v1.InfoType.fromObject(object.infoTypes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CloudDlpDataProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {google.cloud.securitycenter.v1.CloudDlpDataProfile} message CloudDlpDataProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudDlpDataProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.infoTypes = []; + if (options.defaults) { + object.dataProfile = ""; + object.parentType = options.enums === String ? "PARENT_TYPE_UNSPECIFIED" : 0; + } + if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) + object.dataProfile = message.dataProfile; + if (message.parentType != null && message.hasOwnProperty("parentType")) + object.parentType = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType[message.parentType] === undefined ? message.parentType : $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType[message.parentType] : message.parentType; + if (message.infoTypes && message.infoTypes.length) { + object.infoTypes = []; + for (var j = 0; j < message.infoTypes.length; ++j) + object.infoTypes[j] = $root.google.cloud.securitycenter.v1.InfoType.toObject(message.infoTypes[j], options); + } + return object; + }; + + /** + * Converts this CloudDlpDataProfile to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @instance + * @returns {Object.} JSON object + */ + CloudDlpDataProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudDlpDataProfile + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudDlpDataProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudDlpDataProfile"; + }; + + /** + * ParentType enum. + * @name google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType + * @enum {number} + * @property {number} PARENT_TYPE_UNSPECIFIED=0 PARENT_TYPE_UNSPECIFIED value + * @property {number} ORGANIZATION=1 ORGANIZATION value + * @property {number} PROJECT=2 PROJECT value + */ + CloudDlpDataProfile.ParentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORGANIZATION"] = 1; + values[valuesById[2] = "PROJECT"] = 2; + return values; + })(); + + return CloudDlpDataProfile; + })(); + + v1.InfoType = (function() { + + /** + * Properties of an InfoType. + * @memberof google.cloud.securitycenter.v1 + * @interface IInfoType + * @property {string|null} [name] InfoType name + * @property {string|null} [version] InfoType version + * @property {google.cloud.securitycenter.v1.ISensitivityScore|null} [sensitivityScore] InfoType sensitivityScore + */ + + /** + * Constructs a new InfoType. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an InfoType. + * @implements IInfoType + * @constructor + * @param {google.cloud.securitycenter.v1.IInfoType=} [properties] Properties to set + */ + function InfoType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InfoType name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.InfoType + * @instance + */ + InfoType.prototype.name = ""; + + /** + * InfoType version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.InfoType + * @instance + */ + InfoType.prototype.version = ""; + + /** + * InfoType sensitivityScore. + * @member {google.cloud.securitycenter.v1.ISensitivityScore|null|undefined} sensitivityScore + * @memberof google.cloud.securitycenter.v1.InfoType + * @instance + */ + InfoType.prototype.sensitivityScore = null; + + /** + * Creates a new InfoType instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {google.cloud.securitycenter.v1.IInfoType=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.InfoType} InfoType instance + */ + InfoType.create = function create(properties) { + return new InfoType(properties); + }; + + /** + * Encodes the specified InfoType message. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {google.cloud.securitycenter.v1.IInfoType} message InfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoType.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.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.sensitivityScore != null && Object.hasOwnProperty.call(message, "sensitivityScore")) + $root.google.cloud.securitycenter.v1.SensitivityScore.encode(message.sensitivityScore, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InfoType message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {google.cloud.securitycenter.v1.IInfoType} message InfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfoType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.InfoType} InfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.InfoType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + message.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfoType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.InfoType} InfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfoType message. + * @function verify + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfoType.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.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.sensitivityScore != null && message.hasOwnProperty("sensitivityScore")) { + var error = $root.google.cloud.securitycenter.v1.SensitivityScore.verify(message.sensitivityScore); + if (error) + return "sensitivityScore." + error; + } + return null; + }; + + /** + * Creates an InfoType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.InfoType} InfoType + */ + InfoType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.InfoType) + return object; + var message = new $root.google.cloud.securitycenter.v1.InfoType(); + if (object.name != null) + message.name = String(object.name); + if (object.version != null) + message.version = String(object.version); + if (object.sensitivityScore != null) { + if (typeof object.sensitivityScore !== "object") + throw TypeError(".google.cloud.securitycenter.v1.InfoType.sensitivityScore: object expected"); + message.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.fromObject(object.sensitivityScore); + } + return message; + }; + + /** + * Creates a plain object from an InfoType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {google.cloud.securitycenter.v1.InfoType} message InfoType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfoType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = ""; + object.sensitivityScore = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.sensitivityScore != null && message.hasOwnProperty("sensitivityScore")) + object.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.toObject(message.sensitivityScore, options); + return object; + }; + + /** + * Converts this InfoType to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.InfoType + * @instance + * @returns {Object.} JSON object + */ + InfoType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InfoType + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InfoType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.InfoType"; + }; + + return InfoType; + })(); + + v1.SensitivityScore = (function() { + + /** + * Properties of a SensitivityScore. + * @memberof google.cloud.securitycenter.v1 + * @interface ISensitivityScore + * @property {google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|null} [score] SensitivityScore score + */ + + /** + * Constructs a new SensitivityScore. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SensitivityScore. + * @implements ISensitivityScore + * @constructor + * @param {google.cloud.securitycenter.v1.ISensitivityScore=} [properties] Properties to set + */ + function SensitivityScore(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SensitivityScore score. + * @member {google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel} score + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @instance + */ + SensitivityScore.prototype.score = 0; + + /** + * Creates a new SensitivityScore instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {google.cloud.securitycenter.v1.ISensitivityScore=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore instance + */ + SensitivityScore.create = function create(properties) { + return new SensitivityScore(properties); + }; + + /** + * Encodes the specified SensitivityScore message. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {google.cloud.securitycenter.v1.ISensitivityScore} message SensitivityScore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SensitivityScore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + return writer; + }; + + /** + * Encodes the specified SensitivityScore message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {google.cloud.securitycenter.v1.ISensitivityScore} message SensitivityScore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SensitivityScore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SensitivityScore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SensitivityScore.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SensitivityScore(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SensitivityScore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SensitivityScore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SensitivityScore message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SensitivityScore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + switch (message.score) { + default: + return "score: enum value expected"; + case 0: + case 10: + case 12: + case 20: + case 30: + break; + } + return null; + }; + + /** + * Creates a SensitivityScore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore + */ + SensitivityScore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SensitivityScore) + return object; + var message = new $root.google.cloud.securitycenter.v1.SensitivityScore(); + switch (object.score) { + default: + if (typeof object.score === "number") { + message.score = object.score; + break; + } + break; + case "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED": + case 0: + message.score = 0; + break; + case "SENSITIVITY_LOW": + case 10: + message.score = 10; + break; + case "SENSITIVITY_UNKNOWN": + case 12: + message.score = 12; + break; + case "SENSITIVITY_MODERATE": + case 20: + message.score = 20; + break; + case "SENSITIVITY_HIGH": + case 30: + message.score = 30; + break; + } + return message; + }; + + /** + * Creates a plain object from a SensitivityScore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {google.cloud.securitycenter.v1.SensitivityScore} message SensitivityScore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SensitivityScore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = options.enums === String ? "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED" : 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.enums === String ? $root.google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel[message.score] === undefined ? message.score : $root.google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel[message.score] : message.score; + return object; + }; + + /** + * Converts this SensitivityScore to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @instance + * @returns {Object.} JSON object + */ + SensitivityScore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SensitivityScore + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SensitivityScore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SensitivityScore"; + }; + + /** + * SensitivityScoreLevel enum. + * @name google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel + * @enum {number} + * @property {number} SENSITIVITY_SCORE_LEVEL_UNSPECIFIED=0 SENSITIVITY_SCORE_LEVEL_UNSPECIFIED value + * @property {number} SENSITIVITY_LOW=10 SENSITIVITY_LOW value + * @property {number} SENSITIVITY_UNKNOWN=12 SENSITIVITY_UNKNOWN value + * @property {number} SENSITIVITY_MODERATE=20 SENSITIVITY_MODERATE value + * @property {number} SENSITIVITY_HIGH=30 SENSITIVITY_HIGH value + */ + SensitivityScore.SensitivityScoreLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[10] = "SENSITIVITY_LOW"] = 10; + values[valuesById[12] = "SENSITIVITY_UNKNOWN"] = 12; + values[valuesById[20] = "SENSITIVITY_MODERATE"] = 20; + values[valuesById[30] = "SENSITIVITY_HIGH"] = 30; + return values; + })(); + + return SensitivityScore; + })(); + + v1.CloudDlpInspection = (function() { + + /** + * Properties of a CloudDlpInspection. + * @memberof google.cloud.securitycenter.v1 + * @interface ICloudDlpInspection + * @property {string|null} [inspectJob] CloudDlpInspection inspectJob + * @property {string|null} [infoType] CloudDlpInspection infoType + * @property {number|Long|null} [infoTypeCount] CloudDlpInspection infoTypeCount + * @property {boolean|null} [fullScan] CloudDlpInspection fullScan + */ + + /** + * Constructs a new CloudDlpInspection. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CloudDlpInspection. + * @implements ICloudDlpInspection + * @constructor + * @param {google.cloud.securitycenter.v1.ICloudDlpInspection=} [properties] Properties to set + */ + function CloudDlpInspection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudDlpInspection inspectJob. + * @member {string} inspectJob + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @instance + */ + CloudDlpInspection.prototype.inspectJob = ""; + + /** + * CloudDlpInspection infoType. + * @member {string} infoType + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @instance + */ + CloudDlpInspection.prototype.infoType = ""; + + /** + * CloudDlpInspection infoTypeCount. + * @member {number|Long} infoTypeCount + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @instance + */ + CloudDlpInspection.prototype.infoTypeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CloudDlpInspection fullScan. + * @member {boolean} fullScan + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @instance + */ + CloudDlpInspection.prototype.fullScan = false; + + /** + * Creates a new CloudDlpInspection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {google.cloud.securitycenter.v1.ICloudDlpInspection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CloudDlpInspection} CloudDlpInspection instance + */ + CloudDlpInspection.create = function create(properties) { + return new CloudDlpInspection(properties); + }; + + /** + * Encodes the specified CloudDlpInspection message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpInspection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {google.cloud.securitycenter.v1.ICloudDlpInspection} message CloudDlpInspection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDlpInspection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inspectJob != null && Object.hasOwnProperty.call(message, "inspectJob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inspectJob); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.infoType); + if (message.infoTypeCount != null && Object.hasOwnProperty.call(message, "infoTypeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.infoTypeCount); + if (message.fullScan != null && Object.hasOwnProperty.call(message, "fullScan")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.fullScan); + return writer; + }; + + /** + * Encodes the specified CloudDlpInspection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpInspection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {google.cloud.securitycenter.v1.ICloudDlpInspection} message CloudDlpInspection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDlpInspection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudDlpInspection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CloudDlpInspection} CloudDlpInspection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDlpInspection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CloudDlpInspection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inspectJob = reader.string(); + break; + } + case 2: { + message.infoType = reader.string(); + break; + } + case 3: { + message.infoTypeCount = reader.int64(); + break; + } + case 4: { + message.fullScan = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudDlpInspection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CloudDlpInspection} CloudDlpInspection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDlpInspection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudDlpInspection message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudDlpInspection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) + if (!$util.isString(message.inspectJob)) + return "inspectJob: string expected"; + if (message.infoType != null && message.hasOwnProperty("infoType")) + if (!$util.isString(message.infoType)) + return "infoType: string expected"; + if (message.infoTypeCount != null && message.hasOwnProperty("infoTypeCount")) + if (!$util.isInteger(message.infoTypeCount) && !(message.infoTypeCount && $util.isInteger(message.infoTypeCount.low) && $util.isInteger(message.infoTypeCount.high))) + return "infoTypeCount: integer|Long expected"; + if (message.fullScan != null && message.hasOwnProperty("fullScan")) + if (typeof message.fullScan !== "boolean") + return "fullScan: boolean expected"; + return null; + }; + + /** + * Creates a CloudDlpInspection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CloudDlpInspection} CloudDlpInspection + */ + CloudDlpInspection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CloudDlpInspection) + return object; + var message = new $root.google.cloud.securitycenter.v1.CloudDlpInspection(); + if (object.inspectJob != null) + message.inspectJob = String(object.inspectJob); + if (object.infoType != null) + message.infoType = String(object.infoType); + if (object.infoTypeCount != null) + if ($util.Long) + (message.infoTypeCount = $util.Long.fromValue(object.infoTypeCount)).unsigned = false; + else if (typeof object.infoTypeCount === "string") + message.infoTypeCount = parseInt(object.infoTypeCount, 10); + else if (typeof object.infoTypeCount === "number") + message.infoTypeCount = object.infoTypeCount; + else if (typeof object.infoTypeCount === "object") + message.infoTypeCount = new $util.LongBits(object.infoTypeCount.low >>> 0, object.infoTypeCount.high >>> 0).toNumber(); + if (object.fullScan != null) + message.fullScan = Boolean(object.fullScan); + return message; + }; + + /** + * Creates a plain object from a CloudDlpInspection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {google.cloud.securitycenter.v1.CloudDlpInspection} message CloudDlpInspection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudDlpInspection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inspectJob = ""; + object.infoType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.infoTypeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.infoTypeCount = options.longs === String ? "0" : 0; + object.fullScan = false; + } + if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) + object.inspectJob = message.inspectJob; + if (message.infoType != null && message.hasOwnProperty("infoType")) + object.infoType = message.infoType; + if (message.infoTypeCount != null && message.hasOwnProperty("infoTypeCount")) + if (typeof message.infoTypeCount === "number") + object.infoTypeCount = options.longs === String ? String(message.infoTypeCount) : message.infoTypeCount; + else + object.infoTypeCount = options.longs === String ? $util.Long.prototype.toString.call(message.infoTypeCount) : options.longs === Number ? new $util.LongBits(message.infoTypeCount.low >>> 0, message.infoTypeCount.high >>> 0).toNumber() : message.infoTypeCount; + if (message.fullScan != null && message.hasOwnProperty("fullScan")) + object.fullScan = message.fullScan; + return object; + }; + + /** + * Converts this CloudDlpInspection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @instance + * @returns {Object.} JSON object + */ + CloudDlpInspection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudDlpInspection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CloudDlpInspection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudDlpInspection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudDlpInspection"; + }; + + return CloudDlpInspection; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.protocol === "number") { + message.protocol = object.protocol; + break; + } + break; + 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] === undefined ? message.protocol : $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); + }; + + /** + * 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 + * @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.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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.securitycenter.v1 + * @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 + * @property {google.protobuf.ITimestamp|null} [createTime] Container createTime + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.securitycenter.v1.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.name = ""; + + /** + * Container uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.uri = ""; + + /** + * 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; + + /** + * Container createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.createTime = null; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {google.cloud.securitycenter.v1.IContainer=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @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 + */ + Container.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.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(); + 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(); + return writer; + }; + + /** + * 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.Container + * @static + * @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 + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @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.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @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 + */ + Container.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.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 "labels." + 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 Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Container) + return object; + 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]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Container.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {google.cloud.securitycenter.v1.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + object.name = ""; + object.uri = ""; + object.imageId = ""; + object.createTime = null; + } + 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); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.Label = (function() { + + /** + * Properties of a Label. + * @memberof google.cloud.securitycenter.v1 + * @interface ILabel + * @property {string|null} [name] Label name + * @property {string|null} [value] Label value + */ + + /** + * Constructs a new Label. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Label. + * @implements ILabel + * @constructor + * @param {google.cloud.securitycenter.v1.ILabel=} [properties] Properties to set + */ + function Label(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Label name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Label + * @instance + */ + Label.prototype.name = ""; + + /** + * Label value. + * @member {string} value + * @memberof google.cloud.securitycenter.v1.Label + * @instance + */ + Label.prototype.value = ""; + + /** + * Creates a new Label instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {google.cloud.securitycenter.v1.ILabel=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Label} Label instance + */ + Label.create = function create(properties) { + return new Label(properties); + }; + + /** + * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @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 + */ + 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.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * 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.Label + * @static + * @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 + */ + Label.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Label message from the specified reader or buffer. + * @function decode + * @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.Label} Label + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Label.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Label message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + Label.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Label message. + * @function verify + * @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 + */ + 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.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a Label message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Label} Label + */ + Label.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Label) + return object; + var message = new $root.google.cloud.securitycenter.v1.Label(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a Label message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {google.cloud.securitycenter.v1.Label} message Label + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Label.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Label to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Label + * @instance + * @returns {Object.} JSON object + */ + Label.prototype.toJSON = function toJSON() { + 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; + })(); + + 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 + * @property {string|null} [version] Database version + */ + + /** + * 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; + + /** + * Database version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.version = ""; + + /** + * 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]); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.version); + 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 6: { + message.version = 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"; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: 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]); + } + if (object.version != null) + message.version = String(object.version); + 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 = ""; + object.version = ""; + } + 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]; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + 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.EffectiveEventThreatDetectionCustomModule = (function() { + + /** + * Properties of an EffectiveEventThreatDetectionCustomModule. + * @memberof google.cloud.securitycenter.v1 + * @interface IEffectiveEventThreatDetectionCustomModule + * @property {string|null} [name] EffectiveEventThreatDetectionCustomModule name + * @property {google.protobuf.IStruct|null} [config] EffectiveEventThreatDetectionCustomModule config + * @property {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState|null} [enablementState] EffectiveEventThreatDetectionCustomModule enablementState + * @property {string|null} [type] EffectiveEventThreatDetectionCustomModule type + * @property {string|null} [displayName] EffectiveEventThreatDetectionCustomModule displayName + * @property {string|null} [description] EffectiveEventThreatDetectionCustomModule description + */ + + /** + * Constructs a new EffectiveEventThreatDetectionCustomModule. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an EffectiveEventThreatDetectionCustomModule. + * @implements IEffectiveEventThreatDetectionCustomModule + * @constructor + * @param {google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule=} [properties] Properties to set + */ + function EffectiveEventThreatDetectionCustomModule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EffectiveEventThreatDetectionCustomModule name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @instance + */ + EffectiveEventThreatDetectionCustomModule.prototype.name = ""; + + /** + * EffectiveEventThreatDetectionCustomModule config. + * @member {google.protobuf.IStruct|null|undefined} config + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @instance + */ + EffectiveEventThreatDetectionCustomModule.prototype.config = null; + + /** + * EffectiveEventThreatDetectionCustomModule enablementState. + * @member {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState} enablementState + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @instance + */ + EffectiveEventThreatDetectionCustomModule.prototype.enablementState = 0; + + /** + * EffectiveEventThreatDetectionCustomModule type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @instance + */ + EffectiveEventThreatDetectionCustomModule.prototype.type = ""; + + /** + * EffectiveEventThreatDetectionCustomModule displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @instance + */ + EffectiveEventThreatDetectionCustomModule.prototype.displayName = ""; + + /** + * EffectiveEventThreatDetectionCustomModule description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @instance + */ + EffectiveEventThreatDetectionCustomModule.prototype.description = ""; + + /** + * Creates a new EffectiveEventThreatDetectionCustomModule instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} EffectiveEventThreatDetectionCustomModule instance + */ + EffectiveEventThreatDetectionCustomModule.create = function create(properties) { + return new EffectiveEventThreatDetectionCustomModule(properties); + }; + + /** + * Encodes the specified EffectiveEventThreatDetectionCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule} message EffectiveEventThreatDetectionCustomModule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveEventThreatDetectionCustomModule.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.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.protobuf.Struct.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enablementState != null && Object.hasOwnProperty.call(message, "enablementState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.enablementState); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + return writer; + }; + + /** + * Encodes the specified EffectiveEventThreatDetectionCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule} message EffectiveEventThreatDetectionCustomModule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveEventThreatDetectionCustomModule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EffectiveEventThreatDetectionCustomModule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} EffectiveEventThreatDetectionCustomModule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveEventThreatDetectionCustomModule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.enablementState = reader.int32(); + break; + } + case 4: { + message.type = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EffectiveEventThreatDetectionCustomModule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} EffectiveEventThreatDetectionCustomModule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveEventThreatDetectionCustomModule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EffectiveEventThreatDetectionCustomModule message. + * @function verify + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EffectiveEventThreatDetectionCustomModule.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.config != null && message.hasOwnProperty("config")) { + var error = $root.google.protobuf.Struct.verify(message.config); + if (error) + return "config." + error; + } + if (message.enablementState != null && message.hasOwnProperty("enablementState")) + switch (message.enablementState) { + default: + return "enablementState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: 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 EffectiveEventThreatDetectionCustomModule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} EffectiveEventThreatDetectionCustomModule + */ + EffectiveEventThreatDetectionCustomModule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule) + return object; + var message = new $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.config: object expected"); + message.config = $root.google.protobuf.Struct.fromObject(object.config); + } + switch (object.enablementState) { + default: + if (typeof object.enablementState === "number") { + message.enablementState = object.enablementState; + break; + } + break; + case "ENABLEMENT_STATE_UNSPECIFIED": + case 0: + message.enablementState = 0; + break; + case "ENABLED": + case 1: + message.enablementState = 1; + break; + case "DISABLED": + case 2: + message.enablementState = 2; + break; + } + if (object.type != null) + message.type = String(object.type); + 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 EffectiveEventThreatDetectionCustomModule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} message EffectiveEventThreatDetectionCustomModule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EffectiveEventThreatDetectionCustomModule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.config = null; + object.enablementState = options.enums === String ? "ENABLEMENT_STATE_UNSPECIFIED" : 0; + object.type = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.protobuf.Struct.toObject(message.config, options); + if (message.enablementState != null && message.hasOwnProperty("enablementState")) + object.enablementState = options.enums === String ? $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState[message.enablementState] : message.enablementState; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + 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 EffectiveEventThreatDetectionCustomModule to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @instance + * @returns {Object.} JSON object + */ + EffectiveEventThreatDetectionCustomModule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EffectiveEventThreatDetectionCustomModule + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EffectiveEventThreatDetectionCustomModule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule"; + }; + + /** + * EnablementState enum. + * @name google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState + * @enum {number} + * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + */ + EffectiveEventThreatDetectionCustomModule.EnablementState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENABLEMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + + return EffectiveEventThreatDetectionCustomModule; + })(); + + v1.EffectiveSecurityHealthAnalyticsCustomModule = (function() { + + /** + * Properties of an EffectiveSecurityHealthAnalyticsCustomModule. + * @memberof google.cloud.securitycenter.v1 + * @interface IEffectiveSecurityHealthAnalyticsCustomModule + * @property {string|null} [name] EffectiveSecurityHealthAnalyticsCustomModule name + * @property {google.cloud.securitycenter.v1.ICustomConfig|null} [customConfig] EffectiveSecurityHealthAnalyticsCustomModule customConfig + * @property {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState|null} [enablementState] EffectiveSecurityHealthAnalyticsCustomModule enablementState + * @property {string|null} [displayName] EffectiveSecurityHealthAnalyticsCustomModule displayName + */ + + /** + * Constructs a new EffectiveSecurityHealthAnalyticsCustomModule. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an EffectiveSecurityHealthAnalyticsCustomModule. + * @implements IEffectiveSecurityHealthAnalyticsCustomModule + * @constructor + * @param {google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule=} [properties] Properties to set + */ + function EffectiveSecurityHealthAnalyticsCustomModule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EffectiveSecurityHealthAnalyticsCustomModule name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @instance + */ + EffectiveSecurityHealthAnalyticsCustomModule.prototype.name = ""; + + /** + * EffectiveSecurityHealthAnalyticsCustomModule customConfig. + * @member {google.cloud.securitycenter.v1.ICustomConfig|null|undefined} customConfig + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @instance + */ + EffectiveSecurityHealthAnalyticsCustomModule.prototype.customConfig = null; + + /** + * EffectiveSecurityHealthAnalyticsCustomModule enablementState. + * @member {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState} enablementState + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @instance + */ + EffectiveSecurityHealthAnalyticsCustomModule.prototype.enablementState = 0; + + /** + * EffectiveSecurityHealthAnalyticsCustomModule displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @instance + */ + EffectiveSecurityHealthAnalyticsCustomModule.prototype.displayName = ""; + + /** + * Creates a new EffectiveSecurityHealthAnalyticsCustomModule instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} EffectiveSecurityHealthAnalyticsCustomModule instance + */ + EffectiveSecurityHealthAnalyticsCustomModule.create = function create(properties) { + return new EffectiveSecurityHealthAnalyticsCustomModule(properties); + }; + + /** + * Encodes the specified EffectiveSecurityHealthAnalyticsCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule} message EffectiveSecurityHealthAnalyticsCustomModule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveSecurityHealthAnalyticsCustomModule.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.customConfig != null && Object.hasOwnProperty.call(message, "customConfig")) + $root.google.cloud.securitycenter.v1.CustomConfig.encode(message.customConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enablementState != null && Object.hasOwnProperty.call(message, "enablementState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.enablementState); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified EffectiveSecurityHealthAnalyticsCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule} message EffectiveSecurityHealthAnalyticsCustomModule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveSecurityHealthAnalyticsCustomModule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EffectiveSecurityHealthAnalyticsCustomModule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} EffectiveSecurityHealthAnalyticsCustomModule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveSecurityHealthAnalyticsCustomModule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.enablementState = reader.int32(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EffectiveSecurityHealthAnalyticsCustomModule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} EffectiveSecurityHealthAnalyticsCustomModule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveSecurityHealthAnalyticsCustomModule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EffectiveSecurityHealthAnalyticsCustomModule message. + * @function verify + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EffectiveSecurityHealthAnalyticsCustomModule.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.customConfig != null && message.hasOwnProperty("customConfig")) { + var error = $root.google.cloud.securitycenter.v1.CustomConfig.verify(message.customConfig); + if (error) + return "customConfig." + error; + } + if (message.enablementState != null && message.hasOwnProperty("enablementState")) + switch (message.enablementState) { + default: + return "enablementState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an EffectiveSecurityHealthAnalyticsCustomModule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} EffectiveSecurityHealthAnalyticsCustomModule + */ + EffectiveSecurityHealthAnalyticsCustomModule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule) + return object; + var message = new $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule(); + if (object.name != null) + message.name = String(object.name); + if (object.customConfig != null) { + if (typeof object.customConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.customConfig: object expected"); + message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.fromObject(object.customConfig); + } + switch (object.enablementState) { + default: + if (typeof object.enablementState === "number") { + message.enablementState = object.enablementState; + break; + } + break; + case "ENABLEMENT_STATE_UNSPECIFIED": + case 0: + message.enablementState = 0; + break; + case "ENABLED": + case 1: + message.enablementState = 1; + break; + case "DISABLED": + case 2: + message.enablementState = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an EffectiveSecurityHealthAnalyticsCustomModule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} message EffectiveSecurityHealthAnalyticsCustomModule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EffectiveSecurityHealthAnalyticsCustomModule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.customConfig = null; + object.enablementState = options.enums === String ? "ENABLEMENT_STATE_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.customConfig != null && message.hasOwnProperty("customConfig")) + object.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.toObject(message.customConfig, options); + if (message.enablementState != null && message.hasOwnProperty("enablementState")) + object.enablementState = options.enums === String ? $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState[message.enablementState] : message.enablementState; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this EffectiveSecurityHealthAnalyticsCustomModule to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @instance + * @returns {Object.} JSON object + */ + EffectiveSecurityHealthAnalyticsCustomModule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EffectiveSecurityHealthAnalyticsCustomModule + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EffectiveSecurityHealthAnalyticsCustomModule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule"; + }; + + /** + * EnablementState enum. + * @name google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState + * @enum {number} + * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + */ + EffectiveSecurityHealthAnalyticsCustomModule.EnablementState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENABLEMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + + return EffectiveSecurityHealthAnalyticsCustomModule; + })(); + + v1.CustomConfig = (function() { + + /** + * Properties of a CustomConfig. + * @memberof google.cloud.securitycenter.v1 + * @interface ICustomConfig + * @property {google.type.IExpr|null} [predicate] CustomConfig predicate + * @property {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec|null} [customOutput] CustomConfig customOutput + * @property {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector|null} [resourceSelector] CustomConfig resourceSelector + * @property {google.cloud.securitycenter.v1.CustomConfig.Severity|null} [severity] CustomConfig severity + * @property {string|null} [description] CustomConfig description + * @property {string|null} [recommendation] CustomConfig recommendation + */ + + /** + * Constructs a new CustomConfig. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CustomConfig. + * @implements ICustomConfig + * @constructor + * @param {google.cloud.securitycenter.v1.ICustomConfig=} [properties] Properties to set + */ + function CustomConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomConfig predicate. + * @member {google.type.IExpr|null|undefined} predicate + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @instance + */ + CustomConfig.prototype.predicate = null; + + /** + * CustomConfig customOutput. + * @member {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec|null|undefined} customOutput + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @instance + */ + CustomConfig.prototype.customOutput = null; + + /** + * CustomConfig resourceSelector. + * @member {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector|null|undefined} resourceSelector + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @instance + */ + CustomConfig.prototype.resourceSelector = null; + + /** + * CustomConfig severity. + * @member {google.cloud.securitycenter.v1.CustomConfig.Severity} severity + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @instance + */ + CustomConfig.prototype.severity = 0; + + /** + * CustomConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @instance + */ + CustomConfig.prototype.description = ""; + + /** + * CustomConfig recommendation. + * @member {string} recommendation + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @instance + */ + CustomConfig.prototype.recommendation = ""; + + /** + * Creates a new CustomConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {google.cloud.securitycenter.v1.ICustomConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CustomConfig} CustomConfig instance + */ + CustomConfig.create = function create(properties) { + return new CustomConfig(properties); + }; + + /** + * Encodes the specified CustomConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {google.cloud.securitycenter.v1.ICustomConfig} message CustomConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.predicate != null && Object.hasOwnProperty.call(message, "predicate")) + $root.google.type.Expr.encode(message.predicate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customOutput != null && Object.hasOwnProperty.call(message, "customOutput")) + $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.encode(message.customOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceSelector != null && Object.hasOwnProperty.call(message, "resourceSelector")) + $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.severity); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.recommendation != null && Object.hasOwnProperty.call(message, "recommendation")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.recommendation); + return writer; + }; + + /** + * Encodes the specified CustomConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {google.cloud.securitycenter.v1.ICustomConfig} message CustomConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CustomConfig} CustomConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.predicate = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customOutput = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resourceSelector = $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.decode(reader, reader.uint32()); + break; + } + case 4: { + message.severity = reader.int32(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.recommendation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CustomConfig} CustomConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.predicate != null && message.hasOwnProperty("predicate")) { + var error = $root.google.type.Expr.verify(message.predicate); + if (error) + return "predicate." + error; + } + if (message.customOutput != null && message.hasOwnProperty("customOutput")) { + var error = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify(message.customOutput); + if (error) + return "customOutput." + error; + } + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) { + var error = $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify(message.resourceSelector); + if (error) + return "resourceSelector." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.recommendation != null && message.hasOwnProperty("recommendation")) + if (!$util.isString(message.recommendation)) + return "recommendation: string expected"; + return null; + }; + + /** + * Creates a CustomConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CustomConfig} CustomConfig + */ + CustomConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CustomConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.CustomConfig(); + if (object.predicate != null) { + if (typeof object.predicate !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.predicate: object expected"); + message.predicate = $root.google.type.Expr.fromObject(object.predicate); + } + if (object.customOutput != null) { + if (typeof object.customOutput !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.customOutput: object expected"); + message.customOutput = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.fromObject(object.customOutput); + } + if (object.resourceSelector != null) { + if (typeof object.resourceSelector !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.resourceSelector: object expected"); + message.resourceSelector = $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.fromObject(object.resourceSelector); + } + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + 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.description != null) + message.description = String(object.description); + if (object.recommendation != null) + message.recommendation = String(object.recommendation); + return message; + }; + + /** + * Creates a plain object from a CustomConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig} message CustomConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.predicate = null; + object.customOutput = null; + object.resourceSelector = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.description = ""; + object.recommendation = ""; + } + if (message.predicate != null && message.hasOwnProperty("predicate")) + object.predicate = $root.google.type.Expr.toObject(message.predicate, options); + if (message.customOutput != null && message.hasOwnProperty("customOutput")) + object.customOutput = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.toObject(message.customOutput, options); + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + object.resourceSelector = $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.toObject(message.resourceSelector, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.CustomConfig.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.securitycenter.v1.CustomConfig.Severity[message.severity] : message.severity; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.recommendation != null && message.hasOwnProperty("recommendation")) + object.recommendation = message.recommendation; + return object; + }; + + /** + * Converts this CustomConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @instance + * @returns {Object.} JSON object + */ + CustomConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomConfig"; + }; + + CustomConfig.CustomOutputSpec = (function() { + + /** + * Properties of a CustomOutputSpec. + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @interface ICustomOutputSpec + * @property {Array.|null} [properties] CustomOutputSpec properties + */ + + /** + * Constructs a new CustomOutputSpec. + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @classdesc Represents a CustomOutputSpec. + * @implements ICustomOutputSpec + * @constructor + * @param {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec=} [properties] Properties to set + */ + function CustomOutputSpec(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]]; + } + + /** + * CustomOutputSpec properties. + * @member {Array.} properties + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @instance + */ + CustomOutputSpec.prototype.properties = $util.emptyArray; + + /** + * Creates a new CustomOutputSpec instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} CustomOutputSpec instance + */ + CustomOutputSpec.create = function create(properties) { + return new CustomOutputSpec(properties); + }; + + /** + * Encodes the specified CustomOutputSpec message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec} message CustomOutputSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomOutputSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.encode(message.properties[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomOutputSpec message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec} message CustomOutputSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomOutputSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomOutputSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} CustomOutputSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomOutputSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomOutputSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} CustomOutputSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomOutputSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomOutputSpec message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomOutputSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + return null; + }; + + /** + * Creates a CustomOutputSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} CustomOutputSpec + */ + CustomOutputSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec) + return object; + var message = new $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec(); + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.properties: object expected"); + message.properties[i] = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.fromObject(object.properties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CustomOutputSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} message CustomOutputSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomOutputSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.properties = []; + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.toObject(message.properties[j], options); + } + return object; + }; + + /** + * Converts this CustomOutputSpec to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @instance + * @returns {Object.} JSON object + */ + CustomOutputSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomOutputSpec + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomOutputSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec"; + }; + + CustomOutputSpec.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @interface IProperty + * @property {string|null} [name] Property name + * @property {google.type.IExpr|null} [valueExpression] Property valueExpression + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty=} [properties] Properties to set + */ + function Property(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Property name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property valueExpression. + * @member {google.type.IExpr|null|undefined} valueExpression + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @instance + */ + Property.prototype.valueExpression = null; + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.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.valueExpression != null && Object.hasOwnProperty.call(message, "valueExpression")) + $root.google.type.Expr.encode(message.valueExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Property message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.valueExpression = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Property message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Property.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.valueExpression != null && message.hasOwnProperty("valueExpression")) { + var error = $root.google.type.Expr.verify(message.valueExpression); + if (error) + return "valueExpression." + error; + } + return null; + }; + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property) + return object; + var message = new $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.valueExpression != null) { + if (typeof object.valueExpression !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.valueExpression: object expected"); + message.valueExpression = $root.google.type.Expr.fromObject(object.valueExpression); + } + return message; + }; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} message Property + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Property.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.valueExpression = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.valueExpression != null && message.hasOwnProperty("valueExpression")) + object.valueExpression = $root.google.type.Expr.toObject(message.valueExpression, options); + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @instance + * @returns {Object.} JSON object + */ + Property.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Property + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Property.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property"; + }; + + return Property; + })(); + + return CustomOutputSpec; + })(); + + CustomConfig.ResourceSelector = (function() { + + /** + * Properties of a ResourceSelector. + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @interface IResourceSelector + * @property {Array.|null} [resourceTypes] ResourceSelector resourceTypes + */ + + /** + * Constructs a new ResourceSelector. + * @memberof google.cloud.securitycenter.v1.CustomConfig + * @classdesc Represents a ResourceSelector. + * @implements IResourceSelector + * @constructor + * @param {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector=} [properties] Properties to set + */ + function ResourceSelector(properties) { + this.resourceTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceSelector resourceTypes. + * @member {Array.} resourceTypes + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @instance + */ + ResourceSelector.prototype.resourceTypes = $util.emptyArray; + + /** + * Creates a new ResourceSelector instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} ResourceSelector instance + */ + ResourceSelector.create = function create(properties) { + return new ResourceSelector(properties); + }; + + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceTypes != null && message.resourceTypes.length) + for (var i = 0; i < message.resourceTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceTypes[i]); + return writer; + }; + + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceTypes && message.resourceTypes.length)) + message.resourceTypes = []; + message.resourceTypes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSelector message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceTypes != null && message.hasOwnProperty("resourceTypes")) { + if (!Array.isArray(message.resourceTypes)) + return "resourceTypes: array expected"; + for (var i = 0; i < message.resourceTypes.length; ++i) + if (!$util.isString(message.resourceTypes[i])) + return "resourceTypes: string[] expected"; + } + return null; + }; + + /** + * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} ResourceSelector + */ + ResourceSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector) + return object; + var message = new $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector(); + if (object.resourceTypes) { + if (!Array.isArray(object.resourceTypes)) + throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.resourceTypes: array expected"); + message.resourceTypes = []; + for (var i = 0; i < object.resourceTypes.length; ++i) + message.resourceTypes[i] = String(object.resourceTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} message ResourceSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceTypes = []; + if (message.resourceTypes && message.resourceTypes.length) { + object.resourceTypes = []; + for (var j = 0; j < message.resourceTypes.length; ++j) + object.resourceTypes[j] = message.resourceTypes[j]; + } + return object; + }; + + /** + * Converts this ResourceSelector to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @instance + * @returns {Object.} JSON object + */ + ResourceSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceSelector + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomConfig.ResourceSelector"; + }; + + return ResourceSelector; + })(); + + /** + * Severity enum. + * @name google.cloud.securitycenter.v1.CustomConfig.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 + */ + CustomConfig.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 CustomConfig; + })(); + + v1.EventThreatDetectionCustomModule = (function() { + + /** + * Properties of an EventThreatDetectionCustomModule. + * @memberof google.cloud.securitycenter.v1 + * @interface IEventThreatDetectionCustomModule + * @property {string|null} [name] EventThreatDetectionCustomModule name + * @property {google.protobuf.IStruct|null} [config] EventThreatDetectionCustomModule config + * @property {string|null} [ancestorModule] EventThreatDetectionCustomModule ancestorModule + * @property {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState|null} [enablementState] EventThreatDetectionCustomModule enablementState + * @property {string|null} [type] EventThreatDetectionCustomModule type + * @property {string|null} [displayName] EventThreatDetectionCustomModule displayName + * @property {string|null} [description] EventThreatDetectionCustomModule description + * @property {google.protobuf.ITimestamp|null} [updateTime] EventThreatDetectionCustomModule updateTime + * @property {string|null} [lastEditor] EventThreatDetectionCustomModule lastEditor + */ + + /** + * Constructs a new EventThreatDetectionCustomModule. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an EventThreatDetectionCustomModule. + * @implements IEventThreatDetectionCustomModule + * @constructor + * @param {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule=} [properties] Properties to set + */ + function EventThreatDetectionCustomModule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventThreatDetectionCustomModule name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.name = ""; + + /** + * EventThreatDetectionCustomModule config. + * @member {google.protobuf.IStruct|null|undefined} config + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.config = null; + + /** + * EventThreatDetectionCustomModule ancestorModule. + * @member {string} ancestorModule + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.ancestorModule = ""; + + /** + * EventThreatDetectionCustomModule enablementState. + * @member {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState} enablementState + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.enablementState = 0; + + /** + * EventThreatDetectionCustomModule type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.type = ""; + + /** + * EventThreatDetectionCustomModule displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.displayName = ""; + + /** + * EventThreatDetectionCustomModule description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.description = ""; + + /** + * EventThreatDetectionCustomModule updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.updateTime = null; + + /** + * EventThreatDetectionCustomModule lastEditor. + * @member {string} lastEditor + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + */ + EventThreatDetectionCustomModule.prototype.lastEditor = ""; + + /** + * Creates a new EventThreatDetectionCustomModule instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} EventThreatDetectionCustomModule instance + */ + EventThreatDetectionCustomModule.create = function create(properties) { + return new EventThreatDetectionCustomModule(properties); + }; + + /** + * Encodes the specified EventThreatDetectionCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule} message EventThreatDetectionCustomModule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventThreatDetectionCustomModule.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.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.protobuf.Struct.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ancestorModule != null && Object.hasOwnProperty.call(message, "ancestorModule")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestorModule); + if (message.enablementState != null && Object.hasOwnProperty.call(message, "enablementState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.enablementState); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lastEditor != null && Object.hasOwnProperty.call(message, "lastEditor")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.lastEditor); + return writer; + }; + + /** + * Encodes the specified EventThreatDetectionCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule} message EventThreatDetectionCustomModule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventThreatDetectionCustomModule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventThreatDetectionCustomModule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} EventThreatDetectionCustomModule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventThreatDetectionCustomModule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ancestorModule = reader.string(); + break; + } + case 4: { + message.enablementState = reader.int32(); + break; + } + case 5: { + message.type = reader.string(); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.lastEditor = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventThreatDetectionCustomModule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} EventThreatDetectionCustomModule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventThreatDetectionCustomModule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventThreatDetectionCustomModule message. + * @function verify + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventThreatDetectionCustomModule.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.config != null && message.hasOwnProperty("config")) { + var error = $root.google.protobuf.Struct.verify(message.config); + if (error) + return "config." + error; + } + if (message.ancestorModule != null && message.hasOwnProperty("ancestorModule")) + if (!$util.isString(message.ancestorModule)) + return "ancestorModule: string expected"; + if (message.enablementState != null && message.hasOwnProperty("enablementState")) + switch (message.enablementState) { + default: + return "enablementState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: 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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastEditor != null && message.hasOwnProperty("lastEditor")) + if (!$util.isString(message.lastEditor)) + return "lastEditor: string expected"; + return null; + }; + + /** + * Creates an EventThreatDetectionCustomModule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} EventThreatDetectionCustomModule + */ + EventThreatDetectionCustomModule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) + return object; + var message = new $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.config: object expected"); + message.config = $root.google.protobuf.Struct.fromObject(object.config); + } + if (object.ancestorModule != null) + message.ancestorModule = String(object.ancestorModule); + switch (object.enablementState) { + default: + if (typeof object.enablementState === "number") { + message.enablementState = object.enablementState; + break; + } + break; + case "ENABLEMENT_STATE_UNSPECIFIED": + case 0: + message.enablementState = 0; + break; + case "ENABLED": + case 1: + message.enablementState = 1; + break; + case "DISABLED": + case 2: + message.enablementState = 2; + break; + case "INHERITED": + case 3: + message.enablementState = 3; + break; + } + if (object.type != null) + message.type = String(object.type); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastEditor != null) + message.lastEditor = String(object.lastEditor); + return message; + }; + + /** + * Creates a plain object from an EventThreatDetectionCustomModule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} message EventThreatDetectionCustomModule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventThreatDetectionCustomModule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.config = null; + object.ancestorModule = ""; + object.enablementState = options.enums === String ? "ENABLEMENT_STATE_UNSPECIFIED" : 0; + object.type = ""; + object.displayName = ""; + object.description = ""; + object.updateTime = null; + object.lastEditor = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.protobuf.Struct.toObject(message.config, options); + if (message.ancestorModule != null && message.hasOwnProperty("ancestorModule")) + object.ancestorModule = message.ancestorModule; + if (message.enablementState != null && message.hasOwnProperty("enablementState")) + object.enablementState = options.enums === String ? $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState[message.enablementState] : message.enablementState; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastEditor != null && message.hasOwnProperty("lastEditor")) + object.lastEditor = message.lastEditor; + return object; + }; + + /** + * Converts this EventThreatDetectionCustomModule to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @instance + * @returns {Object.} JSON object + */ + EventThreatDetectionCustomModule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventThreatDetectionCustomModule + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventThreatDetectionCustomModule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.EventThreatDetectionCustomModule"; + }; + + /** + * EnablementState enum. + * @name google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState + * @enum {number} + * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} INHERITED=3 INHERITED value + */ + EventThreatDetectionCustomModule.EnablementState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENABLEMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "INHERITED"] = 3; + return values; + })(); + + return EventThreatDetectionCustomModule; + })(); + + v1.CustomModuleValidationErrors = (function() { + + /** + * Properties of a CustomModuleValidationErrors. + * @memberof google.cloud.securitycenter.v1 + * @interface ICustomModuleValidationErrors + * @property {Array.|null} [errors] CustomModuleValidationErrors errors + */ + + /** + * Constructs a new CustomModuleValidationErrors. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CustomModuleValidationErrors. + * @implements ICustomModuleValidationErrors + * @constructor + * @param {google.cloud.securitycenter.v1.ICustomModuleValidationErrors=} [properties] Properties to set + */ + function CustomModuleValidationErrors(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomModuleValidationErrors errors. + * @member {Array.} errors + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @instance + */ + CustomModuleValidationErrors.prototype.errors = $util.emptyArray; + + /** + * Creates a new CustomModuleValidationErrors instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {google.cloud.securitycenter.v1.ICustomModuleValidationErrors=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CustomModuleValidationErrors} CustomModuleValidationErrors instance + */ + CustomModuleValidationErrors.create = function create(properties) { + return new CustomModuleValidationErrors(properties); + }; + + /** + * Encodes the specified CustomModuleValidationErrors message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {google.cloud.securitycenter.v1.ICustomModuleValidationErrors} message CustomModuleValidationErrors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomModuleValidationErrors.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.securitycenter.v1.CustomModuleValidationError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomModuleValidationErrors message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {google.cloud.securitycenter.v1.ICustomModuleValidationErrors} message CustomModuleValidationErrors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomModuleValidationErrors.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomModuleValidationErrors message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CustomModuleValidationErrors} CustomModuleValidationErrors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomModuleValidationErrors.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.securitycenter.v1.CustomModuleValidationError.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomModuleValidationErrors message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CustomModuleValidationErrors} CustomModuleValidationErrors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomModuleValidationErrors.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomModuleValidationErrors message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomModuleValidationErrors.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.CustomModuleValidationError.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a CustomModuleValidationErrors message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CustomModuleValidationErrors} CustomModuleValidationErrors + */ + CustomModuleValidationErrors.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors) + return object; + var message = new $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.securitycenter.v1.CustomModuleValidationErrors.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CustomModuleValidationErrors.errors: object expected"); + message.errors[i] = $root.google.cloud.securitycenter.v1.CustomModuleValidationError.fromObject(object.errors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CustomModuleValidationErrors message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {google.cloud.securitycenter.v1.CustomModuleValidationErrors} message CustomModuleValidationErrors + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomModuleValidationErrors.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.securitycenter.v1.CustomModuleValidationError.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this CustomModuleValidationErrors to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @instance + * @returns {Object.} JSON object + */ + CustomModuleValidationErrors.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomModuleValidationErrors + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomModuleValidationErrors.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomModuleValidationErrors"; + }; + + return CustomModuleValidationErrors; + })(); + + v1.CustomModuleValidationError = (function() { + + /** + * Properties of a CustomModuleValidationError. + * @memberof google.cloud.securitycenter.v1 + * @interface ICustomModuleValidationError + * @property {string|null} [description] CustomModuleValidationError description + * @property {string|null} [fieldPath] CustomModuleValidationError fieldPath + * @property {google.cloud.securitycenter.v1.IPosition|null} [start] CustomModuleValidationError start + * @property {google.cloud.securitycenter.v1.IPosition|null} [end] CustomModuleValidationError end + */ + + /** + * Constructs a new CustomModuleValidationError. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CustomModuleValidationError. + * @implements ICustomModuleValidationError + * @constructor + * @param {google.cloud.securitycenter.v1.ICustomModuleValidationError=} [properties] Properties to set + */ + function CustomModuleValidationError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomModuleValidationError description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @instance + */ + CustomModuleValidationError.prototype.description = ""; + + /** + * CustomModuleValidationError fieldPath. + * @member {string} fieldPath + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @instance + */ + CustomModuleValidationError.prototype.fieldPath = ""; + + /** + * CustomModuleValidationError start. + * @member {google.cloud.securitycenter.v1.IPosition|null|undefined} start + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @instance + */ + CustomModuleValidationError.prototype.start = null; + + /** + * CustomModuleValidationError end. + * @member {google.cloud.securitycenter.v1.IPosition|null|undefined} end + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @instance + */ + CustomModuleValidationError.prototype.end = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CustomModuleValidationError.prototype, "_start", { + get: $util.oneOfGetter($oneOfFields = ["start"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CustomModuleValidationError.prototype, "_end", { + get: $util.oneOfGetter($oneOfFields = ["end"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomModuleValidationError instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {google.cloud.securitycenter.v1.ICustomModuleValidationError=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CustomModuleValidationError} CustomModuleValidationError instance + */ + CustomModuleValidationError.create = function create(properties) { + return new CustomModuleValidationError(properties); + }; + + /** + * Encodes the specified CustomModuleValidationError message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationError.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {google.cloud.securitycenter.v1.ICustomModuleValidationError} message CustomModuleValidationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomModuleValidationError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.fieldPath != null && Object.hasOwnProperty.call(message, "fieldPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldPath); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + $root.google.cloud.securitycenter.v1.Position.encode(message.start, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + $root.google.cloud.securitycenter.v1.Position.encode(message.end, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomModuleValidationError message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {google.cloud.securitycenter.v1.ICustomModuleValidationError} message CustomModuleValidationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomModuleValidationError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomModuleValidationError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CustomModuleValidationError} CustomModuleValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomModuleValidationError.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomModuleValidationError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.fieldPath = reader.string(); + break; + } + case 3: { + message.start = $root.google.cloud.securitycenter.v1.Position.decode(reader, reader.uint32()); + break; + } + case 4: { + message.end = $root.google.cloud.securitycenter.v1.Position.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomModuleValidationError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CustomModuleValidationError} CustomModuleValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomModuleValidationError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomModuleValidationError message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomModuleValidationError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.fieldPath != null && message.hasOwnProperty("fieldPath")) + if (!$util.isString(message.fieldPath)) + return "fieldPath: string expected"; + if (message.start != null && message.hasOwnProperty("start")) { + properties._start = 1; + { + var error = $root.google.cloud.securitycenter.v1.Position.verify(message.start); + if (error) + return "start." + error; + } + } + if (message.end != null && message.hasOwnProperty("end")) { + properties._end = 1; + { + var error = $root.google.cloud.securitycenter.v1.Position.verify(message.end); + if (error) + return "end." + error; + } + } + return null; + }; + + /** + * Creates a CustomModuleValidationError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CustomModuleValidationError} CustomModuleValidationError + */ + CustomModuleValidationError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CustomModuleValidationError) + return object; + var message = new $root.google.cloud.securitycenter.v1.CustomModuleValidationError(); + if (object.description != null) + message.description = String(object.description); + if (object.fieldPath != null) + message.fieldPath = String(object.fieldPath); + if (object.start != null) { + if (typeof object.start !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CustomModuleValidationError.start: object expected"); + message.start = $root.google.cloud.securitycenter.v1.Position.fromObject(object.start); + } + if (object.end != null) { + if (typeof object.end !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CustomModuleValidationError.end: object expected"); + message.end = $root.google.cloud.securitycenter.v1.Position.fromObject(object.end); + } + return message; + }; + + /** + * Creates a plain object from a CustomModuleValidationError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {google.cloud.securitycenter.v1.CustomModuleValidationError} message CustomModuleValidationError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomModuleValidationError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.fieldPath = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.fieldPath != null && message.hasOwnProperty("fieldPath")) + object.fieldPath = message.fieldPath; + if (message.start != null && message.hasOwnProperty("start")) { + object.start = $root.google.cloud.securitycenter.v1.Position.toObject(message.start, options); + if (options.oneofs) + object._start = "start"; + } + if (message.end != null && message.hasOwnProperty("end")) { + object.end = $root.google.cloud.securitycenter.v1.Position.toObject(message.end, options); + if (options.oneofs) + object._end = "end"; + } + return object; + }; + + /** + * Converts this CustomModuleValidationError to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @instance + * @returns {Object.} JSON object + */ + CustomModuleValidationError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomModuleValidationError + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomModuleValidationError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomModuleValidationError"; + }; + + return CustomModuleValidationError; + })(); + + v1.Position = (function() { + + /** + * Properties of a Position. + * @memberof google.cloud.securitycenter.v1 + * @interface IPosition + * @property {number|null} [lineNumber] Position lineNumber + * @property {number|null} [columnNumber] Position columnNumber + */ + + /** + * Constructs a new Position. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Position. + * @implements IPosition + * @constructor + * @param {google.cloud.securitycenter.v1.IPosition=} [properties] Properties to set + */ + function Position(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Position lineNumber. + * @member {number} lineNumber + * @memberof google.cloud.securitycenter.v1.Position + * @instance + */ + Position.prototype.lineNumber = 0; + + /** + * Position columnNumber. + * @member {number} columnNumber + * @memberof google.cloud.securitycenter.v1.Position + * @instance + */ + Position.prototype.columnNumber = 0; + + /** + * Creates a new Position instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {google.cloud.securitycenter.v1.IPosition=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Position} Position instance + */ + Position.create = function create(properties) { + return new Position(properties); + }; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.securitycenter.v1.Position.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {google.cloud.securitycenter.v1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lineNumber != null && Object.hasOwnProperty.call(message, "lineNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lineNumber); + if (message.columnNumber != null && Object.hasOwnProperty.call(message, "columnNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.columnNumber); + return writer; + }; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Position.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {google.cloud.securitycenter.v1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Position message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Position(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.lineNumber = reader.int32(); + break; + } + case 2: { + message.columnNumber = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Position message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Position.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) + if (!$util.isInteger(message.lineNumber)) + return "lineNumber: integer expected"; + if (message.columnNumber != null && message.hasOwnProperty("columnNumber")) + if (!$util.isInteger(message.columnNumber)) + return "columnNumber: integer expected"; + return null; + }; + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Position} Position + */ + Position.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Position) + return object; + var message = new $root.google.cloud.securitycenter.v1.Position(); + if (object.lineNumber != null) + message.lineNumber = object.lineNumber | 0; + if (object.columnNumber != null) + message.columnNumber = object.columnNumber | 0; + return message; + }; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {google.cloud.securitycenter.v1.Position} message Position + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Position.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lineNumber = 0; + object.columnNumber = 0; + } + if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) + object.lineNumber = message.lineNumber; + if (message.columnNumber != null && message.hasOwnProperty("columnNumber")) + object.columnNumber = message.columnNumber; + return object; + }; + + /** + * Converts this Position to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Position + * @instance + * @returns {Object.} JSON object + */ + Position.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Position + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Position + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Position.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Position"; + }; + + return Position; + })(); + + v1.Exfiltration = (function() { + + /** + * Properties of an Exfiltration. + * @memberof google.cloud.securitycenter.v1 + * @interface IExfiltration + * @property {Array.|null} [sources] Exfiltration sources + * @property {Array.|null} [targets] Exfiltration targets + * @property {number|Long|null} [totalExfiltratedBytes] Exfiltration totalExfiltratedBytes + */ + + /** + * Constructs a new Exfiltration. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Exfiltration. + * @implements IExfiltration + * @constructor + * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set + */ + 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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Exfiltration sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @instance + */ + Exfiltration.prototype.sources = $util.emptyArray; + + /** + * Exfiltration targets. + * @member {Array.} targets + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @instance + */ + Exfiltration.prototype.targets = $util.emptyArray; + + /** + * Exfiltration totalExfiltratedBytes. + * @member {number|Long} totalExfiltratedBytes + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @instance + */ + Exfiltration.prototype.totalExfiltratedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Exfiltration instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration instance + */ + Exfiltration.create = function create(properties) { + return new Exfiltration(properties); + }; + + /** + * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @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 + */ + Exfiltration.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.totalExfiltratedBytes != null && Object.hasOwnProperty.call(message, "totalExfiltratedBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalExfiltratedBytes); + return writer; + }; + + /** + * 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.Exfiltration + * @static + * @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 + */ + Exfiltration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Exfiltration message from the specified reader or buffer. + * @function decode + * @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.Exfiltration} Exfiltration + * @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, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 3: { + message.totalExfiltratedBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Exfiltration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + Exfiltration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Exfiltration message. + * @function verify + * @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 + */ + Exfiltration.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 (error) + return "targets." + error; + } + } + if (message.totalExfiltratedBytes != null && message.hasOwnProperty("totalExfiltratedBytes")) + if (!$util.isInteger(message.totalExfiltratedBytes) && !(message.totalExfiltratedBytes && $util.isInteger(message.totalExfiltratedBytes.low) && $util.isInteger(message.totalExfiltratedBytes.high))) + return "totalExfiltratedBytes: integer|Long expected"; + return null; + }; + + /** + * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration + */ + Exfiltration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Exfiltration) + 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]); + } + } + if (object.totalExfiltratedBytes != null) + if ($util.Long) + (message.totalExfiltratedBytes = $util.Long.fromValue(object.totalExfiltratedBytes)).unsigned = false; + else if (typeof object.totalExfiltratedBytes === "string") + message.totalExfiltratedBytes = parseInt(object.totalExfiltratedBytes, 10); + else if (typeof object.totalExfiltratedBytes === "number") + message.totalExfiltratedBytes = object.totalExfiltratedBytes; + else if (typeof object.totalExfiltratedBytes === "object") + message.totalExfiltratedBytes = new $util.LongBits(object.totalExfiltratedBytes.low >>> 0, object.totalExfiltratedBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {google.cloud.securitycenter.v1.Exfiltration} message Exfiltration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exfiltration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.targets = []; + } + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalExfiltratedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalExfiltratedBytes = options.longs === String ? "0" : 0; + 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.totalExfiltratedBytes != null && message.hasOwnProperty("totalExfiltratedBytes")) + if (typeof message.totalExfiltratedBytes === "number") + object.totalExfiltratedBytes = options.longs === String ? String(message.totalExfiltratedBytes) : message.totalExfiltratedBytes; + else + object.totalExfiltratedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalExfiltratedBytes) : options.longs === Number ? new $util.LongBits(message.totalExfiltratedBytes.low >>> 0, message.totalExfiltratedBytes.high >>> 0).toNumber() : message.totalExfiltratedBytes; + return object; + }; + + /** + * Converts this Exfiltration to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @instance + * @returns {Object.} JSON object + */ + Exfiltration.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.ExfilResource = (function() { + + /** + * Properties of an ExfilResource. + * @memberof google.cloud.securitycenter.v1 + * @interface IExfilResource + * @property {string|null} [name] ExfilResource name + * @property {Array.|null} [components] ExfilResource components + */ + + /** + * Constructs a new ExfilResource. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an ExfilResource. + * @implements IExfilResource + * @constructor + * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set + */ + function ExfilResource(properties) { + this.components = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExfilResource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @instance + */ + ExfilResource.prototype.name = ""; + + /** + * ExfilResource components. + * @member {Array.} components + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @instance + */ + ExfilResource.prototype.components = $util.emptyArray; + + /** + * 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 + */ + ExfilResource.create = function create(properties) { + return new ExfilResource(properties); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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 + */ + ExfilResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 + */ + ExfilResource.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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 + */ + ExfilResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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 + */ + 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; + }; + + /** + * Converts this ExfilResource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @instance + * @returns {Object.} JSON object + */ + ExfilResource.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.ExternalExposure = (function() { + + /** + * Properties of an ExternalExposure. + * @memberof google.cloud.securitycenter.v1 + * @interface IExternalExposure + * @property {string|null} [privateIpAddress] ExternalExposure privateIpAddress + * @property {string|null} [privatePort] ExternalExposure privatePort + * @property {string|null} [exposedService] ExternalExposure exposedService + * @property {string|null} [publicIpAddress] ExternalExposure publicIpAddress + * @property {string|null} [publicPort] ExternalExposure publicPort + * @property {string|null} [exposedEndpoint] ExternalExposure exposedEndpoint + * @property {string|null} [loadBalancerFirewallPolicy] ExternalExposure loadBalancerFirewallPolicy + * @property {string|null} [serviceFirewallPolicy] ExternalExposure serviceFirewallPolicy + * @property {string|null} [forwardingRule] ExternalExposure forwardingRule + * @property {string|null} [backendService] ExternalExposure backendService + * @property {string|null} [instanceGroup] ExternalExposure instanceGroup + * @property {string|null} [networkEndpointGroup] ExternalExposure networkEndpointGroup + */ + + /** + * Constructs a new ExternalExposure. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an ExternalExposure. + * @implements IExternalExposure + * @constructor + * @param {google.cloud.securitycenter.v1.IExternalExposure=} [properties] Properties to set + */ + function ExternalExposure(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalExposure privateIpAddress. + * @member {string} privateIpAddress + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.privateIpAddress = ""; + + /** + * ExternalExposure privatePort. + * @member {string} privatePort + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.privatePort = ""; + + /** + * ExternalExposure exposedService. + * @member {string} exposedService + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.exposedService = ""; + + /** + * ExternalExposure publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.publicIpAddress = ""; + + /** + * ExternalExposure publicPort. + * @member {string} publicPort + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.publicPort = ""; + + /** + * ExternalExposure exposedEndpoint. + * @member {string} exposedEndpoint + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.exposedEndpoint = ""; + + /** + * ExternalExposure loadBalancerFirewallPolicy. + * @member {string} loadBalancerFirewallPolicy + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.loadBalancerFirewallPolicy = ""; + + /** + * ExternalExposure serviceFirewallPolicy. + * @member {string} serviceFirewallPolicy + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.serviceFirewallPolicy = ""; + + /** + * ExternalExposure forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.forwardingRule = ""; + + /** + * ExternalExposure backendService. + * @member {string} backendService + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.backendService = ""; + + /** + * ExternalExposure instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.instanceGroup = ""; + + /** + * ExternalExposure networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.networkEndpointGroup = ""; + + /** + * Creates a new ExternalExposure instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {google.cloud.securitycenter.v1.IExternalExposure=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure instance + */ + ExternalExposure.create = function create(properties) { + return new ExternalExposure(properties); + }; + + /** + * Encodes the specified ExternalExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {google.cloud.securitycenter.v1.IExternalExposure} message ExternalExposure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalExposure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateIpAddress != null && Object.hasOwnProperty.call(message, "privateIpAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateIpAddress); + if (message.privatePort != null && Object.hasOwnProperty.call(message, "privatePort")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privatePort); + if (message.exposedService != null && Object.hasOwnProperty.call(message, "exposedService")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exposedService); + if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicIpAddress); + if (message.publicPort != null && Object.hasOwnProperty.call(message, "publicPort")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicPort); + if (message.exposedEndpoint != null && Object.hasOwnProperty.call(message, "exposedEndpoint")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.exposedEndpoint); + if (message.loadBalancerFirewallPolicy != null && Object.hasOwnProperty.call(message, "loadBalancerFirewallPolicy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.loadBalancerFirewallPolicy); + if (message.serviceFirewallPolicy != null && Object.hasOwnProperty.call(message, "serviceFirewallPolicy")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceFirewallPolicy); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.forwardingRule); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.backendService); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.instanceGroup); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified ExternalExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {google.cloud.securitycenter.v1.IExternalExposure} message ExternalExposure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalExposure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalExposure message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalExposure.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ExternalExposure(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.privateIpAddress = reader.string(); + break; + } + case 2: { + message.privatePort = reader.string(); + break; + } + case 3: { + message.exposedService = reader.string(); + break; + } + case 4: { + message.publicIpAddress = reader.string(); + break; + } + case 5: { + message.publicPort = reader.string(); + break; + } + case 6: { + message.exposedEndpoint = reader.string(); + break; + } + case 7: { + message.loadBalancerFirewallPolicy = reader.string(); + break; + } + case 8: { + message.serviceFirewallPolicy = reader.string(); + break; + } + case 9: { + message.forwardingRule = reader.string(); + break; + } + case 10: { + message.backendService = reader.string(); + break; + } + case 11: { + message.instanceGroup = reader.string(); + break; + } + case 12: { + message.networkEndpointGroup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalExposure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalExposure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalExposure message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalExposure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateIpAddress != null && message.hasOwnProperty("privateIpAddress")) + if (!$util.isString(message.privateIpAddress)) + return "privateIpAddress: string expected"; + if (message.privatePort != null && message.hasOwnProperty("privatePort")) + if (!$util.isString(message.privatePort)) + return "privatePort: string expected"; + if (message.exposedService != null && message.hasOwnProperty("exposedService")) + if (!$util.isString(message.exposedService)) + return "exposedService: string expected"; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + if (!$util.isString(message.publicIpAddress)) + return "publicIpAddress: string expected"; + if (message.publicPort != null && message.hasOwnProperty("publicPort")) + if (!$util.isString(message.publicPort)) + return "publicPort: string expected"; + if (message.exposedEndpoint != null && message.hasOwnProperty("exposedEndpoint")) + if (!$util.isString(message.exposedEndpoint)) + return "exposedEndpoint: string expected"; + if (message.loadBalancerFirewallPolicy != null && message.hasOwnProperty("loadBalancerFirewallPolicy")) + if (!$util.isString(message.loadBalancerFirewallPolicy)) + return "loadBalancerFirewallPolicy: string expected"; + if (message.serviceFirewallPolicy != null && message.hasOwnProperty("serviceFirewallPolicy")) + if (!$util.isString(message.serviceFirewallPolicy)) + return "serviceFirewallPolicy: string expected"; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + return null; + }; + + /** + * Creates an ExternalExposure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure + */ + ExternalExposure.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExternalExposure) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExternalExposure(); + if (object.privateIpAddress != null) + message.privateIpAddress = String(object.privateIpAddress); + if (object.privatePort != null) + message.privatePort = String(object.privatePort); + if (object.exposedService != null) + message.exposedService = String(object.exposedService); + if (object.publicIpAddress != null) + message.publicIpAddress = String(object.publicIpAddress); + if (object.publicPort != null) + message.publicPort = String(object.publicPort); + if (object.exposedEndpoint != null) + message.exposedEndpoint = String(object.exposedEndpoint); + if (object.loadBalancerFirewallPolicy != null) + message.loadBalancerFirewallPolicy = String(object.loadBalancerFirewallPolicy); + if (object.serviceFirewallPolicy != null) + message.serviceFirewallPolicy = String(object.serviceFirewallPolicy); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + return message; + }; + + /** + * Creates a plain object from an ExternalExposure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {google.cloud.securitycenter.v1.ExternalExposure} message ExternalExposure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalExposure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.privateIpAddress = ""; + object.privatePort = ""; + object.exposedService = ""; + object.publicIpAddress = ""; + object.publicPort = ""; + object.exposedEndpoint = ""; + object.loadBalancerFirewallPolicy = ""; + object.serviceFirewallPolicy = ""; + object.forwardingRule = ""; + object.backendService = ""; + object.instanceGroup = ""; + object.networkEndpointGroup = ""; + } + if (message.privateIpAddress != null && message.hasOwnProperty("privateIpAddress")) + object.privateIpAddress = message.privateIpAddress; + if (message.privatePort != null && message.hasOwnProperty("privatePort")) + object.privatePort = message.privatePort; + if (message.exposedService != null && message.hasOwnProperty("exposedService")) + object.exposedService = message.exposedService; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + object.publicIpAddress = message.publicIpAddress; + if (message.publicPort != null && message.hasOwnProperty("publicPort")) + object.publicPort = message.publicPort; + if (message.exposedEndpoint != null && message.hasOwnProperty("exposedEndpoint")) + object.exposedEndpoint = message.exposedEndpoint; + if (message.loadBalancerFirewallPolicy != null && message.hasOwnProperty("loadBalancerFirewallPolicy")) + object.loadBalancerFirewallPolicy = message.loadBalancerFirewallPolicy; + if (message.serviceFirewallPolicy != null && message.hasOwnProperty("serviceFirewallPolicy")) + object.serviceFirewallPolicy = message.serviceFirewallPolicy; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this ExternalExposure to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + * @returns {Object.} JSON object + */ + ExternalExposure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalExposure + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalExposure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExternalExposure"; + }; + + return ExternalExposure; + })(); + + 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 + * @property {string|null} [caseUri] ExternalSystem caseUri + * @property {string|null} [casePriority] ExternalSystem casePriority + * @property {google.protobuf.ITimestamp|null} [caseSla] ExternalSystem caseSla + * @property {google.protobuf.ITimestamp|null} [caseCreateTime] ExternalSystem caseCreateTime + * @property {google.protobuf.ITimestamp|null} [caseCloseTime] ExternalSystem caseCloseTime + * @property {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo|null} [ticketInfo] ExternalSystem ticketInfo + */ + + /** + * 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; + + /** + * ExternalSystem caseUri. + * @member {string} caseUri + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.caseUri = ""; + + /** + * ExternalSystem casePriority. + * @member {string} casePriority + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.casePriority = ""; + + /** + * ExternalSystem caseSla. + * @member {google.protobuf.ITimestamp|null|undefined} caseSla + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.caseSla = null; + + /** + * ExternalSystem caseCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} caseCreateTime + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.caseCreateTime = null; + + /** + * ExternalSystem caseCloseTime. + * @member {google.protobuf.ITimestamp|null|undefined} caseCloseTime + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.caseCloseTime = null; + + /** + * ExternalSystem ticketInfo. + * @member {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo|null|undefined} ticketInfo + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.ticketInfo = 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(); + if (message.caseUri != null && Object.hasOwnProperty.call(message, "caseUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.caseUri); + if (message.casePriority != null && Object.hasOwnProperty.call(message, "casePriority")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.casePriority); + if (message.ticketInfo != null && Object.hasOwnProperty.call(message, "ticketInfo")) + $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.encode(message.ticketInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.caseSla != null && Object.hasOwnProperty.call(message, "caseSla")) + $root.google.protobuf.Timestamp.encode(message.caseSla, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.caseCreateTime != null && Object.hasOwnProperty.call(message, "caseCreateTime")) + $root.google.protobuf.Timestamp.encode(message.caseCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.caseCloseTime != null && Object.hasOwnProperty.call(message, "caseCloseTime")) + $root.google.protobuf.Timestamp.encode(message.caseCloseTime, writer.uint32(/* id 11, wireType 2 =*/90).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, error) { + 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(); + if (tag === error) + break; + 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 6: { + message.caseUri = reader.string(); + break; + } + case 7: { + message.casePriority = reader.string(); + break; + } + case 9: { + message.caseSla = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.caseCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.caseCloseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.ticketInfo = $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.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; + } + if (message.caseUri != null && message.hasOwnProperty("caseUri")) + if (!$util.isString(message.caseUri)) + return "caseUri: string expected"; + if (message.casePriority != null && message.hasOwnProperty("casePriority")) + if (!$util.isString(message.casePriority)) + return "casePriority: string expected"; + if (message.caseSla != null && message.hasOwnProperty("caseSla")) { + var error = $root.google.protobuf.Timestamp.verify(message.caseSla); + if (error) + return "caseSla." + error; + } + if (message.caseCreateTime != null && message.hasOwnProperty("caseCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.caseCreateTime); + if (error) + return "caseCreateTime." + error; + } + if (message.caseCloseTime != null && message.hasOwnProperty("caseCloseTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.caseCloseTime); + if (error) + return "caseCloseTime." + error; + } + if (message.ticketInfo != null && message.hasOwnProperty("ticketInfo")) { + var error = $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify(message.ticketInfo); + if (error) + return "ticketInfo." + 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); + } + if (object.caseUri != null) + message.caseUri = String(object.caseUri); + if (object.casePriority != null) + message.casePriority = String(object.casePriority); + if (object.caseSla != null) { + if (typeof object.caseSla !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.caseSla: object expected"); + message.caseSla = $root.google.protobuf.Timestamp.fromObject(object.caseSla); + } + if (object.caseCreateTime != null) { + if (typeof object.caseCreateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.caseCreateTime: object expected"); + message.caseCreateTime = $root.google.protobuf.Timestamp.fromObject(object.caseCreateTime); + } + if (object.caseCloseTime != null) { + if (typeof object.caseCloseTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.caseCloseTime: object expected"); + message.caseCloseTime = $root.google.protobuf.Timestamp.fromObject(object.caseCloseTime); + } + if (object.ticketInfo != null) { + if (typeof object.ticketInfo !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.ticketInfo: object expected"); + message.ticketInfo = $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.fromObject(object.ticketInfo); + } + 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; + object.caseUri = ""; + object.casePriority = ""; + object.ticketInfo = null; + object.caseSla = null; + object.caseCreateTime = null; + object.caseCloseTime = 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); + if (message.caseUri != null && message.hasOwnProperty("caseUri")) + object.caseUri = message.caseUri; + if (message.casePriority != null && message.hasOwnProperty("casePriority")) + object.casePriority = message.casePriority; + if (message.ticketInfo != null && message.hasOwnProperty("ticketInfo")) + object.ticketInfo = $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.toObject(message.ticketInfo, options); + if (message.caseSla != null && message.hasOwnProperty("caseSla")) + object.caseSla = $root.google.protobuf.Timestamp.toObject(message.caseSla, options); + if (message.caseCreateTime != null && message.hasOwnProperty("caseCreateTime")) + object.caseCreateTime = $root.google.protobuf.Timestamp.toObject(message.caseCreateTime, options); + if (message.caseCloseTime != null && message.hasOwnProperty("caseCloseTime")) + object.caseCloseTime = $root.google.protobuf.Timestamp.toObject(message.caseCloseTime, 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); + }; + + /** + * 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"; + }; + + ExternalSystem.TicketInfo = (function() { + + /** + * Properties of a TicketInfo. + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @interface ITicketInfo + * @property {string|null} [id] TicketInfo id + * @property {string|null} [assignee] TicketInfo assignee + * @property {string|null} [description] TicketInfo description + * @property {string|null} [uri] TicketInfo uri + * @property {string|null} [status] TicketInfo status + * @property {google.protobuf.ITimestamp|null} [updateTime] TicketInfo updateTime + */ + + /** + * Constructs a new TicketInfo. + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @classdesc Represents a TicketInfo. + * @implements ITicketInfo + * @constructor + * @param {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo=} [properties] Properties to set + */ + function TicketInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TicketInfo id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.id = ""; + + /** + * TicketInfo assignee. + * @member {string} assignee + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.assignee = ""; + + /** + * TicketInfo description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.description = ""; + + /** + * TicketInfo uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.uri = ""; + + /** + * TicketInfo status. + * @member {string} status + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.status = ""; + + /** + * TicketInfo updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.updateTime = null; + + /** + * Creates a new TicketInfo instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @param {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExternalSystem.TicketInfo} TicketInfo instance + */ + TicketInfo.create = function create(properties) { + return new TicketInfo(properties); + }; + + /** + * Encodes the specified TicketInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @param {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo} message TicketInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TicketInfo.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.assignee != null && Object.hasOwnProperty.call(message, "assignee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignee); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.status); + 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(); + return writer; + }; + + /** + * Encodes the specified TicketInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @param {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo} message TicketInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TicketInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TicketInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @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.TicketInfo} TicketInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TicketInfo.decode = function decode(reader, length, error) { + 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.TicketInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.assignee = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.uri = reader.string(); + break; + } + case 5: { + message.status = reader.string(); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TicketInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ExternalSystem.TicketInfo} TicketInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TicketInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TicketInfo message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TicketInfo.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.assignee != null && message.hasOwnProperty("assignee")) + if (!$util.isString(message.assignee)) + return "assignee: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a TicketInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExternalSystem.TicketInfo} TicketInfo + */ + TicketInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo(); + if (object.id != null) + message.id = String(object.id); + if (object.assignee != null) + message.assignee = String(object.assignee); + if (object.description != null) + message.description = String(object.description); + if (object.uri != null) + message.uri = String(object.uri); + if (object.status != null) + message.status = String(object.status); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a TicketInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @param {google.cloud.securitycenter.v1.ExternalSystem.TicketInfo} message TicketInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TicketInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.assignee = ""; + object.description = ""; + object.uri = ""; + object.status = ""; + object.updateTime = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.assignee != null && message.hasOwnProperty("assignee")) + object.assignee = message.assignee; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this TicketInfo to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @instance + * @returns {Object.} JSON object + */ + TicketInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TicketInfo + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TicketInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExternalSystem.TicketInfo"; + }; + + return TicketInfo; + })(); + + return ExternalSystem; + })(); + + v1.File = (function() { + + /** + * 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 + * @property {google.cloud.securitycenter.v1.File.IDiskPath|null} [diskPath] File diskPath + */ + + /** + * 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 + */ + 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]]; + } + + /** + * 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 + * @instance + */ + File.prototype.partiallyHashed = false; + + /** + * File contents. + * @member {string} contents + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.contents = ""; + + /** + * File diskPath. + * @member {google.cloud.securitycenter.v1.File.IDiskPath|null|undefined} diskPath + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.diskPath = null; + + /** + * 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 + */ + File.create = function create(properties) { + return new File(properties); + }; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.File + * @static + * @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 + */ + File.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.diskPath != null && Object.hasOwnProperty.call(message, "diskPath")) + $root.google.cloud.securitycenter.v1.File.DiskPath.encode(message.diskPath, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * 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.File + * @static + * @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 + */ + File.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a File message from the specified reader or buffer. + * @function decode + * @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.File} File + * @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, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 7: { + message.diskPath = $root.google.cloud.securitycenter.v1.File.DiskPath.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a File message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + File.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a File message. + * @function verify + * @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 + */ + File.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.diskPath != null && message.hasOwnProperty("diskPath")) { + var error = $root.google.cloud.securitycenter.v1.File.DiskPath.verify(message.diskPath); + if (error) + return "diskPath." + error; + } + return null; + }; + + /** + * Creates a File message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.File} File + */ + File.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.File) + 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); + if (object.diskPath != null) { + if (typeof object.diskPath !== "object") + throw TypeError(".google.cloud.securitycenter.v1.File.diskPath: object expected"); + message.diskPath = $root.google.cloud.securitycenter.v1.File.DiskPath.fromObject(object.diskPath); + } + return message; + }; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {google.cloud.securitycenter.v1.File} message File + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + File.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 = ""; + object.diskPath = null; + } + 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; + if (message.diskPath != null && message.hasOwnProperty("diskPath")) + object.diskPath = $root.google.cloud.securitycenter.v1.File.DiskPath.toObject(message.diskPath, options); + return object; + }; + + /** + * Converts this File to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.File + * @instance + * @returns {Object.} JSON object + */ + File.prototype.toJSON = function toJSON() { + 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"; + }; + + File.DiskPath = (function() { + + /** + * Properties of a DiskPath. + * @memberof google.cloud.securitycenter.v1.File + * @interface IDiskPath + * @property {string|null} [partitionUuid] DiskPath partitionUuid + * @property {string|null} [relativePath] DiskPath relativePath + */ + + /** + * Constructs a new DiskPath. + * @memberof google.cloud.securitycenter.v1.File + * @classdesc Represents a DiskPath. + * @implements IDiskPath + * @constructor + * @param {google.cloud.securitycenter.v1.File.IDiskPath=} [properties] Properties to set + */ + function DiskPath(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskPath partitionUuid. + * @member {string} partitionUuid + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @instance + */ + DiskPath.prototype.partitionUuid = ""; + + /** + * DiskPath relativePath. + * @member {string} relativePath + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @instance + */ + DiskPath.prototype.relativePath = ""; + + /** + * Creates a new DiskPath instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @param {google.cloud.securitycenter.v1.File.IDiskPath=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.File.DiskPath} DiskPath instance + */ + DiskPath.create = function create(properties) { + return new DiskPath(properties); + }; + + /** + * Encodes the specified DiskPath message. Does not implicitly {@link google.cloud.securitycenter.v1.File.DiskPath.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @param {google.cloud.securitycenter.v1.File.IDiskPath} message DiskPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskPath.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionUuid != null && Object.hasOwnProperty.call(message, "partitionUuid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.partitionUuid); + if (message.relativePath != null && Object.hasOwnProperty.call(message, "relativePath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.relativePath); + return writer; + }; + + /** + * Encodes the specified DiskPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.DiskPath.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @param {google.cloud.securitycenter.v1.File.IDiskPath} message DiskPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskPath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskPath message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @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.DiskPath} DiskPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskPath.decode = function decode(reader, length, error) { + 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.DiskPath(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partitionUuid = reader.string(); + break; + } + case 2: { + message.relativePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskPath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.File.DiskPath} DiskPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskPath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskPath message. + * @function verify + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskPath.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionUuid != null && message.hasOwnProperty("partitionUuid")) + if (!$util.isString(message.partitionUuid)) + return "partitionUuid: string expected"; + if (message.relativePath != null && message.hasOwnProperty("relativePath")) + if (!$util.isString(message.relativePath)) + return "relativePath: string expected"; + return null; + }; + + /** + * Creates a DiskPath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.File.DiskPath} DiskPath + */ + DiskPath.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.File.DiskPath) + return object; + var message = new $root.google.cloud.securitycenter.v1.File.DiskPath(); + if (object.partitionUuid != null) + message.partitionUuid = String(object.partitionUuid); + if (object.relativePath != null) + message.relativePath = String(object.relativePath); + return message; + }; + + /** + * Creates a plain object from a DiskPath message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @param {google.cloud.securitycenter.v1.File.DiskPath} message DiskPath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskPath.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.partitionUuid = ""; + object.relativePath = ""; + } + if (message.partitionUuid != null && message.hasOwnProperty("partitionUuid")) + object.partitionUuid = message.partitionUuid; + if (message.relativePath != null && message.hasOwnProperty("relativePath")) + object.relativePath = message.relativePath; + return object; + }; + + /** + * Converts this DiskPath to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @instance + * @returns {Object.} JSON object + */ + DiskPath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiskPath + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.File.DiskPath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiskPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.File.DiskPath"; + }; + + return DiskPath; + })(); + + return File; + })(); + + 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 + * @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 {google.cloud.securitycenter.v1.Finding.IMuteInfo|null} [muteInfo] Finding muteInfo + * @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 + * @property {string|null} [nextSteps] Finding nextSteps + * @property {string|null} [moduleName] Finding moduleName + * @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 {google.cloud.securitycenter.v1.IAttackExposure|null} [attackExposure] Finding attackExposure + * @property {Array.|null} [files] Finding files + * @property {google.cloud.securitycenter.v1.ICloudDlpInspection|null} [cloudDlpInspection] Finding cloudDlpInspection + * @property {google.cloud.securitycenter.v1.ICloudDlpDataProfile|null} [cloudDlpDataProfile] Finding cloudDlpDataProfile + * @property {google.cloud.securitycenter.v1.IKernelRootkit|null} [kernelRootkit] Finding kernelRootkit + * @property {Array.|null} [orgPolicies] Finding orgPolicies + * @property {google.cloud.securitycenter.v1.IApplication|null} [application] Finding application + * @property {google.cloud.securitycenter.v1.IBackupDisasterRecovery|null} [backupDisasterRecovery] Finding backupDisasterRecovery + * @property {google.cloud.securitycenter.v1.ISecurityPosture|null} [securityPosture] Finding securityPosture + * @property {Array.|null} [logEntries] Finding logEntries + * @property {Array.|null} [loadBalancers] Finding loadBalancers + * @property {google.cloud.securitycenter.v1.ICloudArmor|null} [cloudArmor] Finding cloudArmor + * @property {google.cloud.securitycenter.v1.INotebook|null} [notebook] Finding notebook + * @property {google.cloud.securitycenter.v1.IToxicCombination|null} [toxicCombination] Finding toxicCombination + * @property {Array.|null} [groupMemberships] Finding groupMemberships + * @property {google.cloud.securitycenter.v1.IChokepoint|null} [chokepoint] Finding chokepoint + * @property {google.cloud.securitycenter.v1.IExternalExposure|null} [externalExposure] Finding externalExposure + */ + + /** + * 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 = {}; + this.externalSystems = {}; + this.connections = []; + this.processes = []; + this.contacts = {}; + this.compliances = []; + this.iamBindings = []; + this.containers = []; + this.files = []; + this.orgPolicies = []; + this.logEntries = []; + this.loadBalancers = []; + this.groupMemberships = []; + if (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; + + /** + * Finding severity. + * @member {google.cloud.securitycenter.v1.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + 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; + + /** + * Finding vulnerability. + * @member {google.cloud.securitycenter.v1.IVulnerability|null|undefined} vulnerability + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + 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 externalSystems. + * @member {Object.} externalSystems + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + 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 + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + 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 + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.muteInitiator = ""; + + /** + * Finding muteInfo. + * @member {google.cloud.securitycenter.v1.Finding.IMuteInfo|null|undefined} muteInfo + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.muteInfo = null; + + /** + * Finding processes. + * @member {Array.} processes + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.processes = $util.emptyArray; + + /** + * Finding contacts. + * @member {Object.} contacts + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.contacts = $util.emptyObject; + + /** + * Finding compliances. + * @member {Array.} compliances + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + 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 + * @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 = ""; + + /** + * Finding moduleName. + * @member {string} moduleName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.moduleName = ""; + + /** + * Finding containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.containers = $util.emptyArray; + + /** + * Finding kubernetes. + * @member {google.cloud.securitycenter.v1.IKubernetes|null|undefined} kubernetes + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + 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; + + /** + * Finding attackExposure. + * @member {google.cloud.securitycenter.v1.IAttackExposure|null|undefined} attackExposure + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.attackExposure = null; + + /** + * Finding files. + * @member {Array.} files + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.files = $util.emptyArray; + + /** + * Finding cloudDlpInspection. + * @member {google.cloud.securitycenter.v1.ICloudDlpInspection|null|undefined} cloudDlpInspection + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.cloudDlpInspection = null; + + /** + * Finding cloudDlpDataProfile. + * @member {google.cloud.securitycenter.v1.ICloudDlpDataProfile|null|undefined} cloudDlpDataProfile + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.cloudDlpDataProfile = null; + + /** + * Finding kernelRootkit. + * @member {google.cloud.securitycenter.v1.IKernelRootkit|null|undefined} kernelRootkit + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.kernelRootkit = null; + + /** + * Finding orgPolicies. + * @member {Array.} orgPolicies + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.orgPolicies = $util.emptyArray; + + /** + * Finding application. + * @member {google.cloud.securitycenter.v1.IApplication|null|undefined} application + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.application = null; + + /** + * Finding backupDisasterRecovery. + * @member {google.cloud.securitycenter.v1.IBackupDisasterRecovery|null|undefined} backupDisasterRecovery + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.backupDisasterRecovery = null; + + /** + * Finding securityPosture. + * @member {google.cloud.securitycenter.v1.ISecurityPosture|null|undefined} securityPosture + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.securityPosture = null; + + /** + * Finding logEntries. + * @member {Array.} logEntries + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.logEntries = $util.emptyArray; + + /** + * Finding loadBalancers. + * @member {Array.} loadBalancers + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.loadBalancers = $util.emptyArray; + + /** + * Finding cloudArmor. + * @member {google.cloud.securitycenter.v1.ICloudArmor|null|undefined} cloudArmor + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.cloudArmor = null; + + /** + * Finding notebook. + * @member {google.cloud.securitycenter.v1.INotebook|null|undefined} notebook + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.notebook = null; + + /** + * Finding toxicCombination. + * @member {google.cloud.securitycenter.v1.IToxicCombination|null|undefined} toxicCombination + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.toxicCombination = null; + + /** + * Finding groupMemberships. + * @member {Array.} groupMemberships + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.groupMemberships = $util.emptyArray; + + /** + * Finding chokepoint. + * @member {google.cloud.securitycenter.v1.IChokepoint|null|undefined} chokepoint + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.chokepoint = null; + + /** + * Finding externalExposure. + * @member {google.cloud.securitycenter.v1.IExternalExposure|null|undefined} externalExposure + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.externalExposure = 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 && 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.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")) + $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.moduleName != null && Object.hasOwnProperty.call(message, "moduleName")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.moduleName); + 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(); + 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.attackExposure != null && Object.hasOwnProperty.call(message, "attackExposure")) + $root.google.cloud.securitycenter.v1.AttackExposure.encode(message.attackExposure, writer.uint32(/* id 45, wireType 2 =*/362).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(); + if (message.cloudDlpInspection != null && Object.hasOwnProperty.call(message, "cloudDlpInspection")) + $root.google.cloud.securitycenter.v1.CloudDlpInspection.encode(message.cloudDlpInspection, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); + if (message.cloudDlpDataProfile != null && Object.hasOwnProperty.call(message, "cloudDlpDataProfile")) + $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.encode(message.cloudDlpDataProfile, writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); + if (message.kernelRootkit != null && Object.hasOwnProperty.call(message, "kernelRootkit")) + $root.google.cloud.securitycenter.v1.KernelRootkit.encode(message.kernelRootkit, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.orgPolicies != null && message.orgPolicies.length) + for (var i = 0; i < message.orgPolicies.length; ++i) + $root.google.cloud.securitycenter.v1.OrgPolicy.encode(message.orgPolicies[i], writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); + if (message.application != null && Object.hasOwnProperty.call(message, "application")) + $root.google.cloud.securitycenter.v1.Application.encode(message.application, writer.uint32(/* id 53, wireType 2 =*/426).fork()).ldelim(); + if (message.backupDisasterRecovery != null && Object.hasOwnProperty.call(message, "backupDisasterRecovery")) + $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.encode(message.backupDisasterRecovery, writer.uint32(/* id 55, wireType 2 =*/442).fork()).ldelim(); + if (message.securityPosture != null && Object.hasOwnProperty.call(message, "securityPosture")) + $root.google.cloud.securitycenter.v1.SecurityPosture.encode(message.securityPosture, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); + if (message.logEntries != null && message.logEntries.length) + for (var i = 0; i < message.logEntries.length; ++i) + $root.google.cloud.securitycenter.v1.LogEntry.encode(message.logEntries[i], writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); + if (message.loadBalancers != null && message.loadBalancers.length) + for (var i = 0; i < message.loadBalancers.length; ++i) + $root.google.cloud.securitycenter.v1.LoadBalancer.encode(message.loadBalancers[i], writer.uint32(/* id 58, wireType 2 =*/466).fork()).ldelim(); + if (message.cloudArmor != null && Object.hasOwnProperty.call(message, "cloudArmor")) + $root.google.cloud.securitycenter.v1.CloudArmor.encode(message.cloudArmor, writer.uint32(/* id 59, wireType 2 =*/474).fork()).ldelim(); + if (message.muteInfo != null && Object.hasOwnProperty.call(message, "muteInfo")) + $root.google.cloud.securitycenter.v1.Finding.MuteInfo.encode(message.muteInfo, writer.uint32(/* id 61, wireType 2 =*/490).fork()).ldelim(); + if (message.notebook != null && Object.hasOwnProperty.call(message, "notebook")) + $root.google.cloud.securitycenter.v1.Notebook.encode(message.notebook, writer.uint32(/* id 63, wireType 2 =*/506).fork()).ldelim(); + if (message.toxicCombination != null && Object.hasOwnProperty.call(message, "toxicCombination")) + $root.google.cloud.securitycenter.v1.ToxicCombination.encode(message.toxicCombination, writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + if (message.groupMemberships != null && message.groupMemberships.length) + for (var i = 0; i < message.groupMemberships.length; ++i) + $root.google.cloud.securitycenter.v1.GroupMembership.encode(message.groupMemberships[i], writer.uint32(/* id 65, wireType 2 =*/522).fork()).ldelim(); + if (message.chokepoint != null && Object.hasOwnProperty.call(message, "chokepoint")) + $root.google.cloud.securitycenter.v1.Chokepoint.encode(message.chokepoint, writer.uint32(/* id 77, wireType 2 =*/618).fork()).ldelim(); + if (message.externalExposure != null && Object.hasOwnProperty.call(message, "externalExposure")) + $root.google.cloud.securitycenter.v1.ExternalExposure.encode(message.externalExposure, writer.uint32(/* id 84, wireType 2 =*/674).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, error) { + 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(); + if (tag === error) + break; + 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 61: { + message.muteInfo = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.decode(reader, reader.uint32()); + 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 36: { + message.parentDisplayName = reader.string(); + 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 41: { + message.moduleName = 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; + } + case 44: { + message.database = $root.google.cloud.securitycenter.v1.Database.decode(reader, reader.uint32()); + break; + } + case 45: { + message.attackExposure = $root.google.cloud.securitycenter.v1.AttackExposure.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; + } + case 48: { + message.cloudDlpInspection = $root.google.cloud.securitycenter.v1.CloudDlpInspection.decode(reader, reader.uint32()); + break; + } + case 49: { + message.cloudDlpDataProfile = $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.decode(reader, reader.uint32()); + break; + } + case 50: { + message.kernelRootkit = $root.google.cloud.securitycenter.v1.KernelRootkit.decode(reader, reader.uint32()); + break; + } + case 51: { + if (!(message.orgPolicies && message.orgPolicies.length)) + message.orgPolicies = []; + message.orgPolicies.push($root.google.cloud.securitycenter.v1.OrgPolicy.decode(reader, reader.uint32())); + break; + } + case 53: { + message.application = $root.google.cloud.securitycenter.v1.Application.decode(reader, reader.uint32()); + break; + } + case 55: { + message.backupDisasterRecovery = $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.decode(reader, reader.uint32()); + break; + } + case 56: { + message.securityPosture = $root.google.cloud.securitycenter.v1.SecurityPosture.decode(reader, reader.uint32()); + break; + } + case 57: { + if (!(message.logEntries && message.logEntries.length)) + message.logEntries = []; + message.logEntries.push($root.google.cloud.securitycenter.v1.LogEntry.decode(reader, reader.uint32())); + break; + } + case 58: { + if (!(message.loadBalancers && message.loadBalancers.length)) + message.loadBalancers = []; + message.loadBalancers.push($root.google.cloud.securitycenter.v1.LoadBalancer.decode(reader, reader.uint32())); + break; + } + case 59: { + message.cloudArmor = $root.google.cloud.securitycenter.v1.CloudArmor.decode(reader, reader.uint32()); + break; + } + case 63: { + message.notebook = $root.google.cloud.securitycenter.v1.Notebook.decode(reader, reader.uint32()); + break; + } + case 64: { + message.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.decode(reader, reader.uint32()); + break; + } + case 65: { + if (!(message.groupMemberships && message.groupMemberships.length)) + message.groupMemberships = []; + message.groupMemberships.push($root.google.cloud.securitycenter.v1.GroupMembership.decode(reader, reader.uint32())); + break; + } + case 77: { + message.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.decode(reader, reader.uint32()); + break; + } + case 84: { + message.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.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: + case 6: + case 7: + case 8: + case 9: + case 10: + 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.muteInfo != null && message.hasOwnProperty("muteInfo")) { + var error = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.verify(message.muteInfo); + if (error) + return "muteInfo." + error; + } + 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.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"; + 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.moduleName != null && message.hasOwnProperty("moduleName")) + if (!$util.isString(message.moduleName)) + return "moduleName: 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; + } + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.cloud.securitycenter.v1.Database.verify(message.database); + if (error) + return "database." + error; + } + if (message.attackExposure != null && message.hasOwnProperty("attackExposure")) { + var error = $root.google.cloud.securitycenter.v1.AttackExposure.verify(message.attackExposure); + if (error) + return "attackExposure." + 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; + } + } + if (message.cloudDlpInspection != null && message.hasOwnProperty("cloudDlpInspection")) { + var error = $root.google.cloud.securitycenter.v1.CloudDlpInspection.verify(message.cloudDlpInspection); + if (error) + return "cloudDlpInspection." + error; + } + if (message.cloudDlpDataProfile != null && message.hasOwnProperty("cloudDlpDataProfile")) { + var error = $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.verify(message.cloudDlpDataProfile); + if (error) + return "cloudDlpDataProfile." + error; + } + if (message.kernelRootkit != null && message.hasOwnProperty("kernelRootkit")) { + var error = $root.google.cloud.securitycenter.v1.KernelRootkit.verify(message.kernelRootkit); + if (error) + return "kernelRootkit." + error; + } + if (message.orgPolicies != null && message.hasOwnProperty("orgPolicies")) { + if (!Array.isArray(message.orgPolicies)) + return "orgPolicies: array expected"; + for (var i = 0; i < message.orgPolicies.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.OrgPolicy.verify(message.orgPolicies[i]); + if (error) + return "orgPolicies." + error; + } + } + if (message.application != null && message.hasOwnProperty("application")) { + var error = $root.google.cloud.securitycenter.v1.Application.verify(message.application); + if (error) + return "application." + error; + } + if (message.backupDisasterRecovery != null && message.hasOwnProperty("backupDisasterRecovery")) { + var error = $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.verify(message.backupDisasterRecovery); + if (error) + return "backupDisasterRecovery." + error; + } + if (message.securityPosture != null && message.hasOwnProperty("securityPosture")) { + var error = $root.google.cloud.securitycenter.v1.SecurityPosture.verify(message.securityPosture); + if (error) + return "securityPosture." + error; + } + if (message.logEntries != null && message.hasOwnProperty("logEntries")) { + if (!Array.isArray(message.logEntries)) + return "logEntries: array expected"; + for (var i = 0; i < message.logEntries.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.LogEntry.verify(message.logEntries[i]); + if (error) + return "logEntries." + error; + } + } + if (message.loadBalancers != null && message.hasOwnProperty("loadBalancers")) { + if (!Array.isArray(message.loadBalancers)) + return "loadBalancers: array expected"; + for (var i = 0; i < message.loadBalancers.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.LoadBalancer.verify(message.loadBalancers[i]); + if (error) + return "loadBalancers." + error; + } + } + if (message.cloudArmor != null && message.hasOwnProperty("cloudArmor")) { + var error = $root.google.cloud.securitycenter.v1.CloudArmor.verify(message.cloudArmor); + if (error) + return "cloudArmor." + error; + } + if (message.notebook != null && message.hasOwnProperty("notebook")) { + var error = $root.google.cloud.securitycenter.v1.Notebook.verify(message.notebook); + if (error) + return "notebook." + error; + } + if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) { + var error = $root.google.cloud.securitycenter.v1.ToxicCombination.verify(message.toxicCombination); + if (error) + return "toxicCombination." + error; + } + if (message.groupMemberships != null && message.hasOwnProperty("groupMemberships")) { + if (!Array.isArray(message.groupMemberships)) + return "groupMemberships: array expected"; + for (var i = 0; i < message.groupMemberships.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupMembership.verify(message.groupMemberships[i]); + if (error) + return "groupMemberships." + error; + } + } + if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) { + var error = $root.google.cloud.securitycenter.v1.Chokepoint.verify(message.chokepoint); + if (error) + return "chokepoint." + error; + } + if (message.externalExposure != null && message.hasOwnProperty("externalExposure")) { + var error = $root.google.cloud.securitycenter.v1.ExternalExposure.verify(message.externalExposure); + if (error) + return "externalExposure." + 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) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + 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) { + default: + if (typeof object.mute === "number") { + message.mute = object.mute; + break; + } + break; + 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) { + default: + if (typeof object.findingClass === "number") { + message.findingClass = object.findingClass; + break; + } + break; + 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; + case "POSTURE_VIOLATION": + case 6: + message.findingClass = 6; + break; + case "TOXIC_COMBINATION": + case 7: + message.findingClass = 7; + break; + case "SENSITIVE_DATA_RISK": + case 8: + message.findingClass = 8; + break; + case "CHOKEPOINT": + case 9: + message.findingClass = 9; + break; + case "EXTERNAL_EXPOSURE": + case 10: + message.findingClass = 10; + 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.muteInfo != null) { + if (typeof object.muteInfo !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.muteInfo: object expected"); + message.muteInfo = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.fromObject(object.muteInfo); + } + 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.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + 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.moduleName != null) + message.moduleName = String(object.moduleName); + 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); + } + 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); + } + if (object.attackExposure != null) { + if (typeof object.attackExposure !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.attackExposure: object expected"); + message.attackExposure = $root.google.cloud.securitycenter.v1.AttackExposure.fromObject(object.attackExposure); + } + 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]); + } + } + if (object.cloudDlpInspection != null) { + if (typeof object.cloudDlpInspection !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.cloudDlpInspection: object expected"); + message.cloudDlpInspection = $root.google.cloud.securitycenter.v1.CloudDlpInspection.fromObject(object.cloudDlpInspection); + } + if (object.cloudDlpDataProfile != null) { + if (typeof object.cloudDlpDataProfile !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.cloudDlpDataProfile: object expected"); + message.cloudDlpDataProfile = $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.fromObject(object.cloudDlpDataProfile); + } + if (object.kernelRootkit != null) { + if (typeof object.kernelRootkit !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.kernelRootkit: object expected"); + message.kernelRootkit = $root.google.cloud.securitycenter.v1.KernelRootkit.fromObject(object.kernelRootkit); + } + if (object.orgPolicies) { + if (!Array.isArray(object.orgPolicies)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.orgPolicies: array expected"); + message.orgPolicies = []; + for (var i = 0; i < object.orgPolicies.length; ++i) { + if (typeof object.orgPolicies[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.orgPolicies: object expected"); + message.orgPolicies[i] = $root.google.cloud.securitycenter.v1.OrgPolicy.fromObject(object.orgPolicies[i]); + } + } + if (object.application != null) { + if (typeof object.application !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.application: object expected"); + message.application = $root.google.cloud.securitycenter.v1.Application.fromObject(object.application); + } + if (object.backupDisasterRecovery != null) { + if (typeof object.backupDisasterRecovery !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.backupDisasterRecovery: object expected"); + message.backupDisasterRecovery = $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.fromObject(object.backupDisasterRecovery); + } + if (object.securityPosture != null) { + if (typeof object.securityPosture !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.securityPosture: object expected"); + message.securityPosture = $root.google.cloud.securitycenter.v1.SecurityPosture.fromObject(object.securityPosture); + } + if (object.logEntries) { + if (!Array.isArray(object.logEntries)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.logEntries: array expected"); + message.logEntries = []; + for (var i = 0; i < object.logEntries.length; ++i) { + if (typeof object.logEntries[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.logEntries: object expected"); + message.logEntries[i] = $root.google.cloud.securitycenter.v1.LogEntry.fromObject(object.logEntries[i]); + } + } + if (object.loadBalancers) { + if (!Array.isArray(object.loadBalancers)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.loadBalancers: array expected"); + message.loadBalancers = []; + for (var i = 0; i < object.loadBalancers.length; ++i) { + if (typeof object.loadBalancers[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.loadBalancers: object expected"); + message.loadBalancers[i] = $root.google.cloud.securitycenter.v1.LoadBalancer.fromObject(object.loadBalancers[i]); + } + } + if (object.cloudArmor != null) { + if (typeof object.cloudArmor !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.cloudArmor: object expected"); + message.cloudArmor = $root.google.cloud.securitycenter.v1.CloudArmor.fromObject(object.cloudArmor); + } + if (object.notebook != null) { + if (typeof object.notebook !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.notebook: object expected"); + message.notebook = $root.google.cloud.securitycenter.v1.Notebook.fromObject(object.notebook); + } + if (object.toxicCombination != null) { + if (typeof object.toxicCombination !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.toxicCombination: object expected"); + message.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.fromObject(object.toxicCombination); + } + if (object.groupMemberships) { + if (!Array.isArray(object.groupMemberships)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.groupMemberships: array expected"); + message.groupMemberships = []; + for (var i = 0; i < object.groupMemberships.length; ++i) { + if (typeof object.groupMemberships[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.groupMemberships: object expected"); + message.groupMemberships[i] = $root.google.cloud.securitycenter.v1.GroupMembership.fromObject(object.groupMemberships[i]); + } + } + if (object.chokepoint != null) { + if (typeof object.chokepoint !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.chokepoint: object expected"); + message.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.fromObject(object.chokepoint); + } + if (object.externalExposure != null) { + if (typeof object.externalExposure !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalExposure: object expected"); + message.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.fromObject(object.externalExposure); + } + 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 = []; + object.files = []; + object.orgPolicies = []; + object.logEntries = []; + object.loadBalancers = []; + object.groupMemberships = []; + } + 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.parentDisplayName = ""; + object.description = ""; + object.exfiltration = null; + object.nextSteps = ""; + object.moduleName = ""; + object.kubernetes = null; + object.database = null; + object.attackExposure = null; + object.cloudDlpInspection = null; + object.cloudDlpDataProfile = null; + object.kernelRootkit = null; + object.application = null; + object.backupDisasterRecovery = null; + object.securityPosture = null; + object.cloudArmor = null; + object.muteInfo = null; + object.notebook = null; + object.toxicCombination = null; + object.chokepoint = null; + object.externalExposure = 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] === 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")) + 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] === 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] === 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] === 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")) + 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.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")) + 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.moduleName != null && message.hasOwnProperty("moduleName")) + object.moduleName = message.moduleName; + 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); + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.cloud.securitycenter.v1.Database.toObject(message.database, options); + if (message.attackExposure != null && message.hasOwnProperty("attackExposure")) + object.attackExposure = $root.google.cloud.securitycenter.v1.AttackExposure.toObject(message.attackExposure, 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); + } + if (message.cloudDlpInspection != null && message.hasOwnProperty("cloudDlpInspection")) + object.cloudDlpInspection = $root.google.cloud.securitycenter.v1.CloudDlpInspection.toObject(message.cloudDlpInspection, options); + if (message.cloudDlpDataProfile != null && message.hasOwnProperty("cloudDlpDataProfile")) + object.cloudDlpDataProfile = $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.toObject(message.cloudDlpDataProfile, options); + if (message.kernelRootkit != null && message.hasOwnProperty("kernelRootkit")) + object.kernelRootkit = $root.google.cloud.securitycenter.v1.KernelRootkit.toObject(message.kernelRootkit, options); + if (message.orgPolicies && message.orgPolicies.length) { + object.orgPolicies = []; + for (var j = 0; j < message.orgPolicies.length; ++j) + object.orgPolicies[j] = $root.google.cloud.securitycenter.v1.OrgPolicy.toObject(message.orgPolicies[j], options); + } + if (message.application != null && message.hasOwnProperty("application")) + object.application = $root.google.cloud.securitycenter.v1.Application.toObject(message.application, options); + if (message.backupDisasterRecovery != null && message.hasOwnProperty("backupDisasterRecovery")) + object.backupDisasterRecovery = $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.toObject(message.backupDisasterRecovery, options); + if (message.securityPosture != null && message.hasOwnProperty("securityPosture")) + object.securityPosture = $root.google.cloud.securitycenter.v1.SecurityPosture.toObject(message.securityPosture, options); + if (message.logEntries && message.logEntries.length) { + object.logEntries = []; + for (var j = 0; j < message.logEntries.length; ++j) + object.logEntries[j] = $root.google.cloud.securitycenter.v1.LogEntry.toObject(message.logEntries[j], options); + } + if (message.loadBalancers && message.loadBalancers.length) { + object.loadBalancers = []; + for (var j = 0; j < message.loadBalancers.length; ++j) + object.loadBalancers[j] = $root.google.cloud.securitycenter.v1.LoadBalancer.toObject(message.loadBalancers[j], options); + } + if (message.cloudArmor != null && message.hasOwnProperty("cloudArmor")) + object.cloudArmor = $root.google.cloud.securitycenter.v1.CloudArmor.toObject(message.cloudArmor, options); + if (message.muteInfo != null && message.hasOwnProperty("muteInfo")) + object.muteInfo = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.toObject(message.muteInfo, options); + if (message.notebook != null && message.hasOwnProperty("notebook")) + object.notebook = $root.google.cloud.securitycenter.v1.Notebook.toObject(message.notebook, options); + if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) + object.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.toObject(message.toxicCombination, options); + if (message.groupMemberships && message.groupMemberships.length) { + object.groupMemberships = []; + for (var j = 0; j < message.groupMemberships.length; ++j) + object.groupMemberships[j] = $root.google.cloud.securitycenter.v1.GroupMembership.toObject(message.groupMemberships[j], options); + } + if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) + object.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.toObject(message.chokepoint, options); + if (message.externalExposure != null && message.hasOwnProperty("externalExposure")) + object.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.toObject(message.externalExposure, 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); + }; + + /** + * 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 + * @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 + * @property {number} POSTURE_VIOLATION=6 POSTURE_VIOLATION value + * @property {number} TOXIC_COMBINATION=7 TOXIC_COMBINATION value + * @property {number} SENSITIVE_DATA_RISK=8 SENSITIVE_DATA_RISK value + * @property {number} CHOKEPOINT=9 CHOKEPOINT value + * @property {number} EXTERNAL_EXPOSURE=10 EXTERNAL_EXPOSURE 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; + values[valuesById[6] = "POSTURE_VIOLATION"] = 6; + values[valuesById[7] = "TOXIC_COMBINATION"] = 7; + values[valuesById[8] = "SENSITIVE_DATA_RISK"] = 8; + values[valuesById[9] = "CHOKEPOINT"] = 9; + values[valuesById[10] = "EXTERNAL_EXPOSURE"] = 10; + return values; + })(); + + Finding.MuteInfo = (function() { + + /** + * Properties of a MuteInfo. + * @memberof google.cloud.securitycenter.v1.Finding + * @interface IMuteInfo + * @property {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute|null} [staticMute] MuteInfo staticMute + * @property {Array.|null} [dynamicMuteRecords] MuteInfo dynamicMuteRecords + */ + + /** + * Constructs a new MuteInfo. + * @memberof google.cloud.securitycenter.v1.Finding + * @classdesc Represents a MuteInfo. + * @implements IMuteInfo + * @constructor + * @param {google.cloud.securitycenter.v1.Finding.IMuteInfo=} [properties] Properties to set + */ + function MuteInfo(properties) { + this.dynamicMuteRecords = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MuteInfo staticMute. + * @member {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute|null|undefined} staticMute + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @instance + */ + MuteInfo.prototype.staticMute = null; + + /** + * MuteInfo dynamicMuteRecords. + * @member {Array.} dynamicMuteRecords + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @instance + */ + MuteInfo.prototype.dynamicMuteRecords = $util.emptyArray; + + /** + * Creates a new MuteInfo instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @param {google.cloud.securitycenter.v1.Finding.IMuteInfo=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo} MuteInfo instance + */ + MuteInfo.create = function create(properties) { + return new MuteInfo(properties); + }; + + /** + * Encodes the specified MuteInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @param {google.cloud.securitycenter.v1.Finding.IMuteInfo} message MuteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.staticMute != null && Object.hasOwnProperty.call(message, "staticMute")) + $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.encode(message.staticMute, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dynamicMuteRecords != null && message.dynamicMuteRecords.length) + for (var i = 0; i < message.dynamicMuteRecords.length; ++i) + $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.encode(message.dynamicMuteRecords[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MuteInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @param {google.cloud.securitycenter.v1.Finding.IMuteInfo} message MuteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MuteInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @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.MuteInfo} MuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteInfo.decode = function decode(reader, length, error) { + 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.MuteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.staticMute = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.dynamicMuteRecords && message.dynamicMuteRecords.length)) + message.dynamicMuteRecords = []; + message.dynamicMuteRecords.push($root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MuteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo} MuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MuteInfo message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MuteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.staticMute != null && message.hasOwnProperty("staticMute")) { + var error = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify(message.staticMute); + if (error) + return "staticMute." + error; + } + if (message.dynamicMuteRecords != null && message.hasOwnProperty("dynamicMuteRecords")) { + if (!Array.isArray(message.dynamicMuteRecords)) + return "dynamicMuteRecords: array expected"; + for (var i = 0; i < message.dynamicMuteRecords.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify(message.dynamicMuteRecords[i]); + if (error) + return "dynamicMuteRecords." + error; + } + } + return null; + }; + + /** + * Creates a MuteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo} MuteInfo + */ + MuteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding.MuteInfo) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding.MuteInfo(); + if (object.staticMute != null) { + if (typeof object.staticMute !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.staticMute: object expected"); + message.staticMute = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.fromObject(object.staticMute); + } + if (object.dynamicMuteRecords) { + if (!Array.isArray(object.dynamicMuteRecords)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.dynamicMuteRecords: array expected"); + message.dynamicMuteRecords = []; + for (var i = 0; i < object.dynamicMuteRecords.length; ++i) { + if (typeof object.dynamicMuteRecords[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.dynamicMuteRecords: object expected"); + message.dynamicMuteRecords[i] = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.fromObject(object.dynamicMuteRecords[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MuteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo} message MuteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MuteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dynamicMuteRecords = []; + if (options.defaults) + object.staticMute = null; + if (message.staticMute != null && message.hasOwnProperty("staticMute")) + object.staticMute = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.toObject(message.staticMute, options); + if (message.dynamicMuteRecords && message.dynamicMuteRecords.length) { + object.dynamicMuteRecords = []; + for (var j = 0; j < message.dynamicMuteRecords.length; ++j) + object.dynamicMuteRecords[j] = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.toObject(message.dynamicMuteRecords[j], options); + } + return object; + }; + + /** + * Converts this MuteInfo to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @instance + * @returns {Object.} JSON object + */ + MuteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MuteInfo + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MuteInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Finding.MuteInfo"; + }; + + MuteInfo.StaticMute = (function() { + + /** + * Properties of a StaticMute. + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @interface IStaticMute + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [state] StaticMute state + * @property {google.protobuf.ITimestamp|null} [applyTime] StaticMute applyTime + */ + + /** + * Constructs a new StaticMute. + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @classdesc Represents a StaticMute. + * @implements IStaticMute + * @constructor + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute=} [properties] Properties to set + */ + function StaticMute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StaticMute state. + * @member {google.cloud.securitycenter.v1.Finding.Mute} state + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @instance + */ + StaticMute.prototype.state = 0; + + /** + * StaticMute applyTime. + * @member {google.protobuf.ITimestamp|null|undefined} applyTime + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @instance + */ + StaticMute.prototype.applyTime = null; + + /** + * Creates a new StaticMute instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute} StaticMute instance + */ + StaticMute.create = function create(properties) { + return new StaticMute(properties); + }; + + /** + * Encodes the specified StaticMute message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute} message StaticMute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticMute.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.applyTime != null && Object.hasOwnProperty.call(message, "applyTime")) + $root.google.protobuf.Timestamp.encode(message.applyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StaticMute message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute} message StaticMute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticMute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StaticMute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @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.MuteInfo.StaticMute} StaticMute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticMute.decode = function decode(reader, length, error) { + 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.MuteInfo.StaticMute(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.applyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StaticMute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute} StaticMute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticMute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StaticMute message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StaticMute.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 4: + break; + } + if (message.applyTime != null && message.hasOwnProperty("applyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.applyTime); + if (error) + return "applyTime." + error; + } + return null; + }; + + /** + * Creates a StaticMute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute} StaticMute + */ + StaticMute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "MUTE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "MUTED": + case 1: + message.state = 1; + break; + case "UNMUTED": + case 2: + message.state = 2; + break; + case "UNDEFINED": + case 4: + message.state = 4; + break; + } + if (object.applyTime != null) { + if (typeof object.applyTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.applyTime: object expected"); + message.applyTime = $root.google.protobuf.Timestamp.fromObject(object.applyTime); + } + return message; + }; + + /** + * Creates a plain object from a StaticMute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute} message StaticMute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StaticMute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "MUTE_UNSPECIFIED" : 0; + object.applyTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.Finding.Mute[message.state] : message.state; + if (message.applyTime != null && message.hasOwnProperty("applyTime")) + object.applyTime = $root.google.protobuf.Timestamp.toObject(message.applyTime, options); + return object; + }; + + /** + * Converts this StaticMute to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @instance + * @returns {Object.} JSON object + */ + StaticMute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StaticMute + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StaticMute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute"; + }; + + return StaticMute; + })(); + + MuteInfo.DynamicMuteRecord = (function() { + + /** + * Properties of a DynamicMuteRecord. + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @interface IDynamicMuteRecord + * @property {string|null} [muteConfig] DynamicMuteRecord muteConfig + * @property {google.protobuf.ITimestamp|null} [matchTime] DynamicMuteRecord matchTime + */ + + /** + * Constructs a new DynamicMuteRecord. + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo + * @classdesc Represents a DynamicMuteRecord. + * @implements IDynamicMuteRecord + * @constructor + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord=} [properties] Properties to set + */ + function DynamicMuteRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DynamicMuteRecord muteConfig. + * @member {string} muteConfig + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @instance + */ + DynamicMuteRecord.prototype.muteConfig = ""; + + /** + * DynamicMuteRecord matchTime. + * @member {google.protobuf.ITimestamp|null|undefined} matchTime + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @instance + */ + DynamicMuteRecord.prototype.matchTime = null; + + /** + * Creates a new DynamicMuteRecord instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord instance + */ + DynamicMuteRecord.create = function create(properties) { + return new DynamicMuteRecord(properties); + }; + + /** + * Encodes the specified DynamicMuteRecord message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord} message DynamicMuteRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicMuteRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.muteConfig); + if (message.matchTime != null && Object.hasOwnProperty.call(message, "matchTime")) + $root.google.protobuf.Timestamp.encode(message.matchTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DynamicMuteRecord message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord} message DynamicMuteRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicMuteRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DynamicMuteRecord message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @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.MuteInfo.DynamicMuteRecord} DynamicMuteRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicMuteRecord.decode = function decode(reader, length, error) { + 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.MuteInfo.DynamicMuteRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.muteConfig = reader.string(); + break; + } + case 2: { + message.matchTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DynamicMuteRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicMuteRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DynamicMuteRecord message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DynamicMuteRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + if (!$util.isString(message.muteConfig)) + return "muteConfig: string expected"; + if (message.matchTime != null && message.hasOwnProperty("matchTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.matchTime); + if (error) + return "matchTime." + error; + } + return null; + }; + + /** + * Creates a DynamicMuteRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord + */ + DynamicMuteRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord(); + if (object.muteConfig != null) + message.muteConfig = String(object.muteConfig); + if (object.matchTime != null) { + if (typeof object.matchTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.matchTime: object expected"); + message.matchTime = $root.google.protobuf.Timestamp.fromObject(object.matchTime); + } + return message; + }; + + /** + * Creates a plain object from a DynamicMuteRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord} message DynamicMuteRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DynamicMuteRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.muteConfig = ""; + object.matchTime = null; + } + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + object.muteConfig = message.muteConfig; + if (message.matchTime != null && message.hasOwnProperty("matchTime")) + object.matchTime = $root.google.protobuf.Timestamp.toObject(message.matchTime, options); + return object; + }; + + /** + * Converts this DynamicMuteRecord to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @instance + * @returns {Object.} JSON object + */ + DynamicMuteRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DynamicMuteRecord + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DynamicMuteRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord"; + }; + + return DynamicMuteRecord; + })(); + + return MuteInfo; + })(); + + return Finding; + })(); + + v1.GroupMembership = (function() { + + /** + * Properties of a GroupMembership. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupMembership + * @property {google.cloud.securitycenter.v1.GroupMembership.GroupType|null} [groupType] GroupMembership groupType + * @property {string|null} [groupId] GroupMembership groupId + */ + + /** + * Constructs a new GroupMembership. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupMembership. + * @implements IGroupMembership + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupMembership=} [properties] Properties to set + */ + function GroupMembership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMembership groupType. + * @member {google.cloud.securitycenter.v1.GroupMembership.GroupType} groupType + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @instance + */ + GroupMembership.prototype.groupType = 0; + + /** + * GroupMembership groupId. + * @member {string} groupId + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @instance + */ + GroupMembership.prototype.groupId = ""; + + /** + * Creates a new GroupMembership instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {google.cloud.securitycenter.v1.IGroupMembership=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership instance + */ + GroupMembership.create = function create(properties) { + return new GroupMembership(properties); + }; + + /** + * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {google.cloud.securitycenter.v1.IGroupMembership} message GroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMembership.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupType != null && Object.hasOwnProperty.call(message, "groupType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.groupType); + if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId); + return writer; + }; + + /** + * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {google.cloud.securitycenter.v1.IGroupMembership} message GroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMembership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMembership message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMembership.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupMembership(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.groupType = reader.int32(); + break; + } + case 2: { + message.groupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMembership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMembership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMembership message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMembership.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupType != null && message.hasOwnProperty("groupType")) + switch (message.groupType) { + default: + return "groupType: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + return null; + }; + + /** + * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership + */ + GroupMembership.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupMembership) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupMembership(); + switch (object.groupType) { + default: + if (typeof object.groupType === "number") { + message.groupType = object.groupType; + break; + } + break; + case "GROUP_TYPE_UNSPECIFIED": + case 0: + message.groupType = 0; + break; + case "GROUP_TYPE_TOXIC_COMBINATION": + case 1: + message.groupType = 1; + break; + case "GROUP_TYPE_CHOKEPOINT": + case 3: + message.groupType = 3; + break; + } + if (object.groupId != null) + message.groupId = String(object.groupId); + return message; + }; + + /** + * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {google.cloud.securitycenter.v1.GroupMembership} message GroupMembership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMembership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groupType = options.enums === String ? "GROUP_TYPE_UNSPECIFIED" : 0; + object.groupId = ""; + } + if (message.groupType != null && message.hasOwnProperty("groupType")) + object.groupType = options.enums === String ? $root.google.cloud.securitycenter.v1.GroupMembership.GroupType[message.groupType] === undefined ? message.groupType : $root.google.cloud.securitycenter.v1.GroupMembership.GroupType[message.groupType] : message.groupType; + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + return object; + }; + + /** + * Converts this GroupMembership to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @instance + * @returns {Object.} JSON object + */ + GroupMembership.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupMembership + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupMembership"; + }; + + /** + * GroupType enum. + * @name google.cloud.securitycenter.v1.GroupMembership.GroupType + * @enum {number} + * @property {number} GROUP_TYPE_UNSPECIFIED=0 GROUP_TYPE_UNSPECIFIED value + * @property {number} GROUP_TYPE_TOXIC_COMBINATION=1 GROUP_TYPE_TOXIC_COMBINATION value + * @property {number} GROUP_TYPE_CHOKEPOINT=3 GROUP_TYPE_CHOKEPOINT value + */ + GroupMembership.GroupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GROUP_TYPE_TOXIC_COMBINATION"] = 1; + values[valuesById[3] = "GROUP_TYPE_CHOKEPOINT"] = 3; + return values; + })(); + + return GroupMembership; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + 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] === 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")) + 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); + }; + + /** + * 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 + * @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 + * @property {Array.|null} [uris] Indicator uris + */ + + /** + * 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 = []; + this.uris = []; + if (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; + + /** + * 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 + * @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(); + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + 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; + } + } + 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; + }; + + /** + * 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]); + } + } + 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; + }; + + /** + * 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 = []; + object.uris = []; + } + 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); + } + 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; + }; + + /** + * 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); + }; + + /** + * 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() { + + /** + * 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 + * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType|null} [signatureType] ProcessSignature signatureType + */ + + /** + * 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; + + /** + * ProcessSignature signatureType. + * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType} signatureType + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.signatureType = 0; + + // 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(); + if (message.signatureType != null && Object.hasOwnProperty.call(message, "signatureType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.signatureType); + 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, error) { + 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(); + if (tag === error) + break; + 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 8: { + message.signatureType = reader.int32(); + 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; + } + } + if (message.signatureType != null && message.hasOwnProperty("signatureType")) + switch (message.signatureType) { + default: + return "signatureType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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); + } + switch (object.signatureType) { + default: + if (typeof object.signatureType === "number") { + message.signatureType = object.signatureType; + break; + } + break; + case "SIGNATURE_TYPE_UNSPECIFIED": + case 0: + message.signatureType = 0; + break; + case "SIGNATURE_TYPE_PROCESS": + case 1: + message.signatureType = 1; + break; + case "SIGNATURE_TYPE_FILE": + case 2: + message.signatureType = 2; + break; + } + 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 (options.defaults) + object.signatureType = options.enums === String ? "SIGNATURE_TYPE_UNSPECIFIED" : 0; + 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 (message.signatureType != null && message.hasOwnProperty("signatureType")) + object.signatureType = options.enums === String ? $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType[message.signatureType] === undefined ? message.signatureType : $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType[message.signatureType] : message.signatureType; + 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); + }; + + /** + * 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() { + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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() { + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + /** + * SignatureType enum. + * @name google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType + * @enum {number} + * @property {number} SIGNATURE_TYPE_UNSPECIFIED=0 SIGNATURE_TYPE_UNSPECIFIED value + * @property {number} SIGNATURE_TYPE_PROCESS=1 SIGNATURE_TYPE_PROCESS value + * @property {number} SIGNATURE_TYPE_FILE=2 SIGNATURE_TYPE_FILE value + */ + ProcessSignature.SignatureType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGNATURE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIGNATURE_TYPE_PROCESS"] = 1; + values[valuesById[2] = "SIGNATURE_TYPE_FILE"] = 2; + return values; + })(); + + return ProcessSignature; + })(); + + return Indicator; + })(); + + v1.KernelRootkit = (function() { + + /** + * Properties of a KernelRootkit. + * @memberof google.cloud.securitycenter.v1 + * @interface IKernelRootkit + * @property {string|null} [name] KernelRootkit name + * @property {boolean|null} [unexpectedCodeModification] KernelRootkit unexpectedCodeModification + * @property {boolean|null} [unexpectedReadOnlyDataModification] KernelRootkit unexpectedReadOnlyDataModification + * @property {boolean|null} [unexpectedFtraceHandler] KernelRootkit unexpectedFtraceHandler + * @property {boolean|null} [unexpectedKprobeHandler] KernelRootkit unexpectedKprobeHandler + * @property {boolean|null} [unexpectedKernelCodePages] KernelRootkit unexpectedKernelCodePages + * @property {boolean|null} [unexpectedSystemCallHandler] KernelRootkit unexpectedSystemCallHandler + * @property {boolean|null} [unexpectedInterruptHandler] KernelRootkit unexpectedInterruptHandler + * @property {boolean|null} [unexpectedProcessesInRunqueue] KernelRootkit unexpectedProcessesInRunqueue + */ + + /** + * Constructs a new KernelRootkit. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a KernelRootkit. + * @implements IKernelRootkit + * @constructor + * @param {google.cloud.securitycenter.v1.IKernelRootkit=} [properties] Properties to set + */ + function KernelRootkit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KernelRootkit name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.name = ""; + + /** + * KernelRootkit unexpectedCodeModification. + * @member {boolean} unexpectedCodeModification + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedCodeModification = false; + + /** + * KernelRootkit unexpectedReadOnlyDataModification. + * @member {boolean} unexpectedReadOnlyDataModification + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedReadOnlyDataModification = false; + + /** + * KernelRootkit unexpectedFtraceHandler. + * @member {boolean} unexpectedFtraceHandler + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedFtraceHandler = false; + + /** + * KernelRootkit unexpectedKprobeHandler. + * @member {boolean} unexpectedKprobeHandler + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedKprobeHandler = false; + + /** + * KernelRootkit unexpectedKernelCodePages. + * @member {boolean} unexpectedKernelCodePages + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedKernelCodePages = false; + + /** + * KernelRootkit unexpectedSystemCallHandler. + * @member {boolean} unexpectedSystemCallHandler + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedSystemCallHandler = false; + + /** + * KernelRootkit unexpectedInterruptHandler. + * @member {boolean} unexpectedInterruptHandler + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedInterruptHandler = false; + + /** + * KernelRootkit unexpectedProcessesInRunqueue. + * @member {boolean} unexpectedProcessesInRunqueue + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedProcessesInRunqueue = false; + + /** + * Creates a new KernelRootkit instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {google.cloud.securitycenter.v1.IKernelRootkit=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.KernelRootkit} KernelRootkit instance + */ + KernelRootkit.create = function create(properties) { + return new KernelRootkit(properties); + }; + + /** + * Encodes the specified KernelRootkit message. Does not implicitly {@link google.cloud.securitycenter.v1.KernelRootkit.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {google.cloud.securitycenter.v1.IKernelRootkit} message KernelRootkit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KernelRootkit.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.unexpectedCodeModification != null && Object.hasOwnProperty.call(message, "unexpectedCodeModification")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.unexpectedCodeModification); + if (message.unexpectedReadOnlyDataModification != null && Object.hasOwnProperty.call(message, "unexpectedReadOnlyDataModification")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unexpectedReadOnlyDataModification); + if (message.unexpectedFtraceHandler != null && Object.hasOwnProperty.call(message, "unexpectedFtraceHandler")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.unexpectedFtraceHandler); + if (message.unexpectedKprobeHandler != null && Object.hasOwnProperty.call(message, "unexpectedKprobeHandler")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.unexpectedKprobeHandler); + if (message.unexpectedKernelCodePages != null && Object.hasOwnProperty.call(message, "unexpectedKernelCodePages")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.unexpectedKernelCodePages); + if (message.unexpectedSystemCallHandler != null && Object.hasOwnProperty.call(message, "unexpectedSystemCallHandler")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.unexpectedSystemCallHandler); + if (message.unexpectedInterruptHandler != null && Object.hasOwnProperty.call(message, "unexpectedInterruptHandler")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.unexpectedInterruptHandler); + if (message.unexpectedProcessesInRunqueue != null && Object.hasOwnProperty.call(message, "unexpectedProcessesInRunqueue")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.unexpectedProcessesInRunqueue); + return writer; + }; + + /** + * Encodes the specified KernelRootkit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.KernelRootkit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {google.cloud.securitycenter.v1.IKernelRootkit} message KernelRootkit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KernelRootkit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KernelRootkit message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.KernelRootkit} KernelRootkit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KernelRootkit.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.KernelRootkit(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.unexpectedCodeModification = reader.bool(); + break; + } + case 3: { + message.unexpectedReadOnlyDataModification = reader.bool(); + break; + } + case 4: { + message.unexpectedFtraceHandler = reader.bool(); + break; + } + case 5: { + message.unexpectedKprobeHandler = reader.bool(); + break; + } + case 6: { + message.unexpectedKernelCodePages = reader.bool(); + break; + } + case 7: { + message.unexpectedSystemCallHandler = reader.bool(); + break; + } + case 8: { + message.unexpectedInterruptHandler = reader.bool(); + break; + } + case 9: { + message.unexpectedProcessesInRunqueue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KernelRootkit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.KernelRootkit} KernelRootkit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KernelRootkit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KernelRootkit message. + * @function verify + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KernelRootkit.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.unexpectedCodeModification != null && message.hasOwnProperty("unexpectedCodeModification")) + if (typeof message.unexpectedCodeModification !== "boolean") + return "unexpectedCodeModification: boolean expected"; + if (message.unexpectedReadOnlyDataModification != null && message.hasOwnProperty("unexpectedReadOnlyDataModification")) + if (typeof message.unexpectedReadOnlyDataModification !== "boolean") + return "unexpectedReadOnlyDataModification: boolean expected"; + if (message.unexpectedFtraceHandler != null && message.hasOwnProperty("unexpectedFtraceHandler")) + if (typeof message.unexpectedFtraceHandler !== "boolean") + return "unexpectedFtraceHandler: boolean expected"; + if (message.unexpectedKprobeHandler != null && message.hasOwnProperty("unexpectedKprobeHandler")) + if (typeof message.unexpectedKprobeHandler !== "boolean") + return "unexpectedKprobeHandler: boolean expected"; + if (message.unexpectedKernelCodePages != null && message.hasOwnProperty("unexpectedKernelCodePages")) + if (typeof message.unexpectedKernelCodePages !== "boolean") + return "unexpectedKernelCodePages: boolean expected"; + if (message.unexpectedSystemCallHandler != null && message.hasOwnProperty("unexpectedSystemCallHandler")) + if (typeof message.unexpectedSystemCallHandler !== "boolean") + return "unexpectedSystemCallHandler: boolean expected"; + if (message.unexpectedInterruptHandler != null && message.hasOwnProperty("unexpectedInterruptHandler")) + if (typeof message.unexpectedInterruptHandler !== "boolean") + return "unexpectedInterruptHandler: boolean expected"; + if (message.unexpectedProcessesInRunqueue != null && message.hasOwnProperty("unexpectedProcessesInRunqueue")) + if (typeof message.unexpectedProcessesInRunqueue !== "boolean") + return "unexpectedProcessesInRunqueue: boolean expected"; + return null; + }; + + /** + * Creates a KernelRootkit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.KernelRootkit} KernelRootkit + */ + KernelRootkit.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.KernelRootkit) + return object; + var message = new $root.google.cloud.securitycenter.v1.KernelRootkit(); + if (object.name != null) + message.name = String(object.name); + if (object.unexpectedCodeModification != null) + message.unexpectedCodeModification = Boolean(object.unexpectedCodeModification); + if (object.unexpectedReadOnlyDataModification != null) + message.unexpectedReadOnlyDataModification = Boolean(object.unexpectedReadOnlyDataModification); + if (object.unexpectedFtraceHandler != null) + message.unexpectedFtraceHandler = Boolean(object.unexpectedFtraceHandler); + if (object.unexpectedKprobeHandler != null) + message.unexpectedKprobeHandler = Boolean(object.unexpectedKprobeHandler); + if (object.unexpectedKernelCodePages != null) + message.unexpectedKernelCodePages = Boolean(object.unexpectedKernelCodePages); + if (object.unexpectedSystemCallHandler != null) + message.unexpectedSystemCallHandler = Boolean(object.unexpectedSystemCallHandler); + if (object.unexpectedInterruptHandler != null) + message.unexpectedInterruptHandler = Boolean(object.unexpectedInterruptHandler); + if (object.unexpectedProcessesInRunqueue != null) + message.unexpectedProcessesInRunqueue = Boolean(object.unexpectedProcessesInRunqueue); + return message; + }; + + /** + * Creates a plain object from a KernelRootkit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {google.cloud.securitycenter.v1.KernelRootkit} message KernelRootkit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KernelRootkit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.unexpectedCodeModification = false; + object.unexpectedReadOnlyDataModification = false; + object.unexpectedFtraceHandler = false; + object.unexpectedKprobeHandler = false; + object.unexpectedKernelCodePages = false; + object.unexpectedSystemCallHandler = false; + object.unexpectedInterruptHandler = false; + object.unexpectedProcessesInRunqueue = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.unexpectedCodeModification != null && message.hasOwnProperty("unexpectedCodeModification")) + object.unexpectedCodeModification = message.unexpectedCodeModification; + if (message.unexpectedReadOnlyDataModification != null && message.hasOwnProperty("unexpectedReadOnlyDataModification")) + object.unexpectedReadOnlyDataModification = message.unexpectedReadOnlyDataModification; + if (message.unexpectedFtraceHandler != null && message.hasOwnProperty("unexpectedFtraceHandler")) + object.unexpectedFtraceHandler = message.unexpectedFtraceHandler; + if (message.unexpectedKprobeHandler != null && message.hasOwnProperty("unexpectedKprobeHandler")) + object.unexpectedKprobeHandler = message.unexpectedKprobeHandler; + if (message.unexpectedKernelCodePages != null && message.hasOwnProperty("unexpectedKernelCodePages")) + object.unexpectedKernelCodePages = message.unexpectedKernelCodePages; + if (message.unexpectedSystemCallHandler != null && message.hasOwnProperty("unexpectedSystemCallHandler")) + object.unexpectedSystemCallHandler = message.unexpectedSystemCallHandler; + if (message.unexpectedInterruptHandler != null && message.hasOwnProperty("unexpectedInterruptHandler")) + object.unexpectedInterruptHandler = message.unexpectedInterruptHandler; + if (message.unexpectedProcessesInRunqueue != null && message.hasOwnProperty("unexpectedProcessesInRunqueue")) + object.unexpectedProcessesInRunqueue = message.unexpectedProcessesInRunqueue; + return object; + }; + + /** + * Converts this KernelRootkit to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @instance + * @returns {Object.} JSON object + */ + KernelRootkit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KernelRootkit + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.KernelRootkit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KernelRootkit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.KernelRootkit"; + }; + + return KernelRootkit; + })(); + + 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 + * @property {Array.|null} [objects] Kubernetes objects + */ + + /** + * 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 = []; + this.objects = []; + if (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; + + /** + * Kubernetes objects. + * @member {Array.} objects + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.objects = $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(); + if (message.objects != null && message.objects.length) + for (var i = 0; i < message.objects.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Object.encode(message.objects[i], writer.uint32(/* id 7, wireType 2 =*/58).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, error) { + 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(); + if (tag === error) + break; + 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 7: { + if (!(message.objects && message.objects.length)) + message.objects = []; + message.objects.push($root.google.cloud.securitycenter.v1.Kubernetes.Object.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; + } + } + if (message.objects != null && message.hasOwnProperty("objects")) { + if (!Array.isArray(message.objects)) + return "objects: array expected"; + for (var i = 0; i < message.objects.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Object.verify(message.objects[i]); + if (error) + return "objects." + 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]); + } + } + if (object.objects) { + if (!Array.isArray(object.objects)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.objects: array expected"); + message.objects = []; + for (var i = 0; i < object.objects.length; ++i) { + if (typeof object.objects[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.objects: object expected"); + message.objects[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Object.fromObject(object.objects[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 = []; + object.objects = []; + } + 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); + } + if (message.objects && message.objects.length) { + object.objects = []; + for (var j = 0; j < message.objects.length; ++j) + object.objects[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Object.toObject(message.objects[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); + }; + + /** + * 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() { + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool instance + */ + NodePool.create = function create(properties) { + return new NodePool(properties); + }; + + /** + * 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.Kubernetes.NodePool + * @static + * @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 + */ + NodePool.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.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 NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @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 + */ + NodePool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodePool message from the specified reader or buffer. + * @function decode + * @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.Kubernetes.NodePool} NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodePool.decode = function decode(reader, length, error) { + 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.NodePool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodePool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + NodePool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodePool message. + * @function verify + * @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 + */ + NodePool.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.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; + } + } + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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 Role message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role + */ + 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.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; + 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 Role message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Role} message Role + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Role.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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] === 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")) + object.name = message.name; + return object; + }; + + /** + * Converts this Role to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @instance + * @returns {Object.} JSON object + */ + Role.prototype.toJSON = function toJSON() { + 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 + * @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; + })(); + + return Role; + })(); + + Kubernetes.Binding = (function() { + + /** + * 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 + */ + + /** + * 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]]; + } + + /** + * Binding ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.ns = ""; + + /** + * Binding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.name = ""; + + /** + * Binding role. + * @member {google.cloud.securitycenter.v1.Kubernetes.IRole|null|undefined} role + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.role = null; + + /** + * Binding subjects. + * @member {Array.} subjects + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.subjects = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + Kubernetes.Subject = (function() { + + /** + * 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 + */ + + /** + * 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]]; + } + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + 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; + }; + + /** + * 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] === 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")) + object.name = message.name; + return object; + }; + + /** + * 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); + }; + + /** + * 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 + * @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; + })(); + + return Subject; + })(); + + Kubernetes.AccessReview = (function() { + + /** + * 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 + */ + + /** + * 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]]; + } + + /** + * AccessReview group. + * @member {string} group + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.group = ""; + + /** + * AccessReview ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.ns = ""; + + /** + * AccessReview name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.name = ""; + + /** + * AccessReview resource. + * @member {string} resource + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.resource = ""; + + /** + * AccessReview subresource. + * @member {string} subresource + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.subresource = ""; + + /** + * 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 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 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 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 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, error) { + 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(); + if (tag === error) + break; + 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 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()); + }; + + /** + * 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 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + Kubernetes.Object = (function() { + + /** + * Properties of an Object. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IObject + * @property {string|null} [group] Object group + * @property {string|null} [kind] Object kind + * @property {string|null} [ns] Object ns + * @property {string|null} [name] Object name + * @property {Array.|null} [containers] Object containers + */ + + /** + * Constructs a new Object. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents an Object. + * @implements IObject + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IObject=} [properties] Properties to set + */ + function Object(properties) { + 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]]; + } + + /** + * Object group. + * @member {string} group + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @instance + */ + Object.prototype.group = ""; + + /** + * Object kind. + * @member {string} kind + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @instance + */ + Object.prototype.kind = ""; + + /** + * Object ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @instance + */ + Object.prototype.ns = ""; + + /** + * Object name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @instance + */ + Object.prototype.name = ""; + + /** + * Object containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @instance + */ + Object.prototype.containers = $util.emptyArray; + + /** + * Creates a new Object instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IObject=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Object} Object instance + */ + Object.create = function create(properties) { + return new Object(properties); + }; + + /** + * Encodes the specified Object message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Object.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IObject} message Object message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Object.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.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + 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 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Object message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Object.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IObject} message Object message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Object.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Object message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @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.Object} Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Object.decode = function decode(reader, length, error) { + 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.Object(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + message.kind = reader.string(); + break; + } + case 3: { + message.ns = reader.string(); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + 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 an Object message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Object} Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Object.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Object message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Object.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.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: 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.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 an Object message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Object} Object + */ + Object.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Object) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Object(); + if (object.group != null) + message.group = String(object.group); + if (object.kind != null) + message.kind = String(object.kind); + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Object.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.Object.containers: object expected"); + message.containers[i] = $root.google.cloud.securitycenter.v1.Container.fromObject(object.containers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Object message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Object} message Object + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Object.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.containers = []; + if (options.defaults) { + object.group = ""; + object.kind = ""; + object.ns = ""; + object.name = ""; + } + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.kind != null && message.hasOwnProperty("kind")) + object.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; + 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 Object to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @instance + * @returns {Object.} JSON object + */ + Object.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Object + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Object + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Object.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Object"; + }; + + return Object; + })(); + + return Kubernetes; + })(); + + v1.LoadBalancer = (function() { + + /** + * Properties of a LoadBalancer. + * @memberof google.cloud.securitycenter.v1 + * @interface ILoadBalancer + * @property {string|null} [name] LoadBalancer name + */ + + /** + * Constructs a new LoadBalancer. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a LoadBalancer. + * @implements ILoadBalancer + * @constructor + * @param {google.cloud.securitycenter.v1.ILoadBalancer=} [properties] Properties to set + */ + function LoadBalancer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoadBalancer name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @instance + */ + LoadBalancer.prototype.name = ""; + + /** + * Creates a new LoadBalancer instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {google.cloud.securitycenter.v1.ILoadBalancer=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.LoadBalancer} LoadBalancer instance + */ + LoadBalancer.create = function create(properties) { + return new LoadBalancer(properties); + }; + + /** + * Encodes the specified LoadBalancer message. Does not implicitly {@link google.cloud.securitycenter.v1.LoadBalancer.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {google.cloud.securitycenter.v1.ILoadBalancer} message LoadBalancer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadBalancer.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 LoadBalancer message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.LoadBalancer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {google.cloud.securitycenter.v1.ILoadBalancer} message LoadBalancer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadBalancer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoadBalancer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.LoadBalancer} LoadBalancer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadBalancer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.LoadBalancer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoadBalancer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.LoadBalancer} LoadBalancer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadBalancer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadBalancer message. + * @function verify + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadBalancer.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 LoadBalancer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.LoadBalancer} LoadBalancer + */ + LoadBalancer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.LoadBalancer) + return object; + var message = new $root.google.cloud.securitycenter.v1.LoadBalancer(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a LoadBalancer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {google.cloud.securitycenter.v1.LoadBalancer} message LoadBalancer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadBalancer.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 LoadBalancer to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @instance + * @returns {Object.} JSON object + */ + LoadBalancer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadBalancer + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.LoadBalancer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadBalancer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.LoadBalancer"; + }; + + return LoadBalancer; + })(); + + v1.LogEntry = (function() { + + /** + * Properties of a LogEntry. + * @memberof google.cloud.securitycenter.v1 + * @interface ILogEntry + * @property {google.cloud.securitycenter.v1.ICloudLoggingEntry|null} [cloudLoggingEntry] LogEntry cloudLoggingEntry + */ + + /** + * Constructs a new LogEntry. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a LogEntry. + * @implements ILogEntry + * @constructor + * @param {google.cloud.securitycenter.v1.ILogEntry=} [properties] Properties to set + */ + function LogEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogEntry cloudLoggingEntry. + * @member {google.cloud.securitycenter.v1.ICloudLoggingEntry|null|undefined} cloudLoggingEntry + * @memberof google.cloud.securitycenter.v1.LogEntry + * @instance + */ + LogEntry.prototype.cloudLoggingEntry = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogEntry logEntry. + * @member {"cloudLoggingEntry"|undefined} logEntry + * @memberof google.cloud.securitycenter.v1.LogEntry + * @instance + */ + Object.defineProperty(LogEntry.prototype, "logEntry", { + get: $util.oneOfGetter($oneOfFields = ["cloudLoggingEntry"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogEntry instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {google.cloud.securitycenter.v1.ILogEntry=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.LogEntry} LogEntry instance + */ + LogEntry.create = function create(properties) { + return new LogEntry(properties); + }; + + /** + * Encodes the specified LogEntry message. Does not implicitly {@link google.cloud.securitycenter.v1.LogEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {google.cloud.securitycenter.v1.ILogEntry} message LogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudLoggingEntry != null && Object.hasOwnProperty.call(message, "cloudLoggingEntry")) + $root.google.cloud.securitycenter.v1.CloudLoggingEntry.encode(message.cloudLoggingEntry, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.LogEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {google.cloud.securitycenter.v1.ILogEntry} message LogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.LogEntry} LogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.LogEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cloudLoggingEntry = $root.google.cloud.securitycenter.v1.CloudLoggingEntry.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.LogEntry} LogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogEntry message. + * @function verify + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudLoggingEntry != null && message.hasOwnProperty("cloudLoggingEntry")) { + properties.logEntry = 1; + { + var error = $root.google.cloud.securitycenter.v1.CloudLoggingEntry.verify(message.cloudLoggingEntry); + if (error) + return "cloudLoggingEntry." + error; + } + } + return null; + }; + + /** + * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.LogEntry} LogEntry + */ + LogEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.LogEntry) + return object; + var message = new $root.google.cloud.securitycenter.v1.LogEntry(); + if (object.cloudLoggingEntry != null) { + if (typeof object.cloudLoggingEntry !== "object") + throw TypeError(".google.cloud.securitycenter.v1.LogEntry.cloudLoggingEntry: object expected"); + message.cloudLoggingEntry = $root.google.cloud.securitycenter.v1.CloudLoggingEntry.fromObject(object.cloudLoggingEntry); + } + return message; + }; + + /** + * Creates a plain object from a LogEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {google.cloud.securitycenter.v1.LogEntry} message LogEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cloudLoggingEntry != null && message.hasOwnProperty("cloudLoggingEntry")) { + object.cloudLoggingEntry = $root.google.cloud.securitycenter.v1.CloudLoggingEntry.toObject(message.cloudLoggingEntry, options); + if (options.oneofs) + object.logEntry = "cloudLoggingEntry"; + } + return object; + }; + + /** + * Converts this LogEntry to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.LogEntry + * @instance + * @returns {Object.} JSON object + */ + LogEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogEntry + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.LogEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.LogEntry"; + }; + + return LogEntry; + })(); + + v1.CloudLoggingEntry = (function() { + + /** + * Properties of a CloudLoggingEntry. + * @memberof google.cloud.securitycenter.v1 + * @interface ICloudLoggingEntry + * @property {string|null} [insertId] CloudLoggingEntry insertId + * @property {string|null} [logId] CloudLoggingEntry logId + * @property {string|null} [resourceContainer] CloudLoggingEntry resourceContainer + * @property {google.protobuf.ITimestamp|null} [timestamp] CloudLoggingEntry timestamp + */ + + /** + * Constructs a new CloudLoggingEntry. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CloudLoggingEntry. + * @implements ICloudLoggingEntry + * @constructor + * @param {google.cloud.securitycenter.v1.ICloudLoggingEntry=} [properties] Properties to set + */ + function CloudLoggingEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingEntry insertId. + * @member {string} insertId + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @instance + */ + CloudLoggingEntry.prototype.insertId = ""; + + /** + * CloudLoggingEntry logId. + * @member {string} logId + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @instance + */ + CloudLoggingEntry.prototype.logId = ""; + + /** + * CloudLoggingEntry resourceContainer. + * @member {string} resourceContainer + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @instance + */ + CloudLoggingEntry.prototype.resourceContainer = ""; + + /** + * CloudLoggingEntry timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @instance + */ + CloudLoggingEntry.prototype.timestamp = null; + + /** + * Creates a new CloudLoggingEntry instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {google.cloud.securitycenter.v1.ICloudLoggingEntry=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CloudLoggingEntry} CloudLoggingEntry instance + */ + CloudLoggingEntry.create = function create(properties) { + return new CloudLoggingEntry(properties); + }; + + /** + * Encodes the specified CloudLoggingEntry message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudLoggingEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {google.cloud.securitycenter.v1.ICloudLoggingEntry} message CloudLoggingEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.insertId != null && Object.hasOwnProperty.call(message, "insertId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.insertId); + if (message.logId != null && Object.hasOwnProperty.call(message, "logId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logId); + if (message.resourceContainer != null && Object.hasOwnProperty.call(message, "resourceContainer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceContainer); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudLoggingEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudLoggingEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {google.cloud.securitycenter.v1.ICloudLoggingEntry} message CloudLoggingEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CloudLoggingEntry} CloudLoggingEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingEntry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CloudLoggingEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.insertId = reader.string(); + break; + } + case 2: { + message.logId = reader.string(); + break; + } + case 3: { + message.resourceContainer = reader.string(); + break; + } + case 4: { + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CloudLoggingEntry} CloudLoggingEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingEntry message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.insertId != null && message.hasOwnProperty("insertId")) + if (!$util.isString(message.insertId)) + return "insertId: string expected"; + if (message.logId != null && message.hasOwnProperty("logId")) + if (!$util.isString(message.logId)) + return "logId: string expected"; + if (message.resourceContainer != null && message.hasOwnProperty("resourceContainer")) + if (!$util.isString(message.resourceContainer)) + return "resourceContainer: string expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a CloudLoggingEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CloudLoggingEntry} CloudLoggingEntry + */ + CloudLoggingEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CloudLoggingEntry) + return object; + var message = new $root.google.cloud.securitycenter.v1.CloudLoggingEntry(); + if (object.insertId != null) + message.insertId = String(object.insertId); + if (object.logId != null) + message.logId = String(object.logId); + if (object.resourceContainer != null) + message.resourceContainer = String(object.resourceContainer); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CloudLoggingEntry.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a CloudLoggingEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {google.cloud.securitycenter.v1.CloudLoggingEntry} message CloudLoggingEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.insertId = ""; + object.logId = ""; + object.resourceContainer = ""; + object.timestamp = null; + } + if (message.insertId != null && message.hasOwnProperty("insertId")) + object.insertId = message.insertId; + if (message.logId != null && message.hasOwnProperty("logId")) + object.logId = message.logId; + if (message.resourceContainer != null && message.hasOwnProperty("resourceContainer")) + object.resourceContainer = message.resourceContainer; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this CloudLoggingEntry to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingEntry + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudLoggingEntry"; + }; + + return CloudLoggingEntry; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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 49: + case 50: + case 37: + case 38: + case 32: + case 56: + case 6: + case 7: + case 59: + case 63: + case 18: + case 19: + case 64: + case 45: + case 46: + case 47: + case 14: + case 35: + case 15: + case 16: + case 9: + case 10: + case 11: + case 22: + case 40: + case 23: + case 58: + case 3: + case 4: + case 44: + case 5: + case 33: + case 39: + case 27: + case 30: + case 29: + case 52: + case 36: + case 8: + case 17: + case 48: + case 42: + case 51: + case 25: + case 24: + case 34: + case 13: + case 28: + case 31: + case 55: + case 20: + case 21: + case 12: + case 41: + case 26: + case 54: + case 53: + case 43: + case 1: + case 2: + case 60: + case 61: + case 57: + case 62: + 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 49: + case 50: + case 37: + case 38: + case 32: + case 56: + case 6: + case 7: + case 59: + case 63: + case 18: + case 19: + case 64: + case 45: + case 46: + case 47: + case 14: + case 35: + case 15: + case 16: + case 9: + case 10: + case 11: + case 22: + case 40: + case 23: + case 58: + case 3: + case 4: + case 44: + case 5: + case 33: + case 39: + case 27: + case 30: + case 29: + case 52: + case 36: + case 8: + case 17: + case 48: + case 42: + case 51: + case 25: + case 24: + case 34: + case 13: + case 28: + case 31: + case 55: + case 20: + case 21: + case 12: + case 41: + case 26: + case 54: + case 53: + case 43: + case 1: + case 2: + case 60: + case 61: + case 57: + case 62: + 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) { + default: + if (typeof object.primaryTactic === "number") { + message.primaryTactic = object.primaryTactic; + break; + } + break; + 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: + if (typeof object.primaryTechniques[i] === "number") { + message.primaryTechniques[i] = object.primaryTechniques[i]; + break; + } + case "TECHNIQUE_UNSPECIFIED": + case 0: + message.primaryTechniques[i] = 0; + break; + case "MASQUERADING": + case 49: + message.primaryTechniques[i] = 49; + break; + case "MATCH_LEGITIMATE_NAME_OR_LOCATION": + case 50: + message.primaryTechniques[i] = 50; + break; + case "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": + case 37: + message.primaryTechniques[i] = 37; + break; + case "STARTUP_ITEMS": + case 38: + message.primaryTechniques[i] = 38; + break; + case "NETWORK_SERVICE_DISCOVERY": + case 32: + message.primaryTechniques[i] = 32; + break; + case "PROCESS_DISCOVERY": + case 56: + message.primaryTechniques[i] = 56; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.primaryTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.primaryTechniques[i] = 7; + break; + case "PYTHON": + case 59: + message.primaryTechniques[i] = 59; + break; + case "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": + case 63: + message.primaryTechniques[i] = 63; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.primaryTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.primaryTechniques[i] = 19; + break; + case "INDICATOR_REMOVAL_FILE_DELETION": + case 64: + message.primaryTechniques[i] = 64; + break; + case "APPLICATION_LAYER_PROTOCOL": + case 45: + message.primaryTechniques[i] = 45; + break; + case "DNS": + case 46: + message.primaryTechniques[i] = 46; + break; + case "SOFTWARE_DEPLOYMENT_TOOLS": + case 47: + message.primaryTechniques[i] = 47; + break; + case "VALID_ACCOUNTS": + case 14: + message.primaryTechniques[i] = 14; + break; + case "DEFAULT_ACCOUNTS": + case 35: + message.primaryTechniques[i] = 35; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.primaryTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.primaryTechniques[i] = 16; + 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 "ACCOUNT_MANIPULATION": + case 22: + message.primaryTechniques[i] = 22; + break; + case "ADDITIONAL_CLOUD_CREDENTIALS": + case 40: + message.primaryTechniques[i] = 40; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.primaryTechniques[i] = 23; + break; + case "ADDITIONAL_CONTAINER_CLUSTER_ROLES": + case 58: + message.primaryTechniques[i] = 58; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.primaryTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.primaryTechniques[i] = 4; + break; + case "BRUTE_FORCE": + case 44: + message.primaryTechniques[i] = 44; + break; + case "SHARED_MODULES": + case 5: + message.primaryTechniques[i] = 5; + break; + case "ACCESS_TOKEN_MANIPULATION": + case 33: + message.primaryTechniques[i] = 33; + break; + case "TOKEN_IMPERSONATION_OR_THEFT": + case 39: + message.primaryTechniques[i] = 39; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.primaryTechniques[i] = 27; + break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.primaryTechniques[i] = 30; + break; + case "DATA_DESTRUCTION": + case 29: + message.primaryTechniques[i] = 29; + break; + case "SERVICE_STOP": + case 52: + message.primaryTechniques[i] = 52; + break; + case "INHIBIT_SYSTEM_RECOVERY": + case 36: + message.primaryTechniques[i] = 36; + break; + case "RESOURCE_HIJACKING": + case 8: + message.primaryTechniques[i] = 8; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.primaryTechniques[i] = 17; + break; + case "CLOUD_SERVICE_DISCOVERY": + case 48: + message.primaryTechniques[i] = 48; + break; + case "STEAL_APPLICATION_ACCESS_TOKEN": + case 42: + message.primaryTechniques[i] = 42; + break; + case "ACCOUNT_ACCESS_REMOVAL": + case 51: + message.primaryTechniques[i] = 51; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.primaryTechniques[i] = 25; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.primaryTechniques[i] = 24; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM": + case 34: + message.primaryTechniques[i] = 34; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.primaryTechniques[i] = 13; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.primaryTechniques[i] = 28; + break; + case "IMPAIR_DEFENSES": + case 31: + message.primaryTechniques[i] = 31; + break; + case "DISABLE_OR_MODIFY_TOOLS": + case 55: + message.primaryTechniques[i] = 55; + 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 "DYNAMIC_RESOLUTION": + case 12: + message.primaryTechniques[i] = 12; + break; + case "LATERAL_TOOL_TRANSFER": + case 41: + message.primaryTechniques[i] = 41; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.primaryTechniques[i] = 26; + break; + case "CREATE_SNAPSHOT": + case 54: + message.primaryTechniques[i] = 54; + break; + case "CLOUD_INFRASTRUCTURE_DISCOVERY": + case 53: + message.primaryTechniques[i] = 53; + break; + case "OBTAIN_CAPABILITIES": + case 43: + message.primaryTechniques[i] = 43; + break; + case "ACTIVE_SCANNING": + case 1: + message.primaryTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.primaryTechniques[i] = 2; + break; + case "CONTAINER_ADMINISTRATION_COMMAND": + case 60: + message.primaryTechniques[i] = 60; + break; + case "ESCAPE_TO_HOST": + case 61: + message.primaryTechniques[i] = 61; + break; + case "CONTAINER_AND_RESOURCE_DISCOVERY": + case 57: + message.primaryTechniques[i] = 57; + break; + case "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": + case 62: + message.primaryTechniques[i] = 62; + 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: + if (typeof object.additionalTactics[i] === "number") { + message.additionalTactics[i] = object.additionalTactics[i]; + break; + } + 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: + if (typeof object.additionalTechniques[i] === "number") { + message.additionalTechniques[i] = object.additionalTechniques[i]; + break; + } + case "TECHNIQUE_UNSPECIFIED": + case 0: + message.additionalTechniques[i] = 0; + break; + case "MASQUERADING": + case 49: + message.additionalTechniques[i] = 49; + break; + case "MATCH_LEGITIMATE_NAME_OR_LOCATION": + case 50: + message.additionalTechniques[i] = 50; + break; + case "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": + case 37: + message.additionalTechniques[i] = 37; + break; + case "STARTUP_ITEMS": + case 38: + message.additionalTechniques[i] = 38; + break; + case "NETWORK_SERVICE_DISCOVERY": + case 32: + message.additionalTechniques[i] = 32; + break; + case "PROCESS_DISCOVERY": + case 56: + message.additionalTechniques[i] = 56; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.additionalTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.additionalTechniques[i] = 7; + break; + case "PYTHON": + case 59: + message.additionalTechniques[i] = 59; + break; + case "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": + case 63: + message.additionalTechniques[i] = 63; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.additionalTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.additionalTechniques[i] = 19; + break; + case "INDICATOR_REMOVAL_FILE_DELETION": + case 64: + message.additionalTechniques[i] = 64; + break; + case "APPLICATION_LAYER_PROTOCOL": + case 45: + message.additionalTechniques[i] = 45; + break; + case "DNS": + case 46: + message.additionalTechniques[i] = 46; + break; + case "SOFTWARE_DEPLOYMENT_TOOLS": + case 47: + message.additionalTechniques[i] = 47; + break; + case "VALID_ACCOUNTS": + case 14: + message.additionalTechniques[i] = 14; + break; + case "DEFAULT_ACCOUNTS": + case 35: + message.additionalTechniques[i] = 35; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.additionalTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.additionalTechniques[i] = 16; + 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 "ACCOUNT_MANIPULATION": + case 22: + message.additionalTechniques[i] = 22; + break; + case "ADDITIONAL_CLOUD_CREDENTIALS": + case 40: + message.additionalTechniques[i] = 40; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.additionalTechniques[i] = 23; + break; + case "ADDITIONAL_CONTAINER_CLUSTER_ROLES": + case 58: + message.additionalTechniques[i] = 58; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.additionalTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.additionalTechniques[i] = 4; + break; + case "BRUTE_FORCE": + case 44: + message.additionalTechniques[i] = 44; + break; + case "SHARED_MODULES": + case 5: + message.additionalTechniques[i] = 5; + break; + case "ACCESS_TOKEN_MANIPULATION": + case 33: + message.additionalTechniques[i] = 33; + break; + case "TOKEN_IMPERSONATION_OR_THEFT": + case 39: + message.additionalTechniques[i] = 39; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.additionalTechniques[i] = 27; + break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.additionalTechniques[i] = 30; + break; + case "DATA_DESTRUCTION": + case 29: + message.additionalTechniques[i] = 29; + break; + case "SERVICE_STOP": + case 52: + message.additionalTechniques[i] = 52; + break; + case "INHIBIT_SYSTEM_RECOVERY": + case 36: + message.additionalTechniques[i] = 36; + break; + case "RESOURCE_HIJACKING": + case 8: + message.additionalTechniques[i] = 8; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.additionalTechniques[i] = 17; + break; + case "CLOUD_SERVICE_DISCOVERY": + case 48: + message.additionalTechniques[i] = 48; + break; + case "STEAL_APPLICATION_ACCESS_TOKEN": + case 42: + message.additionalTechniques[i] = 42; + break; + case "ACCOUNT_ACCESS_REMOVAL": + case 51: + message.additionalTechniques[i] = 51; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.additionalTechniques[i] = 25; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.additionalTechniques[i] = 24; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM": + case 34: + message.additionalTechniques[i] = 34; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.additionalTechniques[i] = 13; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.additionalTechniques[i] = 28; + break; + case "IMPAIR_DEFENSES": + case 31: + message.additionalTechniques[i] = 31; + break; + case "DISABLE_OR_MODIFY_TOOLS": + case 55: + message.additionalTechniques[i] = 55; + 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 "DYNAMIC_RESOLUTION": + case 12: + message.additionalTechniques[i] = 12; + break; + case "LATERAL_TOOL_TRANSFER": + case 41: + message.additionalTechniques[i] = 41; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.additionalTechniques[i] = 26; + break; + case "CREATE_SNAPSHOT": + case 54: + message.additionalTechniques[i] = 54; + break; + case "CLOUD_INFRASTRUCTURE_DISCOVERY": + case 53: + message.additionalTechniques[i] = 53; + break; + case "OBTAIN_CAPABILITIES": + case 43: + message.additionalTechniques[i] = 43; + break; + case "ACTIVE_SCANNING": + case 1: + message.additionalTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.additionalTechniques[i] = 2; + break; + case "CONTAINER_ADMINISTRATION_COMMAND": + case 60: + message.additionalTechniques[i] = 60; + break; + case "ESCAPE_TO_HOST": + case 61: + message.additionalTechniques[i] = 61; + break; + case "CONTAINER_AND_RESOURCE_DISCOVERY": + case 57: + message.additionalTechniques[i] = 57; + break; + case "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": + case 62: + message.additionalTechniques[i] = 62; + 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] === 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]] === 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]] === 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]] === 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; + 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); + }; + + /** + * 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 + * @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} MASQUERADING=49 MASQUERADING value + * @property {number} MATCH_LEGITIMATE_NAME_OR_LOCATION=50 MATCH_LEGITIMATE_NAME_OR_LOCATION value + * @property {number} BOOT_OR_LOGON_INITIALIZATION_SCRIPTS=37 BOOT_OR_LOGON_INITIALIZATION_SCRIPTS value + * @property {number} STARTUP_ITEMS=38 STARTUP_ITEMS value + * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value + * @property {number} PROCESS_DISCOVERY=56 PROCESS_DISCOVERY value + * @property {number} COMMAND_AND_SCRIPTING_INTERPRETER=6 COMMAND_AND_SCRIPTING_INTERPRETER value + * @property {number} UNIX_SHELL=7 UNIX_SHELL value + * @property {number} PYTHON=59 PYTHON value + * @property {number} EXPLOITATION_FOR_PRIVILEGE_ESCALATION=63 EXPLOITATION_FOR_PRIVILEGE_ESCALATION value + * @property {number} PERMISSION_GROUPS_DISCOVERY=18 PERMISSION_GROUPS_DISCOVERY value + * @property {number} CLOUD_GROUPS=19 CLOUD_GROUPS value + * @property {number} INDICATOR_REMOVAL_FILE_DELETION=64 INDICATOR_REMOVAL_FILE_DELETION value + * @property {number} APPLICATION_LAYER_PROTOCOL=45 APPLICATION_LAYER_PROTOCOL value + * @property {number} DNS=46 DNS value + * @property {number} SOFTWARE_DEPLOYMENT_TOOLS=47 SOFTWARE_DEPLOYMENT_TOOLS value + * @property {number} VALID_ACCOUNTS=14 VALID_ACCOUNTS value + * @property {number} DEFAULT_ACCOUNTS=35 DEFAULT_ACCOUNTS value + * @property {number} LOCAL_ACCOUNTS=15 LOCAL_ACCOUNTS value + * @property {number} CLOUD_ACCOUNTS=16 CLOUD_ACCOUNTS 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} ACCOUNT_MANIPULATION=22 ACCOUNT_MANIPULATION value + * @property {number} ADDITIONAL_CLOUD_CREDENTIALS=40 ADDITIONAL_CLOUD_CREDENTIALS value + * @property {number} SSH_AUTHORIZED_KEYS=23 SSH_AUTHORIZED_KEYS value + * @property {number} ADDITIONAL_CONTAINER_CLUSTER_ROLES=58 ADDITIONAL_CONTAINER_CLUSTER_ROLES value + * @property {number} INGRESS_TOOL_TRANSFER=3 INGRESS_TOOL_TRANSFER value + * @property {number} NATIVE_API=4 NATIVE_API value + * @property {number} BRUTE_FORCE=44 BRUTE_FORCE value + * @property {number} SHARED_MODULES=5 SHARED_MODULES value + * @property {number} ACCESS_TOKEN_MANIPULATION=33 ACCESS_TOKEN_MANIPULATION value + * @property {number} TOKEN_IMPERSONATION_OR_THEFT=39 TOKEN_IMPERSONATION_OR_THEFT value + * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value + * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value + * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value + * @property {number} SERVICE_STOP=52 SERVICE_STOP value + * @property {number} INHIBIT_SYSTEM_RECOVERY=36 INHIBIT_SYSTEM_RECOVERY value + * @property {number} RESOURCE_HIJACKING=8 RESOURCE_HIJACKING value + * @property {number} NETWORK_DENIAL_OF_SERVICE=17 NETWORK_DENIAL_OF_SERVICE value + * @property {number} CLOUD_SERVICE_DISCOVERY=48 CLOUD_SERVICE_DISCOVERY value + * @property {number} STEAL_APPLICATION_ACCESS_TOKEN=42 STEAL_APPLICATION_ACCESS_TOKEN value + * @property {number} ACCOUNT_ACCESS_REMOVAL=51 ACCOUNT_ACCESS_REMOVAL value + * @property {number} STEAL_WEB_SESSION_COOKIE=25 STEAL_WEB_SESSION_COOKIE value + * @property {number} CREATE_OR_MODIFY_SYSTEM_PROCESS=24 CREATE_OR_MODIFY_SYSTEM_PROCESS value + * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM=34 ABUSE_ELEVATION_CONTROL_MECHANISM value + * @property {number} UNSECURED_CREDENTIALS=13 UNSECURED_CREDENTIALS value + * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value + * @property {number} IMPAIR_DEFENSES=31 IMPAIR_DEFENSES value + * @property {number} DISABLE_OR_MODIFY_TOOLS=55 DISABLE_OR_MODIFY_TOOLS 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} DYNAMIC_RESOLUTION=12 DYNAMIC_RESOLUTION value + * @property {number} LATERAL_TOOL_TRANSFER=41 LATERAL_TOOL_TRANSFER value + * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value + * @property {number} CREATE_SNAPSHOT=54 CREATE_SNAPSHOT value + * @property {number} CLOUD_INFRASTRUCTURE_DISCOVERY=53 CLOUD_INFRASTRUCTURE_DISCOVERY value + * @property {number} OBTAIN_CAPABILITIES=43 OBTAIN_CAPABILITIES value + * @property {number} ACTIVE_SCANNING=1 ACTIVE_SCANNING value + * @property {number} SCANNING_IP_BLOCKS=2 SCANNING_IP_BLOCKS value + * @property {number} CONTAINER_ADMINISTRATION_COMMAND=60 CONTAINER_ADMINISTRATION_COMMAND value + * @property {number} ESCAPE_TO_HOST=61 ESCAPE_TO_HOST value + * @property {number} CONTAINER_AND_RESOURCE_DISCOVERY=57 CONTAINER_AND_RESOURCE_DISCOVERY value + * @property {number} STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES=62 STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES value + */ + MitreAttack.Technique = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TECHNIQUE_UNSPECIFIED"] = 0; + values[valuesById[49] = "MASQUERADING"] = 49; + values[valuesById[50] = "MATCH_LEGITIMATE_NAME_OR_LOCATION"] = 50; + values[valuesById[37] = "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS"] = 37; + values[valuesById[38] = "STARTUP_ITEMS"] = 38; + values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; + values[valuesById[56] = "PROCESS_DISCOVERY"] = 56; + values[valuesById[6] = "COMMAND_AND_SCRIPTING_INTERPRETER"] = 6; + values[valuesById[7] = "UNIX_SHELL"] = 7; + values[valuesById[59] = "PYTHON"] = 59; + values[valuesById[63] = "EXPLOITATION_FOR_PRIVILEGE_ESCALATION"] = 63; + values[valuesById[18] = "PERMISSION_GROUPS_DISCOVERY"] = 18; + values[valuesById[19] = "CLOUD_GROUPS"] = 19; + values[valuesById[64] = "INDICATOR_REMOVAL_FILE_DELETION"] = 64; + values[valuesById[45] = "APPLICATION_LAYER_PROTOCOL"] = 45; + values[valuesById[46] = "DNS"] = 46; + values[valuesById[47] = "SOFTWARE_DEPLOYMENT_TOOLS"] = 47; + values[valuesById[14] = "VALID_ACCOUNTS"] = 14; + values[valuesById[35] = "DEFAULT_ACCOUNTS"] = 35; + values[valuesById[15] = "LOCAL_ACCOUNTS"] = 15; + values[valuesById[16] = "CLOUD_ACCOUNTS"] = 16; + values[valuesById[9] = "PROXY"] = 9; + values[valuesById[10] = "EXTERNAL_PROXY"] = 10; + values[valuesById[11] = "MULTI_HOP_PROXY"] = 11; + values[valuesById[22] = "ACCOUNT_MANIPULATION"] = 22; + values[valuesById[40] = "ADDITIONAL_CLOUD_CREDENTIALS"] = 40; + values[valuesById[23] = "SSH_AUTHORIZED_KEYS"] = 23; + values[valuesById[58] = "ADDITIONAL_CONTAINER_CLUSTER_ROLES"] = 58; + values[valuesById[3] = "INGRESS_TOOL_TRANSFER"] = 3; + values[valuesById[4] = "NATIVE_API"] = 4; + values[valuesById[44] = "BRUTE_FORCE"] = 44; + values[valuesById[5] = "SHARED_MODULES"] = 5; + values[valuesById[33] = "ACCESS_TOKEN_MANIPULATION"] = 33; + values[valuesById[39] = "TOKEN_IMPERSONATION_OR_THEFT"] = 39; + values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; + values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; + values[valuesById[29] = "DATA_DESTRUCTION"] = 29; + values[valuesById[52] = "SERVICE_STOP"] = 52; + values[valuesById[36] = "INHIBIT_SYSTEM_RECOVERY"] = 36; + values[valuesById[8] = "RESOURCE_HIJACKING"] = 8; + values[valuesById[17] = "NETWORK_DENIAL_OF_SERVICE"] = 17; + values[valuesById[48] = "CLOUD_SERVICE_DISCOVERY"] = 48; + values[valuesById[42] = "STEAL_APPLICATION_ACCESS_TOKEN"] = 42; + values[valuesById[51] = "ACCOUNT_ACCESS_REMOVAL"] = 51; + values[valuesById[25] = "STEAL_WEB_SESSION_COOKIE"] = 25; + values[valuesById[24] = "CREATE_OR_MODIFY_SYSTEM_PROCESS"] = 24; + values[valuesById[34] = "ABUSE_ELEVATION_CONTROL_MECHANISM"] = 34; + values[valuesById[13] = "UNSECURED_CREDENTIALS"] = 13; + values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; + values[valuesById[31] = "IMPAIR_DEFENSES"] = 31; + values[valuesById[55] = "DISABLE_OR_MODIFY_TOOLS"] = 55; + values[valuesById[20] = "EXFILTRATION_OVER_WEB_SERVICE"] = 20; + values[valuesById[21] = "EXFILTRATION_TO_CLOUD_STORAGE"] = 21; + values[valuesById[12] = "DYNAMIC_RESOLUTION"] = 12; + values[valuesById[41] = "LATERAL_TOOL_TRANSFER"] = 41; + values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; + values[valuesById[54] = "CREATE_SNAPSHOT"] = 54; + values[valuesById[53] = "CLOUD_INFRASTRUCTURE_DISCOVERY"] = 53; + values[valuesById[43] = "OBTAIN_CAPABILITIES"] = 43; + values[valuesById[1] = "ACTIVE_SCANNING"] = 1; + values[valuesById[2] = "SCANNING_IP_BLOCKS"] = 2; + values[valuesById[60] = "CONTAINER_ADMINISTRATION_COMMAND"] = 60; + values[valuesById[61] = "ESCAPE_TO_HOST"] = 61; + values[valuesById[57] = "CONTAINER_AND_RESOURCE_DISCOVERY"] = 57; + values[valuesById[62] = "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES"] = 62; + return values; + })(); + + return MitreAttack; + })(); + + v1.Notebook = (function() { + + /** + * Properties of a Notebook. + * @memberof google.cloud.securitycenter.v1 + * @interface INotebook + * @property {string|null} [name] Notebook name + * @property {string|null} [service] Notebook service + * @property {string|null} [lastAuthor] Notebook lastAuthor + * @property {google.protobuf.ITimestamp|null} [notebookUpdateTime] Notebook notebookUpdateTime + */ + + /** + * Constructs a new Notebook. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Notebook. + * @implements INotebook + * @constructor + * @param {google.cloud.securitycenter.v1.INotebook=} [properties] Properties to set + */ + function Notebook(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Notebook name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Notebook + * @instance + */ + Notebook.prototype.name = ""; + + /** + * Notebook service. + * @member {string} service + * @memberof google.cloud.securitycenter.v1.Notebook + * @instance + */ + Notebook.prototype.service = ""; + + /** + * Notebook lastAuthor. + * @member {string} lastAuthor + * @memberof google.cloud.securitycenter.v1.Notebook + * @instance + */ + Notebook.prototype.lastAuthor = ""; + + /** + * Notebook notebookUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} notebookUpdateTime + * @memberof google.cloud.securitycenter.v1.Notebook + * @instance + */ + Notebook.prototype.notebookUpdateTime = null; + + /** + * Creates a new Notebook instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {google.cloud.securitycenter.v1.INotebook=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Notebook} Notebook instance + */ + Notebook.create = function create(properties) { + return new Notebook(properties); + }; + + /** + * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.securitycenter.v1.Notebook.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {google.cloud.securitycenter.v1.INotebook} message Notebook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notebook.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.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.lastAuthor != null && Object.hasOwnProperty.call(message, "lastAuthor")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.lastAuthor); + if (message.notebookUpdateTime != null && Object.hasOwnProperty.call(message, "notebookUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.notebookUpdateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Notebook.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {google.cloud.securitycenter.v1.INotebook} message Notebook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notebook.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Notebook message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Notebook} Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notebook.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Notebook(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.lastAuthor = reader.string(); + break; + } + case 4: { + message.notebookUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Notebook message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Notebook} Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notebook.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Notebook message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Notebook.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.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.lastAuthor != null && message.hasOwnProperty("lastAuthor")) + if (!$util.isString(message.lastAuthor)) + return "lastAuthor: string expected"; + if (message.notebookUpdateTime != null && message.hasOwnProperty("notebookUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.notebookUpdateTime); + if (error) + return "notebookUpdateTime." + error; + } + return null; + }; + + /** + * Creates a Notebook message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Notebook} Notebook + */ + Notebook.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Notebook) + return object; + var message = new $root.google.cloud.securitycenter.v1.Notebook(); + if (object.name != null) + message.name = String(object.name); + if (object.service != null) + message.service = String(object.service); + if (object.lastAuthor != null) + message.lastAuthor = String(object.lastAuthor); + if (object.notebookUpdateTime != null) { + if (typeof object.notebookUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Notebook.notebookUpdateTime: object expected"); + message.notebookUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.notebookUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from a Notebook message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {google.cloud.securitycenter.v1.Notebook} message Notebook + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Notebook.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.service = ""; + object.lastAuthor = ""; + object.notebookUpdateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.lastAuthor != null && message.hasOwnProperty("lastAuthor")) + object.lastAuthor = message.lastAuthor; + if (message.notebookUpdateTime != null && message.hasOwnProperty("notebookUpdateTime")) + object.notebookUpdateTime = $root.google.protobuf.Timestamp.toObject(message.notebookUpdateTime, options); + return object; + }; + + /** + * Converts this Notebook to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Notebook + * @instance + * @returns {Object.} JSON object + */ + Notebook.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Notebook + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Notebook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Notebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Notebook"; + }; + + return Notebook; + })(); + + v1.OrgPolicy = (function() { + + /** + * Properties of an OrgPolicy. + * @memberof google.cloud.securitycenter.v1 + * @interface IOrgPolicy + * @property {string|null} [name] OrgPolicy name + */ + + /** + * Constructs a new OrgPolicy. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an OrgPolicy. + * @implements IOrgPolicy + * @constructor + * @param {google.cloud.securitycenter.v1.IOrgPolicy=} [properties] Properties to set + */ + function OrgPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OrgPolicy name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @instance + */ + OrgPolicy.prototype.name = ""; + + /** + * Creates a new OrgPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {google.cloud.securitycenter.v1.IOrgPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrgPolicy} OrgPolicy instance + */ + OrgPolicy.create = function create(properties) { + return new OrgPolicy(properties); + }; + + /** + * Encodes the specified OrgPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.OrgPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {google.cloud.securitycenter.v1.IOrgPolicy} message OrgPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrgPolicy.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 OrgPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrgPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {google.cloud.securitycenter.v1.IOrgPolicy} message OrgPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrgPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrgPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrgPolicy} OrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrgPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.OrgPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrgPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrgPolicy} OrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrgPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrgPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrgPolicy.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 an OrgPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrgPolicy} OrgPolicy + */ + OrgPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrgPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrgPolicy(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an OrgPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {google.cloud.securitycenter.v1.OrgPolicy} message OrgPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrgPolicy.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 OrgPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @instance + * @returns {Object.} JSON object + */ + OrgPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrgPolicy + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.OrgPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrgPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.OrgPolicy"; + }; + + return OrgPolicy; + })(); + + v1.Process = (function() { + + /** + * 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 + * @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 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 + * @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); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); + 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, error) { + 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(); + if (tag === error) + break; + 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; + } + 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.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) + 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.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"); + 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 (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; + object.name = ""; + } + 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; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.val = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v1.EnvironmentVariable} message EnvironmentVariable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnvironmentVariable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.val = ""; + } + 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 EnvironmentVariable to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @instance + * @returns {Object.} JSON object + */ + EnvironmentVariable.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.SecurityPosture = (function() { + + /** + * Properties of a SecurityPosture. + * @memberof google.cloud.securitycenter.v1 + * @interface ISecurityPosture + * @property {string|null} [name] SecurityPosture name + * @property {string|null} [revisionId] SecurityPosture revisionId + * @property {string|null} [postureDeploymentResource] SecurityPosture postureDeploymentResource + * @property {string|null} [postureDeployment] SecurityPosture postureDeployment + * @property {string|null} [changedPolicy] SecurityPosture changedPolicy + * @property {string|null} [policySet] SecurityPosture policySet + * @property {string|null} [policy] SecurityPosture policy + * @property {Array.|null} [policyDriftDetails] SecurityPosture policyDriftDetails + */ + + /** + * Constructs a new SecurityPosture. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityPosture. + * @implements ISecurityPosture + * @constructor + * @param {google.cloud.securitycenter.v1.ISecurityPosture=} [properties] Properties to set + */ + function SecurityPosture(properties) { + this.policyDriftDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPosture name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + */ + SecurityPosture.prototype.name = ""; + + /** + * SecurityPosture revisionId. + * @member {string} revisionId + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + */ + SecurityPosture.prototype.revisionId = ""; + + /** + * SecurityPosture postureDeploymentResource. + * @member {string} postureDeploymentResource + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + */ + SecurityPosture.prototype.postureDeploymentResource = ""; + + /** + * SecurityPosture postureDeployment. + * @member {string} postureDeployment + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + */ + SecurityPosture.prototype.postureDeployment = ""; + + /** + * SecurityPosture changedPolicy. + * @member {string} changedPolicy + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + */ + SecurityPosture.prototype.changedPolicy = ""; + + /** + * SecurityPosture policySet. + * @member {string} policySet + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + */ + SecurityPosture.prototype.policySet = ""; + + /** + * SecurityPosture policy. + * @member {string} policy + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + */ + SecurityPosture.prototype.policy = ""; + + /** + * SecurityPosture policyDriftDetails. + * @member {Array.} policyDriftDetails + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + */ + SecurityPosture.prototype.policyDriftDetails = $util.emptyArray; + + /** + * Creates a new SecurityPosture instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {google.cloud.securitycenter.v1.ISecurityPosture=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityPosture} SecurityPosture instance + */ + SecurityPosture.create = function create(properties) { + return new SecurityPosture(properties); + }; + + /** + * Encodes the specified SecurityPosture message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {google.cloud.securitycenter.v1.ISecurityPosture} message SecurityPosture message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPosture.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + if (message.postureDeploymentResource != null && Object.hasOwnProperty.call(message, "postureDeploymentResource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.postureDeploymentResource); + if (message.postureDeployment != null && Object.hasOwnProperty.call(message, "postureDeployment")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.postureDeployment); + if (message.changedPolicy != null && Object.hasOwnProperty.call(message, "changedPolicy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.changedPolicy); + if (message.policySet != null && Object.hasOwnProperty.call(message, "policySet")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.policySet); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.policy); + if (message.policyDriftDetails != null && message.policyDriftDetails.length) + for (var i = 0; i < message.policyDriftDetails.length; ++i) + $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.encode(message.policyDriftDetails[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityPosture message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {google.cloud.securitycenter.v1.ISecurityPosture} message SecurityPosture message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPosture.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPosture message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SecurityPosture} SecurityPosture + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPosture.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityPosture(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + case 3: { + message.postureDeploymentResource = reader.string(); + break; + } + case 4: { + message.postureDeployment = reader.string(); + break; + } + case 5: { + message.changedPolicy = reader.string(); + break; + } + case 6: { + message.policySet = reader.string(); + break; + } + case 7: { + message.policy = reader.string(); + break; + } + case 8: { + if (!(message.policyDriftDetails && message.policyDriftDetails.length)) + message.policyDriftDetails = []; + message.policyDriftDetails.push($root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPosture message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SecurityPosture} SecurityPosture + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPosture.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPosture message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPosture.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.postureDeploymentResource != null && message.hasOwnProperty("postureDeploymentResource")) + if (!$util.isString(message.postureDeploymentResource)) + return "postureDeploymentResource: string expected"; + if (message.postureDeployment != null && message.hasOwnProperty("postureDeployment")) + if (!$util.isString(message.postureDeployment)) + return "postureDeployment: string expected"; + if (message.changedPolicy != null && message.hasOwnProperty("changedPolicy")) + if (!$util.isString(message.changedPolicy)) + return "changedPolicy: string expected"; + if (message.policySet != null && message.hasOwnProperty("policySet")) + if (!$util.isString(message.policySet)) + return "policySet: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) + if (!$util.isString(message.policy)) + return "policy: string expected"; + if (message.policyDriftDetails != null && message.hasOwnProperty("policyDriftDetails")) { + if (!Array.isArray(message.policyDriftDetails)) + return "policyDriftDetails: array expected"; + for (var i = 0; i < message.policyDriftDetails.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify(message.policyDriftDetails[i]); + if (error) + return "policyDriftDetails." + error; + } + } + return null; + }; + + /** + * Creates a SecurityPosture message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SecurityPosture} SecurityPosture + */ + SecurityPosture.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityPosture) + return object; + var message = new $root.google.cloud.securitycenter.v1.SecurityPosture(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.postureDeploymentResource != null) + message.postureDeploymentResource = String(object.postureDeploymentResource); + if (object.postureDeployment != null) + message.postureDeployment = String(object.postureDeployment); + if (object.changedPolicy != null) + message.changedPolicy = String(object.changedPolicy); + if (object.policySet != null) + message.policySet = String(object.policySet); + if (object.policy != null) + message.policy = String(object.policy); + if (object.policyDriftDetails) { + if (!Array.isArray(object.policyDriftDetails)) + throw TypeError(".google.cloud.securitycenter.v1.SecurityPosture.policyDriftDetails: array expected"); + message.policyDriftDetails = []; + for (var i = 0; i < object.policyDriftDetails.length; ++i) { + if (typeof object.policyDriftDetails[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SecurityPosture.policyDriftDetails: object expected"); + message.policyDriftDetails[i] = $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.fromObject(object.policyDriftDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SecurityPosture message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {google.cloud.securitycenter.v1.SecurityPosture} message SecurityPosture + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPosture.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policyDriftDetails = []; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + object.postureDeploymentResource = ""; + object.postureDeployment = ""; + object.changedPolicy = ""; + object.policySet = ""; + object.policy = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.postureDeploymentResource != null && message.hasOwnProperty("postureDeploymentResource")) + object.postureDeploymentResource = message.postureDeploymentResource; + if (message.postureDeployment != null && message.hasOwnProperty("postureDeployment")) + object.postureDeployment = message.postureDeployment; + if (message.changedPolicy != null && message.hasOwnProperty("changedPolicy")) + object.changedPolicy = message.changedPolicy; + if (message.policySet != null && message.hasOwnProperty("policySet")) + object.policySet = message.policySet; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = message.policy; + if (message.policyDriftDetails && message.policyDriftDetails.length) { + object.policyDriftDetails = []; + for (var j = 0; j < message.policyDriftDetails.length; ++j) + object.policyDriftDetails[j] = $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.toObject(message.policyDriftDetails[j], options); + } + return object; + }; + + /** + * Converts this SecurityPosture to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @instance + * @returns {Object.} JSON object + */ + SecurityPosture.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityPosture + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityPosture.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityPosture"; + }; + + SecurityPosture.PolicyDriftDetails = (function() { + + /** + * Properties of a PolicyDriftDetails. + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @interface IPolicyDriftDetails + * @property {string|null} [field] PolicyDriftDetails field + * @property {string|null} [expectedValue] PolicyDriftDetails expectedValue + * @property {string|null} [detectedValue] PolicyDriftDetails detectedValue + */ + + /** + * Constructs a new PolicyDriftDetails. + * @memberof google.cloud.securitycenter.v1.SecurityPosture + * @classdesc Represents a PolicyDriftDetails. + * @implements IPolicyDriftDetails + * @constructor + * @param {google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails=} [properties] Properties to set + */ + function PolicyDriftDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDriftDetails field. + * @member {string} field + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @instance + */ + PolicyDriftDetails.prototype.field = ""; + + /** + * PolicyDriftDetails expectedValue. + * @member {string} expectedValue + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @instance + */ + PolicyDriftDetails.prototype.expectedValue = ""; + + /** + * PolicyDriftDetails detectedValue. + * @member {string} detectedValue + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @instance + */ + PolicyDriftDetails.prototype.detectedValue = ""; + + /** + * Creates a new PolicyDriftDetails instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails instance + */ + PolicyDriftDetails.create = function create(properties) { + return new PolicyDriftDetails(properties); + }; + + /** + * Encodes the specified PolicyDriftDetails message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails} message PolicyDriftDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDriftDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.expectedValue != null && Object.hasOwnProperty.call(message, "expectedValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.expectedValue); + if (message.detectedValue != null && Object.hasOwnProperty.call(message, "detectedValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedValue); + return writer; + }; + + /** + * Encodes the specified PolicyDriftDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails} message PolicyDriftDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDriftDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDriftDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDriftDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.expectedValue = reader.string(); + break; + } + case 3: { + message.detectedValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDriftDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDriftDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDriftDetails message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDriftDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.expectedValue != null && message.hasOwnProperty("expectedValue")) + if (!$util.isString(message.expectedValue)) + return "expectedValue: string expected"; + if (message.detectedValue != null && message.hasOwnProperty("detectedValue")) + if (!$util.isString(message.detectedValue)) + return "detectedValue: string expected"; + return null; + }; + + /** + * Creates a PolicyDriftDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails + */ + PolicyDriftDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails) + return object; + var message = new $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails(); + if (object.field != null) + message.field = String(object.field); + if (object.expectedValue != null) + message.expectedValue = String(object.expectedValue); + if (object.detectedValue != null) + message.detectedValue = String(object.detectedValue); + return message; + }; + + /** + * Creates a plain object from a PolicyDriftDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} message PolicyDriftDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDriftDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.expectedValue = ""; + object.detectedValue = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.expectedValue != null && message.hasOwnProperty("expectedValue")) + object.expectedValue = message.expectedValue; + if (message.detectedValue != null && message.hasOwnProperty("detectedValue")) + object.detectedValue = message.detectedValue; + return object; + }; + + /** + * Converts this PolicyDriftDetails to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @instance + * @returns {Object.} JSON object + */ + PolicyDriftDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDriftDetails + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDriftDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails"; + }; + + return PolicyDriftDetails; + })(); + + return SecurityPosture; + })(); + + v1.ToxicCombination = (function() { + + /** + * Properties of a ToxicCombination. + * @memberof google.cloud.securitycenter.v1 + * @interface IToxicCombination + * @property {number|null} [attackExposureScore] ToxicCombination attackExposureScore + * @property {Array.|null} [relatedFindings] ToxicCombination relatedFindings + */ + + /** + * Constructs a new ToxicCombination. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ToxicCombination. + * @implements IToxicCombination + * @constructor + * @param {google.cloud.securitycenter.v1.IToxicCombination=} [properties] Properties to set + */ + function ToxicCombination(properties) { + this.relatedFindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToxicCombination attackExposureScore. + * @member {number} attackExposureScore + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @instance + */ + ToxicCombination.prototype.attackExposureScore = 0; + + /** + * ToxicCombination relatedFindings. + * @member {Array.} relatedFindings + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @instance + */ + ToxicCombination.prototype.relatedFindings = $util.emptyArray; + + /** + * Creates a new ToxicCombination instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v1.IToxicCombination=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination instance + */ + ToxicCombination.create = function create(properties) { + return new ToxicCombination(properties); + }; + + /** + * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v1.IToxicCombination} message ToxicCombination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToxicCombination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attackExposureScore != null && Object.hasOwnProperty.call(message, "attackExposureScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.attackExposureScore); + if (message.relatedFindings != null && message.relatedFindings.length) + for (var i = 0; i < message.relatedFindings.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.relatedFindings[i]); + return writer; + }; + + /** + * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v1.IToxicCombination} message ToxicCombination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToxicCombination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToxicCombination.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ToxicCombination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.attackExposureScore = reader.double(); + break; + } + case 2: { + if (!(message.relatedFindings && message.relatedFindings.length)) + message.relatedFindings = []; + message.relatedFindings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToxicCombination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToxicCombination message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToxicCombination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) + if (typeof message.attackExposureScore !== "number") + return "attackExposureScore: number expected"; + if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { + if (!Array.isArray(message.relatedFindings)) + return "relatedFindings: array expected"; + for (var i = 0; i < message.relatedFindings.length; ++i) + if (!$util.isString(message.relatedFindings[i])) + return "relatedFindings: string[] expected"; + } + return null; + }; + + /** + * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination + */ + ToxicCombination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ToxicCombination) + return object; + var message = new $root.google.cloud.securitycenter.v1.ToxicCombination(); + if (object.attackExposureScore != null) + message.attackExposureScore = Number(object.attackExposureScore); + if (object.relatedFindings) { + if (!Array.isArray(object.relatedFindings)) + throw TypeError(".google.cloud.securitycenter.v1.ToxicCombination.relatedFindings: array expected"); + message.relatedFindings = []; + for (var i = 0; i < object.relatedFindings.length; ++i) + message.relatedFindings[i] = String(object.relatedFindings[i]); + } + return message; + }; + + /** + * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v1.ToxicCombination} message ToxicCombination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToxicCombination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedFindings = []; + if (options.defaults) + object.attackExposureScore = 0; + if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) + object.attackExposureScore = options.json && !isFinite(message.attackExposureScore) ? String(message.attackExposureScore) : message.attackExposureScore; + if (message.relatedFindings && message.relatedFindings.length) { + object.relatedFindings = []; + for (var j = 0; j < message.relatedFindings.length; ++j) + object.relatedFindings[j] = message.relatedFindings[j]; + } + return object; + }; + + /** + * Converts this ToxicCombination to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @instance + * @returns {Object.} JSON object + */ + ToxicCombination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToxicCombination + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToxicCombination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ToxicCombination"; + }; + + return ToxicCombination; + })(); + + v1.Vulnerability = (function() { + + /** + * Properties of a Vulnerability. + * @memberof google.cloud.securitycenter.v1 + * @interface IVulnerability + * @property {google.cloud.securitycenter.v1.ICve|null} [cve] Vulnerability cve + * @property {google.cloud.securitycenter.v1.IPackage|null} [offendingPackage] Vulnerability offendingPackage + * @property {google.cloud.securitycenter.v1.IPackage|null} [fixedPackage] Vulnerability fixedPackage + * @property {google.cloud.securitycenter.v1.ISecurityBulletin|null} [securityBulletin] Vulnerability securityBulletin + */ + + /** + * 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; + + /** + * Vulnerability offendingPackage. + * @member {google.cloud.securitycenter.v1.IPackage|null|undefined} offendingPackage + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @instance + */ + Vulnerability.prototype.offendingPackage = null; + + /** + * Vulnerability fixedPackage. + * @member {google.cloud.securitycenter.v1.IPackage|null|undefined} fixedPackage + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @instance + */ + Vulnerability.prototype.fixedPackage = null; + + /** + * Vulnerability securityBulletin. + * @member {google.cloud.securitycenter.v1.ISecurityBulletin|null|undefined} securityBulletin + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @instance + */ + Vulnerability.prototype.securityBulletin = 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(); + if (message.offendingPackage != null && Object.hasOwnProperty.call(message, "offendingPackage")) + $root.google.cloud.securitycenter.v1.Package.encode(message.offendingPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fixedPackage != null && Object.hasOwnProperty.call(message, "fixedPackage")) + $root.google.cloud.securitycenter.v1.Package.encode(message.fixedPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.securityBulletin != null && Object.hasOwnProperty.call(message, "securityBulletin")) + $root.google.cloud.securitycenter.v1.SecurityBulletin.encode(message.securityBulletin, writer.uint32(/* id 4, wireType 2 =*/34).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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cve = $root.google.cloud.securitycenter.v1.Cve.decode(reader, reader.uint32()); + break; + } + case 2: { + message.offendingPackage = $root.google.cloud.securitycenter.v1.Package.decode(reader, reader.uint32()); + break; + } + case 3: { + message.fixedPackage = $root.google.cloud.securitycenter.v1.Package.decode(reader, reader.uint32()); + break; + } + case 4: { + message.securityBulletin = $root.google.cloud.securitycenter.v1.SecurityBulletin.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; + } + if (message.offendingPackage != null && message.hasOwnProperty("offendingPackage")) { + var error = $root.google.cloud.securitycenter.v1.Package.verify(message.offendingPackage); + if (error) + return "offendingPackage." + error; + } + if (message.fixedPackage != null && message.hasOwnProperty("fixedPackage")) { + var error = $root.google.cloud.securitycenter.v1.Package.verify(message.fixedPackage); + if (error) + return "fixedPackage." + error; + } + if (message.securityBulletin != null && message.hasOwnProperty("securityBulletin")) { + var error = $root.google.cloud.securitycenter.v1.SecurityBulletin.verify(message.securityBulletin); + if (error) + return "securityBulletin." + 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); + } + if (object.offendingPackage != null) { + if (typeof object.offendingPackage !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Vulnerability.offendingPackage: object expected"); + message.offendingPackage = $root.google.cloud.securitycenter.v1.Package.fromObject(object.offendingPackage); + } + if (object.fixedPackage != null) { + if (typeof object.fixedPackage !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Vulnerability.fixedPackage: object expected"); + message.fixedPackage = $root.google.cloud.securitycenter.v1.Package.fromObject(object.fixedPackage); + } + if (object.securityBulletin != null) { + if (typeof object.securityBulletin !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Vulnerability.securityBulletin: object expected"); + message.securityBulletin = $root.google.cloud.securitycenter.v1.SecurityBulletin.fromObject(object.securityBulletin); + } + 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; + object.offendingPackage = null; + object.fixedPackage = null; + object.securityBulletin = null; + } + if (message.cve != null && message.hasOwnProperty("cve")) + object.cve = $root.google.cloud.securitycenter.v1.Cve.toObject(message.cve, options); + if (message.offendingPackage != null && message.hasOwnProperty("offendingPackage")) + object.offendingPackage = $root.google.cloud.securitycenter.v1.Package.toObject(message.offendingPackage, options); + if (message.fixedPackage != null && message.hasOwnProperty("fixedPackage")) + object.fixedPackage = $root.google.cloud.securitycenter.v1.Package.toObject(message.fixedPackage, options); + if (message.securityBulletin != null && message.hasOwnProperty("securityBulletin")) + object.securityBulletin = $root.google.cloud.securitycenter.v1.SecurityBulletin.toObject(message.securityBulletin, 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); + }; + + /** + * 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; + })(); + + 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 + * @property {boolean|null} [upstreamFixAvailable] Cve upstreamFixAvailable + * @property {google.cloud.securitycenter.v1.Cve.RiskRating|null} [impact] Cve impact + * @property {google.cloud.securitycenter.v1.Cve.ExploitationActivity|null} [exploitationActivity] Cve exploitationActivity + * @property {boolean|null} [observedInTheWild] Cve observedInTheWild + * @property {boolean|null} [zeroDay] Cve zeroDay + * @property {google.protobuf.ITimestamp|null} [exploitReleaseDate] Cve exploitReleaseDate + */ + + /** + * 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; + + /** + * Cve upstreamFixAvailable. + * @member {boolean} upstreamFixAvailable + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.upstreamFixAvailable = false; + + /** + * Cve impact. + * @member {google.cloud.securitycenter.v1.Cve.RiskRating} impact + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.impact = 0; + + /** + * Cve exploitationActivity. + * @member {google.cloud.securitycenter.v1.Cve.ExploitationActivity} exploitationActivity + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.exploitationActivity = 0; + + /** + * Cve observedInTheWild. + * @member {boolean} observedInTheWild + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.observedInTheWild = false; + + /** + * Cve zeroDay. + * @member {boolean} zeroDay + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.zeroDay = false; + + /** + * Cve exploitReleaseDate. + * @member {google.protobuf.ITimestamp|null|undefined} exploitReleaseDate + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.exploitReleaseDate = 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(); + if (message.upstreamFixAvailable != null && Object.hasOwnProperty.call(message, "upstreamFixAvailable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.upstreamFixAvailable); + if (message.impact != null && Object.hasOwnProperty.call(message, "impact")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.impact); + if (message.exploitationActivity != null && Object.hasOwnProperty.call(message, "exploitationActivity")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.exploitationActivity); + if (message.observedInTheWild != null && Object.hasOwnProperty.call(message, "observedInTheWild")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.observedInTheWild); + if (message.zeroDay != null && Object.hasOwnProperty.call(message, "zeroDay")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.zeroDay); + if (message.exploitReleaseDate != null && Object.hasOwnProperty.call(message, "exploitReleaseDate")) + $root.google.protobuf.Timestamp.encode(message.exploitReleaseDate, writer.uint32(/* id 9, wireType 2 =*/74).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, error) { + 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(); + if (tag === error) + break; + 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 5: { + message.impact = reader.int32(); + break; + } + case 6: { + message.exploitationActivity = reader.int32(); + break; + } + case 7: { + message.observedInTheWild = reader.bool(); + break; + } + case 8: { + message.zeroDay = reader.bool(); + break; + } + case 9: { + message.exploitReleaseDate = $root.google.protobuf.Timestamp.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; + } + if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) + if (typeof message.upstreamFixAvailable !== "boolean") + return "upstreamFixAvailable: boolean expected"; + if (message.impact != null && message.hasOwnProperty("impact")) + switch (message.impact) { + default: + return "impact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.exploitationActivity != null && message.hasOwnProperty("exploitationActivity")) + switch (message.exploitationActivity) { + default: + return "exploitationActivity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.observedInTheWild != null && message.hasOwnProperty("observedInTheWild")) + if (typeof message.observedInTheWild !== "boolean") + return "observedInTheWild: boolean expected"; + if (message.zeroDay != null && message.hasOwnProperty("zeroDay")) + if (typeof message.zeroDay !== "boolean") + return "zeroDay: boolean expected"; + if (message.exploitReleaseDate != null && message.hasOwnProperty("exploitReleaseDate")) { + var error = $root.google.protobuf.Timestamp.verify(message.exploitReleaseDate); + if (error) + return "exploitReleaseDate." + 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); + } + if (object.upstreamFixAvailable != null) + message.upstreamFixAvailable = Boolean(object.upstreamFixAvailable); + switch (object.impact) { + default: + if (typeof object.impact === "number") { + message.impact = object.impact; + break; + } + break; + case "RISK_RATING_UNSPECIFIED": + case 0: + message.impact = 0; + break; + case "LOW": + case 1: + message.impact = 1; + break; + case "MEDIUM": + case 2: + message.impact = 2; + break; + case "HIGH": + case 3: + message.impact = 3; + break; + case "CRITICAL": + case 4: + message.impact = 4; + break; + } + switch (object.exploitationActivity) { + default: + if (typeof object.exploitationActivity === "number") { + message.exploitationActivity = object.exploitationActivity; + break; + } + break; + case "EXPLOITATION_ACTIVITY_UNSPECIFIED": + case 0: + message.exploitationActivity = 0; + break; + case "WIDE": + case 1: + message.exploitationActivity = 1; + break; + case "CONFIRMED": + case 2: + message.exploitationActivity = 2; + break; + case "AVAILABLE": + case 3: + message.exploitationActivity = 3; + break; + case "ANTICIPATED": + case 4: + message.exploitationActivity = 4; + break; + case "NO_KNOWN": + case 5: + message.exploitationActivity = 5; + break; + } + if (object.observedInTheWild != null) + message.observedInTheWild = Boolean(object.observedInTheWild); + if (object.zeroDay != null) + message.zeroDay = Boolean(object.zeroDay); + if (object.exploitReleaseDate != null) { + if (typeof object.exploitReleaseDate !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Cve.exploitReleaseDate: object expected"); + message.exploitReleaseDate = $root.google.protobuf.Timestamp.fromObject(object.exploitReleaseDate); + } + 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; + object.upstreamFixAvailable = false; + object.impact = options.enums === String ? "RISK_RATING_UNSPECIFIED" : 0; + object.exploitationActivity = options.enums === String ? "EXPLOITATION_ACTIVITY_UNSPECIFIED" : 0; + object.observedInTheWild = false; + object.zeroDay = false; + object.exploitReleaseDate = 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); + if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) + object.upstreamFixAvailable = message.upstreamFixAvailable; + if (message.impact != null && message.hasOwnProperty("impact")) + object.impact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cve.RiskRating[message.impact] === undefined ? message.impact : $root.google.cloud.securitycenter.v1.Cve.RiskRating[message.impact] : message.impact; + if (message.exploitationActivity != null && message.hasOwnProperty("exploitationActivity")) + object.exploitationActivity = options.enums === String ? $root.google.cloud.securitycenter.v1.Cve.ExploitationActivity[message.exploitationActivity] === undefined ? message.exploitationActivity : $root.google.cloud.securitycenter.v1.Cve.ExploitationActivity[message.exploitationActivity] : message.exploitationActivity; + if (message.observedInTheWild != null && message.hasOwnProperty("observedInTheWild")) + object.observedInTheWild = message.observedInTheWild; + if (message.zeroDay != null && message.hasOwnProperty("zeroDay")) + object.zeroDay = message.zeroDay; + if (message.exploitReleaseDate != null && message.hasOwnProperty("exploitReleaseDate")) + object.exploitReleaseDate = $root.google.protobuf.Timestamp.toObject(message.exploitReleaseDate, 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); + }; + + /** + * 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"; + }; + + /** + * RiskRating enum. + * @name google.cloud.securitycenter.v1.Cve.RiskRating + * @enum {number} + * @property {number} RISK_RATING_UNSPECIFIED=0 RISK_RATING_UNSPECIFIED value + * @property {number} LOW=1 LOW value + * @property {number} MEDIUM=2 MEDIUM value + * @property {number} HIGH=3 HIGH value + * @property {number} CRITICAL=4 CRITICAL value + */ + Cve.RiskRating = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RISK_RATING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOW"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + values[valuesById[3] = "HIGH"] = 3; + values[valuesById[4] = "CRITICAL"] = 4; + return values; + })(); + + /** + * ExploitationActivity enum. + * @name google.cloud.securitycenter.v1.Cve.ExploitationActivity + * @enum {number} + * @property {number} EXPLOITATION_ACTIVITY_UNSPECIFIED=0 EXPLOITATION_ACTIVITY_UNSPECIFIED value + * @property {number} WIDE=1 WIDE value + * @property {number} CONFIRMED=2 CONFIRMED value + * @property {number} AVAILABLE=3 AVAILABLE value + * @property {number} ANTICIPATED=4 ANTICIPATED value + * @property {number} NO_KNOWN=5 NO_KNOWN value + */ + Cve.ExploitationActivity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPLOITATION_ACTIVITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "WIDE"] = 1; + values[valuesById[2] = "CONFIRMED"] = 2; + values[valuesById[3] = "AVAILABLE"] = 3; + values[valuesById[4] = "ANTICIPATED"] = 4; + values[valuesById[5] = "NO_KNOWN"] = 5; + return values; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 + */ + Cvssv3.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + Cvssv3.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cvssv3 message. + * @function verify + * @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 + */ + Cvssv3.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 a Cvssv3 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 + */ + Cvssv3.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Cvssv3) + return object; + var message = new $root.google.cloud.securitycenter.v1.Cvssv3(); + 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; + 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; + } + switch (object.attackComplexity) { + default: + if (typeof object.attackComplexity === "number") { + message.attackComplexity = object.attackComplexity; + break; + } + break; + 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) { + default: + if (typeof object.privilegesRequired === "number") { + message.privilegesRequired = object.privilegesRequired; + break; + } + break; + 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) { + default: + if (typeof object.userInteraction === "number") { + message.userInteraction = object.userInteraction; + break; + } + break; + 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) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + 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) { + default: + if (typeof object.confidentialityImpact === "number") { + message.confidentialityImpact = object.confidentialityImpact; + break; + } + break; + 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) { + default: + if (typeof object.integrityImpact === "number") { + message.integrityImpact = object.integrityImpact; + break; + } + break; + 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) { + default: + if (typeof object.availabilityImpact === "number") { + message.availabilityImpact = object.availabilityImpact; + break; + } + break; + 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 a Cvssv3 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v1.Cvssv3} message Cvssv3 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cvssv3.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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] === 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] === 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] === 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] === 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] === 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] === 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] === 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] === undefined ? message.availabilityImpact : $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.availabilityImpact] : message.availabilityImpact; + return object; + }; + + /** + * Converts this Cvssv3 to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + * @returns {Object.} JSON object + */ + Cvssv3.prototype.toJSON = function toJSON() { + 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 + * @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.Package = (function() { + + /** + * Properties of a Package. + * @memberof google.cloud.securitycenter.v1 + * @interface IPackage + * @property {string|null} [packageName] Package packageName + * @property {string|null} [cpeUri] Package cpeUri + * @property {string|null} [packageType] Package packageType + * @property {string|null} [packageVersion] Package packageVersion + */ + + /** + * Constructs a new Package. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Package. + * @implements IPackage + * @constructor + * @param {google.cloud.securitycenter.v1.IPackage=} [properties] Properties to set + */ + function Package(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Package packageName. + * @member {string} packageName + * @memberof google.cloud.securitycenter.v1.Package + * @instance + */ + Package.prototype.packageName = ""; + + /** + * Package cpeUri. + * @member {string} cpeUri + * @memberof google.cloud.securitycenter.v1.Package + * @instance + */ + Package.prototype.cpeUri = ""; + + /** + * Package packageType. + * @member {string} packageType + * @memberof google.cloud.securitycenter.v1.Package + * @instance + */ + Package.prototype.packageType = ""; + + /** + * Package packageVersion. + * @member {string} packageVersion + * @memberof google.cloud.securitycenter.v1.Package + * @instance + */ + Package.prototype.packageVersion = ""; + + /** + * Creates a new Package instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {google.cloud.securitycenter.v1.IPackage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Package} Package instance + */ + Package.create = function create(properties) { + return new Package(properties); + }; + + /** + * Encodes the specified Package message. Does not implicitly {@link google.cloud.securitycenter.v1.Package.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {google.cloud.securitycenter.v1.IPackage} message Package message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Package.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.packageName); + if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cpeUri); + if (message.packageType != null && Object.hasOwnProperty.call(message, "packageType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.packageType); + if (message.packageVersion != null && Object.hasOwnProperty.call(message, "packageVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageVersion); + return writer; + }; + + /** + * Encodes the specified Package message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Package.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {google.cloud.securitycenter.v1.IPackage} message Package message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Package.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Package message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Package} Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Package.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Package(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.packageName = reader.string(); + break; + } + case 2: { + message.cpeUri = reader.string(); + break; + } + case 3: { + message.packageType = reader.string(); + break; + } + case 4: { + message.packageVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Package message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Package} Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Package.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Package message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Package.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageName != null && message.hasOwnProperty("packageName")) + if (!$util.isString(message.packageName)) + return "packageName: string expected"; + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + if (!$util.isString(message.cpeUri)) + return "cpeUri: string expected"; + if (message.packageType != null && message.hasOwnProperty("packageType")) + if (!$util.isString(message.packageType)) + return "packageType: string expected"; + if (message.packageVersion != null && message.hasOwnProperty("packageVersion")) + if (!$util.isString(message.packageVersion)) + return "packageVersion: string expected"; + return null; + }; + + /** + * Creates a Package message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Package} Package + */ + Package.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Package) + return object; + var message = new $root.google.cloud.securitycenter.v1.Package(); + if (object.packageName != null) + message.packageName = String(object.packageName); + if (object.cpeUri != null) + message.cpeUri = String(object.cpeUri); + if (object.packageType != null) + message.packageType = String(object.packageType); + if (object.packageVersion != null) + message.packageVersion = String(object.packageVersion); + return message; + }; + + /** + * Creates a plain object from a Package message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {google.cloud.securitycenter.v1.Package} message Package + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Package.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.packageName = ""; + object.cpeUri = ""; + object.packageType = ""; + object.packageVersion = ""; + } + if (message.packageName != null && message.hasOwnProperty("packageName")) + object.packageName = message.packageName; + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + object.cpeUri = message.cpeUri; + if (message.packageType != null && message.hasOwnProperty("packageType")) + object.packageType = message.packageType; + if (message.packageVersion != null && message.hasOwnProperty("packageVersion")) + object.packageVersion = message.packageVersion; + return object; + }; + + /** + * Converts this Package to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Package + * @instance + * @returns {Object.} JSON object + */ + Package.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Package + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Package + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Package.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Package"; + }; + + return Package; + })(); + + v1.SecurityBulletin = (function() { + + /** + * Properties of a SecurityBulletin. + * @memberof google.cloud.securitycenter.v1 + * @interface ISecurityBulletin + * @property {string|null} [bulletinId] SecurityBulletin bulletinId + * @property {google.protobuf.ITimestamp|null} [submissionTime] SecurityBulletin submissionTime + * @property {string|null} [suggestedUpgradeVersion] SecurityBulletin suggestedUpgradeVersion + */ + + /** + * Constructs a new SecurityBulletin. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityBulletin. + * @implements ISecurityBulletin + * @constructor + * @param {google.cloud.securitycenter.v1.ISecurityBulletin=} [properties] Properties to set + */ + function SecurityBulletin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityBulletin bulletinId. + * @member {string} bulletinId + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @instance + */ + SecurityBulletin.prototype.bulletinId = ""; + + /** + * SecurityBulletin submissionTime. + * @member {google.protobuf.ITimestamp|null|undefined} submissionTime + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @instance + */ + SecurityBulletin.prototype.submissionTime = null; + + /** + * SecurityBulletin suggestedUpgradeVersion. + * @member {string} suggestedUpgradeVersion + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @instance + */ + SecurityBulletin.prototype.suggestedUpgradeVersion = ""; + + /** + * Creates a new SecurityBulletin instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {google.cloud.securitycenter.v1.ISecurityBulletin=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityBulletin} SecurityBulletin instance + */ + SecurityBulletin.create = function create(properties) { + return new SecurityBulletin(properties); + }; + + /** + * Encodes the specified SecurityBulletin message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityBulletin.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {google.cloud.securitycenter.v1.ISecurityBulletin} message SecurityBulletin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityBulletin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bulletinId != null && Object.hasOwnProperty.call(message, "bulletinId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bulletinId); + if (message.submissionTime != null && Object.hasOwnProperty.call(message, "submissionTime")) + $root.google.protobuf.Timestamp.encode(message.submissionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.suggestedUpgradeVersion != null && Object.hasOwnProperty.call(message, "suggestedUpgradeVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.suggestedUpgradeVersion); + return writer; + }; + + /** + * Encodes the specified SecurityBulletin message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityBulletin.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {google.cloud.securitycenter.v1.ISecurityBulletin} message SecurityBulletin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityBulletin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityBulletin message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SecurityBulletin} SecurityBulletin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityBulletin.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityBulletin(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bulletinId = reader.string(); + break; + } + case 2: { + message.submissionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.suggestedUpgradeVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityBulletin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SecurityBulletin} SecurityBulletin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityBulletin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityBulletin message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityBulletin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bulletinId != null && message.hasOwnProperty("bulletinId")) + if (!$util.isString(message.bulletinId)) + return "bulletinId: string expected"; + if (message.submissionTime != null && message.hasOwnProperty("submissionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submissionTime); + if (error) + return "submissionTime." + error; + } + if (message.suggestedUpgradeVersion != null && message.hasOwnProperty("suggestedUpgradeVersion")) + if (!$util.isString(message.suggestedUpgradeVersion)) + return "suggestedUpgradeVersion: string expected"; + return null; + }; + + /** + * Creates a SecurityBulletin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SecurityBulletin} SecurityBulletin + */ + SecurityBulletin.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityBulletin) + return object; + var message = new $root.google.cloud.securitycenter.v1.SecurityBulletin(); + if (object.bulletinId != null) + message.bulletinId = String(object.bulletinId); + if (object.submissionTime != null) { + if (typeof object.submissionTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SecurityBulletin.submissionTime: object expected"); + message.submissionTime = $root.google.protobuf.Timestamp.fromObject(object.submissionTime); + } + if (object.suggestedUpgradeVersion != null) + message.suggestedUpgradeVersion = String(object.suggestedUpgradeVersion); + return message; + }; + + /** + * Creates a plain object from a SecurityBulletin message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {google.cloud.securitycenter.v1.SecurityBulletin} message SecurityBulletin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityBulletin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bulletinId = ""; + object.submissionTime = null; + object.suggestedUpgradeVersion = ""; + } + if (message.bulletinId != null && message.hasOwnProperty("bulletinId")) + object.bulletinId = message.bulletinId; + if (message.submissionTime != null && message.hasOwnProperty("submissionTime")) + object.submissionTime = $root.google.protobuf.Timestamp.toObject(message.submissionTime, options); + if (message.suggestedUpgradeVersion != null && message.hasOwnProperty("suggestedUpgradeVersion")) + object.suggestedUpgradeVersion = message.suggestedUpgradeVersion; + return object; + }; + + /** + * Converts this SecurityBulletin to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @instance + * @returns {Object.} JSON object + */ + SecurityBulletin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityBulletin + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SecurityBulletin + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityBulletin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityBulletin"; + }; + + return SecurityBulletin; + })(); + + v1.MuteConfig = (function() { + + /** + * Properties of a MuteConfig. + * @memberof google.cloud.securitycenter.v1 + * @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 + * @property {google.cloud.securitycenter.v1.MuteConfig.MuteConfigType|null} [type] MuteConfig type + * @property {google.protobuf.ITimestamp|null} [expiryTime] MuteConfig expiryTime + */ + + /** + * Constructs a new MuteConfig. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a MuteConfig. + * @implements IMuteConfig + * @constructor + * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set + */ + function MuteConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MuteConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.name = ""; + + /** + * MuteConfig displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.displayName = ""; + + /** + * MuteConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.description = ""; + + /** + * MuteConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.filter = ""; + + /** + * MuteConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.createTime = null; + + /** + * MuteConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.updateTime = null; + + /** + * MuteConfig mostRecentEditor. + * @member {string} mostRecentEditor + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.mostRecentEditor = ""; + + /** + * MuteConfig type. + * @member {google.cloud.securitycenter.v1.MuteConfig.MuteConfigType} type + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.type = 0; + + /** + * MuteConfig expiryTime. + * @member {google.protobuf.ITimestamp|null|undefined} expiryTime + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.expiryTime = null; + + /** + * Creates a new MuteConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig instance + */ + MuteConfig.create = function create(properties) { + return new MuteConfig(properties); + }; + + /** + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @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 + */ + 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 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); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * 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.MuteConfig + * @static + * @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 + */ + MuteConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MuteConfig message from the specified reader or buffer. + * @function decode + * @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.MuteConfig} MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MuteConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + MuteConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MuteConfig message. + * @function verify + * @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 + */ + MuteConfig.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.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"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); + if (error) + return "expiryTime." + error; + } + return null; + }; + + /** + * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig + */ + MuteConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.MuteConfig) + return object; + 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.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); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "MUTE_CONFIG_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STATIC": + case 1: + message.type = 1; + break; + case "DYNAMIC": + case 2: + message.type = 2; + break; + } + if (object.expiryTime != null) { + if (typeof object.expiryTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.MuteConfig.expiryTime: object expected"); + message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); + } + return message; + }; + + /** + * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {google.cloud.securitycenter.v1.MuteConfig} message MuteConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MuteConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.filter = ""; + object.createTime = null; + object.updateTime = null; + object.mostRecentEditor = ""; + object.type = options.enums === String ? "MUTE_CONFIG_TYPE_UNSPECIFIED" : 0; + object.expiryTime = 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.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; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.securitycenter.v1.MuteConfig.MuteConfigType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v1.MuteConfig.MuteConfigType[message.type] : message.type; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + return object; + }; + + /** + * Converts this MuteConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + * @returns {Object.} JSON object + */ + MuteConfig.prototype.toJSON = function toJSON() { + 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"; + }; + + /** + * MuteConfigType enum. + * @name google.cloud.securitycenter.v1.MuteConfig.MuteConfigType + * @enum {number} + * @property {number} MUTE_CONFIG_TYPE_UNSPECIFIED=0 MUTE_CONFIG_TYPE_UNSPECIFIED value + * @property {number} STATIC=1 STATIC value + * @property {number} DYNAMIC=2 DYNAMIC value + */ + MuteConfig.MuteConfigType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_CONFIG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATIC"] = 1; + values[valuesById[2] = "DYNAMIC"] = 2; + return values; + })(); + + return MuteConfig; + })(); + + v1.NotificationConfig = (function() { + + /** + * Properties of a NotificationConfig. + * @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 + */ + + /** + * Constructs a new NotificationConfig. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig + * @constructor + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + */ + function NotificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.name = ""; + + /** + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.description = ""; + + /** + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + 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; + + /** + * 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.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig instance + */ + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); + }; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @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 + */ + NotificationConfig.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.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 NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @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 + */ + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @function decode + * @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.NotificationConfig} NotificationConfig + * @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, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationConfig message. + * @function verify + * @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 + */ + 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.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 a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + */ + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig) + return object; + 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 NotificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1.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.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.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 NotificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + * @returns {Object.} JSON object + */ + NotificationConfig.prototype.toJSON = function toJSON() { + 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() { + + /** + * Properties of a StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @interface IStreamingConfig + * @property {string|null} [filter] StreamingConfig filter + */ + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 + */ + + /** + * 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 + */ + NotificationMessage.prototype.notificationConfigName = ""; + + /** + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + */ + 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; + + /** + * 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.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage instance + */ + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); + }; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @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 + */ + NotificationMessage.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(); + return writer; + }; + + /** + * 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.NotificationMessage + * @static + * @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 + */ + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer. + * @function decode + * @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.NotificationMessage} NotificationMessage + * @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, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + NotificationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationMessage message. + * @function verify + * @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 + */ + NotificationMessage.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; + { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + 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; + }; + + /** + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + */ + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationMessage) + 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); + } + return message; + }; + + /** + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1.NotificationMessage} message NotificationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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")) { + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + 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; + }; + + /** + * Converts this NotificationMessage to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + * @returns {Object.} JSON object + */ + NotificationMessage.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @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 {Array.|null} [folders] Resource folders + * @property {google.cloud.securitycenter.v1.CloudProvider|null} [cloudProvider] Resource cloudProvider + * @property {string|null} [organization] Resource organization + * @property {string|null} [service] Resource service + * @property {string|null} [location] Resource location + * @property {google.cloud.securitycenter.v1.IAwsMetadata|null} [awsMetadata] Resource awsMetadata + * @property {google.cloud.securitycenter.v1.IAzureMetadata|null} [azureMetadata] Resource azureMetadata + * @property {google.cloud.securitycenter.v1.IResourcePath|null} [resourcePath] Resource resourcePath + * @property {string|null} [resourcePathString] Resource resourcePathString + */ + + /** + * 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]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + 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 + * @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 = ""; + + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + + /** + * Resource cloudProvider. + * @member {google.cloud.securitycenter.v1.CloudProvider} cloudProvider + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.cloudProvider = 0; + + /** + * Resource organization. + * @member {string} organization + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.organization = ""; + + /** + * Resource service. + * @member {string} service + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.service = ""; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Resource awsMetadata. + * @member {google.cloud.securitycenter.v1.IAwsMetadata|null|undefined} awsMetadata + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.awsMetadata = null; + + /** + * Resource azureMetadata. + * @member {google.cloud.securitycenter.v1.IAzureMetadata|null|undefined} azureMetadata + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.azureMetadata = null; + + /** + * Resource resourcePath. + * @member {google.cloud.securitycenter.v1.IResourcePath|null|undefined} resourcePath + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.resourcePath = null; + + /** + * Resource resourcePathString. + * @member {string} resourcePathString + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.resourcePathString = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Resource cloudProviderMetadata. + * @member {"awsMetadata"|"azureMetadata"|undefined} cloudProviderMetadata + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Object.defineProperty(Resource.prototype, "cloudProviderMetadata", { + get: $util.oneOfGetter($oneOfFields = ["awsMetadata", "azureMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * 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); + 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.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.cloudProvider); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.organization); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.service); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.location); + if (message.awsMetadata != null && Object.hasOwnProperty.call(message, "awsMetadata")) + $root.google.cloud.securitycenter.v1.AwsMetadata.encode(message.awsMetadata, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.azureMetadata != null && Object.hasOwnProperty.call(message, "azureMetadata")) + $root.google.cloud.securitycenter.v1.AzureMetadata.encode(message.azureMetadata, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.resourcePath != null && Object.hasOwnProperty.call(message, "resourcePath")) + $root.google.cloud.securitycenter.v1.ResourcePath.encode(message.resourcePath, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.resourcePathString != null && Object.hasOwnProperty.call(message, "resourcePathString")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.resourcePathString); + 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, error) { + 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(); + if (tag === error) + break; + 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 9: { + message.cloudProvider = reader.int32(); + break; + } + case 10: { + message.organization = reader.string(); + break; + } + case 11: { + message.service = reader.string(); + break; + } + case 12: { + message.location = reader.string(); + break; + } + case 16: { + message.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.decode(reader, reader.uint32()); + break; + } + case 17: { + message.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.decode(reader, reader.uint32()); + break; + } + case 18: { + message.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.decode(reader, reader.uint32()); + break; + } + case 19: { + message.resourcePathString = 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"; + 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.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"; + 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.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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + switch (message.cloudProvider) { + default: + return "cloudProvider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v1.AwsMetadata.verify(message.awsMetadata); + if (error) + return "awsMetadata." + error; + } + } + if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { + if (properties.cloudProviderMetadata === 1) + return "cloudProviderMetadata: multiple values"; + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v1.AzureMetadata.verify(message.azureMetadata); + if (error) + return "azureMetadata." + error; + } + } + if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) { + var error = $root.google.cloud.securitycenter.v1.ResourcePath.verify(message.resourcePath); + if (error) + return "resourcePath." + error; + } + if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) + if (!$util.isString(message.resourcePathString)) + return "resourcePathString: 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.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) + 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.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]); + } + } + switch (object.cloudProvider) { + default: + if (typeof object.cloudProvider === "number") { + message.cloudProvider = object.cloudProvider; + break; + } + break; + case "CLOUD_PROVIDER_UNSPECIFIED": + case 0: + message.cloudProvider = 0; + break; + case "GOOGLE_CLOUD_PLATFORM": + case 1: + message.cloudProvider = 1; + break; + case "AMAZON_WEB_SERVICES": + case 2: + message.cloudProvider = 2; + break; + case "MICROSOFT_AZURE": + case 3: + message.cloudProvider = 3; + break; + } + if (object.organization != null) + message.organization = String(object.organization); + if (object.service != null) + message.service = String(object.service); + if (object.location != null) + message.location = String(object.location); + if (object.awsMetadata != null) { + if (typeof object.awsMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Resource.awsMetadata: object expected"); + message.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.fromObject(object.awsMetadata); + } + if (object.azureMetadata != null) { + if (typeof object.azureMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Resource.azureMetadata: object expected"); + message.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.fromObject(object.azureMetadata); + } + if (object.resourcePath != null) { + if (typeof object.resourcePath !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Resource.resourcePath: object expected"); + message.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.fromObject(object.resourcePath); + } + if (object.resourcePathString != null) + message.resourcePathString = String(object.resourcePathString); + 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.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.name = ""; + object.project = ""; + object.projectDisplayName = ""; + object.parent = ""; + object.parentDisplayName = ""; + object.type = ""; + object.displayName = ""; + object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; + object.organization = ""; + object.service = ""; + object.location = ""; + object.resourcePath = null; + object.resourcePathString = ""; + } + 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.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] : message.cloudProvider; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { + object.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.toObject(message.awsMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "awsMetadata"; + } + if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { + object.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.toObject(message.azureMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "azureMetadata"; + } + if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) + object.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.toObject(message.resourcePath, options); + if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) + object.resourcePathString = message.resourcePathString; + 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); + }; + + /** + * 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; + })(); + + /** + * CloudProvider enum. + * @name google.cloud.securitycenter.v1.CloudProvider + * @enum {number} + * @property {number} CLOUD_PROVIDER_UNSPECIFIED=0 CLOUD_PROVIDER_UNSPECIFIED value + * @property {number} GOOGLE_CLOUD_PLATFORM=1 GOOGLE_CLOUD_PLATFORM value + * @property {number} AMAZON_WEB_SERVICES=2 AMAZON_WEB_SERVICES value + * @property {number} MICROSOFT_AZURE=3 MICROSOFT_AZURE value + */ + v1.CloudProvider = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLOUD_PROVIDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_CLOUD_PLATFORM"] = 1; + values[valuesById[2] = "AMAZON_WEB_SERVICES"] = 2; + values[valuesById[3] = "MICROSOFT_AZURE"] = 3; + return values; + })(); + + v1.AwsMetadata = (function() { + + /** + * Properties of an AwsMetadata. + * @memberof google.cloud.securitycenter.v1 + * @interface IAwsMetadata + * @property {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization|null} [organization] AwsMetadata organization + * @property {Array.|null} [organizationalUnits] AwsMetadata organizationalUnits + * @property {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount|null} [account] AwsMetadata account + */ + + /** + * Constructs a new AwsMetadata. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an AwsMetadata. + * @implements IAwsMetadata + * @constructor + * @param {google.cloud.securitycenter.v1.IAwsMetadata=} [properties] Properties to set + */ + function AwsMetadata(properties) { + this.organizationalUnits = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsMetadata organization. + * @member {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization|null|undefined} organization + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @instance + */ + AwsMetadata.prototype.organization = null; + + /** + * AwsMetadata organizationalUnits. + * @member {Array.} organizationalUnits + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @instance + */ + AwsMetadata.prototype.organizationalUnits = $util.emptyArray; + + /** + * AwsMetadata account. + * @member {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount|null|undefined} account + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @instance + */ + AwsMetadata.prototype.account = null; + + /** + * Creates a new AwsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {google.cloud.securitycenter.v1.IAwsMetadata=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AwsMetadata} AwsMetadata instance + */ + AwsMetadata.create = function create(properties) { + return new AwsMetadata(properties); + }; + + /** + * Encodes the specified AwsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {google.cloud.securitycenter.v1.IAwsMetadata} message AwsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.encode(message.organization, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.organizationalUnits != null && message.organizationalUnits.length) + for (var i = 0; i < message.organizationalUnits.length; ++i) + $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.encode(message.organizationalUnits[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.encode(message.account, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AwsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {google.cloud.securitycenter.v1.IAwsMetadata} message AwsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AwsMetadata} AwsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AwsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.organization = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.organizationalUnits && message.organizationalUnits.length)) + message.organizationalUnits = []; + message.organizationalUnits.push($root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.decode(reader, reader.uint32())); + break; + } + case 4: { + message.account = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AwsMetadata} AwsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsMetadata message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organization != null && message.hasOwnProperty("organization")) { + var error = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify(message.organization); + if (error) + return "organization." + error; + } + if (message.organizationalUnits != null && message.hasOwnProperty("organizationalUnits")) { + if (!Array.isArray(message.organizationalUnits)) + return "organizationalUnits: array expected"; + for (var i = 0; i < message.organizationalUnits.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify(message.organizationalUnits[i]); + if (error) + return "organizationalUnits." + error; + } + } + if (message.account != null && message.hasOwnProperty("account")) { + var error = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify(message.account); + if (error) + return "account." + error; + } + return null; + }; + + /** + * Creates an AwsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AwsMetadata} AwsMetadata + */ + AwsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AwsMetadata) + return object; + var message = new $root.google.cloud.securitycenter.v1.AwsMetadata(); + if (object.organization != null) { + if (typeof object.organization !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AwsMetadata.organization: object expected"); + message.organization = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.fromObject(object.organization); + } + if (object.organizationalUnits) { + if (!Array.isArray(object.organizationalUnits)) + throw TypeError(".google.cloud.securitycenter.v1.AwsMetadata.organizationalUnits: array expected"); + message.organizationalUnits = []; + for (var i = 0; i < object.organizationalUnits.length; ++i) { + if (typeof object.organizationalUnits[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AwsMetadata.organizationalUnits: object expected"); + message.organizationalUnits[i] = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.fromObject(object.organizationalUnits[i]); + } + } + if (object.account != null) { + if (typeof object.account !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AwsMetadata.account: object expected"); + message.account = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.fromObject(object.account); + } + return message; + }; + + /** + * Creates a plain object from an AwsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata} message AwsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.organizationalUnits = []; + if (options.defaults) { + object.organization = null; + object.account = null; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.toObject(message.organization, options); + if (message.organizationalUnits && message.organizationalUnits.length) { + object.organizationalUnits = []; + for (var j = 0; j < message.organizationalUnits.length; ++j) + object.organizationalUnits[j] = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.toObject(message.organizationalUnits[j], options); + } + if (message.account != null && message.hasOwnProperty("account")) + object.account = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.toObject(message.account, options); + return object; + }; + + /** + * Converts this AwsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @instance + * @returns {Object.} JSON object + */ + AwsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsMetadata + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AwsMetadata"; + }; + + AwsMetadata.AwsOrganization = (function() { + + /** + * Properties of an AwsOrganization. + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @interface IAwsOrganization + * @property {string|null} [id] AwsOrganization id + */ + + /** + * Constructs a new AwsOrganization. + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @classdesc Represents an AwsOrganization. + * @implements IAwsOrganization + * @constructor + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization=} [properties] Properties to set + */ + function AwsOrganization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsOrganization id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @instance + */ + AwsOrganization.prototype.id = ""; + + /** + * Creates a new AwsOrganization instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} AwsOrganization instance + */ + AwsOrganization.create = function create(properties) { + return new AwsOrganization(properties); + }; + + /** + * Encodes the specified AwsOrganization message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization} message AwsOrganization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsOrganization.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); + return writer; + }; + + /** + * Encodes the specified AwsOrganization message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization} message AwsOrganization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsOrganization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsOrganization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} AwsOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsOrganization.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsOrganization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} AwsOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsOrganization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsOrganization message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsOrganization.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"; + return null; + }; + + /** + * Creates an AwsOrganization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} AwsOrganization + */ + AwsOrganization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization) + return object; + var message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization(); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from an AwsOrganization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} message AwsOrganization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsOrganization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this AwsOrganization to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @instance + * @returns {Object.} JSON object + */ + AwsOrganization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsOrganization + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsOrganization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization"; + }; + + return AwsOrganization; + })(); + + AwsMetadata.AwsOrganizationalUnit = (function() { + + /** + * Properties of an AwsOrganizationalUnit. + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @interface IAwsOrganizationalUnit + * @property {string|null} [id] AwsOrganizationalUnit id + * @property {string|null} [name] AwsOrganizationalUnit name + */ + + /** + * Constructs a new AwsOrganizationalUnit. + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @classdesc Represents an AwsOrganizationalUnit. + * @implements IAwsOrganizationalUnit + * @constructor + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit=} [properties] Properties to set + */ + function AwsOrganizationalUnit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsOrganizationalUnit id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @instance + */ + AwsOrganizationalUnit.prototype.id = ""; + + /** + * AwsOrganizationalUnit name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @instance + */ + AwsOrganizationalUnit.prototype.name = ""; + + /** + * Creates a new AwsOrganizationalUnit instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit instance + */ + AwsOrganizationalUnit.create = function create(properties) { + return new AwsOrganizationalUnit(properties); + }; + + /** + * Encodes the specified AwsOrganizationalUnit message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit} message AwsOrganizationalUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsOrganizationalUnit.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified AwsOrganizationalUnit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit} message AwsOrganizationalUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsOrganizationalUnit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsOrganizationalUnit message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsOrganizationalUnit.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsOrganizationalUnit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsOrganizationalUnit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsOrganizationalUnit message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsOrganizationalUnit.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an AwsOrganizationalUnit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit + */ + AwsOrganizationalUnit.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit) + return object; + var message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AwsOrganizationalUnit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} message AwsOrganizationalUnit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsOrganizationalUnit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this AwsOrganizationalUnit to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @instance + * @returns {Object.} JSON object + */ + AwsOrganizationalUnit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsOrganizationalUnit + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsOrganizationalUnit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit"; + }; + + return AwsOrganizationalUnit; + })(); + + AwsMetadata.AwsAccount = (function() { + + /** + * Properties of an AwsAccount. + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @interface IAwsAccount + * @property {string|null} [id] AwsAccount id + * @property {string|null} [name] AwsAccount name + */ + + /** + * Constructs a new AwsAccount. + * @memberof google.cloud.securitycenter.v1.AwsMetadata + * @classdesc Represents an AwsAccount. + * @implements IAwsAccount + * @constructor + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount=} [properties] Properties to set + */ + function AwsAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsAccount id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @instance + */ + AwsAccount.prototype.id = ""; + + /** + * AwsAccount name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @instance + */ + AwsAccount.prototype.name = ""; + + /** + * Creates a new AwsAccount instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} AwsAccount instance + */ + AwsAccount.create = function create(properties) { + return new AwsAccount(properties); + }; + + /** + * Encodes the specified AwsAccount message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount} message AwsAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsAccount.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified AwsAccount message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount} message AwsAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} AwsAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsAccount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} AwsAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsAccount message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsAccount.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an AwsAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} AwsAccount + */ + AwsAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount) + return object; + var message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AwsAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} message AwsAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this AwsAccount to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @instance + * @returns {Object.} JSON object + */ + AwsAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsAccount + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AwsMetadata.AwsAccount"; + }; + + return AwsAccount; + })(); + + return AwsMetadata; + })(); + + v1.AzureMetadata = (function() { + + /** + * Properties of an AzureMetadata. + * @memberof google.cloud.securitycenter.v1 + * @interface IAzureMetadata + * @property {Array.|null} [managementGroups] AzureMetadata managementGroups + * @property {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription|null} [subscription] AzureMetadata subscription + * @property {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup|null} [resourceGroup] AzureMetadata resourceGroup + */ + + /** + * Constructs a new AzureMetadata. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an AzureMetadata. + * @implements IAzureMetadata + * @constructor + * @param {google.cloud.securitycenter.v1.IAzureMetadata=} [properties] Properties to set + */ + function AzureMetadata(properties) { + this.managementGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureMetadata managementGroups. + * @member {Array.} managementGroups + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @instance + */ + AzureMetadata.prototype.managementGroups = $util.emptyArray; + + /** + * AzureMetadata subscription. + * @member {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription|null|undefined} subscription + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @instance + */ + AzureMetadata.prototype.subscription = null; + + /** + * AzureMetadata resourceGroup. + * @member {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup|null|undefined} resourceGroup + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @instance + */ + AzureMetadata.prototype.resourceGroup = null; + + /** + * Creates a new AzureMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {google.cloud.securitycenter.v1.IAzureMetadata=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AzureMetadata} AzureMetadata instance + */ + AzureMetadata.create = function create(properties) { + return new AzureMetadata(properties); + }; + + /** + * Encodes the specified AzureMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {google.cloud.securitycenter.v1.IAzureMetadata} message AzureMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.managementGroups != null && message.managementGroups.length) + for (var i = 0; i < message.managementGroups.length; ++i) + $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.encode(message.managementGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.encode(message.subscription, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.resourceGroup != null && Object.hasOwnProperty.call(message, "resourceGroup")) + $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.encode(message.resourceGroup, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AzureMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {google.cloud.securitycenter.v1.IAzureMetadata} message AzureMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AzureMetadata} AzureMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AzureMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + if (!(message.managementGroups && message.managementGroups.length)) + message.managementGroups = []; + message.managementGroups.push($root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.decode(reader, reader.uint32())); + break; + } + case 5: { + message.subscription = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.decode(reader, reader.uint32()); + break; + } + case 6: { + message.resourceGroup = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AzureMetadata} AzureMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureMetadata message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.managementGroups != null && message.hasOwnProperty("managementGroups")) { + if (!Array.isArray(message.managementGroups)) + return "managementGroups: array expected"; + for (var i = 0; i < message.managementGroups.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify(message.managementGroups[i]); + if (error) + return "managementGroups." + error; + } + } + if (message.subscription != null && message.hasOwnProperty("subscription")) { + var error = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify(message.subscription); + if (error) + return "subscription." + error; + } + if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) { + var error = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify(message.resourceGroup); + if (error) + return "resourceGroup." + error; + } + return null; + }; + + /** + * Creates an AzureMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AzureMetadata} AzureMetadata + */ + AzureMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AzureMetadata) + return object; + var message = new $root.google.cloud.securitycenter.v1.AzureMetadata(); + if (object.managementGroups) { + if (!Array.isArray(object.managementGroups)) + throw TypeError(".google.cloud.securitycenter.v1.AzureMetadata.managementGroups: array expected"); + message.managementGroups = []; + for (var i = 0; i < object.managementGroups.length; ++i) { + if (typeof object.managementGroups[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AzureMetadata.managementGroups: object expected"); + message.managementGroups[i] = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.fromObject(object.managementGroups[i]); + } + } + if (object.subscription != null) { + if (typeof object.subscription !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AzureMetadata.subscription: object expected"); + message.subscription = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.fromObject(object.subscription); + } + if (object.resourceGroup != null) { + if (typeof object.resourceGroup !== "object") + throw TypeError(".google.cloud.securitycenter.v1.AzureMetadata.resourceGroup: object expected"); + message.resourceGroup = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.fromObject(object.resourceGroup); + } + return message; + }; + + /** + * Creates a plain object from an AzureMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata} message AzureMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.managementGroups = []; + if (options.defaults) { + object.subscription = null; + object.resourceGroup = null; + } + if (message.managementGroups && message.managementGroups.length) { + object.managementGroups = []; + for (var j = 0; j < message.managementGroups.length; ++j) + object.managementGroups[j] = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.toObject(message.managementGroups[j], options); + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.toObject(message.subscription, options); + if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) + object.resourceGroup = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.toObject(message.resourceGroup, options); + return object; + }; + + /** + * Converts this AzureMetadata to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @instance + * @returns {Object.} JSON object + */ + AzureMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureMetadata + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AzureMetadata"; + }; + + AzureMetadata.AzureManagementGroup = (function() { + + /** + * Properties of an AzureManagementGroup. + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @interface IAzureManagementGroup + * @property {string|null} [id] AzureManagementGroup id + * @property {string|null} [displayName] AzureManagementGroup displayName + */ + + /** + * Constructs a new AzureManagementGroup. + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @classdesc Represents an AzureManagementGroup. + * @implements IAzureManagementGroup + * @constructor + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup=} [properties] Properties to set + */ + function AzureManagementGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureManagementGroup id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @instance + */ + AzureManagementGroup.prototype.id = ""; + + /** + * AzureManagementGroup displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @instance + */ + AzureManagementGroup.prototype.displayName = ""; + + /** + * Creates a new AzureManagementGroup instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} AzureManagementGroup instance + */ + AzureManagementGroup.create = function create(properties) { + return new AzureManagementGroup(properties); + }; + + /** + * Encodes the specified AzureManagementGroup message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup} message AzureManagementGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureManagementGroup.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AzureManagementGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup} message AzureManagementGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureManagementGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureManagementGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} AzureManagementGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureManagementGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureManagementGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} AzureManagementGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureManagementGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureManagementGroup message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureManagementGroup.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AzureManagementGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} AzureManagementGroup + */ + AzureManagementGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup) + return object; + var message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AzureManagementGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} message AzureManagementGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureManagementGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AzureManagementGroup to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @instance + * @returns {Object.} JSON object + */ + AzureManagementGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureManagementGroup + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureManagementGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup"; + }; + + return AzureManagementGroup; + })(); + + AzureMetadata.AzureSubscription = (function() { + + /** + * Properties of an AzureSubscription. + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @interface IAzureSubscription + * @property {string|null} [id] AzureSubscription id + * @property {string|null} [displayName] AzureSubscription displayName + */ + + /** + * Constructs a new AzureSubscription. + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @classdesc Represents an AzureSubscription. + * @implements IAzureSubscription + * @constructor + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription=} [properties] Properties to set + */ + function AzureSubscription(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureSubscription id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @instance + */ + AzureSubscription.prototype.id = ""; + + /** + * AzureSubscription displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @instance + */ + AzureSubscription.prototype.displayName = ""; + + /** + * Creates a new AzureSubscription instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} AzureSubscription instance + */ + AzureSubscription.create = function create(properties) { + return new AzureSubscription(properties); + }; + + /** + * Encodes the specified AzureSubscription message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription} message AzureSubscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureSubscription.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AzureSubscription message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription} message AzureSubscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureSubscription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureSubscription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} AzureSubscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureSubscription.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureSubscription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} AzureSubscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureSubscription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureSubscription message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureSubscription.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AzureSubscription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} AzureSubscription + */ + AzureSubscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription) + return object; + var message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AzureSubscription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} message AzureSubscription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureSubscription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AzureSubscription to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @instance + * @returns {Object.} JSON object + */ + AzureSubscription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureSubscription + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureSubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription"; + }; + + return AzureSubscription; + })(); + + AzureMetadata.AzureResourceGroup = (function() { + + /** + * Properties of an AzureResourceGroup. + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @interface IAzureResourceGroup + * @property {string|null} [name] AzureResourceGroup name + */ + + /** + * Constructs a new AzureResourceGroup. + * @memberof google.cloud.securitycenter.v1.AzureMetadata + * @classdesc Represents an AzureResourceGroup. + * @implements IAzureResourceGroup + * @constructor + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup=} [properties] Properties to set + */ + function AzureResourceGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureResourceGroup name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @instance + */ + AzureResourceGroup.prototype.name = ""; + + /** + * Creates a new AzureResourceGroup instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} AzureResourceGroup instance + */ + AzureResourceGroup.create = function create(properties) { + return new AzureResourceGroup(properties); + }; + + /** + * Encodes the specified AzureResourceGroup message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup} message AzureResourceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureResourceGroup.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 AzureResourceGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup} message AzureResourceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureResourceGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureResourceGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} AzureResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureResourceGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureResourceGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} AzureResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureResourceGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureResourceGroup message. + * @function verify + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureResourceGroup.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 an AzureResourceGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} AzureResourceGroup + */ + AzureResourceGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup) + return object; + var message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AzureResourceGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} message AzureResourceGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureResourceGroup.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 AzureResourceGroup to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @instance + * @returns {Object.} JSON object + */ + AzureResourceGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureResourceGroup + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureResourceGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup"; + }; + + return AzureResourceGroup; + })(); + + return AzureMetadata; + })(); + + v1.ResourcePath = (function() { + + /** + * Properties of a ResourcePath. + * @memberof google.cloud.securitycenter.v1 + * @interface IResourcePath + * @property {Array.|null} [nodes] ResourcePath nodes + */ + + /** + * Constructs a new ResourcePath. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ResourcePath. + * @implements IResourcePath + * @constructor + * @param {google.cloud.securitycenter.v1.IResourcePath=} [properties] Properties to set + */ + function ResourcePath(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]]; + } + + /** + * ResourcePath nodes. + * @member {Array.} nodes + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @instance + */ + ResourcePath.prototype.nodes = $util.emptyArray; + + /** + * Creates a new ResourcePath instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {google.cloud.securitycenter.v1.IResourcePath=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ResourcePath} ResourcePath instance + */ + ResourcePath.create = function create(properties) { + return new ResourcePath(properties); + }; + + /** + * Encodes the specified ResourcePath message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {google.cloud.securitycenter.v1.IResourcePath} message ResourcePath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePath.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourcePath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {google.cloud.securitycenter.v1.IResourcePath} message ResourcePath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePath message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ResourcePath} ResourcePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePath.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourcePath(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ResourcePath} ResourcePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePath message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePath.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.ResourcePath.ResourcePathNode.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ResourcePath} ResourcePath + */ + ResourcePath.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ResourcePath) + return object; + var message = new $root.google.cloud.securitycenter.v1.ResourcePath(); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.securitycenter.v1.ResourcePath.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.ResourcePath.nodes: object expected"); + message.nodes[i] = $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.fromObject(object.nodes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResourcePath message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {google.cloud.securitycenter.v1.ResourcePath} message ResourcePath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePath.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + 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.ResourcePath.ResourcePathNode.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this ResourcePath to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @instance + * @returns {Object.} JSON object + */ + ResourcePath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourcePath + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourcePath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourcePath"; + }; + + /** + * ResourcePathNodeType enum. + * @name google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType + * @enum {number} + * @property {number} RESOURCE_PATH_NODE_TYPE_UNSPECIFIED=0 RESOURCE_PATH_NODE_TYPE_UNSPECIFIED value + * @property {number} GCP_ORGANIZATION=1 GCP_ORGANIZATION value + * @property {number} GCP_FOLDER=2 GCP_FOLDER value + * @property {number} GCP_PROJECT=3 GCP_PROJECT value + * @property {number} AWS_ORGANIZATION=4 AWS_ORGANIZATION value + * @property {number} AWS_ORGANIZATIONAL_UNIT=5 AWS_ORGANIZATIONAL_UNIT value + * @property {number} AWS_ACCOUNT=6 AWS_ACCOUNT value + * @property {number} AZURE_MANAGEMENT_GROUP=7 AZURE_MANAGEMENT_GROUP value + * @property {number} AZURE_SUBSCRIPTION=8 AZURE_SUBSCRIPTION value + * @property {number} AZURE_RESOURCE_GROUP=9 AZURE_RESOURCE_GROUP value + */ + ResourcePath.ResourcePathNodeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GCP_ORGANIZATION"] = 1; + values[valuesById[2] = "GCP_FOLDER"] = 2; + values[valuesById[3] = "GCP_PROJECT"] = 3; + values[valuesById[4] = "AWS_ORGANIZATION"] = 4; + values[valuesById[5] = "AWS_ORGANIZATIONAL_UNIT"] = 5; + values[valuesById[6] = "AWS_ACCOUNT"] = 6; + values[valuesById[7] = "AZURE_MANAGEMENT_GROUP"] = 7; + values[valuesById[8] = "AZURE_SUBSCRIPTION"] = 8; + values[valuesById[9] = "AZURE_RESOURCE_GROUP"] = 9; + return values; + })(); + + ResourcePath.ResourcePathNode = (function() { + + /** + * Properties of a ResourcePathNode. + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @interface IResourcePathNode + * @property {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType|null} [nodeType] ResourcePathNode nodeType + * @property {string|null} [id] ResourcePathNode id + * @property {string|null} [displayName] ResourcePathNode displayName + */ + + /** + * Constructs a new ResourcePathNode. + * @memberof google.cloud.securitycenter.v1.ResourcePath + * @classdesc Represents a ResourcePathNode. + * @implements IResourcePathNode + * @constructor + * @param {google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode=} [properties] Properties to set + */ + function ResourcePathNode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePathNode nodeType. + * @member {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType} nodeType + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @instance + */ + ResourcePathNode.prototype.nodeType = 0; + + /** + * ResourcePathNode id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @instance + */ + ResourcePathNode.prototype.id = ""; + + /** + * ResourcePathNode displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @instance + */ + ResourcePathNode.prototype.displayName = ""; + + /** + * Creates a new ResourcePathNode instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} ResourcePathNode instance + */ + ResourcePathNode.create = function create(properties) { + return new ResourcePathNode(properties); + }; + + /** + * Encodes the specified ResourcePathNode message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode} message ResourcePathNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePathNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeType); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ResourcePathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode} message ResourcePathNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePathNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePathNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} ResourcePathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePathNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodeType = reader.int32(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePathNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} ResourcePathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePathNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePathNode message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePathNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeType != null && message.hasOwnProperty("nodeType")) + switch (message.nodeType) { + default: + return "nodeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a ResourcePathNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} ResourcePathNode + */ + ResourcePathNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode) + return object; + var message = new $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode(); + switch (object.nodeType) { + default: + if (typeof object.nodeType === "number") { + message.nodeType = object.nodeType; + break; + } + break; + case "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED": + case 0: + message.nodeType = 0; + break; + case "GCP_ORGANIZATION": + case 1: + message.nodeType = 1; + break; + case "GCP_FOLDER": + case 2: + message.nodeType = 2; + break; + case "GCP_PROJECT": + case 3: + message.nodeType = 3; + break; + case "AWS_ORGANIZATION": + case 4: + message.nodeType = 4; + break; + case "AWS_ORGANIZATIONAL_UNIT": + case 5: + message.nodeType = 5; + break; + case "AWS_ACCOUNT": + case 6: + message.nodeType = 6; + break; + case "AZURE_MANAGEMENT_GROUP": + case 7: + message.nodeType = 7; + break; + case "AZURE_SUBSCRIPTION": + case 8: + message.nodeType = 8; + break; + case "AZURE_RESOURCE_GROUP": + case 9: + message.nodeType = 9; + break; + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a ResourcePathNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} message ResourcePathNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePathNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeType = options.enums === String ? "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" : 0; + object.id = ""; + object.displayName = ""; + } + if (message.nodeType != null && message.hasOwnProperty("nodeType")) + object.nodeType = options.enums === String ? $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType[message.nodeType] === undefined ? message.nodeType : $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType[message.nodeType] : message.nodeType; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ResourcePathNode to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @instance + * @returns {Object.} JSON object + */ + ResourcePathNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourcePathNode + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourcePathNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode"; + }; + + return ResourcePathNode; + })(); + + return ResourcePath; + })(); + + 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 && 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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() { + + /** + * 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 + * @constructor + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + 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) + 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; + + /** + * 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 + * @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 && 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + 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; + } + 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; + }; + + /** + * 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) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; + 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; + } + 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; + }; + + /** + * 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 = []; + object.folderIds = []; + } + 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] === 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) + object.folderIds[j] = message.folderIds[j]; + } + 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); + }; + + /** + * 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 + * @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.ResourceValueConfig = (function() { + + /** + * Properties of a ResourceValueConfig. + * @memberof google.cloud.securitycenter.v1 + * @interface IResourceValueConfig + * @property {string|null} [name] ResourceValueConfig name + * @property {google.cloud.securitycenter.v1.ResourceValue|null} [resourceValue] ResourceValueConfig resourceValue + * @property {Array.|null} [tagValues] ResourceValueConfig tagValues + * @property {string|null} [resourceType] ResourceValueConfig resourceType + * @property {string|null} [scope] ResourceValueConfig scope + * @property {Object.|null} [resourceLabelsSelector] ResourceValueConfig resourceLabelsSelector + * @property {string|null} [description] ResourceValueConfig description + * @property {google.protobuf.ITimestamp|null} [createTime] ResourceValueConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ResourceValueConfig updateTime + * @property {google.cloud.securitycenter.v1.CloudProvider|null} [cloudProvider] ResourceValueConfig cloudProvider + * @property {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping|null} [sensitiveDataProtectionMapping] ResourceValueConfig sensitiveDataProtectionMapping + */ + + /** + * Constructs a new ResourceValueConfig. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ResourceValueConfig. + * @implements IResourceValueConfig + * @constructor + * @param {google.cloud.securitycenter.v1.IResourceValueConfig=} [properties] Properties to set + */ + function ResourceValueConfig(properties) { + this.tagValues = []; + this.resourceLabelsSelector = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceValueConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.name = ""; + + /** + * ResourceValueConfig resourceValue. + * @member {google.cloud.securitycenter.v1.ResourceValue} resourceValue + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.resourceValue = 0; + + /** + * ResourceValueConfig tagValues. + * @member {Array.} tagValues + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.tagValues = $util.emptyArray; + + /** + * ResourceValueConfig resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.resourceType = ""; + + /** + * ResourceValueConfig scope. + * @member {string} scope + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.scope = ""; + + /** + * ResourceValueConfig resourceLabelsSelector. + * @member {Object.} resourceLabelsSelector + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.resourceLabelsSelector = $util.emptyObject; + + /** + * ResourceValueConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.description = ""; + + /** + * ResourceValueConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.createTime = null; + + /** + * ResourceValueConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.updateTime = null; + + /** + * ResourceValueConfig cloudProvider. + * @member {google.cloud.securitycenter.v1.CloudProvider} cloudProvider + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.cloudProvider = 0; + + /** + * ResourceValueConfig sensitiveDataProtectionMapping. + * @member {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping|null|undefined} sensitiveDataProtectionMapping + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.sensitiveDataProtectionMapping = null; + + /** + * Creates a new ResourceValueConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {google.cloud.securitycenter.v1.IResourceValueConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ResourceValueConfig} ResourceValueConfig instance + */ + ResourceValueConfig.create = function create(properties) { + return new ResourceValueConfig(properties); + }; + + /** + * Encodes the specified ResourceValueConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {google.cloud.securitycenter.v1.IResourceValueConfig} message ResourceValueConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceValueConfig.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.resourceValue != null && Object.hasOwnProperty.call(message, "resourceValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceValue); + if (message.tagValues != null && message.tagValues.length) + for (var i = 0; i < message.tagValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tagValues[i]); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceType); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.scope); + if (message.resourceLabelsSelector != null && Object.hasOwnProperty.call(message, "resourceLabelsSelector")) + for (var keys = Object.keys(message.resourceLabelsSelector), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourceLabelsSelector[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.cloudProvider); + if (message.sensitiveDataProtectionMapping != null && Object.hasOwnProperty.call(message, "sensitiveDataProtectionMapping")) + $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.encode(message.sensitiveDataProtectionMapping, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceValueConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {google.cloud.securitycenter.v1.IResourceValueConfig} message ResourceValueConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceValueConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceValueConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ResourceValueConfig} ResourceValueConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceValueConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourceValueConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resourceValue = reader.int32(); + break; + } + case 3: { + if (!(message.tagValues && message.tagValues.length)) + message.tagValues = []; + message.tagValues.push(reader.string()); + break; + } + case 4: { + message.resourceType = reader.string(); + break; + } + case 5: { + message.scope = reader.string(); + break; + } + case 6: { + if (message.resourceLabelsSelector === $util.emptyObject) + message.resourceLabelsSelector = {}; + 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.resourceLabelsSelector[key] = value; + break; + } + case 7: { + message.description = reader.string(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.cloudProvider = reader.int32(); + break; + } + case 11: { + message.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceValueConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ResourceValueConfig} ResourceValueConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceValueConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceValueConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceValueConfig.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.resourceValue != null && message.hasOwnProperty("resourceValue")) + switch (message.resourceValue) { + default: + return "resourceValue: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.tagValues != null && message.hasOwnProperty("tagValues")) { + if (!Array.isArray(message.tagValues)) + return "tagValues: array expected"; + for (var i = 0; i < message.tagValues.length; ++i) + if (!$util.isString(message.tagValues[i])) + return "tagValues: string[] expected"; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.resourceLabelsSelector != null && message.hasOwnProperty("resourceLabelsSelector")) { + if (!$util.isObject(message.resourceLabelsSelector)) + return "resourceLabelsSelector: object expected"; + var key = Object.keys(message.resourceLabelsSelector); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourceLabelsSelector[key[i]])) + return "resourceLabelsSelector: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + switch (message.cloudProvider) { + default: + return "cloudProvider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sensitiveDataProtectionMapping != null && message.hasOwnProperty("sensitiveDataProtectionMapping")) { + var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify(message.sensitiveDataProtectionMapping); + if (error) + return "sensitiveDataProtectionMapping." + error; + } + return null; + }; + + /** + * Creates a ResourceValueConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ResourceValueConfig} ResourceValueConfig + */ + ResourceValueConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ResourceValueConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.ResourceValueConfig(); + if (object.name != null) + message.name = String(object.name); + switch (object.resourceValue) { + default: + if (typeof object.resourceValue === "number") { + message.resourceValue = object.resourceValue; + break; + } + break; + case "RESOURCE_VALUE_UNSPECIFIED": + case 0: + message.resourceValue = 0; + break; + case "HIGH": + case 1: + message.resourceValue = 1; + break; + case "MEDIUM": + case 2: + message.resourceValue = 2; + break; + case "LOW": + case 3: + message.resourceValue = 3; + break; + case "NONE": + case 4: + message.resourceValue = 4; + break; + } + if (object.tagValues) { + if (!Array.isArray(object.tagValues)) + throw TypeError(".google.cloud.securitycenter.v1.ResourceValueConfig.tagValues: array expected"); + message.tagValues = []; + for (var i = 0; i < object.tagValues.length; ++i) + message.tagValues[i] = String(object.tagValues[i]); + } + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.scope != null) + message.scope = String(object.scope); + if (object.resourceLabelsSelector) { + if (typeof object.resourceLabelsSelector !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ResourceValueConfig.resourceLabelsSelector: object expected"); + message.resourceLabelsSelector = {}; + for (var keys = Object.keys(object.resourceLabelsSelector), i = 0; i < keys.length; ++i) + message.resourceLabelsSelector[keys[i]] = String(object.resourceLabelsSelector[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ResourceValueConfig.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.ResourceValueConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.cloudProvider) { + default: + if (typeof object.cloudProvider === "number") { + message.cloudProvider = object.cloudProvider; + break; + } + break; + case "CLOUD_PROVIDER_UNSPECIFIED": + case 0: + message.cloudProvider = 0; + break; + case "GOOGLE_CLOUD_PLATFORM": + case 1: + message.cloudProvider = 1; + break; + case "AMAZON_WEB_SERVICES": + case 2: + message.cloudProvider = 2; + break; + case "MICROSOFT_AZURE": + case 3: + message.cloudProvider = 3; + break; + } + if (object.sensitiveDataProtectionMapping != null) { + if (typeof object.sensitiveDataProtectionMapping !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ResourceValueConfig.sensitiveDataProtectionMapping: object expected"); + message.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.fromObject(object.sensitiveDataProtectionMapping); + } + return message; + }; + + /** + * Creates a plain object from a ResourceValueConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {google.cloud.securitycenter.v1.ResourceValueConfig} message ResourceValueConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceValueConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tagValues = []; + if (options.objects || options.defaults) + object.resourceLabelsSelector = {}; + if (options.defaults) { + object.name = ""; + object.resourceValue = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; + object.resourceType = ""; + object.scope = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; + object.sensitiveDataProtectionMapping = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) + object.resourceValue = options.enums === String ? $root.google.cloud.securitycenter.v1.ResourceValue[message.resourceValue] === undefined ? message.resourceValue : $root.google.cloud.securitycenter.v1.ResourceValue[message.resourceValue] : message.resourceValue; + if (message.tagValues && message.tagValues.length) { + object.tagValues = []; + for (var j = 0; j < message.tagValues.length; ++j) + object.tagValues[j] = message.tagValues[j]; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + var keys2; + if (message.resourceLabelsSelector && (keys2 = Object.keys(message.resourceLabelsSelector)).length) { + object.resourceLabelsSelector = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceLabelsSelector[keys2[j]] = message.resourceLabelsSelector[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] : message.cloudProvider; + if (message.sensitiveDataProtectionMapping != null && message.hasOwnProperty("sensitiveDataProtectionMapping")) + object.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.toObject(message.sensitiveDataProtectionMapping, options); + return object; + }; + + /** + * Converts this ResourceValueConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @instance + * @returns {Object.} JSON object + */ + ResourceValueConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceValueConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceValueConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourceValueConfig"; + }; + + ResourceValueConfig.SensitiveDataProtectionMapping = (function() { + + /** + * Properties of a SensitiveDataProtectionMapping. + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @interface ISensitiveDataProtectionMapping + * @property {google.cloud.securitycenter.v1.ResourceValue|null} [highSensitivityMapping] SensitiveDataProtectionMapping highSensitivityMapping + * @property {google.cloud.securitycenter.v1.ResourceValue|null} [mediumSensitivityMapping] SensitiveDataProtectionMapping mediumSensitivityMapping + */ + + /** + * Constructs a new SensitiveDataProtectionMapping. + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig + * @classdesc Represents a SensitiveDataProtectionMapping. + * @implements ISensitiveDataProtectionMapping + * @constructor + * @param {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping=} [properties] Properties to set + */ + function SensitiveDataProtectionMapping(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SensitiveDataProtectionMapping highSensitivityMapping. + * @member {google.cloud.securitycenter.v1.ResourceValue} highSensitivityMapping + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @instance + */ + SensitiveDataProtectionMapping.prototype.highSensitivityMapping = 0; + + /** + * SensitiveDataProtectionMapping mediumSensitivityMapping. + * @member {google.cloud.securitycenter.v1.ResourceValue} mediumSensitivityMapping + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @instance + */ + SensitiveDataProtectionMapping.prototype.mediumSensitivityMapping = 0; + + /** + * Creates a new SensitiveDataProtectionMapping instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping instance + */ + SensitiveDataProtectionMapping.create = function create(properties) { + return new SensitiveDataProtectionMapping(properties); + }; + + /** + * Encodes the specified SensitiveDataProtectionMapping message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping} message SensitiveDataProtectionMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SensitiveDataProtectionMapping.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.highSensitivityMapping != null && Object.hasOwnProperty.call(message, "highSensitivityMapping")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highSensitivityMapping); + if (message.mediumSensitivityMapping != null && Object.hasOwnProperty.call(message, "mediumSensitivityMapping")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediumSensitivityMapping); + return writer; + }; + + /** + * Encodes the specified SensitiveDataProtectionMapping message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping} message SensitiveDataProtectionMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SensitiveDataProtectionMapping.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SensitiveDataProtectionMapping.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.highSensitivityMapping = reader.int32(); + break; + } + case 2: { + message.mediumSensitivityMapping = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SensitiveDataProtectionMapping.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SensitiveDataProtectionMapping message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SensitiveDataProtectionMapping.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.highSensitivityMapping != null && message.hasOwnProperty("highSensitivityMapping")) + switch (message.highSensitivityMapping) { + default: + return "highSensitivityMapping: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.mediumSensitivityMapping != null && message.hasOwnProperty("mediumSensitivityMapping")) + switch (message.mediumSensitivityMapping) { + default: + return "mediumSensitivityMapping: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a SensitiveDataProtectionMapping message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping + */ + SensitiveDataProtectionMapping.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping) + return object; + var message = new $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping(); + switch (object.highSensitivityMapping) { + default: + if (typeof object.highSensitivityMapping === "number") { + message.highSensitivityMapping = object.highSensitivityMapping; + break; + } + break; + case "RESOURCE_VALUE_UNSPECIFIED": + case 0: + message.highSensitivityMapping = 0; + break; + case "HIGH": + case 1: + message.highSensitivityMapping = 1; + break; + case "MEDIUM": + case 2: + message.highSensitivityMapping = 2; + break; + case "LOW": + case 3: + message.highSensitivityMapping = 3; + break; + case "NONE": + case 4: + message.highSensitivityMapping = 4; + break; + } + switch (object.mediumSensitivityMapping) { + default: + if (typeof object.mediumSensitivityMapping === "number") { + message.mediumSensitivityMapping = object.mediumSensitivityMapping; + break; + } + break; + case "RESOURCE_VALUE_UNSPECIFIED": + case 0: + message.mediumSensitivityMapping = 0; + break; + case "HIGH": + case 1: + message.mediumSensitivityMapping = 1; + break; + case "MEDIUM": + case 2: + message.mediumSensitivityMapping = 2; + break; + case "LOW": + case 3: + message.mediumSensitivityMapping = 3; + break; + case "NONE": + case 4: + message.mediumSensitivityMapping = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a SensitiveDataProtectionMapping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} message SensitiveDataProtectionMapping + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SensitiveDataProtectionMapping.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.highSensitivityMapping = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; + object.mediumSensitivityMapping = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; + } + if (message.highSensitivityMapping != null && message.hasOwnProperty("highSensitivityMapping")) + object.highSensitivityMapping = options.enums === String ? $root.google.cloud.securitycenter.v1.ResourceValue[message.highSensitivityMapping] === undefined ? message.highSensitivityMapping : $root.google.cloud.securitycenter.v1.ResourceValue[message.highSensitivityMapping] : message.highSensitivityMapping; + if (message.mediumSensitivityMapping != null && message.hasOwnProperty("mediumSensitivityMapping")) + object.mediumSensitivityMapping = options.enums === String ? $root.google.cloud.securitycenter.v1.ResourceValue[message.mediumSensitivityMapping] === undefined ? message.mediumSensitivityMapping : $root.google.cloud.securitycenter.v1.ResourceValue[message.mediumSensitivityMapping] : message.mediumSensitivityMapping; + return object; + }; + + /** + * Converts this SensitiveDataProtectionMapping to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @instance + * @returns {Object.} JSON object + */ + SensitiveDataProtectionMapping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SensitiveDataProtectionMapping + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SensitiveDataProtectionMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping"; + }; + + return SensitiveDataProtectionMapping; + })(); + + return ResourceValueConfig; + })(); + + /** + * ResourceValue enum. + * @name google.cloud.securitycenter.v1.ResourceValue + * @enum {number} + * @property {number} RESOURCE_VALUE_UNSPECIFIED=0 RESOURCE_VALUE_UNSPECIFIED value + * @property {number} HIGH=1 HIGH value + * @property {number} MEDIUM=2 MEDIUM value + * @property {number} LOW=3 LOW value + * @property {number} NONE=4 NONE value + */ + v1.ResourceValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_VALUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGH"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + values[valuesById[3] = "LOW"] = 3; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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] === 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; + }; + + /** + * 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); + }; + + /** + * 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 + * @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.SecurityHealthAnalyticsCustomModule = (function() { + + /** + * Properties of a SecurityHealthAnalyticsCustomModule. + * @memberof google.cloud.securitycenter.v1 + * @interface ISecurityHealthAnalyticsCustomModule + * @property {string|null} [name] SecurityHealthAnalyticsCustomModule name + * @property {string|null} [displayName] SecurityHealthAnalyticsCustomModule displayName + * @property {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState|null} [enablementState] SecurityHealthAnalyticsCustomModule enablementState + * @property {google.protobuf.ITimestamp|null} [updateTime] SecurityHealthAnalyticsCustomModule updateTime + * @property {string|null} [lastEditor] SecurityHealthAnalyticsCustomModule lastEditor + * @property {string|null} [ancestorModule] SecurityHealthAnalyticsCustomModule ancestorModule + * @property {google.cloud.securitycenter.v1.ICustomConfig|null} [customConfig] SecurityHealthAnalyticsCustomModule customConfig + */ + + /** + * Constructs a new SecurityHealthAnalyticsCustomModule. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityHealthAnalyticsCustomModule. + * @implements ISecurityHealthAnalyticsCustomModule + * @constructor + * @param {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule=} [properties] Properties to set + */ + function SecurityHealthAnalyticsCustomModule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityHealthAnalyticsCustomModule name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @instance + */ + SecurityHealthAnalyticsCustomModule.prototype.name = ""; + + /** + * SecurityHealthAnalyticsCustomModule displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @instance + */ + SecurityHealthAnalyticsCustomModule.prototype.displayName = ""; + + /** + * SecurityHealthAnalyticsCustomModule enablementState. + * @member {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState} enablementState + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @instance + */ + SecurityHealthAnalyticsCustomModule.prototype.enablementState = 0; + + /** + * SecurityHealthAnalyticsCustomModule updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @instance + */ + SecurityHealthAnalyticsCustomModule.prototype.updateTime = null; + + /** + * SecurityHealthAnalyticsCustomModule lastEditor. + * @member {string} lastEditor + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @instance + */ + SecurityHealthAnalyticsCustomModule.prototype.lastEditor = ""; + + /** + * SecurityHealthAnalyticsCustomModule ancestorModule. + * @member {string} ancestorModule + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @instance + */ + SecurityHealthAnalyticsCustomModule.prototype.ancestorModule = ""; + + /** + * SecurityHealthAnalyticsCustomModule customConfig. + * @member {google.cloud.securitycenter.v1.ICustomConfig|null|undefined} customConfig + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @instance + */ + SecurityHealthAnalyticsCustomModule.prototype.customConfig = null; + + /** + * Creates a new SecurityHealthAnalyticsCustomModule instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} SecurityHealthAnalyticsCustomModule instance + */ + SecurityHealthAnalyticsCustomModule.create = function create(properties) { + return new SecurityHealthAnalyticsCustomModule(properties); + }; + + /** + * Encodes the specified SecurityHealthAnalyticsCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule} message SecurityHealthAnalyticsCustomModule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityHealthAnalyticsCustomModule.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.enablementState != null && Object.hasOwnProperty.call(message, "enablementState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.enablementState); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastEditor != null && Object.hasOwnProperty.call(message, "lastEditor")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastEditor); + if (message.ancestorModule != null && Object.hasOwnProperty.call(message, "ancestorModule")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.ancestorModule); + if (message.customConfig != null && Object.hasOwnProperty.call(message, "customConfig")) + $root.google.cloud.securitycenter.v1.CustomConfig.encode(message.customConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityHealthAnalyticsCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule} message SecurityHealthAnalyticsCustomModule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityHealthAnalyticsCustomModule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityHealthAnalyticsCustomModule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} SecurityHealthAnalyticsCustomModule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityHealthAnalyticsCustomModule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 4: { + message.enablementState = reader.int32(); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastEditor = reader.string(); + break; + } + case 7: { + message.ancestorModule = reader.string(); + break; + } + case 8: { + message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityHealthAnalyticsCustomModule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} SecurityHealthAnalyticsCustomModule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityHealthAnalyticsCustomModule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityHealthAnalyticsCustomModule message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityHealthAnalyticsCustomModule.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.enablementState != null && message.hasOwnProperty("enablementState")) + switch (message.enablementState) { + default: + return "enablementState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastEditor != null && message.hasOwnProperty("lastEditor")) + if (!$util.isString(message.lastEditor)) + return "lastEditor: string expected"; + if (message.ancestorModule != null && message.hasOwnProperty("ancestorModule")) + if (!$util.isString(message.ancestorModule)) + return "ancestorModule: string expected"; + if (message.customConfig != null && message.hasOwnProperty("customConfig")) { + var error = $root.google.cloud.securitycenter.v1.CustomConfig.verify(message.customConfig); + if (error) + return "customConfig." + error; + } + return null; + }; + + /** + * Creates a SecurityHealthAnalyticsCustomModule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} SecurityHealthAnalyticsCustomModule + */ + SecurityHealthAnalyticsCustomModule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) + return object; + var message = new $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.enablementState) { + default: + if (typeof object.enablementState === "number") { + message.enablementState = object.enablementState; + break; + } + break; + case "ENABLEMENT_STATE_UNSPECIFIED": + case 0: + message.enablementState = 0; + break; + case "ENABLED": + case 1: + message.enablementState = 1; + break; + case "DISABLED": + case 2: + message.enablementState = 2; + break; + case "INHERITED": + case 3: + message.enablementState = 3; + break; + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastEditor != null) + message.lastEditor = String(object.lastEditor); + if (object.ancestorModule != null) + message.ancestorModule = String(object.ancestorModule); + if (object.customConfig != null) { + if (typeof object.customConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.customConfig: object expected"); + message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.fromObject(object.customConfig); + } + return message; + }; + + /** + * Creates a plain object from a SecurityHealthAnalyticsCustomModule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} message SecurityHealthAnalyticsCustomModule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityHealthAnalyticsCustomModule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.enablementState = options.enums === String ? "ENABLEMENT_STATE_UNSPECIFIED" : 0; + object.updateTime = null; + object.lastEditor = ""; + object.ancestorModule = ""; + object.customConfig = 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.enablementState != null && message.hasOwnProperty("enablementState")) + object.enablementState = options.enums === String ? $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState[message.enablementState] : message.enablementState; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastEditor != null && message.hasOwnProperty("lastEditor")) + object.lastEditor = message.lastEditor; + if (message.ancestorModule != null && message.hasOwnProperty("ancestorModule")) + object.ancestorModule = message.ancestorModule; + if (message.customConfig != null && message.hasOwnProperty("customConfig")) + object.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.toObject(message.customConfig, options); + return object; + }; + + /** + * Converts this SecurityHealthAnalyticsCustomModule to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @instance + * @returns {Object.} JSON object + */ + SecurityHealthAnalyticsCustomModule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityHealthAnalyticsCustomModule + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityHealthAnalyticsCustomModule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule"; + }; + + /** + * EnablementState enum. + * @name google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState + * @enum {number} + * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} INHERITED=3 INHERITED value + */ + SecurityHealthAnalyticsCustomModule.EnablementState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENABLEMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "INHERITED"] = 3; + return values; + })(); + + return SecurityHealthAnalyticsCustomModule; + })(); + + 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|createSecurityHealthAnalyticsCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateSecurityHealthAnalyticsCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} [response] SecurityHealthAnalyticsCustomModule + */ + + /** + * Calls CreateSecurityHealthAnalyticsCustomModule. + * @function createSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest} request CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSecurityHealthAnalyticsCustomModule = function createSecurityHealthAnalyticsCustomModule(request, callback) { + return this.rpcCall(createSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule, request, callback); + }, "name", { value: "CreateSecurityHealthAnalyticsCustomModule" }); + + /** + * Calls CreateSecurityHealthAnalyticsCustomModule. + * @function createSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest} request CreateSecurityHealthAnalyticsCustomModuleRequest 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|deleteSecurityHealthAnalyticsCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteSecurityHealthAnalyticsCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSecurityHealthAnalyticsCustomModule. + * @function deleteSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest} request DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteSecurityHealthAnalyticsCustomModule = function deleteSecurityHealthAnalyticsCustomModule(request, callback) { + return this.rpcCall(deleteSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSecurityHealthAnalyticsCustomModule" }); + + /** + * Calls DeleteSecurityHealthAnalyticsCustomModule. + * @function deleteSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest} request DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSimulation}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSimulationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Simulation} [response] Simulation + */ + + /** + * Calls GetSimulation. + * @function getSimulation + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSimulationRequest} request GetSimulationRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSimulationCallback} callback Node-style callback called with the error, if any, and Simulation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSimulation = function getSimulation(request, callback) { + return this.rpcCall(getSimulation, $root.google.cloud.securitycenter.v1.GetSimulationRequest, $root.google.cloud.securitycenter.v1.Simulation, request, callback); + }, "name", { value: "GetSimulation" }); + + /** + * Calls GetSimulation. + * @function getSimulation + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSimulationRequest} request GetSimulationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getValuedResource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetValuedResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ValuedResource} [response] ValuedResource + */ + + /** + * Calls GetValuedResource. + * @function getValuedResource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest} request GetValuedResourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetValuedResourceCallback} callback Node-style callback called with the error, if any, and ValuedResource + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getValuedResource = function getValuedResource(request, callback) { + return this.rpcCall(getValuedResource, $root.google.cloud.securitycenter.v1.GetValuedResourceRequest, $root.google.cloud.securitycenter.v1.ValuedResource, request, callback); + }, "name", { value: "GetValuedResource" }); + + /** + * Calls GetValuedResource. + * @function getValuedResource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest} request GetValuedResourceRequest message or plain object + * @returns {Promise} Promise + * @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 + * @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|getEffectiveSecurityHealthAnalyticsCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetEffectiveSecurityHealthAnalyticsCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} [response] EffectiveSecurityHealthAnalyticsCustomModule + */ + + /** + * Calls GetEffectiveSecurityHealthAnalyticsCustomModule. + * @function getEffectiveSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest} request GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and EffectiveSecurityHealthAnalyticsCustomModule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getEffectiveSecurityHealthAnalyticsCustomModule = function getEffectiveSecurityHealthAnalyticsCustomModule(request, callback) { + return this.rpcCall(getEffectiveSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule, request, callback); + }, "name", { value: "GetEffectiveSecurityHealthAnalyticsCustomModule" }); + + /** + * Calls GetEffectiveSecurityHealthAnalyticsCustomModule. + * @function getEffectiveSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest} request GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSecurityHealthAnalyticsCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSecurityHealthAnalyticsCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} [response] SecurityHealthAnalyticsCustomModule + */ + + /** + * Calls GetSecurityHealthAnalyticsCustomModule. + * @function getSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest} request GetSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSecurityHealthAnalyticsCustomModule = function getSecurityHealthAnalyticsCustomModule(request, callback) { + return this.rpcCall(getSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule, request, callback); + }, "name", { value: "GetSecurityHealthAnalyticsCustomModule" }); + + /** + * Calls GetSecurityHealthAnalyticsCustomModule. + * @function getSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest} request GetSecurityHealthAnalyticsCustomModuleRequest 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|listDescendantSecurityHealthAnalyticsCustomModules}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListDescendantSecurityHealthAnalyticsCustomModulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} [response] ListDescendantSecurityHealthAnalyticsCustomModulesResponse + */ + + /** + * Calls ListDescendantSecurityHealthAnalyticsCustomModules. + * @function listDescendantSecurityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest} request ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModulesCallback} callback Node-style callback called with the error, if any, and ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listDescendantSecurityHealthAnalyticsCustomModules = function listDescendantSecurityHealthAnalyticsCustomModules(request, callback) { + return this.rpcCall(listDescendantSecurityHealthAnalyticsCustomModules, $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse, request, callback); + }, "name", { value: "ListDescendantSecurityHealthAnalyticsCustomModules" }); + + /** + * Calls ListDescendantSecurityHealthAnalyticsCustomModules. + * @function listDescendantSecurityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest} request ListDescendantSecurityHealthAnalyticsCustomModulesRequest 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|listEffectiveSecurityHealthAnalyticsCustomModules}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListEffectiveSecurityHealthAnalyticsCustomModulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} [response] ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + */ + + /** + * Calls ListEffectiveSecurityHealthAnalyticsCustomModules. + * @function listEffectiveSecurityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest} request ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModulesCallback} callback Node-style callback called with the error, if any, and ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listEffectiveSecurityHealthAnalyticsCustomModules = function listEffectiveSecurityHealthAnalyticsCustomModules(request, callback) { + return this.rpcCall(listEffectiveSecurityHealthAnalyticsCustomModules, $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, request, callback); + }, "name", { value: "ListEffectiveSecurityHealthAnalyticsCustomModules" }); + + /** + * Calls ListEffectiveSecurityHealthAnalyticsCustomModules. + * @function listEffectiveSecurityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest} request ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listSecurityHealthAnalyticsCustomModules}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListSecurityHealthAnalyticsCustomModulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} [response] ListSecurityHealthAnalyticsCustomModulesResponse + */ + + /** + * Calls ListSecurityHealthAnalyticsCustomModules. + * @function listSecurityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest} request ListSecurityHealthAnalyticsCustomModulesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModulesCallback} callback Node-style callback called with the error, if any, and ListSecurityHealthAnalyticsCustomModulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSecurityHealthAnalyticsCustomModules = function listSecurityHealthAnalyticsCustomModules(request, callback) { + return this.rpcCall(listSecurityHealthAnalyticsCustomModules, $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse, request, callback); + }, "name", { value: "ListSecurityHealthAnalyticsCustomModules" }); + + /** + * Calls ListSecurityHealthAnalyticsCustomModules. + * @function listSecurityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest} request ListSecurityHealthAnalyticsCustomModulesRequest 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|simulateSecurityHealthAnalyticsCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SimulateSecurityHealthAnalyticsCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} [response] SimulateSecurityHealthAnalyticsCustomModuleResponse + */ + + /** + * Calls SimulateSecurityHealthAnalyticsCustomModule. + * @function simulateSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest} request SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and SimulateSecurityHealthAnalyticsCustomModuleResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.simulateSecurityHealthAnalyticsCustomModule = function simulateSecurityHealthAnalyticsCustomModule(request, callback) { + return this.rpcCall(simulateSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse, request, callback); + }, "name", { value: "SimulateSecurityHealthAnalyticsCustomModule" }); + + /** + * Calls SimulateSecurityHealthAnalyticsCustomModule. + * @function simulateSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest} request SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @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 + * @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|updateSecurityHealthAnalyticsCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSecurityHealthAnalyticsCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} [response] SecurityHealthAnalyticsCustomModule + */ + + /** + * Calls UpdateSecurityHealthAnalyticsCustomModule. + * @function updateSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest} request UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityHealthAnalyticsCustomModule = function updateSecurityHealthAnalyticsCustomModule(request, callback) { + return this.rpcCall(updateSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule, request, callback); + }, "name", { value: "UpdateSecurityHealthAnalyticsCustomModule" }); + + /** + * Calls UpdateSecurityHealthAnalyticsCustomModule. + * @function updateSecurityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest} request UpdateSecurityHealthAnalyticsCustomModuleRequest 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 + */ + + /** + * 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 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createEventThreatDetectionCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateEventThreatDetectionCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} [response] EventThreatDetectionCustomModule + */ + + /** + * Calls CreateEventThreatDetectionCustomModule. + * @function createEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest} request CreateEventThreatDetectionCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createEventThreatDetectionCustomModule = function createEventThreatDetectionCustomModule(request, callback) { + return this.rpcCall(createEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule, request, callback); + }, "name", { value: "CreateEventThreatDetectionCustomModule" }); + + /** + * Calls CreateEventThreatDetectionCustomModule. + * @function createEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest} request CreateEventThreatDetectionCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteEventThreatDetectionCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteEventThreatDetectionCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEventThreatDetectionCustomModule. + * @function deleteEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest} request DeleteEventThreatDetectionCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteEventThreatDetectionCustomModule = function deleteEventThreatDetectionCustomModule(request, callback) { + return this.rpcCall(deleteEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEventThreatDetectionCustomModule" }); + + /** + * Calls DeleteEventThreatDetectionCustomModule. + * @function deleteEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest} request DeleteEventThreatDetectionCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getEventThreatDetectionCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetEventThreatDetectionCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} [response] EventThreatDetectionCustomModule + */ + + /** + * Calls GetEventThreatDetectionCustomModule. + * @function getEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest} request GetEventThreatDetectionCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getEventThreatDetectionCustomModule = function getEventThreatDetectionCustomModule(request, callback) { + return this.rpcCall(getEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule, request, callback); + }, "name", { value: "GetEventThreatDetectionCustomModule" }); + + /** + * Calls GetEventThreatDetectionCustomModule. + * @function getEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest} request GetEventThreatDetectionCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listDescendantEventThreatDetectionCustomModules}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListDescendantEventThreatDetectionCustomModulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} [response] ListDescendantEventThreatDetectionCustomModulesResponse + */ + + /** + * Calls ListDescendantEventThreatDetectionCustomModules. + * @function listDescendantEventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest} request ListDescendantEventThreatDetectionCustomModulesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModulesCallback} callback Node-style callback called with the error, if any, and ListDescendantEventThreatDetectionCustomModulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listDescendantEventThreatDetectionCustomModules = function listDescendantEventThreatDetectionCustomModules(request, callback) { + return this.rpcCall(listDescendantEventThreatDetectionCustomModules, $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse, request, callback); + }, "name", { value: "ListDescendantEventThreatDetectionCustomModules" }); + + /** + * Calls ListDescendantEventThreatDetectionCustomModules. + * @function listDescendantEventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest} request ListDescendantEventThreatDetectionCustomModulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listEventThreatDetectionCustomModules}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListEventThreatDetectionCustomModulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} [response] ListEventThreatDetectionCustomModulesResponse + */ + + /** + * Calls ListEventThreatDetectionCustomModules. + * @function listEventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest} request ListEventThreatDetectionCustomModulesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModulesCallback} callback Node-style callback called with the error, if any, and ListEventThreatDetectionCustomModulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listEventThreatDetectionCustomModules = function listEventThreatDetectionCustomModules(request, callback) { + return this.rpcCall(listEventThreatDetectionCustomModules, $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse, request, callback); + }, "name", { value: "ListEventThreatDetectionCustomModules" }); + + /** + * Calls ListEventThreatDetectionCustomModules. + * @function listEventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest} request ListEventThreatDetectionCustomModulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateEventThreatDetectionCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateEventThreatDetectionCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} [response] EventThreatDetectionCustomModule + */ + + /** + * Calls UpdateEventThreatDetectionCustomModule. + * @function updateEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest} request UpdateEventThreatDetectionCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateEventThreatDetectionCustomModule = function updateEventThreatDetectionCustomModule(request, callback) { + return this.rpcCall(updateEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule, request, callback); + }, "name", { value: "UpdateEventThreatDetectionCustomModule" }); + + /** + * Calls UpdateEventThreatDetectionCustomModule. + * @function updateEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest} request UpdateEventThreatDetectionCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|validateEventThreatDetectionCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ValidateEventThreatDetectionCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} [response] ValidateEventThreatDetectionCustomModuleResponse + */ + + /** + * Calls ValidateEventThreatDetectionCustomModule. + * @function validateEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest} request ValidateEventThreatDetectionCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and ValidateEventThreatDetectionCustomModuleResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.validateEventThreatDetectionCustomModule = function validateEventThreatDetectionCustomModule(request, callback) { + return this.rpcCall(validateEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse, request, callback); + }, "name", { value: "ValidateEventThreatDetectionCustomModule" }); + + /** + * Calls ValidateEventThreatDetectionCustomModule. + * @function validateEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest} request ValidateEventThreatDetectionCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getEffectiveEventThreatDetectionCustomModule}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetEffectiveEventThreatDetectionCustomModuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} [response] EffectiveEventThreatDetectionCustomModule + */ + + /** + * Calls GetEffectiveEventThreatDetectionCustomModule. + * @function getEffectiveEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest} request GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and EffectiveEventThreatDetectionCustomModule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getEffectiveEventThreatDetectionCustomModule = function getEffectiveEventThreatDetectionCustomModule(request, callback) { + return this.rpcCall(getEffectiveEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule, request, callback); + }, "name", { value: "GetEffectiveEventThreatDetectionCustomModule" }); + + /** + * Calls GetEffectiveEventThreatDetectionCustomModule. + * @function getEffectiveEventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest} request GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listEffectiveEventThreatDetectionCustomModules}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListEffectiveEventThreatDetectionCustomModulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} [response] ListEffectiveEventThreatDetectionCustomModulesResponse + */ + + /** + * Calls ListEffectiveEventThreatDetectionCustomModules. + * @function listEffectiveEventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest} request ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModulesCallback} callback Node-style callback called with the error, if any, and ListEffectiveEventThreatDetectionCustomModulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listEffectiveEventThreatDetectionCustomModules = function listEffectiveEventThreatDetectionCustomModules(request, callback) { + return this.rpcCall(listEffectiveEventThreatDetectionCustomModules, $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse, request, callback); + }, "name", { value: "ListEffectiveEventThreatDetectionCustomModules" }); + + /** + * Calls ListEffectiveEventThreatDetectionCustomModules. + * @function listEffectiveEventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest} request ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|batchCreateResourceValueConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef BatchCreateResourceValueConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} [response] BatchCreateResourceValueConfigsResponse + */ + + /** + * Calls BatchCreateResourceValueConfigs. + * @function batchCreateResourceValueConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest} request BatchCreateResourceValueConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigsCallback} callback Node-style callback called with the error, if any, and BatchCreateResourceValueConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.batchCreateResourceValueConfigs = function batchCreateResourceValueConfigs(request, callback) { + return this.rpcCall(batchCreateResourceValueConfigs, $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest, $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse, request, callback); + }, "name", { value: "BatchCreateResourceValueConfigs" }); + + /** + * Calls BatchCreateResourceValueConfigs. + * @function batchCreateResourceValueConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest} request BatchCreateResourceValueConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteResourceValueConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteResourceValueConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteResourceValueConfig. + * @function deleteResourceValueConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest} request DeleteResourceValueConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteResourceValueConfig = function deleteResourceValueConfig(request, callback) { + return this.rpcCall(deleteResourceValueConfig, $root.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteResourceValueConfig" }); + + /** + * Calls DeleteResourceValueConfig. + * @function deleteResourceValueConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest} request DeleteResourceValueConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getResourceValueConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetResourceValueConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ResourceValueConfig} [response] ResourceValueConfig + */ + + /** + * Calls GetResourceValueConfig. + * @function getResourceValueConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest} request GetResourceValueConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfigCallback} callback Node-style callback called with the error, if any, and ResourceValueConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getResourceValueConfig = function getResourceValueConfig(request, callback) { + return this.rpcCall(getResourceValueConfig, $root.google.cloud.securitycenter.v1.GetResourceValueConfigRequest, $root.google.cloud.securitycenter.v1.ResourceValueConfig, request, callback); + }, "name", { value: "GetResourceValueConfig" }); + + /** + * Calls GetResourceValueConfig. + * @function getResourceValueConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest} request GetResourceValueConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listResourceValueConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListResourceValueConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} [response] ListResourceValueConfigsResponse + */ + + /** + * Calls ListResourceValueConfigs. + * @function listResourceValueConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest} request ListResourceValueConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigsCallback} callback Node-style callback called with the error, if any, and ListResourceValueConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listResourceValueConfigs = function listResourceValueConfigs(request, callback) { + return this.rpcCall(listResourceValueConfigs, $root.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest, $root.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse, request, callback); + }, "name", { value: "ListResourceValueConfigs" }); + + /** + * Calls ListResourceValueConfigs. + * @function listResourceValueConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest} request ListResourceValueConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateResourceValueConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateResourceValueConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ResourceValueConfig} [response] ResourceValueConfig + */ + + /** + * Calls UpdateResourceValueConfig. + * @function updateResourceValueConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest} request UpdateResourceValueConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfigCallback} callback Node-style callback called with the error, if any, and ResourceValueConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateResourceValueConfig = function updateResourceValueConfig(request, callback) { + return this.rpcCall(updateResourceValueConfig, $root.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest, $root.google.cloud.securitycenter.v1.ResourceValueConfig, request, callback); + }, "name", { value: "UpdateResourceValueConfig" }); + + /** + * Calls UpdateResourceValueConfig. + * @function updateResourceValueConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest} request UpdateResourceValueConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listValuedResources}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListValuedResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListValuedResourcesResponse} [response] ListValuedResourcesResponse + */ + + /** + * Calls ListValuedResources. + * @function listValuedResources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest} request ListValuedResourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListValuedResourcesCallback} callback Node-style callback called with the error, if any, and ListValuedResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listValuedResources = function listValuedResources(request, callback) { + return this.rpcCall(listValuedResources, $root.google.cloud.securitycenter.v1.ListValuedResourcesRequest, $root.google.cloud.securitycenter.v1.ListValuedResourcesResponse, request, callback); + }, "name", { value: "ListValuedResources" }); + + /** + * Calls ListValuedResources. + * @function listValuedResources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest} request ListValuedResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listAttackPaths}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListAttackPathsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListAttackPathsResponse} [response] ListAttackPathsResponse + */ + + /** + * Calls ListAttackPaths. + * @function listAttackPaths + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest} request ListAttackPathsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAttackPathsCallback} callback Node-style callback called with the error, if any, and ListAttackPathsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAttackPaths = function listAttackPaths(request, callback) { + return this.rpcCall(listAttackPaths, $root.google.cloud.securitycenter.v1.ListAttackPathsRequest, $root.google.cloud.securitycenter.v1.ListAttackPathsResponse, request, callback); + }, "name", { value: "ListAttackPaths" }); + + /** + * Calls ListAttackPaths. + * @function listAttackPaths + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest} request ListAttackPathsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1.BulkMuteFindingsRequest = (function() { + + /** + * Properties of a BulkMuteFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IBulkMuteFindingsRequest + * @property {string|null} [parent] BulkMuteFindingsRequest parent + * @property {string|null} [filter] BulkMuteFindingsRequest filter + * @property {string|null} [muteAnnotation] BulkMuteFindingsRequest muteAnnotation + * @property {google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState|null} [muteState] BulkMuteFindingsRequest muteState + */ + + /** + * Constructs a new BulkMuteFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BulkMuteFindingsRequest. + * @implements IBulkMuteFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set + */ + function BulkMuteFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BulkMuteFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.parent = ""; + + /** + * BulkMuteFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.filter = ""; + + /** + * BulkMuteFindingsRequest muteAnnotation. + * @member {string} muteAnnotation + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.muteAnnotation = ""; + + /** + * BulkMuteFindingsRequest muteState. + * @member {google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState} muteState + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.muteState = 0; + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest instance + */ + BulkMuteFindingsRequest.create = function create(properties) { + return new BulkMuteFindingsRequest(properties); + }; + + /** + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @function encode + * @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.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.muteAnnotation != null && Object.hasOwnProperty.call(message, "muteAnnotation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.muteAnnotation); + if (message.muteState != null && Object.hasOwnProperty.call(message, "muteState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.muteState); + return writer; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 4: { + message.muteState = reader.int32(); + 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"; + if (message.muteState != null && message.hasOwnProperty("muteState")) + switch (message.muteState) { + default: + return "muteState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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); + switch (object.muteState) { + default: + if (typeof object.muteState === "number") { + message.muteState = object.muteState; + break; + } + break; + case "MUTE_STATE_UNSPECIFIED": + case 0: + message.muteState = 0; + break; + case "MUTED": + case 1: + message.muteState = 1; + break; + case "UNDEFINED": + case 2: + message.muteState = 2; + break; + } + 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 = ""; + object.muteState = options.enums === String ? "MUTE_STATE_UNSPECIFIED" : 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.muteAnnotation != null && message.hasOwnProperty("muteAnnotation")) + object.muteAnnotation = message.muteAnnotation; + if (message.muteState != null && message.hasOwnProperty("muteState")) + object.muteState = options.enums === String ? $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState[message.muteState] === undefined ? message.muteState : $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState[message.muteState] : message.muteState; + 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); + }; + + /** + * 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"; + }; + + /** + * MuteState enum. + * @name google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState + * @enum {number} + * @property {number} MUTE_STATE_UNSPECIFIED=0 MUTE_STATE_UNSPECIFIED value + * @property {number} MUTED=1 MUTED value + * @property {number} UNDEFINED=2 UNDEFINED value + */ + BulkMuteFindingsRequest.MuteState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MUTED"] = 1; + values[valuesById[2] = "UNDEFINED"] = 2; + return values; + })(); + + 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.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.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. + * @function decode + * @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.BulkMuteFindingsResponse} BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + BulkMuteFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkMuteFindingsResponse message. + * @function verify + * @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 + */ + BulkMuteFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse + */ + BulkMuteFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse) + return object; + return new $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse(); + }; + + /** + * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} message BulkMuteFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkMuteFindingsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BulkMuteFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + BulkMuteFindingsResponse.prototype.toJSON = function toJSON() { + 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; + })(); + + 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 && 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.CreateMuteConfigRequest = (function() { + + /** + * 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 + */ + + /** + * 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 + */ + 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]]; + } + + /** + * CreateMuteConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.parent = ""; + + /** + * CreateMuteConfigRequest muteConfig. + * @member {google.cloud.securitycenter.v1.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.muteConfig = null; + + /** + * CreateMuteConfigRequest muteConfigId. + * @member {string} muteConfigId + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.muteConfigId = ""; + + /** + * 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); + }; + + /** + * 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; + }; + + /** + * 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 + */ + CreateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * Converts this CreateMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMuteConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.CreateResourceValueConfigRequest = (function() { + + /** + * Properties of a CreateResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateResourceValueConfigRequest + * @property {string|null} [parent] CreateResourceValueConfigRequest parent + * @property {google.cloud.securitycenter.v1.IResourceValueConfig|null} [resourceValueConfig] CreateResourceValueConfigRequest resourceValueConfig + */ + + /** + * Constructs a new CreateResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateResourceValueConfigRequest. + * @implements ICreateResourceValueConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest=} [properties] Properties to set + */ + function CreateResourceValueConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateResourceValueConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @instance + */ + CreateResourceValueConfigRequest.prototype.parent = ""; + + /** + * CreateResourceValueConfigRequest resourceValueConfig. + * @member {google.cloud.securitycenter.v1.IResourceValueConfig|null|undefined} resourceValueConfig + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @instance + */ + CreateResourceValueConfigRequest.prototype.resourceValueConfig = null; + + /** + * Creates a new CreateResourceValueConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest instance + */ + CreateResourceValueConfigRequest.create = function create(properties) { + return new CreateResourceValueConfigRequest(properties); + }; + + /** + * Encodes the specified CreateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest} message CreateResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateResourceValueConfigRequest.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.resourceValueConfig != null && Object.hasOwnProperty.call(message, "resourceValueConfig")) + $root.google.cloud.securitycenter.v1.ResourceValueConfig.encode(message.resourceValueConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest} message CreateResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateResourceValueConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateResourceValueConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateResourceValueConfigRequest.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.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) { + var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.verify(message.resourceValueConfig); + if (error) + return "resourceValueConfig." + error; + } + return null; + }; + + /** + * Creates a CreateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest + */ + CreateResourceValueConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceValueConfig != null) { + if (typeof object.resourceValueConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.resourceValueConfig: object expected"); + message.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.fromObject(object.resourceValueConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateResourceValueConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} message CreateResourceValueConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateResourceValueConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceValueConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) + object.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.toObject(message.resourceValueConfig, options); + return object; + }; + + /** + * Converts this CreateResourceValueConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateResourceValueConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateResourceValueConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateResourceValueConfigRequest"; + }; + + return CreateResourceValueConfigRequest; + })(); + + v1.BatchCreateResourceValueConfigsRequest = (function() { + + /** + * Properties of a BatchCreateResourceValueConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IBatchCreateResourceValueConfigsRequest + * @property {string|null} [parent] BatchCreateResourceValueConfigsRequest parent + * @property {Array.|null} [requests] BatchCreateResourceValueConfigsRequest requests + */ + + /** + * Constructs a new BatchCreateResourceValueConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BatchCreateResourceValueConfigsRequest. + * @implements IBatchCreateResourceValueConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest=} [properties] Properties to set + */ + function BatchCreateResourceValueConfigsRequest(properties) { + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateResourceValueConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @instance + */ + BatchCreateResourceValueConfigsRequest.prototype.parent = ""; + + /** + * BatchCreateResourceValueConfigsRequest requests. + * @member {Array.} requests + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @instance + */ + BatchCreateResourceValueConfigsRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchCreateResourceValueConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest instance + */ + BatchCreateResourceValueConfigsRequest.create = function create(properties) { + return new BatchCreateResourceValueConfigsRequest(properties); + }; + + /** + * Encodes the specified BatchCreateResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateResourceValueConfigsRequest.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.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateResourceValueConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateResourceValueConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateResourceValueConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateResourceValueConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateResourceValueConfigsRequest.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.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest + */ + BatchCreateResourceValueConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateResourceValueConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateResourceValueConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateResourceValueConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateResourceValueConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateResourceValueConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateResourceValueConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest"; + }; + + return BatchCreateResourceValueConfigsRequest; + })(); + + v1.BatchCreateResourceValueConfigsResponse = (function() { + + /** + * Properties of a BatchCreateResourceValueConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IBatchCreateResourceValueConfigsResponse + * @property {Array.|null} [resourceValueConfigs] BatchCreateResourceValueConfigsResponse resourceValueConfigs + */ + + /** + * Constructs a new BatchCreateResourceValueConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BatchCreateResourceValueConfigsResponse. + * @implements IBatchCreateResourceValueConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse=} [properties] Properties to set + */ + function BatchCreateResourceValueConfigsResponse(properties) { + this.resourceValueConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateResourceValueConfigsResponse resourceValueConfigs. + * @member {Array.} resourceValueConfigs + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @instance + */ + BatchCreateResourceValueConfigsResponse.prototype.resourceValueConfigs = $util.emptyArray; + + /** + * Creates a new BatchCreateResourceValueConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse instance + */ + BatchCreateResourceValueConfigsResponse.create = function create(properties) { + return new BatchCreateResourceValueConfigsResponse(properties); + }; + + /** + * Encodes the specified BatchCreateResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateResourceValueConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceValueConfigs != null && message.resourceValueConfigs.length) + for (var i = 0; i < message.resourceValueConfigs.length; ++i) + $root.google.cloud.securitycenter.v1.ResourceValueConfig.encode(message.resourceValueConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateResourceValueConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateResourceValueConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceValueConfigs && message.resourceValueConfigs.length)) + message.resourceValueConfigs = []; + message.resourceValueConfigs.push($root.google.cloud.securitycenter.v1.ResourceValueConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateResourceValueConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateResourceValueConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateResourceValueConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceValueConfigs != null && message.hasOwnProperty("resourceValueConfigs")) { + if (!Array.isArray(message.resourceValueConfigs)) + return "resourceValueConfigs: array expected"; + for (var i = 0; i < message.resourceValueConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.verify(message.resourceValueConfigs[i]); + if (error) + return "resourceValueConfigs." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse + */ + BatchCreateResourceValueConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse(); + if (object.resourceValueConfigs) { + if (!Array.isArray(object.resourceValueConfigs)) + throw TypeError(".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.resourceValueConfigs: array expected"); + message.resourceValueConfigs = []; + for (var i = 0; i < object.resourceValueConfigs.length; ++i) { + if (typeof object.resourceValueConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.resourceValueConfigs: object expected"); + message.resourceValueConfigs[i] = $root.google.cloud.securitycenter.v1.ResourceValueConfig.fromObject(object.resourceValueConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateResourceValueConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateResourceValueConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceValueConfigs = []; + if (message.resourceValueConfigs && message.resourceValueConfigs.length) { + object.resourceValueConfigs = []; + for (var j = 0; j < message.resourceValueConfigs.length; ++j) + object.resourceValueConfigs[j] = $root.google.cloud.securitycenter.v1.ResourceValueConfig.toObject(message.resourceValueConfigs[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateResourceValueConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateResourceValueConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateResourceValueConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateResourceValueConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse"; + }; + + return BatchCreateResourceValueConfigsResponse; + })(); + + v1.DeleteResourceValueConfigRequest = (function() { + + /** + * Properties of a DeleteResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteResourceValueConfigRequest + * @property {string|null} [name] DeleteResourceValueConfigRequest name + */ + + /** + * Constructs a new DeleteResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteResourceValueConfigRequest. + * @implements IDeleteResourceValueConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest=} [properties] Properties to set + */ + function DeleteResourceValueConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteResourceValueConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @instance + */ + DeleteResourceValueConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteResourceValueConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest instance + */ + DeleteResourceValueConfigRequest.create = function create(properties) { + return new DeleteResourceValueConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourceValueConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteResourceValueConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest + */ + DeleteResourceValueConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteResourceValueConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteResourceValueConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteResourceValueConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest"; + }; + + return DeleteResourceValueConfigRequest; + })(); + + v1.GetResourceValueConfigRequest = (function() { + + /** + * Properties of a GetResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetResourceValueConfigRequest + * @property {string|null} [name] GetResourceValueConfigRequest name + */ + + /** + * Constructs a new GetResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetResourceValueConfigRequest. + * @implements IGetResourceValueConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest=} [properties] Properties to set + */ + function GetResourceValueConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetResourceValueConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @instance + */ + GetResourceValueConfigRequest.prototype.name = ""; + + /** + * Creates a new GetResourceValueConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} GetResourceValueConfigRequest instance + */ + GetResourceValueConfigRequest.create = function create(properties) { + return new GetResourceValueConfigRequest(properties); + }; + + /** + * Encodes the specified GetResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetResourceValueConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest} message GetResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourceValueConfigRequest.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 GetResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetResourceValueConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest} message GetResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} GetResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourceValueConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetResourceValueConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} GetResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetResourceValueConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetResourceValueConfigRequest.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 GetResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} GetResourceValueConfigRequest + */ + GetResourceValueConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetResourceValueConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetResourceValueConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetResourceValueConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} message GetResourceValueConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetResourceValueConfigRequest.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 GetResourceValueConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetResourceValueConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetResourceValueConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetResourceValueConfigRequest"; + }; + + return GetResourceValueConfigRequest; + })(); + + v1.ListResourceValueConfigsRequest = (function() { + + /** + * Properties of a ListResourceValueConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListResourceValueConfigsRequest + * @property {string|null} [parent] ListResourceValueConfigsRequest parent + * @property {number|null} [pageSize] ListResourceValueConfigsRequest pageSize + * @property {string|null} [pageToken] ListResourceValueConfigsRequest pageToken + */ + + /** + * Constructs a new ListResourceValueConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListResourceValueConfigsRequest. + * @implements IListResourceValueConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest=} [properties] Properties to set + */ + function ListResourceValueConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceValueConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @instance + */ + ListResourceValueConfigsRequest.prototype.parent = ""; + + /** + * ListResourceValueConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @instance + */ + ListResourceValueConfigsRequest.prototype.pageSize = 0; + + /** + * ListResourceValueConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @instance + */ + ListResourceValueConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListResourceValueConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest instance + */ + ListResourceValueConfigsRequest.create = function create(properties) { + return new ListResourceValueConfigsRequest(properties); + }; + + /** + * Encodes the specified ListResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest} message ListResourceValueConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest} message ListResourceValueConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceValueConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceValueConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListResourceValueConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceValueConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceValueConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest + */ + ListResourceValueConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest(); + 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 ListResourceValueConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} message ListResourceValueConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListResourceValueConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceValueConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceValueConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListResourceValueConfigsRequest"; + }; + + return ListResourceValueConfigsRequest; + })(); + + v1.ListResourceValueConfigsResponse = (function() { + + /** + * Properties of a ListResourceValueConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListResourceValueConfigsResponse + * @property {Array.|null} [resourceValueConfigs] ListResourceValueConfigsResponse resourceValueConfigs + * @property {string|null} [nextPageToken] ListResourceValueConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListResourceValueConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListResourceValueConfigsResponse. + * @implements IListResourceValueConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsResponse=} [properties] Properties to set + */ + function ListResourceValueConfigsResponse(properties) { + this.resourceValueConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceValueConfigsResponse resourceValueConfigs. + * @member {Array.} resourceValueConfigs + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @instance + */ + ListResourceValueConfigsResponse.prototype.resourceValueConfigs = $util.emptyArray; + + /** + * ListResourceValueConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @instance + */ + ListResourceValueConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListResourceValueConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse instance + */ + ListResourceValueConfigsResponse.create = function create(properties) { + return new ListResourceValueConfigsResponse(properties); + }; + + /** + * Encodes the specified ListResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsResponse} message ListResourceValueConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceValueConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceValueConfigs != null && message.resourceValueConfigs.length) + for (var i = 0; i < message.resourceValueConfigs.length; ++i) + $root.google.cloud.securitycenter.v1.ResourceValueConfig.encode(message.resourceValueConfigs[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 ListResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsResponse} message ListResourceValueConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceValueConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceValueConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceValueConfigs && message.resourceValueConfigs.length)) + message.resourceValueConfigs = []; + message.resourceValueConfigs.push($root.google.cloud.securitycenter.v1.ResourceValueConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceValueConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceValueConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceValueConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceValueConfigs != null && message.hasOwnProperty("resourceValueConfigs")) { + if (!Array.isArray(message.resourceValueConfigs)) + return "resourceValueConfigs: array expected"; + for (var i = 0; i < message.resourceValueConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.verify(message.resourceValueConfigs[i]); + if (error) + return "resourceValueConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse + */ + ListResourceValueConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse(); + if (object.resourceValueConfigs) { + if (!Array.isArray(object.resourceValueConfigs)) + throw TypeError(".google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.resourceValueConfigs: array expected"); + message.resourceValueConfigs = []; + for (var i = 0; i < object.resourceValueConfigs.length; ++i) { + if (typeof object.resourceValueConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.resourceValueConfigs: object expected"); + message.resourceValueConfigs[i] = $root.google.cloud.securitycenter.v1.ResourceValueConfig.fromObject(object.resourceValueConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListResourceValueConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} message ListResourceValueConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceValueConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceValueConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.resourceValueConfigs && message.resourceValueConfigs.length) { + object.resourceValueConfigs = []; + for (var j = 0; j < message.resourceValueConfigs.length; ++j) + object.resourceValueConfigs[j] = $root.google.cloud.securitycenter.v1.ResourceValueConfig.toObject(message.resourceValueConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListResourceValueConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListResourceValueConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceValueConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceValueConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListResourceValueConfigsResponse"; + }; + + return ListResourceValueConfigsResponse; + })(); + + v1.UpdateResourceValueConfigRequest = (function() { + + /** + * Properties of an UpdateResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateResourceValueConfigRequest + * @property {google.cloud.securitycenter.v1.IResourceValueConfig|null} [resourceValueConfig] UpdateResourceValueConfigRequest resourceValueConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateResourceValueConfigRequest updateMask + */ + + /** + * Constructs a new UpdateResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateResourceValueConfigRequest. + * @implements IUpdateResourceValueConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest=} [properties] Properties to set + */ + function UpdateResourceValueConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateResourceValueConfigRequest resourceValueConfig. + * @member {google.cloud.securitycenter.v1.IResourceValueConfig|null|undefined} resourceValueConfig + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @instance + */ + UpdateResourceValueConfigRequest.prototype.resourceValueConfig = null; + + /** + * UpdateResourceValueConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @instance + */ + UpdateResourceValueConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateResourceValueConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest instance + */ + UpdateResourceValueConfigRequest.create = function create(properties) { + return new UpdateResourceValueConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateResourceValueConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceValueConfig != null && Object.hasOwnProperty.call(message, "resourceValueConfig")) + $root.google.cloud.securitycenter.v1.ResourceValueConfig.encode(message.resourceValueConfig, 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 UpdateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateResourceValueConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.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 UpdateResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateResourceValueConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateResourceValueConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) { + var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.verify(message.resourceValueConfig); + if (error) + return "resourceValueConfig." + 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 UpdateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest + */ + UpdateResourceValueConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest(); + if (object.resourceValueConfig != null) { + if (typeof object.resourceValueConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.resourceValueConfig: object expected"); + message.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.fromObject(object.resourceValueConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateResourceValueConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateResourceValueConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceValueConfig = null; + object.updateMask = null; + } + if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) + object.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.toObject(message.resourceValueConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateResourceValueConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateResourceValueConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateResourceValueConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest"; + }; + + return UpdateResourceValueConfigRequest; + })(); + + 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); + }; + + /** + * 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; + }; + + /** + * 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 + */ + CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.CreateSecurityHealthAnalyticsCustomModuleRequest = (function() { + + /** + * Properties of a CreateSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateSecurityHealthAnalyticsCustomModuleRequest + * @property {string|null} [parent] CreateSecurityHealthAnalyticsCustomModuleRequest parent + * @property {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null} [securityHealthAnalyticsCustomModule] CreateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule + */ + + /** + * Constructs a new CreateSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateSecurityHealthAnalyticsCustomModuleRequest. + * @implements ICreateSecurityHealthAnalyticsCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + */ + function CreateSecurityHealthAnalyticsCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecurityHealthAnalyticsCustomModuleRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.prototype.parent = ""; + + /** + * CreateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule. + * @member {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null|undefined} securityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.prototype.securityHealthAnalyticsCustomModule = null; + + /** + * Creates a new CreateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} CreateSecurityHealthAnalyticsCustomModuleRequest instance + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { + return new CreateSecurityHealthAnalyticsCustomModuleRequest(properties); + }; + + /** + * Encodes the specified CreateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest} message CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.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.securityHealthAnalyticsCustomModule != null && Object.hasOwnProperty.call(message, "securityHealthAnalyticsCustomModule")) + $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.encode(message.securityHealthAnalyticsCustomModule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest} message CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} CreateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} CreateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecurityHealthAnalyticsCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.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.securityHealthAnalyticsCustomModule != null && message.hasOwnProperty("securityHealthAnalyticsCustomModule")) { + var error = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify(message.securityHealthAnalyticsCustomModule); + if (error) + return "securityHealthAnalyticsCustomModule." + error; + } + return null; + }; + + /** + * Creates a CreateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} CreateSecurityHealthAnalyticsCustomModuleRequest + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.securityHealthAnalyticsCustomModule != null) { + if (typeof object.securityHealthAnalyticsCustomModule !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.securityHealthAnalyticsCustomModule: object expected"); + message.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.fromObject(object.securityHealthAnalyticsCustomModule); + } + return message; + }; + + /** + * Creates a plain object from a CreateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} message CreateSecurityHealthAnalyticsCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.securityHealthAnalyticsCustomModule = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.securityHealthAnalyticsCustomModule != null && message.hasOwnProperty("securityHealthAnalyticsCustomModule")) + object.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.toObject(message.securityHealthAnalyticsCustomModule, options); + return object; + }; + + /** + * Converts this CreateSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecurityHealthAnalyticsCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest"; + }; + + return CreateSecurityHealthAnalyticsCustomModuleRequest; + })(); + + 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 && 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.DeleteMuteConfigRequest = (function() { + + /** + * Properties of a DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteMuteConfigRequest + * @property {string|null} [name] DeleteMuteConfigRequest name + */ + + /** + * 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 + */ + 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]]; + } + + /** + * DeleteMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @instance + */ + DeleteMuteConfigRequest.prototype.name = ""; + + /** + * 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); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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 + */ + DeleteMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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 + */ + 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; + }; + + /** + * Converts this DeleteMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMuteConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.DeleteNotificationConfigRequest = (function() { + + /** + * Properties of a DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name + */ + + /** + * 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 + */ + 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]]; + } + + /** + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @instance + */ + DeleteNotificationConfigRequest.prototype.name = ""; + + /** + * 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); + }; + + /** + * 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 + */ + DeleteNotificationConfigRequest.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 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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 + */ + DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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 + */ + 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; + }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.DeleteSecurityHealthAnalyticsCustomModuleRequest = (function() { + + /** + * Properties of a DeleteSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteSecurityHealthAnalyticsCustomModuleRequest + * @property {string|null} [name] DeleteSecurityHealthAnalyticsCustomModuleRequest name + */ + + /** + * Constructs a new DeleteSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteSecurityHealthAnalyticsCustomModuleRequest. + * @implements IDeleteSecurityHealthAnalyticsCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + */ + function DeleteSecurityHealthAnalyticsCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSecurityHealthAnalyticsCustomModuleRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.prototype.name = ""; + + /** + * Creates a new DeleteSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} DeleteSecurityHealthAnalyticsCustomModuleRequest instance + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { + return new DeleteSecurityHealthAnalyticsCustomModuleRequest(properties); + }; + + /** + * Encodes the specified DeleteSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest} message DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.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 DeleteSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest} message DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} DeleteSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} DeleteSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSecurityHealthAnalyticsCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.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 DeleteSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} DeleteSecurityHealthAnalyticsCustomModuleRequest + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} message DeleteSecurityHealthAnalyticsCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.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 DeleteSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSecurityHealthAnalyticsCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest"; + }; + + return DeleteSecurityHealthAnalyticsCustomModuleRequest; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.GetMuteConfigRequest = (function() { + + /** + * Properties of a GetMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetMuteConfigRequest + * @property {string|null} [name] GetMuteConfigRequest name + */ + + /** + * Constructs a new GetMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetMuteConfigRequest. + * @implements IGetMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set + */ + function GetMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @instance + */ + GetMuteConfigRequest.prototype.name = ""; + + /** + * Creates a new GetMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest instance + */ + GetMuteConfigRequest.create = function create(properties) { + return new GetMuteConfigRequest(properties); + }; + + /** + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @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 + */ + GetMuteConfigRequest.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 GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @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 + */ + GetMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @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.GetMuteConfigRequest} GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMuteConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + GetMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMuteConfigRequest message. + * @function verify + * @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 + */ + GetMuteConfigRequest.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 GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest + */ + GetMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetMuteConfigRequest) + return object; + 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 GetMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.GetMuteConfigRequest} message GetMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMuteConfigRequest.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 GetMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetMuteConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.GetNotificationConfigRequest = (function() { + + /** + * Properties of a GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name + */ + + /** + * 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 + */ + 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]]; + } + + /** + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @instance + */ + GetNotificationConfigRequest.prototype.name = ""; + + /** + * 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); + }; + + /** + * 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 + */ + GetNotificationConfigRequest.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 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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 + */ + GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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 + */ + 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; + }; + + /** + * Converts this GetNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest = (function() { + + /** + * Properties of a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @property {string|null} [name] GetEffectiveSecurityHealthAnalyticsCustomModuleRequest name + */ + + /** + * Constructs a new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. + * @implements IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + */ + function GetEffectiveSecurityHealthAnalyticsCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEffectiveSecurityHealthAnalyticsCustomModuleRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.prototype.name = ""; + + /** + * Creates a new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} GetEffectiveSecurityHealthAnalyticsCustomModuleRequest instance + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { + return new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest(properties); + }; + + /** + * Encodes the specified GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest} message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest} message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest"; + }; + + return GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; + })(); + + v1.GetSecurityHealthAnalyticsCustomModuleRequest = (function() { + + /** + * Properties of a GetSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetSecurityHealthAnalyticsCustomModuleRequest + * @property {string|null} [name] GetSecurityHealthAnalyticsCustomModuleRequest name + */ + + /** + * Constructs a new GetSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetSecurityHealthAnalyticsCustomModuleRequest. + * @implements IGetSecurityHealthAnalyticsCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + */ + function GetSecurityHealthAnalyticsCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSecurityHealthAnalyticsCustomModuleRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + GetSecurityHealthAnalyticsCustomModuleRequest.prototype.name = ""; + + /** + * Creates a new GetSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} GetSecurityHealthAnalyticsCustomModuleRequest instance + */ + GetSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { + return new GetSecurityHealthAnalyticsCustomModuleRequest(properties); + }; + + /** + * Encodes the specified GetSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest} message GetSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecurityHealthAnalyticsCustomModuleRequest.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 GetSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest} message GetSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} GetSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} GetSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSecurityHealthAnalyticsCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSecurityHealthAnalyticsCustomModuleRequest.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 GetSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} GetSecurityHealthAnalyticsCustomModuleRequest + */ + GetSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} message GetSecurityHealthAnalyticsCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSecurityHealthAnalyticsCustomModuleRequest.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 GetSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + GetSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSecurityHealthAnalyticsCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest"; + }; + + return GetSecurityHealthAnalyticsCustomModuleRequest; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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); + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + 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); + }; + + /** + * 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; + })(); + + v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest = (function() { + + /** + * Properties of a ListDescendantSecurityHealthAnalyticsCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @property {string|null} [parent] ListDescendantSecurityHealthAnalyticsCustomModulesRequest parent + * @property {number|null} [pageSize] ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageSize + * @property {string|null} [pageToken] ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageToken + */ + + /** + * Constructs a new ListDescendantSecurityHealthAnalyticsCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListDescendantSecurityHealthAnalyticsCustomModulesRequest. + * @implements IListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set + */ + function ListDescendantSecurityHealthAnalyticsCustomModulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDescendantSecurityHealthAnalyticsCustomModulesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.prototype.parent = ""; + + /** + * ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.prototype.pageSize = 0; + + /** + * ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDescendantSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} ListDescendantSecurityHealthAnalyticsCustomModulesRequest instance + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.create = function create(properties) { + return new ListDescendantSecurityHealthAnalyticsCustomModulesRequest(properties); + }; + + /** + * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest} message ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest} message ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} ListDescendantSecurityHealthAnalyticsCustomModulesRequest + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest(); + 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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} message ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDescendantSecurityHealthAnalyticsCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest"; + }; + + return ListDescendantSecurityHealthAnalyticsCustomModulesRequest; + })(); + + v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse = (function() { + + /** + * Properties of a ListDescendantSecurityHealthAnalyticsCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @property {Array.|null} [securityHealthAnalyticsCustomModules] ListDescendantSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules + * @property {string|null} [nextPageToken] ListDescendantSecurityHealthAnalyticsCustomModulesResponse nextPageToken + */ + + /** + * Constructs a new ListDescendantSecurityHealthAnalyticsCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListDescendantSecurityHealthAnalyticsCustomModulesResponse. + * @implements IListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set + */ + function ListDescendantSecurityHealthAnalyticsCustomModulesResponse(properties) { + this.securityHealthAnalyticsCustomModules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDescendantSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules. + * @member {Array.} securityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @instance + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.prototype.securityHealthAnalyticsCustomModules = $util.emptyArray; + + /** + * ListDescendantSecurityHealthAnalyticsCustomModulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @instance + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDescendantSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} ListDescendantSecurityHealthAnalyticsCustomModulesResponse instance + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.create = function create(properties) { + return new ListDescendantSecurityHealthAnalyticsCustomModulesResponse(properties); + }; + + /** + * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse} message ListDescendantSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityHealthAnalyticsCustomModules != null && message.securityHealthAnalyticsCustomModules.length) + for (var i = 0; i < message.securityHealthAnalyticsCustomModules.length; ++i) + $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.encode(message.securityHealthAnalyticsCustomModules[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 ListDescendantSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse} message ListDescendantSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.securityHealthAnalyticsCustomModules && message.securityHealthAnalyticsCustomModules.length)) + message.securityHealthAnalyticsCustomModules = []; + message.securityHealthAnalyticsCustomModules.push($root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityHealthAnalyticsCustomModules != null && message.hasOwnProperty("securityHealthAnalyticsCustomModules")) { + if (!Array.isArray(message.securityHealthAnalyticsCustomModules)) + return "securityHealthAnalyticsCustomModules: array expected"; + for (var i = 0; i < message.securityHealthAnalyticsCustomModules.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify(message.securityHealthAnalyticsCustomModules[i]); + if (error) + return "securityHealthAnalyticsCustomModules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} ListDescendantSecurityHealthAnalyticsCustomModulesResponse + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse(); + if (object.securityHealthAnalyticsCustomModules) { + if (!Array.isArray(object.securityHealthAnalyticsCustomModules)) + throw TypeError(".google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.securityHealthAnalyticsCustomModules: array expected"); + message.securityHealthAnalyticsCustomModules = []; + for (var i = 0; i < object.securityHealthAnalyticsCustomModules.length; ++i) { + if (typeof object.securityHealthAnalyticsCustomModules[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.securityHealthAnalyticsCustomModules: object expected"); + message.securityHealthAnalyticsCustomModules[i] = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.fromObject(object.securityHealthAnalyticsCustomModules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} message ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.securityHealthAnalyticsCustomModules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.securityHealthAnalyticsCustomModules && message.securityHealthAnalyticsCustomModules.length) { + object.securityHealthAnalyticsCustomModules = []; + for (var j = 0; j < message.securityHealthAnalyticsCustomModules.length; ++j) + object.securityHealthAnalyticsCustomModules[j] = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.toObject(message.securityHealthAnalyticsCustomModules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDescendantSecurityHealthAnalyticsCustomModulesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDescendantSecurityHealthAnalyticsCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse"; + }; + + return ListDescendantSecurityHealthAnalyticsCustomModulesResponse; + })(); + + v1.ListValuedResourcesRequest = (function() { + + /** + * Properties of a ListValuedResourcesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListValuedResourcesRequest + * @property {string|null} [parent] ListValuedResourcesRequest parent + * @property {string|null} [filter] ListValuedResourcesRequest filter + * @property {string|null} [pageToken] ListValuedResourcesRequest pageToken + * @property {number|null} [pageSize] ListValuedResourcesRequest pageSize + * @property {string|null} [orderBy] ListValuedResourcesRequest orderBy + */ + + /** + * Constructs a new ListValuedResourcesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListValuedResourcesRequest. + * @implements IListValuedResourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest=} [properties] Properties to set + */ + function ListValuedResourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValuedResourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.parent = ""; + + /** + * ListValuedResourcesRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.filter = ""; + + /** + * ListValuedResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.pageToken = ""; + + /** + * ListValuedResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.pageSize = 0; + + /** + * ListValuedResourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListValuedResourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListValuedResourcesRequest} ListValuedResourcesRequest instance + */ + ListValuedResourcesRequest.create = function create(properties) { + return new ListValuedResourcesRequest(properties); + }; + + /** + * Encodes the specified ListValuedResourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest} message ListValuedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValuedResourcesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListValuedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest} message ListValuedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValuedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValuedResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListValuedResourcesRequest} ListValuedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValuedResourcesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListValuedResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValuedResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListValuedResourcesRequest} ListValuedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValuedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValuedResourcesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValuedResourcesRequest.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.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListValuedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListValuedResourcesRequest} ListValuedResourcesRequest + */ + ListValuedResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListValuedResourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListValuedResourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListValuedResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListValuedResourcesRequest} message ListValuedResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValuedResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageToken = ""; + object.pageSize = 0; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListValuedResourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListValuedResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValuedResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValuedResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListValuedResourcesRequest"; + }; + + return ListValuedResourcesRequest; + })(); + + v1.ListValuedResourcesResponse = (function() { + + /** + * Properties of a ListValuedResourcesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListValuedResourcesResponse + * @property {Array.|null} [valuedResources] ListValuedResourcesResponse valuedResources + * @property {string|null} [nextPageToken] ListValuedResourcesResponse nextPageToken + * @property {number|null} [totalSize] ListValuedResourcesResponse totalSize + */ + + /** + * Constructs a new ListValuedResourcesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListValuedResourcesResponse. + * @implements IListValuedResourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListValuedResourcesResponse=} [properties] Properties to set + */ + function ListValuedResourcesResponse(properties) { + this.valuedResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValuedResourcesResponse valuedResources. + * @member {Array.} valuedResources + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @instance + */ + ListValuedResourcesResponse.prototype.valuedResources = $util.emptyArray; + + /** + * ListValuedResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @instance + */ + ListValuedResourcesResponse.prototype.nextPageToken = ""; + + /** + * ListValuedResourcesResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @instance + */ + ListValuedResourcesResponse.prototype.totalSize = 0; + + /** + * Creates a new ListValuedResourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListValuedResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListValuedResourcesResponse} ListValuedResourcesResponse instance + */ + ListValuedResourcesResponse.create = function create(properties) { + return new ListValuedResourcesResponse(properties); + }; + + /** + * Encodes the specified ListValuedResourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListValuedResourcesResponse} message ListValuedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValuedResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.valuedResources != null && message.valuedResources.length) + for (var i = 0; i < message.valuedResources.length; ++i) + $root.google.cloud.securitycenter.v1.ValuedResource.encode(message.valuedResources[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); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListValuedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListValuedResourcesResponse} message ListValuedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValuedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValuedResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListValuedResourcesResponse} ListValuedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValuedResourcesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListValuedResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.valuedResources && message.valuedResources.length)) + message.valuedResources = []; + message.valuedResources.push($root.google.cloud.securitycenter.v1.ValuedResource.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValuedResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListValuedResourcesResponse} ListValuedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValuedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValuedResourcesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValuedResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.valuedResources != null && message.hasOwnProperty("valuedResources")) { + if (!Array.isArray(message.valuedResources)) + return "valuedResources: array expected"; + for (var i = 0; i < message.valuedResources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ValuedResource.verify(message.valuedResources[i]); + if (error) + return "valuedResources." + 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 ListValuedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListValuedResourcesResponse} ListValuedResourcesResponse + */ + ListValuedResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListValuedResourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListValuedResourcesResponse(); + if (object.valuedResources) { + if (!Array.isArray(object.valuedResources)) + throw TypeError(".google.cloud.securitycenter.v1.ListValuedResourcesResponse.valuedResources: array expected"); + message.valuedResources = []; + for (var i = 0; i < object.valuedResources.length; ++i) { + if (typeof object.valuedResources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListValuedResourcesResponse.valuedResources: object expected"); + message.valuedResources[i] = $root.google.cloud.securitycenter.v1.ValuedResource.fromObject(object.valuedResources[i]); + } + } + 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 ListValuedResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListValuedResourcesResponse} message ListValuedResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValuedResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.valuedResources = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.valuedResources && message.valuedResources.length) { + object.valuedResources = []; + for (var j = 0; j < message.valuedResources.length; ++j) + object.valuedResources[j] = $root.google.cloud.securitycenter.v1.ValuedResource.toObject(message.valuedResources[j], 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 ListValuedResourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListValuedResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValuedResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValuedResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListValuedResourcesResponse"; + }; + + return ListValuedResourcesResponse; + })(); + + v1.ListAttackPathsRequest = (function() { + + /** + * Properties of a ListAttackPathsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListAttackPathsRequest + * @property {string|null} [parent] ListAttackPathsRequest parent + * @property {string|null} [filter] ListAttackPathsRequest filter + * @property {string|null} [pageToken] ListAttackPathsRequest pageToken + * @property {number|null} [pageSize] ListAttackPathsRequest pageSize + */ + + /** + * Constructs a new ListAttackPathsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListAttackPathsRequest. + * @implements IListAttackPathsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest=} [properties] Properties to set + */ + function ListAttackPathsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttackPathsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @instance + */ + ListAttackPathsRequest.prototype.parent = ""; + + /** + * ListAttackPathsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @instance + */ + ListAttackPathsRequest.prototype.filter = ""; + + /** + * ListAttackPathsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @instance + */ + ListAttackPathsRequest.prototype.pageToken = ""; + + /** + * ListAttackPathsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @instance + */ + ListAttackPathsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAttackPathsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAttackPathsRequest} ListAttackPathsRequest instance + */ + ListAttackPathsRequest.create = function create(properties) { + return new ListAttackPathsRequest(properties); + }; + + /** + * Encodes the specified ListAttackPathsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest} message ListAttackPathsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttackPathsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAttackPathsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest} message ListAttackPathsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttackPathsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttackPathsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAttackPathsRequest} ListAttackPathsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttackPathsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAttackPathsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttackPathsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAttackPathsRequest} ListAttackPathsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttackPathsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttackPathsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttackPathsRequest.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.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 ListAttackPathsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAttackPathsRequest} ListAttackPathsRequest + */ + ListAttackPathsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAttackPathsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAttackPathsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + 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 ListAttackPathsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListAttackPathsRequest} message ListAttackPathsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttackPathsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + 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.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListAttackPathsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAttackPathsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttackPathsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttackPathsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAttackPathsRequest"; + }; + + return ListAttackPathsRequest; + })(); + + v1.ListAttackPathsResponse = (function() { + + /** + * Properties of a ListAttackPathsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListAttackPathsResponse + * @property {Array.|null} [attackPaths] ListAttackPathsResponse attackPaths + * @property {string|null} [nextPageToken] ListAttackPathsResponse nextPageToken + */ + + /** + * Constructs a new ListAttackPathsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListAttackPathsResponse. + * @implements IListAttackPathsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListAttackPathsResponse=} [properties] Properties to set + */ + function ListAttackPathsResponse(properties) { + this.attackPaths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttackPathsResponse attackPaths. + * @member {Array.} attackPaths + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @instance + */ + ListAttackPathsResponse.prototype.attackPaths = $util.emptyArray; + + /** + * ListAttackPathsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @instance + */ + ListAttackPathsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAttackPathsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAttackPathsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAttackPathsResponse} ListAttackPathsResponse instance + */ + ListAttackPathsResponse.create = function create(properties) { + return new ListAttackPathsResponse(properties); + }; + + /** + * Encodes the specified ListAttackPathsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAttackPathsResponse} message ListAttackPathsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttackPathsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attackPaths != null && message.attackPaths.length) + for (var i = 0; i < message.attackPaths.length; ++i) + $root.google.cloud.securitycenter.v1.AttackPath.encode(message.attackPaths[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 ListAttackPathsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAttackPathsResponse} message ListAttackPathsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttackPathsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttackPathsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAttackPathsResponse} ListAttackPathsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttackPathsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAttackPathsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.attackPaths && message.attackPaths.length)) + message.attackPaths = []; + message.attackPaths.push($root.google.cloud.securitycenter.v1.AttackPath.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttackPathsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAttackPathsResponse} ListAttackPathsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttackPathsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttackPathsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttackPathsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attackPaths != null && message.hasOwnProperty("attackPaths")) { + if (!Array.isArray(message.attackPaths)) + return "attackPaths: array expected"; + for (var i = 0; i < message.attackPaths.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.AttackPath.verify(message.attackPaths[i]); + if (error) + return "attackPaths." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttackPathsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAttackPathsResponse} ListAttackPathsResponse + */ + ListAttackPathsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAttackPathsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAttackPathsResponse(); + if (object.attackPaths) { + if (!Array.isArray(object.attackPaths)) + throw TypeError(".google.cloud.securitycenter.v1.ListAttackPathsResponse.attackPaths: array expected"); + message.attackPaths = []; + for (var i = 0; i < object.attackPaths.length; ++i) { + if (typeof object.attackPaths[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAttackPathsResponse.attackPaths: object expected"); + message.attackPaths[i] = $root.google.cloud.securitycenter.v1.AttackPath.fromObject(object.attackPaths[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttackPathsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListAttackPathsResponse} message ListAttackPathsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttackPathsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attackPaths = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.attackPaths && message.attackPaths.length) { + object.attackPaths = []; + for (var j = 0; j < message.attackPaths.length; ++j) + object.attackPaths[j] = $root.google.cloud.securitycenter.v1.AttackPath.toObject(message.attackPaths[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAttackPathsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAttackPathsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttackPathsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttackPathsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAttackPathsResponse"; + }; + + return ListAttackPathsResponse; + })(); + + v1.GetSimulationRequest = (function() { + + /** + * Properties of a GetSimulationRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetSimulationRequest + * @property {string|null} [name] GetSimulationRequest name + */ + + /** + * Constructs a new GetSimulationRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetSimulationRequest. + * @implements IGetSimulationRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetSimulationRequest=} [properties] Properties to set + */ + function GetSimulationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSimulationRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @instance + */ + GetSimulationRequest.prototype.name = ""; + + /** + * Creates a new GetSimulationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSimulationRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSimulationRequest} GetSimulationRequest instance + */ + GetSimulationRequest.create = function create(properties) { + return new GetSimulationRequest(properties); + }; + + /** + * Encodes the specified GetSimulationRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSimulationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSimulationRequest} message GetSimulationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSimulationRequest.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 GetSimulationRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSimulationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSimulationRequest} message GetSimulationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSimulationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSimulationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetSimulationRequest} GetSimulationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSimulationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSimulationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSimulationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetSimulationRequest} GetSimulationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSimulationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSimulationRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSimulationRequest.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 GetSimulationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetSimulationRequest} GetSimulationRequest + */ + GetSimulationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSimulationRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetSimulationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSimulationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {google.cloud.securitycenter.v1.GetSimulationRequest} message GetSimulationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSimulationRequest.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 GetSimulationRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @instance + * @returns {Object.} JSON object + */ + GetSimulationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSimulationRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetSimulationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSimulationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetSimulationRequest"; + }; + + return GetSimulationRequest; + })(); + + v1.GetValuedResourceRequest = (function() { + + /** + * Properties of a GetValuedResourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetValuedResourceRequest + * @property {string|null} [name] GetValuedResourceRequest name + */ + + /** + * Constructs a new GetValuedResourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetValuedResourceRequest. + * @implements IGetValuedResourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest=} [properties] Properties to set + */ + function GetValuedResourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetValuedResourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @instance + */ + GetValuedResourceRequest.prototype.name = ""; + + /** + * Creates a new GetValuedResourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetValuedResourceRequest} GetValuedResourceRequest instance + */ + GetValuedResourceRequest.create = function create(properties) { + return new GetValuedResourceRequest(properties); + }; + + /** + * Encodes the specified GetValuedResourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetValuedResourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest} message GetValuedResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValuedResourceRequest.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 GetValuedResourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetValuedResourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest} message GetValuedResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValuedResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetValuedResourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetValuedResourceRequest} GetValuedResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValuedResourceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetValuedResourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetValuedResourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetValuedResourceRequest} GetValuedResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValuedResourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetValuedResourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetValuedResourceRequest.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 GetValuedResourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetValuedResourceRequest} GetValuedResourceRequest + */ + GetValuedResourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetValuedResourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetValuedResourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetValuedResourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {google.cloud.securitycenter.v1.GetValuedResourceRequest} message GetValuedResourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetValuedResourceRequest.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 GetValuedResourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetValuedResourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetValuedResourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetValuedResourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetValuedResourceRequest"; + }; + + return GetValuedResourceRequest; + })(); + + v1.ListMuteConfigsRequest = (function() { + + /** + * Properties of a ListMuteConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListMuteConfigsRequest + * @property {string|null} [parent] ListMuteConfigsRequest parent + * @property {number|null} [pageSize] ListMuteConfigsRequest pageSize + * @property {string|null} [pageToken] ListMuteConfigsRequest pageToken + */ + + /** + * Constructs a new ListMuteConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListMuteConfigsRequest. + * @implements IListMuteConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set + */ + function ListMuteConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMuteConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.parent = ""; + + /** + * ListMuteConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.pageSize = 0; + + /** + * ListMuteConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMuteConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest instance + */ + ListMuteConfigsRequest.create = function create(properties) { + return new ListMuteConfigsRequest(properties); + }; + + /** + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @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 + */ + ListMuteConfigsRequest.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 ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @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 + */ + ListMuteConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. + * @function decode + * @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.ListMuteConfigsRequest} ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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 ListMuteConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ListMuteConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMuteConfigsRequest message. + * @function verify + * @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 + */ + ListMuteConfigsRequest.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 ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest + */ + ListMuteConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest) + return object; + 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 ListMuteConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListMuteConfigsRequest} message ListMuteConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMuteConfigsRequest.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 ListMuteConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMuteConfigsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.ListMuteConfigsResponse = (function() { + + /** + * Properties of a ListMuteConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListMuteConfigsResponse + * @property {Array.|null} [muteConfigs] ListMuteConfigsResponse muteConfigs + * @property {string|null} [nextPageToken] ListMuteConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListMuteConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListMuteConfigsResponse. + * @implements IListMuteConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set + */ + function ListMuteConfigsResponse(properties) { + this.muteConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMuteConfigsResponse muteConfigs. + * @member {Array.} muteConfigs + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @instance + */ + ListMuteConfigsResponse.prototype.muteConfigs = $util.emptyArray; + + /** + * ListMuteConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @instance + */ + ListMuteConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMuteConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse instance + */ + ListMuteConfigsResponse.create = function create(properties) { + return new ListMuteConfigsResponse(properties); + }; + + /** + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @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 + */ + ListMuteConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @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 + */ + ListMuteConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. + * @function decode + * @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.ListMuteConfigsResponse} ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ListMuteConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMuteConfigsResponse message. + * @function verify + * @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 + */ + ListMuteConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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 "muteConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse + */ + ListMuteConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse) + return object; + 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.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListMuteConfigsResponse} message ListMuteConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMuteConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.muteConfigs = []; + if (options.defaults) + 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMuteConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMuteConfigsResponse.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.ListNotificationConfigsRequest = (function() { + + /** + * Properties of a ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListNotificationConfigsRequest + * @property {string|null} [parent] ListNotificationConfigsRequest parent + * @property {string|null} [pageToken] ListNotificationConfigsRequest pageToken + * @property {number|null} [pageSize] ListNotificationConfigsRequest pageSize + */ + + /** + * Constructs a new ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListNotificationConfigsRequest. + * @implements IListNotificationConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest=} [properties] Properties to set + */ + function ListNotificationConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.parent = ""; + + /** + * ListNotificationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageToken = ""; + + /** + * ListNotificationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListNotificationConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance + */ + ListNotificationConfigsRequest.create = function create(properties) { + return new ListNotificationConfigsRequest(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @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 + */ + ListNotificationConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * 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.ListNotificationConfigsRequest + * @static + * @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 + */ + ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. + * @function decode + * @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.ListNotificationConfigsRequest} ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + 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; + } + } + return message; + }; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + */ + ListNotificationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest) + return object; + 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 ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} message ListNotificationConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.ListNotificationConfigsResponse = (function() { + + /** + * Properties of a ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListNotificationConfigsResponse + * @property {Array.|null} [notificationConfigs] ListNotificationConfigsResponse notificationConfigs + * @property {string|null} [nextPageToken] ListNotificationConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListNotificationConfigsResponse. + * @implements IListNotificationConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse=} [properties] Properties to set + */ + function ListNotificationConfigsResponse(properties) { + this.notificationConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsResponse notificationConfigs. + * @member {Array.} notificationConfigs + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; + + /** + * ListNotificationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListNotificationConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance + */ + ListNotificationConfigsResponse.create = function create(properties) { + return new ListNotificationConfigsResponse(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @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 + */ + ListNotificationConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * 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.ListNotificationConfigsResponse + * @static + * @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 + */ + ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. + * @function decode + * @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.ListNotificationConfigsResponse} ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNotificationConfigsResponse message. + * @function verify + * @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 + */ + ListNotificationConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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 "notificationConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + */ + ListNotificationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse) + return object; + 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.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} message ListNotificationConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest = (function() { + + /** + * Properties of a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @property {string|null} [parent] ListEffectiveSecurityHealthAnalyticsCustomModulesRequest parent + * @property {number|null} [pageSize] ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageSize + * @property {string|null} [pageToken] ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageToken + */ + + /** + * Constructs a new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. + * @implements IListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set + */ + function ListEffectiveSecurityHealthAnalyticsCustomModulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEffectiveSecurityHealthAnalyticsCustomModulesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.prototype.parent = ""; + + /** + * ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.prototype.pageSize = 0; + + /** + * ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} ListEffectiveSecurityHealthAnalyticsCustomModulesRequest instance + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.create = function create(properties) { + return new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest(properties); + }; + + /** + * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest} message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest} message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest(); + 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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest"; + }; + + return ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; + })(); + + v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse = (function() { + + /** + * Properties of a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @property {Array.|null} [effectiveSecurityHealthAnalyticsCustomModules] ListEffectiveSecurityHealthAnalyticsCustomModulesResponse effectiveSecurityHealthAnalyticsCustomModules + * @property {string|null} [nextPageToken] ListEffectiveSecurityHealthAnalyticsCustomModulesResponse nextPageToken + */ + + /** + * Constructs a new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. + * @implements IListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set + */ + function ListEffectiveSecurityHealthAnalyticsCustomModulesResponse(properties) { + this.effectiveSecurityHealthAnalyticsCustomModules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEffectiveSecurityHealthAnalyticsCustomModulesResponse effectiveSecurityHealthAnalyticsCustomModules. + * @member {Array.} effectiveSecurityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @instance + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.prototype.effectiveSecurityHealthAnalyticsCustomModules = $util.emptyArray; + + /** + * ListEffectiveSecurityHealthAnalyticsCustomModulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @instance + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} ListEffectiveSecurityHealthAnalyticsCustomModulesResponse instance + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.create = function create(properties) { + return new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse(properties); + }; + + /** + * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse} message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.effectiveSecurityHealthAnalyticsCustomModules != null && message.effectiveSecurityHealthAnalyticsCustomModules.length) + for (var i = 0; i < message.effectiveSecurityHealthAnalyticsCustomModules.length; ++i) + $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.encode(message.effectiveSecurityHealthAnalyticsCustomModules[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 ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse} message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.effectiveSecurityHealthAnalyticsCustomModules && message.effectiveSecurityHealthAnalyticsCustomModules.length)) + message.effectiveSecurityHealthAnalyticsCustomModules = []; + message.effectiveSecurityHealthAnalyticsCustomModules.push($root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.effectiveSecurityHealthAnalyticsCustomModules != null && message.hasOwnProperty("effectiveSecurityHealthAnalyticsCustomModules")) { + if (!Array.isArray(message.effectiveSecurityHealthAnalyticsCustomModules)) + return "effectiveSecurityHealthAnalyticsCustomModules: array expected"; + for (var i = 0; i < message.effectiveSecurityHealthAnalyticsCustomModules.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify(message.effectiveSecurityHealthAnalyticsCustomModules[i]); + if (error) + return "effectiveSecurityHealthAnalyticsCustomModules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse(); + if (object.effectiveSecurityHealthAnalyticsCustomModules) { + if (!Array.isArray(object.effectiveSecurityHealthAnalyticsCustomModules)) + throw TypeError(".google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.effectiveSecurityHealthAnalyticsCustomModules: array expected"); + message.effectiveSecurityHealthAnalyticsCustomModules = []; + for (var i = 0; i < object.effectiveSecurityHealthAnalyticsCustomModules.length; ++i) { + if (typeof object.effectiveSecurityHealthAnalyticsCustomModules[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.effectiveSecurityHealthAnalyticsCustomModules: object expected"); + message.effectiveSecurityHealthAnalyticsCustomModules[i] = $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.fromObject(object.effectiveSecurityHealthAnalyticsCustomModules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.effectiveSecurityHealthAnalyticsCustomModules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.effectiveSecurityHealthAnalyticsCustomModules && message.effectiveSecurityHealthAnalyticsCustomModules.length) { + object.effectiveSecurityHealthAnalyticsCustomModules = []; + for (var j = 0; j < message.effectiveSecurityHealthAnalyticsCustomModules.length; ++j) + object.effectiveSecurityHealthAnalyticsCustomModules[j] = $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.toObject(message.effectiveSecurityHealthAnalyticsCustomModules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEffectiveSecurityHealthAnalyticsCustomModulesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse"; + }; + + return ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; + })(); + + v1.ListSecurityHealthAnalyticsCustomModulesRequest = (function() { + + /** + * Properties of a ListSecurityHealthAnalyticsCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListSecurityHealthAnalyticsCustomModulesRequest + * @property {string|null} [parent] ListSecurityHealthAnalyticsCustomModulesRequest parent + * @property {number|null} [pageSize] ListSecurityHealthAnalyticsCustomModulesRequest pageSize + * @property {string|null} [pageToken] ListSecurityHealthAnalyticsCustomModulesRequest pageToken + */ + + /** + * Constructs a new ListSecurityHealthAnalyticsCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListSecurityHealthAnalyticsCustomModulesRequest. + * @implements IListSecurityHealthAnalyticsCustomModulesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set + */ + function ListSecurityHealthAnalyticsCustomModulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecurityHealthAnalyticsCustomModulesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListSecurityHealthAnalyticsCustomModulesRequest.prototype.parent = ""; + + /** + * ListSecurityHealthAnalyticsCustomModulesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListSecurityHealthAnalyticsCustomModulesRequest.prototype.pageSize = 0; + + /** + * ListSecurityHealthAnalyticsCustomModulesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @instance + */ + ListSecurityHealthAnalyticsCustomModulesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} ListSecurityHealthAnalyticsCustomModulesRequest instance + */ + ListSecurityHealthAnalyticsCustomModulesRequest.create = function create(properties) { + return new ListSecurityHealthAnalyticsCustomModulesRequest(properties); + }; + + /** + * Encodes the specified ListSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest} message ListSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecurityHealthAnalyticsCustomModulesRequest.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 ListSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest} message ListSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecurityHealthAnalyticsCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} ListSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecurityHealthAnalyticsCustomModulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} ListSecurityHealthAnalyticsCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecurityHealthAnalyticsCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecurityHealthAnalyticsCustomModulesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecurityHealthAnalyticsCustomModulesRequest.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 ListSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} ListSecurityHealthAnalyticsCustomModulesRequest + */ + ListSecurityHealthAnalyticsCustomModulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest(); + 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 ListSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} message ListSecurityHealthAnalyticsCustomModulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecurityHealthAnalyticsCustomModulesRequest.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 ListSecurityHealthAnalyticsCustomModulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSecurityHealthAnalyticsCustomModulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecurityHealthAnalyticsCustomModulesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecurityHealthAnalyticsCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest"; + }; + + return ListSecurityHealthAnalyticsCustomModulesRequest; + })(); + + v1.ListSecurityHealthAnalyticsCustomModulesResponse = (function() { + + /** + * Properties of a ListSecurityHealthAnalyticsCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListSecurityHealthAnalyticsCustomModulesResponse + * @property {Array.|null} [securityHealthAnalyticsCustomModules] ListSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules + * @property {string|null} [nextPageToken] ListSecurityHealthAnalyticsCustomModulesResponse nextPageToken + */ + + /** + * Constructs a new ListSecurityHealthAnalyticsCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListSecurityHealthAnalyticsCustomModulesResponse. + * @implements IListSecurityHealthAnalyticsCustomModulesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set + */ + function ListSecurityHealthAnalyticsCustomModulesResponse(properties) { + this.securityHealthAnalyticsCustomModules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules. + * @member {Array.} securityHealthAnalyticsCustomModules + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @instance + */ + ListSecurityHealthAnalyticsCustomModulesResponse.prototype.securityHealthAnalyticsCustomModules = $util.emptyArray; + + /** + * ListSecurityHealthAnalyticsCustomModulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @instance + */ + ListSecurityHealthAnalyticsCustomModulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} ListSecurityHealthAnalyticsCustomModulesResponse instance + */ + ListSecurityHealthAnalyticsCustomModulesResponse.create = function create(properties) { + return new ListSecurityHealthAnalyticsCustomModulesResponse(properties); + }; + + /** + * Encodes the specified ListSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse} message ListSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecurityHealthAnalyticsCustomModulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityHealthAnalyticsCustomModules != null && message.securityHealthAnalyticsCustomModules.length) + for (var i = 0; i < message.securityHealthAnalyticsCustomModules.length; ++i) + $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.encode(message.securityHealthAnalyticsCustomModules[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 ListSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse} message ListSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecurityHealthAnalyticsCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} ListSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecurityHealthAnalyticsCustomModulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.securityHealthAnalyticsCustomModules && message.securityHealthAnalyticsCustomModules.length)) + message.securityHealthAnalyticsCustomModules = []; + message.securityHealthAnalyticsCustomModules.push($root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} ListSecurityHealthAnalyticsCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecurityHealthAnalyticsCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecurityHealthAnalyticsCustomModulesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecurityHealthAnalyticsCustomModulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityHealthAnalyticsCustomModules != null && message.hasOwnProperty("securityHealthAnalyticsCustomModules")) { + if (!Array.isArray(message.securityHealthAnalyticsCustomModules)) + return "securityHealthAnalyticsCustomModules: array expected"; + for (var i = 0; i < message.securityHealthAnalyticsCustomModules.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify(message.securityHealthAnalyticsCustomModules[i]); + if (error) + return "securityHealthAnalyticsCustomModules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} ListSecurityHealthAnalyticsCustomModulesResponse + */ + ListSecurityHealthAnalyticsCustomModulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse(); + if (object.securityHealthAnalyticsCustomModules) { + if (!Array.isArray(object.securityHealthAnalyticsCustomModules)) + throw TypeError(".google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.securityHealthAnalyticsCustomModules: array expected"); + message.securityHealthAnalyticsCustomModules = []; + for (var i = 0; i < object.securityHealthAnalyticsCustomModules.length; ++i) { + if (typeof object.securityHealthAnalyticsCustomModules[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.securityHealthAnalyticsCustomModules: object expected"); + message.securityHealthAnalyticsCustomModules[i] = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.fromObject(object.securityHealthAnalyticsCustomModules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} message ListSecurityHealthAnalyticsCustomModulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecurityHealthAnalyticsCustomModulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.securityHealthAnalyticsCustomModules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.securityHealthAnalyticsCustomModules && message.securityHealthAnalyticsCustomModules.length) { + object.securityHealthAnalyticsCustomModules = []; + for (var j = 0; j < message.securityHealthAnalyticsCustomModules.length; ++j) + object.securityHealthAnalyticsCustomModules[j] = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.toObject(message.securityHealthAnalyticsCustomModules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSecurityHealthAnalyticsCustomModulesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSecurityHealthAnalyticsCustomModulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSecurityHealthAnalyticsCustomModulesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSecurityHealthAnalyticsCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse"; + }; + + return ListSecurityHealthAnalyticsCustomModulesResponse; + })(); + + 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 && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + 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.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")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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() { + + /** + * 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 && 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; + 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] === undefined ? message.stateChange : $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); + }; + + /** + * 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 + * @enum {number} + * @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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + 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.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")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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() { + + /** + * 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 && 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 && Object.hasOwnProperty.call(message, "stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; + 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] === 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; + }; + + /** + * 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); + }; + + /** + * 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 + * @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() { + + /** + * Properties of a Resource. + * @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 {Array.|null} [folders] Resource folders + * @property {google.cloud.securitycenter.v1.CloudProvider|null} [cloudProvider] Resource cloudProvider + * @property {string|null} [organization] Resource organization + * @property {string|null} [service] Resource service + * @property {string|null} [location] Resource location + * @property {google.cloud.securitycenter.v1.IAwsMetadata|null} [awsMetadata] Resource awsMetadata + * @property {google.cloud.securitycenter.v1.IAzureMetadata|null} [azureMetadata] Resource azureMetadata + * @property {google.cloud.securitycenter.v1.IResourcePath|null} [resourcePath] Resource resourcePath + * @property {string|null} [resourcePathString] Resource resourcePathString + */ + + /** + * 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) { + 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]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + 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 + * @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 = ""; + + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + + /** + * Resource cloudProvider. + * @member {google.cloud.securitycenter.v1.CloudProvider} cloudProvider + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.cloudProvider = 0; + + /** + * Resource organization. + * @member {string} organization + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.organization = ""; + + /** + * Resource service. + * @member {string} service + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.service = ""; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Resource awsMetadata. + * @member {google.cloud.securitycenter.v1.IAwsMetadata|null|undefined} awsMetadata + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.awsMetadata = null; + + /** + * Resource azureMetadata. + * @member {google.cloud.securitycenter.v1.IAzureMetadata|null|undefined} azureMetadata + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.azureMetadata = null; + + /** + * Resource resourcePath. + * @member {google.cloud.securitycenter.v1.IResourcePath|null|undefined} resourcePath + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.resourcePath = null; + + /** + * Resource resourcePathString. + * @member {string} resourcePathString + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.resourcePathString = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Resource cloudProviderMetadata. + * @member {"awsMetadata"|"azureMetadata"|undefined} cloudProviderMetadata + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Object.defineProperty(Resource.prototype, "cloudProviderMetadata", { + get: $util.oneOfGetter($oneOfFields = ["awsMetadata", "azureMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.projectName != null && Object.hasOwnProperty.call(message, "projectName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parentName != null && Object.hasOwnProperty.call(message, "parentName")) + 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); + if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.cloudProvider); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.organization); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.service); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.location); + if (message.awsMetadata != null && Object.hasOwnProperty.call(message, "awsMetadata")) + $root.google.cloud.securitycenter.v1.AwsMetadata.encode(message.awsMetadata, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.azureMetadata != null && Object.hasOwnProperty.call(message, "azureMetadata")) + $root.google.cloud.securitycenter.v1.AzureMetadata.encode(message.azureMetadata, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.resourcePath != null && Object.hasOwnProperty.call(message, "resourcePath")) + $root.google.cloud.securitycenter.v1.ResourcePath.encode(message.resourcePath, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.resourcePathString != null && Object.hasOwnProperty.call(message, "resourcePathString")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.resourcePathString); + 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, error) { + 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(); + if (tag === error) + break; + 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 9: { + message.cloudProvider = reader.int32(); + break; + } + case 10: { + message.organization = reader.string(); + break; + } + case 11: { + message.service = reader.string(); + break; + } + case 12: { + message.location = reader.string(); + break; + } + case 16: { + message.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.decode(reader, reader.uint32()); + break; + } + case 17: { + message.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.decode(reader, reader.uint32()); + break; + } + case 18: { + message.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.decode(reader, reader.uint32()); + break; + } + case 19: { + message.resourcePathString = 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"; + 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.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"; + 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"; + 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + switch (message.cloudProvider) { + default: + return "cloudProvider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v1.AwsMetadata.verify(message.awsMetadata); + if (error) + return "awsMetadata." + error; + } + } + if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { + if (properties.cloudProviderMetadata === 1) + return "cloudProviderMetadata: multiple values"; + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v1.AzureMetadata.verify(message.azureMetadata); + if (error) + return "azureMetadata." + error; + } + } + if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) { + var error = $root.google.cloud.securitycenter.v1.ResourcePath.verify(message.resourcePath); + if (error) + return "resourcePath." + error; + } + if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) + if (!$util.isString(message.resourcePathString)) + return "resourcePathString: 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.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) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parentName != null) + 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]); + } + } + switch (object.cloudProvider) { + default: + if (typeof object.cloudProvider === "number") { + message.cloudProvider = object.cloudProvider; + break; + } + break; + case "CLOUD_PROVIDER_UNSPECIFIED": + case 0: + message.cloudProvider = 0; + break; + case "GOOGLE_CLOUD_PLATFORM": + case 1: + message.cloudProvider = 1; + break; + case "AMAZON_WEB_SERVICES": + case 2: + message.cloudProvider = 2; + break; + case "MICROSOFT_AZURE": + case 3: + message.cloudProvider = 3; + break; + } + if (object.organization != null) + message.organization = String(object.organization); + if (object.service != null) + message.service = String(object.service); + if (object.location != null) + message.location = String(object.location); + if (object.awsMetadata != null) { + if (typeof object.awsMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.awsMetadata: object expected"); + message.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.fromObject(object.awsMetadata); + } + if (object.azureMetadata != null) { + if (typeof object.azureMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.azureMetadata: object expected"); + message.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.fromObject(object.azureMetadata); + } + if (object.resourcePath != null) { + if (typeof object.resourcePath !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.resourcePath: object expected"); + message.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.fromObject(object.resourcePath); + } + if (object.resourcePathString != null) + message.resourcePathString = String(object.resourcePathString); + 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.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.name = ""; + object.projectName = ""; + object.projectDisplayName = ""; + object.parentName = ""; + object.parentDisplayName = ""; + object.type = ""; + object.displayName = ""; + object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; + object.organization = ""; + object.service = ""; + object.location = ""; + object.resourcePath = null; + object.resourcePathString = ""; + } + 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; + 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; + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] : message.cloudProvider; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { + object.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.toObject(message.awsMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "awsMetadata"; + } + if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { + object.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.toObject(message.azureMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "azureMetadata"; + } + if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) + object.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.toObject(message.resourcePath, options); + if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) + object.resourcePathString = message.resourcePathString; + 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); + }; + + /** + * 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; + })(); + + 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 && 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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] === 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + v1.SetMuteRequest = (function() { + + /** + * Properties of a SetMuteRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ISetMuteRequest + * @property {string|null} [name] SetMuteRequest name + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] SetMuteRequest mute + */ + + /** + * Constructs a new SetMuteRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SetMuteRequest. + * @implements ISetMuteRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set + */ + function SetMuteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetMuteRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @instance + */ + SetMuteRequest.prototype.name = ""; + + /** + * SetMuteRequest mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @instance + */ + SetMuteRequest.prototype.mute = 0; + + /** + * Creates a new SetMuteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest instance + */ + SetMuteRequest.create = function create(properties) { + return new SetMuteRequest(properties); + }; + + /** + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @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 + */ + 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.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mute); + return writer; + }; + + /** + * 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.SetMuteRequest + * @static + * @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 + */ + SetMuteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer. + * @function decode + * @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.SetMuteRequest} SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMuteRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.mute = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + SetMuteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetMuteRequest message. + * @function verify + * @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 + */ + 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.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + return null; + }; + + /** + * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest + */ + SetMuteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetMuteRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.SetMuteRequest(); + 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; + 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; + } + return message; + }; + + /** + * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v1.SetMuteRequest} message SetMuteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetMuteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; + } + 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] === undefined ? message.mute : $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; + return object; + }; + + /** + * Converts this SetMuteRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @instance + * @returns {Object.} JSON object + */ + SetMuteRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.SimulateSecurityHealthAnalyticsCustomModuleRequest = (function() { + + /** + * Properties of a SimulateSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ISimulateSecurityHealthAnalyticsCustomModuleRequest + * @property {string|null} [parent] SimulateSecurityHealthAnalyticsCustomModuleRequest parent + * @property {google.cloud.securitycenter.v1.ICustomConfig|null} [customConfig] SimulateSecurityHealthAnalyticsCustomModuleRequest customConfig + * @property {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource|null} [resource] SimulateSecurityHealthAnalyticsCustomModuleRequest resource + */ + + /** + * Constructs a new SimulateSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SimulateSecurityHealthAnalyticsCustomModuleRequest. + * @implements ISimulateSecurityHealthAnalyticsCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + */ + function SimulateSecurityHealthAnalyticsCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimulateSecurityHealthAnalyticsCustomModuleRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.prototype.parent = ""; + + /** + * SimulateSecurityHealthAnalyticsCustomModuleRequest customConfig. + * @member {google.cloud.securitycenter.v1.ICustomConfig|null|undefined} customConfig + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.prototype.customConfig = null; + + /** + * SimulateSecurityHealthAnalyticsCustomModuleRequest resource. + * @member {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.prototype.resource = null; + + /** + * Creates a new SimulateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} SimulateSecurityHealthAnalyticsCustomModuleRequest instance + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { + return new SimulateSecurityHealthAnalyticsCustomModuleRequest(properties); + }; + + /** + * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest} message SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.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.customConfig != null && Object.hasOwnProperty.call(message, "customConfig")) + $root.google.cloud.securitycenter.v1.CustomConfig.encode(message.customConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest} message SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} SimulateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} SimulateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulateSecurityHealthAnalyticsCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.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.customConfig != null && message.hasOwnProperty("customConfig")) { + var error = $root.google.cloud.securitycenter.v1.CustomConfig.verify(message.customConfig); + if (error) + return "customConfig." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a SimulateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} SimulateSecurityHealthAnalyticsCustomModuleRequest + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.customConfig != null) { + if (typeof object.customConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.customConfig: object expected"); + message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.fromObject(object.customConfig); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a SimulateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} message SimulateSecurityHealthAnalyticsCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.customConfig = null; + object.resource = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.customConfig != null && message.hasOwnProperty("customConfig")) + object.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.toObject(message.customConfig, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this SimulateSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SimulateSecurityHealthAnalyticsCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SimulateSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest"; + }; + + SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource = (function() { + + /** + * Properties of a SimulatedResource. + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @interface ISimulatedResource + * @property {string|null} [resourceType] SimulatedResource resourceType + * @property {google.protobuf.IStruct|null} [resourceData] SimulatedResource resourceData + * @property {google.iam.v1.IPolicy|null} [iamPolicyData] SimulatedResource iamPolicyData + */ + + /** + * Constructs a new SimulatedResource. + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest + * @classdesc Represents a SimulatedResource. + * @implements ISimulatedResource + * @constructor + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource=} [properties] Properties to set + */ + function SimulatedResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimulatedResource resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @instance + */ + SimulatedResource.prototype.resourceType = ""; + + /** + * SimulatedResource resourceData. + * @member {google.protobuf.IStruct|null|undefined} resourceData + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @instance + */ + SimulatedResource.prototype.resourceData = null; + + /** + * SimulatedResource iamPolicyData. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicyData + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @instance + */ + SimulatedResource.prototype.iamPolicyData = null; + + /** + * Creates a new SimulatedResource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} SimulatedResource instance + */ + SimulatedResource.create = function create(properties) { + return new SimulatedResource(properties); + }; + + /** + * Encodes the specified SimulatedResource message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource} message SimulatedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulatedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceType); + if (message.resourceData != null && Object.hasOwnProperty.call(message, "resourceData")) + $root.google.protobuf.Struct.encode(message.resourceData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.iamPolicyData != null && Object.hasOwnProperty.call(message, "iamPolicyData")) + $root.google.iam.v1.Policy.encode(message.iamPolicyData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SimulatedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource} message SimulatedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulatedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulatedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} SimulatedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulatedResource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resourceType = reader.string(); + break; + } + case 2: { + message.resourceData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.iamPolicyData = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulatedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} SimulatedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulatedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulatedResource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulatedResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceData != null && message.hasOwnProperty("resourceData")) { + var error = $root.google.protobuf.Struct.verify(message.resourceData); + if (error) + return "resourceData." + error; + } + if (message.iamPolicyData != null && message.hasOwnProperty("iamPolicyData")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicyData); + if (error) + return "iamPolicyData." + error; + } + return null; + }; + + /** + * Creates a SimulatedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} SimulatedResource + */ + SimulatedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource) + return object; + var message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource(); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceData != null) { + if (typeof object.resourceData !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.resourceData: object expected"); + message.resourceData = $root.google.protobuf.Struct.fromObject(object.resourceData); + } + if (object.iamPolicyData != null) { + if (typeof object.iamPolicyData !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.iamPolicyData: object expected"); + message.iamPolicyData = $root.google.iam.v1.Policy.fromObject(object.iamPolicyData); + } + return message; + }; + + /** + * Creates a plain object from a SimulatedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} message SimulatedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulatedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceType = ""; + object.resourceData = null; + object.iamPolicyData = null; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceData != null && message.hasOwnProperty("resourceData")) + object.resourceData = $root.google.protobuf.Struct.toObject(message.resourceData, options); + if (message.iamPolicyData != null && message.hasOwnProperty("iamPolicyData")) + object.iamPolicyData = $root.google.iam.v1.Policy.toObject(message.iamPolicyData, options); + return object; + }; + + /** + * Converts this SimulatedResource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @instance + * @returns {Object.} JSON object + */ + SimulatedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SimulatedResource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SimulatedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource"; + }; + + return SimulatedResource; + })(); + + return SimulateSecurityHealthAnalyticsCustomModuleRequest; + })(); + + v1.SimulateSecurityHealthAnalyticsCustomModuleResponse = (function() { + + /** + * Properties of a SimulateSecurityHealthAnalyticsCustomModuleResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface ISimulateSecurityHealthAnalyticsCustomModuleResponse + * @property {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult|null} [result] SimulateSecurityHealthAnalyticsCustomModuleResponse result + */ + + /** + * Constructs a new SimulateSecurityHealthAnalyticsCustomModuleResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SimulateSecurityHealthAnalyticsCustomModuleResponse. + * @implements ISimulateSecurityHealthAnalyticsCustomModuleResponse + * @constructor + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse=} [properties] Properties to set + */ + function SimulateSecurityHealthAnalyticsCustomModuleResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimulateSecurityHealthAnalyticsCustomModuleResponse result. + * @member {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult|null|undefined} result + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @instance + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.prototype.result = null; + + /** + * Creates a new SimulateSecurityHealthAnalyticsCustomModuleResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} SimulateSecurityHealthAnalyticsCustomModuleResponse instance + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.create = function create(properties) { + return new SimulateSecurityHealthAnalyticsCustomModuleResponse(properties); + }; + + /** + * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse} message SimulateSecurityHealthAnalyticsCustomModuleResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.encode(message.result, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse} message SimulateSecurityHealthAnalyticsCustomModuleResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulateSecurityHealthAnalyticsCustomModuleResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} SimulateSecurityHealthAnalyticsCustomModuleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.result = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulateSecurityHealthAnalyticsCustomModuleResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} SimulateSecurityHealthAnalyticsCustomModuleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulateSecurityHealthAnalyticsCustomModuleResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a SimulateSecurityHealthAnalyticsCustomModuleResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} SimulateSecurityHealthAnalyticsCustomModuleResponse + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.result: object expected"); + message.result = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a SimulateSecurityHealthAnalyticsCustomModuleResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} message SimulateSecurityHealthAnalyticsCustomModuleResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.result = null; + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.toObject(message.result, options); + return object; + }; + + /** + * Converts this SimulateSecurityHealthAnalyticsCustomModuleResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @instance + * @returns {Object.} JSON object + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SimulateSecurityHealthAnalyticsCustomModuleResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SimulateSecurityHealthAnalyticsCustomModuleResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse"; + }; + + SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult = (function() { + + /** + * Properties of a SimulatedResult. + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @interface ISimulatedResult + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] SimulatedResult finding + * @property {google.protobuf.IEmpty|null} [noViolation] SimulatedResult noViolation + * @property {google.rpc.IStatus|null} [error] SimulatedResult error + */ + + /** + * Constructs a new SimulatedResult. + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse + * @classdesc Represents a SimulatedResult. + * @implements ISimulatedResult + * @constructor + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult=} [properties] Properties to set + */ + function SimulatedResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimulatedResult finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @instance + */ + SimulatedResult.prototype.finding = null; + + /** + * SimulatedResult noViolation. + * @member {google.protobuf.IEmpty|null|undefined} noViolation + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @instance + */ + SimulatedResult.prototype.noViolation = null; + + /** + * SimulatedResult error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @instance + */ + SimulatedResult.prototype.error = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SimulatedResult result. + * @member {"finding"|"noViolation"|"error"|undefined} result + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @instance + */ + Object.defineProperty(SimulatedResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["finding", "noViolation", "error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SimulatedResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} SimulatedResult instance + */ + SimulatedResult.create = function create(properties) { + return new SimulatedResult(properties); + }; + + /** + * Encodes the specified SimulatedResult message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult} message SimulatedResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulatedResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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.noViolation != null && Object.hasOwnProperty.call(message, "noViolation")) + $root.google.protobuf.Empty.encode(message.noViolation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SimulatedResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult} message SimulatedResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulatedResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulatedResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} SimulatedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulatedResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.noViolation = $root.google.protobuf.Empty.decode(reader, reader.uint32()); + break; + } + case 3: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulatedResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} SimulatedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulatedResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulatedResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulatedResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.finding != null && message.hasOwnProperty("finding")) { + properties.result = 1; + { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + } + if (message.noViolation != null && message.hasOwnProperty("noViolation")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Empty.verify(message.noViolation); + if (error) + return "noViolation." + error; + } + } + if (message.error != null && message.hasOwnProperty("error")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + return null; + }; + + /** + * Creates a SimulatedResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} SimulatedResult + */ + SimulatedResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + if (object.noViolation != null) { + if (typeof object.noViolation !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.noViolation: object expected"); + message.noViolation = $root.google.protobuf.Empty.fromObject(object.noViolation); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a SimulatedResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} message SimulatedResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulatedResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.finding != null && message.hasOwnProperty("finding")) { + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (options.oneofs) + object.result = "finding"; + } + if (message.noViolation != null && message.hasOwnProperty("noViolation")) { + object.noViolation = $root.google.protobuf.Empty.toObject(message.noViolation, options); + if (options.oneofs) + object.result = "noViolation"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + return object; + }; + + /** + * Converts this SimulatedResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @instance + * @returns {Object.} JSON object + */ + SimulatedResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SimulatedResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SimulatedResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult"; + }; + + return SimulatedResult; + })(); + + return SimulateSecurityHealthAnalyticsCustomModuleResponse; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.UpdateSecurityHealthAnalyticsCustomModuleRequest = (function() { + + /** + * Properties of an UpdateSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSecurityHealthAnalyticsCustomModuleRequest + * @property {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null} [securityHealthAnalyticsCustomModule] UpdateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityHealthAnalyticsCustomModuleRequest updateMask + */ + + /** + * Constructs a new UpdateSecurityHealthAnalyticsCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSecurityHealthAnalyticsCustomModuleRequest. + * @implements IUpdateSecurityHealthAnalyticsCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + */ + function UpdateSecurityHealthAnalyticsCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule. + * @member {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null|undefined} securityHealthAnalyticsCustomModule + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.prototype.securityHealthAnalyticsCustomModule = null; + + /** + * UpdateSecurityHealthAnalyticsCustomModuleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @instance + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} UpdateSecurityHealthAnalyticsCustomModuleRequest instance + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { + return new UpdateSecurityHealthAnalyticsCustomModuleRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest} message UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityHealthAnalyticsCustomModule != null && Object.hasOwnProperty.call(message, "securityHealthAnalyticsCustomModule")) + $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.encode(message.securityHealthAnalyticsCustomModule, 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 UpdateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest} message UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} UpdateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.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 UpdateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} UpdateSecurityHealthAnalyticsCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecurityHealthAnalyticsCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityHealthAnalyticsCustomModule != null && message.hasOwnProperty("securityHealthAnalyticsCustomModule")) { + var error = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify(message.securityHealthAnalyticsCustomModule); + if (error) + return "securityHealthAnalyticsCustomModule." + 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 UpdateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} UpdateSecurityHealthAnalyticsCustomModuleRequest + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest(); + if (object.securityHealthAnalyticsCustomModule != null) { + if (typeof object.securityHealthAnalyticsCustomModule !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.securityHealthAnalyticsCustomModule: object expected"); + message.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.fromObject(object.securityHealthAnalyticsCustomModule); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} message UpdateSecurityHealthAnalyticsCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityHealthAnalyticsCustomModule = null; + object.updateMask = null; + } + if (message.securityHealthAnalyticsCustomModule != null && message.hasOwnProperty("securityHealthAnalyticsCustomModule")) + object.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.toObject(message.securityHealthAnalyticsCustomModule, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSecurityHealthAnalyticsCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSecurityHealthAnalyticsCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest"; + }; + + return UpdateSecurityHealthAnalyticsCustomModuleRequest; + })(); + + 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.CreateBigQueryExportRequest = (function() { + + /** + * Properties of a CreateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @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 CreateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateBigQueryExportRequest. + * @implements ICreateBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest=} [properties] Properties to set + */ + function CreateBigQueryExportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBigQueryExportRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.parent = ""; + + /** + * CreateBigQueryExportRequest bigQueryExport. + * @member {google.cloud.securitycenter.v1.IBigQueryExport|null|undefined} bigQueryExport + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.bigQueryExport = null; + + /** + * CreateBigQueryExportRequest bigQueryExportId. + * @member {string} bigQueryExportId + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.bigQueryExportId = ""; + + /** + * Creates a new CreateBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest instance + */ + CreateBigQueryExportRequest.create = function create(properties) { + return new CreateBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @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 + */ + CreateBigQueryExportRequest.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.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 CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @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 + */ + CreateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @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.CreateBigQueryExportRequest} CreateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBigQueryExportRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CreateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBigQueryExportRequest message. + * @function verify + * @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 + */ + CreateBigQueryExportRequest.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.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 CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest + */ + CreateBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest) + return object; + 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 CreateBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} message CreateBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBigQueryExportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.bigQueryExport = null; + object.bigQueryExportId = ""; + } + 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 CreateBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBigQueryExportRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1.UpdateBigQueryExportRequest = (function() { + + /** + * 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 UpdateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateBigQueryExportRequest. + * @implements IUpdateBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest=} [properties] Properties to set + */ + function UpdateBigQueryExportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBigQueryExportRequest bigQueryExport. + * @member {google.cloud.securitycenter.v1.IBigQueryExport|null|undefined} bigQueryExport + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @instance + */ + UpdateBigQueryExportRequest.prototype.bigQueryExport = null; + + /** + * UpdateBigQueryExportRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @instance + */ + UpdateBigQueryExportRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest instance + */ + UpdateBigQueryExportRequest.create = function create(properties) { + return new UpdateBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @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 + */ + UpdateBigQueryExportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @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 + */ + UpdateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @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.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBigQueryExportRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + UpdateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1.CreateEventThreatDetectionCustomModuleRequest = (function() { + + /** + * Properties of a CreateEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateEventThreatDetectionCustomModuleRequest + * @property {string|null} [parent] CreateEventThreatDetectionCustomModuleRequest parent + * @property {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null} [eventThreatDetectionCustomModule] CreateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule + */ + + /** + * Constructs a new CreateEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateEventThreatDetectionCustomModuleRequest. + * @implements ICreateEventThreatDetectionCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + */ + function CreateEventThreatDetectionCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEventThreatDetectionCustomModuleRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @instance + */ + CreateEventThreatDetectionCustomModuleRequest.prototype.parent = ""; + + /** + * CreateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule. + * @member {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null|undefined} eventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @instance + */ + CreateEventThreatDetectionCustomModuleRequest.prototype.eventThreatDetectionCustomModule = null; + + /** + * Creates a new CreateEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} CreateEventThreatDetectionCustomModuleRequest instance + */ + CreateEventThreatDetectionCustomModuleRequest.create = function create(properties) { + return new CreateEventThreatDetectionCustomModuleRequest(properties); + }; + + /** + * Encodes the specified CreateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest} message CreateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventThreatDetectionCustomModuleRequest.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.eventThreatDetectionCustomModule != null && Object.hasOwnProperty.call(message, "eventThreatDetectionCustomModule")) + $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.encode(message.eventThreatDetectionCustomModule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest} message CreateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} CreateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} CreateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEventThreatDetectionCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEventThreatDetectionCustomModuleRequest.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.eventThreatDetectionCustomModule != null && message.hasOwnProperty("eventThreatDetectionCustomModule")) { + var error = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify(message.eventThreatDetectionCustomModule); + if (error) + return "eventThreatDetectionCustomModule." + error; + } + return null; + }; + + /** + * Creates a CreateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} CreateEventThreatDetectionCustomModuleRequest + */ + CreateEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.eventThreatDetectionCustomModule != null) { + if (typeof object.eventThreatDetectionCustomModule !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.eventThreatDetectionCustomModule: object expected"); + message.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.fromObject(object.eventThreatDetectionCustomModule); + } + return message; + }; + + /** + * Creates a plain object from a CreateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} message CreateEventThreatDetectionCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEventThreatDetectionCustomModuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.eventThreatDetectionCustomModule = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.eventThreatDetectionCustomModule != null && message.hasOwnProperty("eventThreatDetectionCustomModule")) + object.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.toObject(message.eventThreatDetectionCustomModule, options); + return object; + }; + + /** + * Converts this CreateEventThreatDetectionCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEventThreatDetectionCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest"; + }; + + return CreateEventThreatDetectionCustomModuleRequest; + })(); + + v1.ValidateEventThreatDetectionCustomModuleRequest = (function() { + + /** + * Properties of a ValidateEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IValidateEventThreatDetectionCustomModuleRequest + * @property {string|null} [parent] ValidateEventThreatDetectionCustomModuleRequest parent + * @property {string|null} [rawText] ValidateEventThreatDetectionCustomModuleRequest rawText + * @property {string|null} [type] ValidateEventThreatDetectionCustomModuleRequest type + */ + + /** + * Constructs a new ValidateEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ValidateEventThreatDetectionCustomModuleRequest. + * @implements IValidateEventThreatDetectionCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + */ + function ValidateEventThreatDetectionCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateEventThreatDetectionCustomModuleRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @instance + */ + ValidateEventThreatDetectionCustomModuleRequest.prototype.parent = ""; + + /** + * ValidateEventThreatDetectionCustomModuleRequest rawText. + * @member {string} rawText + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @instance + */ + ValidateEventThreatDetectionCustomModuleRequest.prototype.rawText = ""; + + /** + * ValidateEventThreatDetectionCustomModuleRequest type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @instance + */ + ValidateEventThreatDetectionCustomModuleRequest.prototype.type = ""; + + /** + * Creates a new ValidateEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} ValidateEventThreatDetectionCustomModuleRequest instance + */ + ValidateEventThreatDetectionCustomModuleRequest.create = function create(properties) { + return new ValidateEventThreatDetectionCustomModuleRequest(properties); + }; + + /** + * Encodes the specified ValidateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest} message ValidateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateEventThreatDetectionCustomModuleRequest.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.rawText != null && Object.hasOwnProperty.call(message, "rawText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rawText); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + return writer; + }; + + /** + * Encodes the specified ValidateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest} message ValidateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} ValidateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.rawText = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} ValidateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateEventThreatDetectionCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateEventThreatDetectionCustomModuleRequest.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.rawText != null && message.hasOwnProperty("rawText")) + if (!$util.isString(message.rawText)) + return "rawText: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a ValidateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} ValidateEventThreatDetectionCustomModuleRequest + */ + ValidateEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.rawText != null) + message.rawText = String(object.rawText); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a ValidateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} message ValidateEventThreatDetectionCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateEventThreatDetectionCustomModuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.rawText = ""; + object.type = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.rawText != null && message.hasOwnProperty("rawText")) + object.rawText = message.rawText; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this ValidateEventThreatDetectionCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateEventThreatDetectionCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest"; + }; + + return ValidateEventThreatDetectionCustomModuleRequest; + })(); + + v1.ValidateEventThreatDetectionCustomModuleResponse = (function() { + + /** + * Properties of a ValidateEventThreatDetectionCustomModuleResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IValidateEventThreatDetectionCustomModuleResponse + * @property {google.cloud.securitycenter.v1.ICustomModuleValidationErrors|null} [errors] ValidateEventThreatDetectionCustomModuleResponse errors + */ + + /** + * Constructs a new ValidateEventThreatDetectionCustomModuleResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ValidateEventThreatDetectionCustomModuleResponse. + * @implements IValidateEventThreatDetectionCustomModuleResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse=} [properties] Properties to set + */ + function ValidateEventThreatDetectionCustomModuleResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateEventThreatDetectionCustomModuleResponse errors. + * @member {google.cloud.securitycenter.v1.ICustomModuleValidationErrors|null|undefined} errors + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @instance + */ + ValidateEventThreatDetectionCustomModuleResponse.prototype.errors = null; + + /** + * Creates a new ValidateEventThreatDetectionCustomModuleResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} ValidateEventThreatDetectionCustomModuleResponse instance + */ + ValidateEventThreatDetectionCustomModuleResponse.create = function create(properties) { + return new ValidateEventThreatDetectionCustomModuleResponse(properties); + }; + + /** + * Encodes the specified ValidateEventThreatDetectionCustomModuleResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse} message ValidateEventThreatDetectionCustomModuleResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateEventThreatDetectionCustomModuleResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) + $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.encode(message.errors, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidateEventThreatDetectionCustomModuleResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse} message ValidateEventThreatDetectionCustomModuleResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateEventThreatDetectionCustomModuleResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateEventThreatDetectionCustomModuleResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} ValidateEventThreatDetectionCustomModuleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateEventThreatDetectionCustomModuleResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.errors = $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateEventThreatDetectionCustomModuleResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} ValidateEventThreatDetectionCustomModuleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateEventThreatDetectionCustomModuleResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateEventThreatDetectionCustomModuleResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateEventThreatDetectionCustomModuleResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errors != null && message.hasOwnProperty("errors")) { + var error = $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify(message.errors); + if (error) + return "errors." + error; + } + return null; + }; + + /** + * Creates a ValidateEventThreatDetectionCustomModuleResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} ValidateEventThreatDetectionCustomModuleResponse + */ + ValidateEventThreatDetectionCustomModuleResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse(); + if (object.errors != null) { + if (typeof object.errors !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.errors: object expected"); + message.errors = $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.fromObject(object.errors); + } + return message; + }; + + /** + * Creates a plain object from a ValidateEventThreatDetectionCustomModuleResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} message ValidateEventThreatDetectionCustomModuleResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateEventThreatDetectionCustomModuleResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.errors = null; + if (message.errors != null && message.hasOwnProperty("errors")) + object.errors = $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.toObject(message.errors, options); + return object; + }; + + /** + * Converts this ValidateEventThreatDetectionCustomModuleResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @instance + * @returns {Object.} JSON object + */ + ValidateEventThreatDetectionCustomModuleResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateEventThreatDetectionCustomModuleResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateEventThreatDetectionCustomModuleResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse"; + }; + + return ValidateEventThreatDetectionCustomModuleResponse; + })(); + + v1.DeleteEventThreatDetectionCustomModuleRequest = (function() { + + /** + * Properties of a DeleteEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteEventThreatDetectionCustomModuleRequest + * @property {string|null} [name] DeleteEventThreatDetectionCustomModuleRequest name + */ + + /** + * Constructs a new DeleteEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteEventThreatDetectionCustomModuleRequest. + * @implements IDeleteEventThreatDetectionCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + */ + function DeleteEventThreatDetectionCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEventThreatDetectionCustomModuleRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @instance + */ + DeleteEventThreatDetectionCustomModuleRequest.prototype.name = ""; + + /** + * Creates a new DeleteEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} DeleteEventThreatDetectionCustomModuleRequest instance + */ + DeleteEventThreatDetectionCustomModuleRequest.create = function create(properties) { + return new DeleteEventThreatDetectionCustomModuleRequest(properties); + }; + + /** + * Encodes the specified DeleteEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest} message DeleteEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEventThreatDetectionCustomModuleRequest.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 DeleteEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest} message DeleteEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} DeleteEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} DeleteEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEventThreatDetectionCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEventThreatDetectionCustomModuleRequest.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 DeleteEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} DeleteEventThreatDetectionCustomModuleRequest + */ + DeleteEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} message DeleteEventThreatDetectionCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEventThreatDetectionCustomModuleRequest.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 DeleteEventThreatDetectionCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEventThreatDetectionCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest"; + }; + + return DeleteEventThreatDetectionCustomModuleRequest; + })(); + + v1.GetEventThreatDetectionCustomModuleRequest = (function() { + + /** + * Properties of a GetEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetEventThreatDetectionCustomModuleRequest + * @property {string|null} [name] GetEventThreatDetectionCustomModuleRequest name + */ + + /** + * Constructs a new GetEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetEventThreatDetectionCustomModuleRequest. + * @implements IGetEventThreatDetectionCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + */ + function GetEventThreatDetectionCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEventThreatDetectionCustomModuleRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @instance + */ + GetEventThreatDetectionCustomModuleRequest.prototype.name = ""; + + /** + * Creates a new GetEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} GetEventThreatDetectionCustomModuleRequest instance + */ + GetEventThreatDetectionCustomModuleRequest.create = function create(properties) { + return new GetEventThreatDetectionCustomModuleRequest(properties); + }; + + /** + * Encodes the specified GetEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest} message GetEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEventThreatDetectionCustomModuleRequest.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 GetEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest} message GetEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} GetEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} GetEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEventThreatDetectionCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEventThreatDetectionCustomModuleRequest.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 GetEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} GetEventThreatDetectionCustomModuleRequest + */ + GetEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} message GetEventThreatDetectionCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEventThreatDetectionCustomModuleRequest.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 GetEventThreatDetectionCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + GetEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEventThreatDetectionCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest"; + }; + + return GetEventThreatDetectionCustomModuleRequest; + })(); + + v1.ListDescendantEventThreatDetectionCustomModulesRequest = (function() { + + /** + * Properties of a ListDescendantEventThreatDetectionCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListDescendantEventThreatDetectionCustomModulesRequest + * @property {string|null} [parent] ListDescendantEventThreatDetectionCustomModulesRequest parent + * @property {string|null} [pageToken] ListDescendantEventThreatDetectionCustomModulesRequest pageToken + * @property {number|null} [pageSize] ListDescendantEventThreatDetectionCustomModulesRequest pageSize + */ + + /** + * Constructs a new ListDescendantEventThreatDetectionCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListDescendantEventThreatDetectionCustomModulesRequest. + * @implements IListDescendantEventThreatDetectionCustomModulesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest=} [properties] Properties to set + */ + function ListDescendantEventThreatDetectionCustomModulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDescendantEventThreatDetectionCustomModulesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @instance + */ + ListDescendantEventThreatDetectionCustomModulesRequest.prototype.parent = ""; + + /** + * ListDescendantEventThreatDetectionCustomModulesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @instance + */ + ListDescendantEventThreatDetectionCustomModulesRequest.prototype.pageToken = ""; + + /** + * ListDescendantEventThreatDetectionCustomModulesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @instance + */ + ListDescendantEventThreatDetectionCustomModulesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListDescendantEventThreatDetectionCustomModulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} ListDescendantEventThreatDetectionCustomModulesRequest instance + */ + ListDescendantEventThreatDetectionCustomModulesRequest.create = function create(properties) { + return new ListDescendantEventThreatDetectionCustomModulesRequest(properties); + }; + + /** + * Encodes the specified ListDescendantEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest} message ListDescendantEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDescendantEventThreatDetectionCustomModulesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListDescendantEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest} message ListDescendantEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDescendantEventThreatDetectionCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDescendantEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} ListDescendantEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDescendantEventThreatDetectionCustomModulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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; + } + } + return message; + }; + + /** + * Decodes a ListDescendantEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} ListDescendantEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDescendantEventThreatDetectionCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDescendantEventThreatDetectionCustomModulesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDescendantEventThreatDetectionCustomModulesRequest.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 ListDescendantEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} ListDescendantEventThreatDetectionCustomModulesRequest + */ + ListDescendantEventThreatDetectionCustomModulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest(); + 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 ListDescendantEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} message ListDescendantEventThreatDetectionCustomModulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDescendantEventThreatDetectionCustomModulesRequest.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 ListDescendantEventThreatDetectionCustomModulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDescendantEventThreatDetectionCustomModulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDescendantEventThreatDetectionCustomModulesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDescendantEventThreatDetectionCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest"; + }; + + return ListDescendantEventThreatDetectionCustomModulesRequest; + })(); + + v1.ListDescendantEventThreatDetectionCustomModulesResponse = (function() { + + /** + * Properties of a ListDescendantEventThreatDetectionCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListDescendantEventThreatDetectionCustomModulesResponse + * @property {Array.|null} [eventThreatDetectionCustomModules] ListDescendantEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules + * @property {string|null} [nextPageToken] ListDescendantEventThreatDetectionCustomModulesResponse nextPageToken + */ + + /** + * Constructs a new ListDescendantEventThreatDetectionCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListDescendantEventThreatDetectionCustomModulesResponse. + * @implements IListDescendantEventThreatDetectionCustomModulesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse=} [properties] Properties to set + */ + function ListDescendantEventThreatDetectionCustomModulesResponse(properties) { + this.eventThreatDetectionCustomModules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDescendantEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules. + * @member {Array.} eventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @instance + */ + ListDescendantEventThreatDetectionCustomModulesResponse.prototype.eventThreatDetectionCustomModules = $util.emptyArray; + + /** + * ListDescendantEventThreatDetectionCustomModulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @instance + */ + ListDescendantEventThreatDetectionCustomModulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDescendantEventThreatDetectionCustomModulesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} ListDescendantEventThreatDetectionCustomModulesResponse instance + */ + ListDescendantEventThreatDetectionCustomModulesResponse.create = function create(properties) { + return new ListDescendantEventThreatDetectionCustomModulesResponse(properties); + }; + + /** + * Encodes the specified ListDescendantEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse} message ListDescendantEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDescendantEventThreatDetectionCustomModulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventThreatDetectionCustomModules != null && message.eventThreatDetectionCustomModules.length) + for (var i = 0; i < message.eventThreatDetectionCustomModules.length; ++i) + $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.encode(message.eventThreatDetectionCustomModules[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 ListDescendantEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse} message ListDescendantEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDescendantEventThreatDetectionCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDescendantEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} ListDescendantEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDescendantEventThreatDetectionCustomModulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.eventThreatDetectionCustomModules && message.eventThreatDetectionCustomModules.length)) + message.eventThreatDetectionCustomModules = []; + message.eventThreatDetectionCustomModules.push($root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDescendantEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} ListDescendantEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDescendantEventThreatDetectionCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDescendantEventThreatDetectionCustomModulesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDescendantEventThreatDetectionCustomModulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventThreatDetectionCustomModules != null && message.hasOwnProperty("eventThreatDetectionCustomModules")) { + if (!Array.isArray(message.eventThreatDetectionCustomModules)) + return "eventThreatDetectionCustomModules: array expected"; + for (var i = 0; i < message.eventThreatDetectionCustomModules.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify(message.eventThreatDetectionCustomModules[i]); + if (error) + return "eventThreatDetectionCustomModules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDescendantEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} ListDescendantEventThreatDetectionCustomModulesResponse + */ + ListDescendantEventThreatDetectionCustomModulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse(); + if (object.eventThreatDetectionCustomModules) { + if (!Array.isArray(object.eventThreatDetectionCustomModules)) + throw TypeError(".google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.eventThreatDetectionCustomModules: array expected"); + message.eventThreatDetectionCustomModules = []; + for (var i = 0; i < object.eventThreatDetectionCustomModules.length; ++i) { + if (typeof object.eventThreatDetectionCustomModules[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.eventThreatDetectionCustomModules: object expected"); + message.eventThreatDetectionCustomModules[i] = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.fromObject(object.eventThreatDetectionCustomModules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDescendantEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} message ListDescendantEventThreatDetectionCustomModulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDescendantEventThreatDetectionCustomModulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.eventThreatDetectionCustomModules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.eventThreatDetectionCustomModules && message.eventThreatDetectionCustomModules.length) { + object.eventThreatDetectionCustomModules = []; + for (var j = 0; j < message.eventThreatDetectionCustomModules.length; ++j) + object.eventThreatDetectionCustomModules[j] = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.toObject(message.eventThreatDetectionCustomModules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDescendantEventThreatDetectionCustomModulesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDescendantEventThreatDetectionCustomModulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDescendantEventThreatDetectionCustomModulesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDescendantEventThreatDetectionCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse"; + }; + + return ListDescendantEventThreatDetectionCustomModulesResponse; + })(); + + v1.ListEventThreatDetectionCustomModulesRequest = (function() { + + /** + * Properties of a ListEventThreatDetectionCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListEventThreatDetectionCustomModulesRequest + * @property {string|null} [parent] ListEventThreatDetectionCustomModulesRequest parent + * @property {string|null} [pageToken] ListEventThreatDetectionCustomModulesRequest pageToken + * @property {number|null} [pageSize] ListEventThreatDetectionCustomModulesRequest pageSize + */ + + /** + * Constructs a new ListEventThreatDetectionCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListEventThreatDetectionCustomModulesRequest. + * @implements IListEventThreatDetectionCustomModulesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest=} [properties] Properties to set + */ + function ListEventThreatDetectionCustomModulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEventThreatDetectionCustomModulesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @instance + */ + ListEventThreatDetectionCustomModulesRequest.prototype.parent = ""; + + /** + * ListEventThreatDetectionCustomModulesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @instance + */ + ListEventThreatDetectionCustomModulesRequest.prototype.pageToken = ""; + + /** + * ListEventThreatDetectionCustomModulesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @instance + */ + ListEventThreatDetectionCustomModulesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListEventThreatDetectionCustomModulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} ListEventThreatDetectionCustomModulesRequest instance + */ + ListEventThreatDetectionCustomModulesRequest.create = function create(properties) { + return new ListEventThreatDetectionCustomModulesRequest(properties); + }; + + /** + * Encodes the specified ListEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest} message ListEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventThreatDetectionCustomModulesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest} message ListEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventThreatDetectionCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} ListEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventThreatDetectionCustomModulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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; + } + } + return message; + }; + + /** + * Decodes a ListEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} ListEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventThreatDetectionCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEventThreatDetectionCustomModulesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEventThreatDetectionCustomModulesRequest.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 ListEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} ListEventThreatDetectionCustomModulesRequest + */ + ListEventThreatDetectionCustomModulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest(); + 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 ListEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} message ListEventThreatDetectionCustomModulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEventThreatDetectionCustomModulesRequest.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 ListEventThreatDetectionCustomModulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEventThreatDetectionCustomModulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEventThreatDetectionCustomModulesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEventThreatDetectionCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest"; + }; + + return ListEventThreatDetectionCustomModulesRequest; + })(); + + v1.ListEventThreatDetectionCustomModulesResponse = (function() { + + /** + * Properties of a ListEventThreatDetectionCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListEventThreatDetectionCustomModulesResponse + * @property {Array.|null} [eventThreatDetectionCustomModules] ListEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules + * @property {string|null} [nextPageToken] ListEventThreatDetectionCustomModulesResponse nextPageToken + */ + + /** + * Constructs a new ListEventThreatDetectionCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListEventThreatDetectionCustomModulesResponse. + * @implements IListEventThreatDetectionCustomModulesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse=} [properties] Properties to set + */ + function ListEventThreatDetectionCustomModulesResponse(properties) { + this.eventThreatDetectionCustomModules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules. + * @member {Array.} eventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @instance + */ + ListEventThreatDetectionCustomModulesResponse.prototype.eventThreatDetectionCustomModules = $util.emptyArray; + + /** + * ListEventThreatDetectionCustomModulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @instance + */ + ListEventThreatDetectionCustomModulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEventThreatDetectionCustomModulesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} ListEventThreatDetectionCustomModulesResponse instance + */ + ListEventThreatDetectionCustomModulesResponse.create = function create(properties) { + return new ListEventThreatDetectionCustomModulesResponse(properties); + }; + + /** + * Encodes the specified ListEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse} message ListEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventThreatDetectionCustomModulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventThreatDetectionCustomModules != null && message.eventThreatDetectionCustomModules.length) + for (var i = 0; i < message.eventThreatDetectionCustomModules.length; ++i) + $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.encode(message.eventThreatDetectionCustomModules[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 ListEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse} message ListEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventThreatDetectionCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} ListEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventThreatDetectionCustomModulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.eventThreatDetectionCustomModules && message.eventThreatDetectionCustomModules.length)) + message.eventThreatDetectionCustomModules = []; + message.eventThreatDetectionCustomModules.push($root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} ListEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventThreatDetectionCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEventThreatDetectionCustomModulesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEventThreatDetectionCustomModulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventThreatDetectionCustomModules != null && message.hasOwnProperty("eventThreatDetectionCustomModules")) { + if (!Array.isArray(message.eventThreatDetectionCustomModules)) + return "eventThreatDetectionCustomModules: array expected"; + for (var i = 0; i < message.eventThreatDetectionCustomModules.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify(message.eventThreatDetectionCustomModules[i]); + if (error) + return "eventThreatDetectionCustomModules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} ListEventThreatDetectionCustomModulesResponse + */ + ListEventThreatDetectionCustomModulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse(); + if (object.eventThreatDetectionCustomModules) { + if (!Array.isArray(object.eventThreatDetectionCustomModules)) + throw TypeError(".google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.eventThreatDetectionCustomModules: array expected"); + message.eventThreatDetectionCustomModules = []; + for (var i = 0; i < object.eventThreatDetectionCustomModules.length; ++i) { + if (typeof object.eventThreatDetectionCustomModules[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.eventThreatDetectionCustomModules: object expected"); + message.eventThreatDetectionCustomModules[i] = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.fromObject(object.eventThreatDetectionCustomModules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} message ListEventThreatDetectionCustomModulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEventThreatDetectionCustomModulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.eventThreatDetectionCustomModules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.eventThreatDetectionCustomModules && message.eventThreatDetectionCustomModules.length) { + object.eventThreatDetectionCustomModules = []; + for (var j = 0; j < message.eventThreatDetectionCustomModules.length; ++j) + object.eventThreatDetectionCustomModules[j] = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.toObject(message.eventThreatDetectionCustomModules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEventThreatDetectionCustomModulesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEventThreatDetectionCustomModulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEventThreatDetectionCustomModulesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEventThreatDetectionCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse"; + }; + + return ListEventThreatDetectionCustomModulesResponse; + })(); + + v1.UpdateEventThreatDetectionCustomModuleRequest = (function() { + + /** + * Properties of an UpdateEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateEventThreatDetectionCustomModuleRequest + * @property {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null} [eventThreatDetectionCustomModule] UpdateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEventThreatDetectionCustomModuleRequest updateMask + */ + + /** + * Constructs a new UpdateEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateEventThreatDetectionCustomModuleRequest. + * @implements IUpdateEventThreatDetectionCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + */ + function UpdateEventThreatDetectionCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule. + * @member {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null|undefined} eventThreatDetectionCustomModule + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @instance + */ + UpdateEventThreatDetectionCustomModuleRequest.prototype.eventThreatDetectionCustomModule = null; + + /** + * UpdateEventThreatDetectionCustomModuleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @instance + */ + UpdateEventThreatDetectionCustomModuleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} UpdateEventThreatDetectionCustomModuleRequest instance + */ + UpdateEventThreatDetectionCustomModuleRequest.create = function create(properties) { + return new UpdateEventThreatDetectionCustomModuleRequest(properties); + }; + + /** + * Encodes the specified UpdateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest} message UpdateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEventThreatDetectionCustomModuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventThreatDetectionCustomModule != null && Object.hasOwnProperty.call(message, "eventThreatDetectionCustomModule")) + $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.encode(message.eventThreatDetectionCustomModule, 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 UpdateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest} message UpdateEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} UpdateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.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 UpdateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} UpdateEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEventThreatDetectionCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEventThreatDetectionCustomModuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventThreatDetectionCustomModule != null && message.hasOwnProperty("eventThreatDetectionCustomModule")) { + var error = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify(message.eventThreatDetectionCustomModule); + if (error) + return "eventThreatDetectionCustomModule." + 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 UpdateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} UpdateEventThreatDetectionCustomModuleRequest + */ + UpdateEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest(); + if (object.eventThreatDetectionCustomModule != null) { + if (typeof object.eventThreatDetectionCustomModule !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.eventThreatDetectionCustomModule: object expected"); + message.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.fromObject(object.eventThreatDetectionCustomModule); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} message UpdateEventThreatDetectionCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEventThreatDetectionCustomModuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventThreatDetectionCustomModule = null; + object.updateMask = null; + } + if (message.eventThreatDetectionCustomModule != null && message.hasOwnProperty("eventThreatDetectionCustomModule")) + object.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.toObject(message.eventThreatDetectionCustomModule, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEventThreatDetectionCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEventThreatDetectionCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest"; + }; + + return UpdateEventThreatDetectionCustomModuleRequest; + })(); + + v1.GetEffectiveEventThreatDetectionCustomModuleRequest = (function() { + + /** + * Properties of a GetEffectiveEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetEffectiveEventThreatDetectionCustomModuleRequest + * @property {string|null} [name] GetEffectiveEventThreatDetectionCustomModuleRequest name + */ + + /** + * Constructs a new GetEffectiveEventThreatDetectionCustomModuleRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetEffectiveEventThreatDetectionCustomModuleRequest. + * @implements IGetEffectiveEventThreatDetectionCustomModuleRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + */ + function GetEffectiveEventThreatDetectionCustomModuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEffectiveEventThreatDetectionCustomModuleRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @instance + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.prototype.name = ""; + + /** + * Creates a new GetEffectiveEventThreatDetectionCustomModuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} GetEffectiveEventThreatDetectionCustomModuleRequest instance + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.create = function create(properties) { + return new GetEffectiveEventThreatDetectionCustomModuleRequest(properties); + }; + + /** + * Encodes the specified GetEffectiveEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest} message GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.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 GetEffectiveEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest} message GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEffectiveEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} GetEffectiveEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEffectiveEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} GetEffectiveEventThreatDetectionCustomModuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEffectiveEventThreatDetectionCustomModuleRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.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 GetEffectiveEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} GetEffectiveEventThreatDetectionCustomModuleRequest + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEffectiveEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} message GetEffectiveEventThreatDetectionCustomModuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.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 GetEffectiveEventThreatDetectionCustomModuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @instance + * @returns {Object.} JSON object + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEffectiveEventThreatDetectionCustomModuleRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEffectiveEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest"; + }; + + return GetEffectiveEventThreatDetectionCustomModuleRequest; + })(); + + v1.ListEffectiveEventThreatDetectionCustomModulesRequest = (function() { + + /** + * Properties of a ListEffectiveEventThreatDetectionCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListEffectiveEventThreatDetectionCustomModulesRequest + * @property {string|null} [parent] ListEffectiveEventThreatDetectionCustomModulesRequest parent + * @property {string|null} [pageToken] ListEffectiveEventThreatDetectionCustomModulesRequest pageToken + * @property {number|null} [pageSize] ListEffectiveEventThreatDetectionCustomModulesRequest pageSize + */ + + /** + * Constructs a new ListEffectiveEventThreatDetectionCustomModulesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListEffectiveEventThreatDetectionCustomModulesRequest. + * @implements IListEffectiveEventThreatDetectionCustomModulesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest=} [properties] Properties to set + */ + function ListEffectiveEventThreatDetectionCustomModulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEffectiveEventThreatDetectionCustomModulesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @instance + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.prototype.parent = ""; + + /** + * ListEffectiveEventThreatDetectionCustomModulesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @instance + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.prototype.pageToken = ""; + + /** + * ListEffectiveEventThreatDetectionCustomModulesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @instance + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListEffectiveEventThreatDetectionCustomModulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} ListEffectiveEventThreatDetectionCustomModulesRequest instance + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.create = function create(properties) { + return new ListEffectiveEventThreatDetectionCustomModulesRequest(properties); + }; + + /** + * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest} message ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest} message ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEffectiveEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} ListEffectiveEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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; + } + } + return message; + }; + + /** + * Decodes a ListEffectiveEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} ListEffectiveEventThreatDetectionCustomModulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEffectiveEventThreatDetectionCustomModulesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.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 ListEffectiveEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} ListEffectiveEventThreatDetectionCustomModulesRequest + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest(); + 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 ListEffectiveEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} message ListEffectiveEventThreatDetectionCustomModulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.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 ListEffectiveEventThreatDetectionCustomModulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEffectiveEventThreatDetectionCustomModulesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEffectiveEventThreatDetectionCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest"; + }; + + return ListEffectiveEventThreatDetectionCustomModulesRequest; + })(); + + v1.ListEffectiveEventThreatDetectionCustomModulesResponse = (function() { + + /** + * Properties of a ListEffectiveEventThreatDetectionCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListEffectiveEventThreatDetectionCustomModulesResponse + * @property {Array.|null} [effectiveEventThreatDetectionCustomModules] ListEffectiveEventThreatDetectionCustomModulesResponse effectiveEventThreatDetectionCustomModules + * @property {string|null} [nextPageToken] ListEffectiveEventThreatDetectionCustomModulesResponse nextPageToken + */ + + /** + * Constructs a new ListEffectiveEventThreatDetectionCustomModulesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListEffectiveEventThreatDetectionCustomModulesResponse. + * @implements IListEffectiveEventThreatDetectionCustomModulesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse=} [properties] Properties to set + */ + function ListEffectiveEventThreatDetectionCustomModulesResponse(properties) { + this.effectiveEventThreatDetectionCustomModules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEffectiveEventThreatDetectionCustomModulesResponse effectiveEventThreatDetectionCustomModules. + * @member {Array.} effectiveEventThreatDetectionCustomModules + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @instance + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.prototype.effectiveEventThreatDetectionCustomModules = $util.emptyArray; + + /** + * ListEffectiveEventThreatDetectionCustomModulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @instance + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEffectiveEventThreatDetectionCustomModulesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} ListEffectiveEventThreatDetectionCustomModulesResponse instance + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.create = function create(properties) { + return new ListEffectiveEventThreatDetectionCustomModulesResponse(properties); + }; + + /** + * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse} message ListEffectiveEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.effectiveEventThreatDetectionCustomModules != null && message.effectiveEventThreatDetectionCustomModules.length) + for (var i = 0; i < message.effectiveEventThreatDetectionCustomModules.length; ++i) + $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.encode(message.effectiveEventThreatDetectionCustomModules[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 ListEffectiveEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse} message ListEffectiveEventThreatDetectionCustomModulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEffectiveEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} ListEffectiveEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.effectiveEventThreatDetectionCustomModules && message.effectiveEventThreatDetectionCustomModules.length)) + message.effectiveEventThreatDetectionCustomModules = []; + message.effectiveEventThreatDetectionCustomModules.push($root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEffectiveEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} ListEffectiveEventThreatDetectionCustomModulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEffectiveEventThreatDetectionCustomModulesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.effectiveEventThreatDetectionCustomModules != null && message.hasOwnProperty("effectiveEventThreatDetectionCustomModules")) { + if (!Array.isArray(message.effectiveEventThreatDetectionCustomModules)) + return "effectiveEventThreatDetectionCustomModules: array expected"; + for (var i = 0; i < message.effectiveEventThreatDetectionCustomModules.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify(message.effectiveEventThreatDetectionCustomModules[i]); + if (error) + return "effectiveEventThreatDetectionCustomModules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEffectiveEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} ListEffectiveEventThreatDetectionCustomModulesResponse + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse(); + if (object.effectiveEventThreatDetectionCustomModules) { + if (!Array.isArray(object.effectiveEventThreatDetectionCustomModules)) + throw TypeError(".google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.effectiveEventThreatDetectionCustomModules: array expected"); + message.effectiveEventThreatDetectionCustomModules = []; + for (var i = 0; i < object.effectiveEventThreatDetectionCustomModules.length; ++i) { + if (typeof object.effectiveEventThreatDetectionCustomModules[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.effectiveEventThreatDetectionCustomModules: object expected"); + message.effectiveEventThreatDetectionCustomModules[i] = $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.fromObject(object.effectiveEventThreatDetectionCustomModules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEffectiveEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} message ListEffectiveEventThreatDetectionCustomModulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.effectiveEventThreatDetectionCustomModules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.effectiveEventThreatDetectionCustomModules && message.effectiveEventThreatDetectionCustomModules.length) { + object.effectiveEventThreatDetectionCustomModules = []; + for (var j = 0; j < message.effectiveEventThreatDetectionCustomModules.length; ++j) + object.effectiveEventThreatDetectionCustomModules[j] = $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.toObject(message.effectiveEventThreatDetectionCustomModules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEffectiveEventThreatDetectionCustomModulesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEffectiveEventThreatDetectionCustomModulesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEffectiveEventThreatDetectionCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse"; + }; + + return ListEffectiveEventThreatDetectionCustomModulesResponse; + })(); + + v1.Simulation = (function() { + + /** + * Properties of a Simulation. + * @memberof google.cloud.securitycenter.v1 + * @interface ISimulation + * @property {string|null} [name] Simulation name + * @property {google.protobuf.ITimestamp|null} [createTime] Simulation createTime + * @property {Array.|null} [resourceValueConfigsMetadata] Simulation resourceValueConfigsMetadata + * @property {google.cloud.securitycenter.v1.CloudProvider|null} [cloudProvider] Simulation cloudProvider + */ + + /** + * Constructs a new Simulation. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Simulation. + * @implements ISimulation + * @constructor + * @param {google.cloud.securitycenter.v1.ISimulation=} [properties] Properties to set + */ + function Simulation(properties) { + this.resourceValueConfigsMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Simulation name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Simulation + * @instance + */ + Simulation.prototype.name = ""; + + /** + * Simulation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Simulation + * @instance + */ + Simulation.prototype.createTime = null; + + /** + * Simulation resourceValueConfigsMetadata. + * @member {Array.} resourceValueConfigsMetadata + * @memberof google.cloud.securitycenter.v1.Simulation + * @instance + */ + Simulation.prototype.resourceValueConfigsMetadata = $util.emptyArray; + + /** + * Simulation cloudProvider. + * @member {google.cloud.securitycenter.v1.CloudProvider} cloudProvider + * @memberof google.cloud.securitycenter.v1.Simulation + * @instance + */ + Simulation.prototype.cloudProvider = 0; + + /** + * Creates a new Simulation instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {google.cloud.securitycenter.v1.ISimulation=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Simulation} Simulation instance + */ + Simulation.create = function create(properties) { + return new Simulation(properties); + }; + + /** + * Encodes the specified Simulation message. Does not implicitly {@link google.cloud.securitycenter.v1.Simulation.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {google.cloud.securitycenter.v1.ISimulation} message Simulation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Simulation.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceValueConfigsMetadata != null && message.resourceValueConfigsMetadata.length) + for (var i = 0; i < message.resourceValueConfigsMetadata.length; ++i) + $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.encode(message.resourceValueConfigsMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cloudProvider); + return writer; + }; + + /** + * Encodes the specified Simulation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Simulation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {google.cloud.securitycenter.v1.ISimulation} message Simulation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Simulation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Simulation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Simulation} Simulation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Simulation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Simulation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.resourceValueConfigsMetadata && message.resourceValueConfigsMetadata.length)) + message.resourceValueConfigsMetadata = []; + message.resourceValueConfigsMetadata.push($root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.decode(reader, reader.uint32())); + break; + } + case 4: { + message.cloudProvider = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Simulation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Simulation} Simulation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Simulation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Simulation message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Simulation.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.resourceValueConfigsMetadata != null && message.hasOwnProperty("resourceValueConfigsMetadata")) { + if (!Array.isArray(message.resourceValueConfigsMetadata)) + return "resourceValueConfigsMetadata: array expected"; + for (var i = 0; i < message.resourceValueConfigsMetadata.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify(message.resourceValueConfigsMetadata[i]); + if (error) + return "resourceValueConfigsMetadata." + error; + } + } + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + switch (message.cloudProvider) { + default: + return "cloudProvider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Simulation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Simulation} Simulation + */ + Simulation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Simulation) + return object; + var message = new $root.google.cloud.securitycenter.v1.Simulation(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Simulation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.resourceValueConfigsMetadata) { + if (!Array.isArray(object.resourceValueConfigsMetadata)) + throw TypeError(".google.cloud.securitycenter.v1.Simulation.resourceValueConfigsMetadata: array expected"); + message.resourceValueConfigsMetadata = []; + for (var i = 0; i < object.resourceValueConfigsMetadata.length; ++i) { + if (typeof object.resourceValueConfigsMetadata[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Simulation.resourceValueConfigsMetadata: object expected"); + message.resourceValueConfigsMetadata[i] = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.fromObject(object.resourceValueConfigsMetadata[i]); + } + } + switch (object.cloudProvider) { + default: + if (typeof object.cloudProvider === "number") { + message.cloudProvider = object.cloudProvider; + break; + } + break; + case "CLOUD_PROVIDER_UNSPECIFIED": + case 0: + message.cloudProvider = 0; + break; + case "GOOGLE_CLOUD_PLATFORM": + case 1: + message.cloudProvider = 1; + break; + case "AMAZON_WEB_SERVICES": + case 2: + message.cloudProvider = 2; + break; + case "MICROSOFT_AZURE": + case 3: + message.cloudProvider = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Simulation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {google.cloud.securitycenter.v1.Simulation} message Simulation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Simulation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceValueConfigsMetadata = []; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.resourceValueConfigsMetadata && message.resourceValueConfigsMetadata.length) { + object.resourceValueConfigsMetadata = []; + for (var j = 0; j < message.resourceValueConfigsMetadata.length; ++j) + object.resourceValueConfigsMetadata[j] = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.toObject(message.resourceValueConfigsMetadata[j], options); + } + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] : message.cloudProvider; + return object; + }; + + /** + * Converts this Simulation to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Simulation + * @instance + * @returns {Object.} JSON object + */ + Simulation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Simulation + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Simulation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Simulation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Simulation"; + }; + + return Simulation; + })(); + + v1.ValuedResource = (function() { + + /** + * Properties of a ValuedResource. + * @memberof google.cloud.securitycenter.v1 + * @interface IValuedResource + * @property {string|null} [name] ValuedResource name + * @property {string|null} [resource] ValuedResource resource + * @property {string|null} [resourceType] ValuedResource resourceType + * @property {string|null} [displayName] ValuedResource displayName + * @property {google.cloud.securitycenter.v1.ValuedResource.ResourceValue|null} [resourceValue] ValuedResource resourceValue + * @property {number|null} [exposedScore] ValuedResource exposedScore + * @property {Array.|null} [resourceValueConfigsUsed] ValuedResource resourceValueConfigsUsed + */ + + /** + * Constructs a new ValuedResource. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ValuedResource. + * @implements IValuedResource + * @constructor + * @param {google.cloud.securitycenter.v1.IValuedResource=} [properties] Properties to set + */ + function ValuedResource(properties) { + this.resourceValueConfigsUsed = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValuedResource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @instance + */ + ValuedResource.prototype.name = ""; + + /** + * ValuedResource resource. + * @member {string} resource + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @instance + */ + ValuedResource.prototype.resource = ""; + + /** + * ValuedResource resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @instance + */ + ValuedResource.prototype.resourceType = ""; + + /** + * ValuedResource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @instance + */ + ValuedResource.prototype.displayName = ""; + + /** + * ValuedResource resourceValue. + * @member {google.cloud.securitycenter.v1.ValuedResource.ResourceValue} resourceValue + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @instance + */ + ValuedResource.prototype.resourceValue = 0; + + /** + * ValuedResource exposedScore. + * @member {number} exposedScore + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @instance + */ + ValuedResource.prototype.exposedScore = 0; + + /** + * ValuedResource resourceValueConfigsUsed. + * @member {Array.} resourceValueConfigsUsed + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @instance + */ + ValuedResource.prototype.resourceValueConfigsUsed = $util.emptyArray; + + /** + * Creates a new ValuedResource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {google.cloud.securitycenter.v1.IValuedResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ValuedResource} ValuedResource instance + */ + ValuedResource.create = function create(properties) { + return new ValuedResource(properties); + }; + + /** + * Encodes the specified ValuedResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ValuedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {google.cloud.securitycenter.v1.IValuedResource} message ValuedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValuedResource.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.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.resourceValue != null && Object.hasOwnProperty.call(message, "resourceValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resourceValue); + if (message.exposedScore != null && Object.hasOwnProperty.call(message, "exposedScore")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.exposedScore); + if (message.resourceValueConfigsUsed != null && message.resourceValueConfigsUsed.length) + for (var i = 0; i < message.resourceValueConfigsUsed.length; ++i) + $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.encode(message.resourceValueConfigsUsed[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValuedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValuedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {google.cloud.securitycenter.v1.IValuedResource} message ValuedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValuedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValuedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ValuedResource} ValuedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValuedResource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ValuedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resource = reader.string(); + break; + } + case 3: { + message.resourceType = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.resourceValue = reader.int32(); + break; + } + case 6: { + message.exposedScore = reader.double(); + break; + } + case 7: { + if (!(message.resourceValueConfigsUsed && message.resourceValueConfigsUsed.length)) + message.resourceValueConfigsUsed = []; + message.resourceValueConfigsUsed.push($root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValuedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ValuedResource} ValuedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValuedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValuedResource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValuedResource.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.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) + switch (message.resourceValue) { + default: + return "resourceValue: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exposedScore != null && message.hasOwnProperty("exposedScore")) + if (typeof message.exposedScore !== "number") + return "exposedScore: number expected"; + if (message.resourceValueConfigsUsed != null && message.hasOwnProperty("resourceValueConfigsUsed")) { + if (!Array.isArray(message.resourceValueConfigsUsed)) + return "resourceValueConfigsUsed: array expected"; + for (var i = 0; i < message.resourceValueConfigsUsed.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify(message.resourceValueConfigsUsed[i]); + if (error) + return "resourceValueConfigsUsed." + error; + } + } + return null; + }; + + /** + * Creates a ValuedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ValuedResource} ValuedResource + */ + ValuedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ValuedResource) + return object; + var message = new $root.google.cloud.securitycenter.v1.ValuedResource(); + if (object.name != null) + message.name = String(object.name); + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.resourceValue) { + default: + if (typeof object.resourceValue === "number") { + message.resourceValue = object.resourceValue; + break; + } + break; + case "RESOURCE_VALUE_UNSPECIFIED": + case 0: + message.resourceValue = 0; + break; + case "RESOURCE_VALUE_LOW": + case 1: + message.resourceValue = 1; + break; + case "RESOURCE_VALUE_MEDIUM": + case 2: + message.resourceValue = 2; + break; + case "RESOURCE_VALUE_HIGH": + case 3: + message.resourceValue = 3; + break; + } + if (object.exposedScore != null) + message.exposedScore = Number(object.exposedScore); + if (object.resourceValueConfigsUsed) { + if (!Array.isArray(object.resourceValueConfigsUsed)) + throw TypeError(".google.cloud.securitycenter.v1.ValuedResource.resourceValueConfigsUsed: array expected"); + message.resourceValueConfigsUsed = []; + for (var i = 0; i < object.resourceValueConfigsUsed.length; ++i) { + if (typeof object.resourceValueConfigsUsed[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ValuedResource.resourceValueConfigsUsed: object expected"); + message.resourceValueConfigsUsed[i] = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.fromObject(object.resourceValueConfigsUsed[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValuedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {google.cloud.securitycenter.v1.ValuedResource} message ValuedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValuedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceValueConfigsUsed = []; + if (options.defaults) { + object.name = ""; + object.resource = ""; + object.resourceType = ""; + object.displayName = ""; + object.resourceValue = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; + object.exposedScore = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) + object.resourceValue = options.enums === String ? $root.google.cloud.securitycenter.v1.ValuedResource.ResourceValue[message.resourceValue] === undefined ? message.resourceValue : $root.google.cloud.securitycenter.v1.ValuedResource.ResourceValue[message.resourceValue] : message.resourceValue; + if (message.exposedScore != null && message.hasOwnProperty("exposedScore")) + object.exposedScore = options.json && !isFinite(message.exposedScore) ? String(message.exposedScore) : message.exposedScore; + if (message.resourceValueConfigsUsed && message.resourceValueConfigsUsed.length) { + object.resourceValueConfigsUsed = []; + for (var j = 0; j < message.resourceValueConfigsUsed.length; ++j) + object.resourceValueConfigsUsed[j] = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.toObject(message.resourceValueConfigsUsed[j], options); + } + return object; + }; + + /** + * Converts this ValuedResource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @instance + * @returns {Object.} JSON object + */ + ValuedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValuedResource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ValuedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValuedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ValuedResource"; + }; + + /** + * ResourceValue enum. + * @name google.cloud.securitycenter.v1.ValuedResource.ResourceValue + * @enum {number} + * @property {number} RESOURCE_VALUE_UNSPECIFIED=0 RESOURCE_VALUE_UNSPECIFIED value + * @property {number} RESOURCE_VALUE_LOW=1 RESOURCE_VALUE_LOW value + * @property {number} RESOURCE_VALUE_MEDIUM=2 RESOURCE_VALUE_MEDIUM value + * @property {number} RESOURCE_VALUE_HIGH=3 RESOURCE_VALUE_HIGH value + */ + ValuedResource.ResourceValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_VALUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_VALUE_LOW"] = 1; + values[valuesById[2] = "RESOURCE_VALUE_MEDIUM"] = 2; + values[valuesById[3] = "RESOURCE_VALUE_HIGH"] = 3; + return values; + })(); + + return ValuedResource; + })(); + + v1.ResourceValueConfigMetadata = (function() { + + /** + * Properties of a ResourceValueConfigMetadata. + * @memberof google.cloud.securitycenter.v1 + * @interface IResourceValueConfigMetadata + * @property {string|null} [name] ResourceValueConfigMetadata name + */ + + /** + * Constructs a new ResourceValueConfigMetadata. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ResourceValueConfigMetadata. + * @implements IResourceValueConfigMetadata + * @constructor + * @param {google.cloud.securitycenter.v1.IResourceValueConfigMetadata=} [properties] Properties to set + */ + function ResourceValueConfigMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceValueConfigMetadata name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @instance + */ + ResourceValueConfigMetadata.prototype.name = ""; + + /** + * Creates a new ResourceValueConfigMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {google.cloud.securitycenter.v1.IResourceValueConfigMetadata=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} ResourceValueConfigMetadata instance + */ + ResourceValueConfigMetadata.create = function create(properties) { + return new ResourceValueConfigMetadata(properties); + }; + + /** + * Encodes the specified ResourceValueConfigMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {google.cloud.securitycenter.v1.IResourceValueConfigMetadata} message ResourceValueConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceValueConfigMetadata.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 ResourceValueConfigMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {google.cloud.securitycenter.v1.IResourceValueConfigMetadata} message ResourceValueConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceValueConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} ResourceValueConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceValueConfigMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} ResourceValueConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceValueConfigMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceValueConfigMetadata message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceValueConfigMetadata.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 ResourceValueConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} ResourceValueConfigMetadata + */ + ResourceValueConfigMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata) + return object; + var message = new $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ResourceValueConfigMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} message ResourceValueConfigMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceValueConfigMetadata.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 ResourceValueConfigMetadata to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @instance + * @returns {Object.} JSON object + */ + ResourceValueConfigMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceValueConfigMetadata + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceValueConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourceValueConfigMetadata"; + }; + + return ResourceValueConfigMetadata; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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 + * @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); + }; + + /** + * 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() { + + /** + * 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 && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + 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]); + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + 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; + }; + + /** + * 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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + } + message.marks[key] = value; + 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); + }; + + /** + * 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; + })(); + + 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 && 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.v1beta1.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(); + 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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.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) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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] === 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")) + 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); + }; + + /** + * 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 + * @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; + })(); + + 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 && 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.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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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() { + + /** + * 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; + 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] === undefined ? message.inclusionMode : $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); + }; + + /** + * 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 + * @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; + })(); + + 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 + */ + + /** + * 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 + */ + 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.v1beta1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * 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 + */ + 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 + */ + 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.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 + */ + 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.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 + */ + RunAssetDiscoveryResponse.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 + */ + 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 + */ + 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.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + 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) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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 + */ + 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] === 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; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + 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 + * @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; + })(); + + 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 && 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.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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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.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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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); + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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); + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + 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.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")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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() { + + /** + * 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 && 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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] === undefined ? message.state : $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); + }; + + /** + * 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 + * @enum {number} + * @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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + 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 && 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 && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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.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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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] === 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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 && 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 && 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 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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); + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + return v1beta1; + })(); + + securitycenter.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.Asset = (function() { + + /** + * 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 + * @property {string|null} [canonicalName] Asset canonicalName + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * 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; + + /** + * 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 + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.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; + }; + + /** + * 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.v1p1beta1.Asset + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + } + 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; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.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; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Asset) + return object; + 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); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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; + object.canonicalName = ""; + } + 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); + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * 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); + }; + + /** + * 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() { + + /** + * 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 + * @property {Array.|null} [folders] SecurityCenterProperties folders + */ + + /** + * 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 = []; + 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]]; + } + + /** + * 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 = ""; + + /** + * 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 + * @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 && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + 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 && Object.hasOwnProperty.call(message, "resourceDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); + if (message.resourceParentDisplayName != null && Object.hasOwnProperty.call(message, "resourceParentDisplayName")) + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + 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"; + 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; + }; + + /** + * 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); + 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; + }; + + /** + * 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 = []; + object.folders = []; + } + 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; + 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + Asset.IamPolicy = (function() { + + /** + * Properties of an IamPolicy. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @interface IIamPolicy + * @property {string|null} [policyBlob] IamPolicy policyBlob + */ + + /** + * 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]]; + } + + /** + * IamPolicy policyBlob. + * @member {string} policyBlob + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @instance + */ + IamPolicy.prototype.policyBlob = ""; + + /** + * 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 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 && Object.hasOwnProperty.call(message, "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.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, error) { + 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(); + if (tag === error) + break; + 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.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 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 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + v1p1beta1.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks + * @property {string|null} [canonicalName] SecurityMarks canonicalName + */ + + /** + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.name = ""; + + /** + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @instance + */ + 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 + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks instance + */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @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 + */ + SecurityMarks.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.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; + }; + + /** + * 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.v1p1beta1.SecurityMarks + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + } + message.marks[key] = value; + break; + } + case 3: { + message.canonicalName = 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.v1p1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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"; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: 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.v1p1beta1.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks + */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks) + return object; + 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]]); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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 = ""; + object.canonicalName = ""; + } + 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.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @instance + * @returns {Object.} JSON object + */ + SecurityMarks.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.Finding = (function() { + + /** + * 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 + * @property {google.cloud.securitycenter.v1p1beta1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [canonicalName] Finding canonicalName + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.parent = ""; + + /** + * 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; + + /** + * Finding severity. + * @member {google.cloud.securitycenter.v1p1beta1.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + 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 + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @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 + */ + 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.v1p1beta1.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 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; + }; + + /** + * 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.v1p1beta1.Finding + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.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; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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"; + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Finding) + return object; + 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) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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.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); + } + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + 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); + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.canonicalName = ""; + } + 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] === 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")) + 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); + if (message.severity != null && message.hasOwnProperty("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; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + 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 + * @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.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; + })(); + + 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 NotificationConfig. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig=} [properties] Properties to set + */ + function NotificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.name = ""; + + /** + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.description = ""; + + /** + * NotificationConfig eventType. + * @member {google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType} eventType + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.eventType = 0; + + /** + * 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.v1p1beta1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig instance + */ + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); + }; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @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 + */ + NotificationConfig.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.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.eventType); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pubsubTopic); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + 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; + }; + + /** + * 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.v1p1beta1.NotificationConfig + * @static + * @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 + */ + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @function decode + * @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.v1p1beta1.NotificationConfig} NotificationConfig + * @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, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationConfig message. + * @function verify + * @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 + */ + 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.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 a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig + */ + 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) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + 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] === 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")) + 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); + }; + + /** + * 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() { + + /** + * 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 && 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.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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + /** + * EventType enum. + * @name google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} FINDING=1 FINDING value + */ + NotificationConfig.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FINDING"] = 1; + return values; + })(); + + return NotificationConfig; + })(); + + v1p1beta1.NotificationMessage = (function() { + + /** + * 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 + * @property {google.cloud.securitycenter.v1p1beta1.IResource|null} [resource] NotificationMessage resource + */ + + /** + * Constructs a new NotificationMessage. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a NotificationMessage. + * @implements INotificationMessage + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.notificationConfigName = ""; + + /** + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @instance + */ + 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; + + /** + * NotificationMessage event. + * @member {"finding"|undefined} event + * @memberof google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage instance + */ + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); + }; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @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 + */ + NotificationMessage.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.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; + }; + + /** + * 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.v1p1beta1.NotificationMessage + * @static + * @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 + */ + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer. + * @function decode + * @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.v1p1beta1.NotificationMessage} NotificationMessage + * @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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + NotificationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationMessage message. + * @function verify + * @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 + */ + NotificationMessage.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; + { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); + if (error) + 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; + }; + + /** + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage + */ + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.NotificationMessage) + return object; + 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); + } + 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; + }; + + /** + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationMessage} message NotificationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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")) { + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); + 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; + }; + + /** + * Converts this NotificationMessage to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @instance + * @returns {Object.} JSON object + */ + NotificationMessage.prototype.toJSON = function toJSON() { + 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; + })(); + + 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 + * @property {Array.|null} [folders] Resource folders + */ + + /** + * 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) { + 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]]; + } + + /** + * 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 = ""; + + /** + * 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 + * @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); + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + 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"; + 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; + }; + + /** + * 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); + 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; + }; + + /** + * 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.arrays || options.defaults) + object.folders = []; + 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; + 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + v1p1beta1.OrganizationSettings = (function() { + + /** + * 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 OrganizationSettings. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * 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.v1p1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.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); + }; + + /** + * 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() { + + /** + * 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 + * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds + */ + + /** + * 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 = []; + this.folderIds = []; + if (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; + + /** + * 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 + * @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 && 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + 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; + } + 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; + }; + + /** + * 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) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; + 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; + } + 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; + }; + + /** + * 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 = []; + object.folderIds = []; + } + 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] === 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) + object.folderIds[j] = message.folderIds[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); + }; + + /** + * 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 + * @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; + })(); + + v1p1beta1.RunAssetDiscoveryResponse = (function() { + + /** + * 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 RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @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 + */ + 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.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) + 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; + 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.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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; + }; + + /** + * 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); + }; + + /** + * 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 + * @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; + })(); + + 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 + * @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 + */ + 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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 + */ + 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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 + */ + 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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 + */ + 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.v1p1beta1.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.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 + */ + + /** + * 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 + */ + 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.v1p1beta1.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.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 + */ + + /** + * 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 + */ + 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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 + */ + 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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 + */ + 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" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @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 + */ + 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" }); + + /** + * 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 + */ + + return SecurityCenter; + })(); + + 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 CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) + return object; + 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 a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.CreateNotificationConfigRequest = (function() { + + /** + * 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 + */ + + /** + * 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]]; + } + + /** + * CreateNotificationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.parent = ""; + + /** + * CreateNotificationConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.configId = ""; + + /** + * CreateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * 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); + }; + + /** + * 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 && 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.v1p1beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + v1p1beta1.CreateSourceRequest = (function() { + + /** + * 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 {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * 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.v1p1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * 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 && 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.v1p1beta1.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.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 + */ + 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.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, error) { + 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(); + if (tag === error) + break; + 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()); + }; + + /** + * 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; + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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 + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.DeleteNotificationConfigRequest = (function() { + + /** + * Properties of a DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name + */ + + /** + * 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]]; + } + + /** + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @instance + */ + DeleteNotificationConfigRequest.prototype.name = ""; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * 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 + */ + DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.GetNotificationConfigRequest = (function() { + + /** + * Properties of a GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name + */ + + /** + * 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]]; + } + + /** + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @instance + */ + GetNotificationConfigRequest.prototype.name = ""; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * 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 + */ + GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * Converts this GetNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.GetOrganizationSettingsRequest = (function() { + + /** + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name + */ + + /** + * 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 + */ + 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.v1p1beta1.GetOrganizationSettingsRequest + * @instance + */ + GetOrganizationSettingsRequest.prototype.name = ""; + + /** + * 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); + }; + + /** + * 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 + */ + GetOrganizationSettingsRequest.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 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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.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 + */ + 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.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; + }; + + /** + * 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; + }; + + /** + * 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 + */ + 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.v1p1beta1.GetOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * 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 + */ + 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.v1p1beta1.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * 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); + }; + + /** + * 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 + */ + GetSourceRequest.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 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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.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 + */ + 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.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; + }; + + /** + * 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; + }; + + /** + * 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 + */ + 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.v1p1beta1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.GroupAssetsRequest = (function() { + + /** + * 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} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ + + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; + + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * 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 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.v1p1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest instance + */ + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); + }; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @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 + */ + GroupAssetsRequest.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.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 GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.GroupAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest + */ + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.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.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.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.v1p1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.GroupAssetsResponse = (function() { + + /** + * 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 GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * 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.v1p1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse instance + */ + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); + }; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @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 + */ + 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.v1p1beta1.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 GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.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 GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse + */ + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) + return object; + 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 GroupAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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 GroupAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + 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; + })(); + + 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} [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 + */ + GroupFindingsRequest.prototype.compareDuration = null; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest instance + */ + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); + }; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @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 + */ + GroupFindingsRequest.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); + return writer; + }; + + /** + * 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.v1p1beta1.GroupFindingsRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.GroupFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest + */ + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) + return object; + 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.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.v1p1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.GroupFindingsResponse = (function() { + + /** + * 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 GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.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 + */ + GroupFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse instance + */ + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); + }; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @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 + */ + 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.v1p1beta1.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 GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.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 GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse + */ + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) + return object; + 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 GroupFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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 GroupFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsResponse.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.GroupResult = (function() { + + /** + * 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 GroupResult. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupResult + * @instance + */ + GroupResult.prototype.properties = $util.emptyObject; + + /** + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult instance + */ + GroupResult.create = function create(properties) { + return new GroupResult(properties); + }; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @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 && 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 GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @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.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.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.v1p1beta1.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, error) { + 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, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + 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.v1p1beta1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.GroupResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult + */ + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupResult) + return object; + 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.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.v1p1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupResult + * @instance + * @returns {Object.} JSON object + */ + GroupResult.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.ListNotificationConfigsRequest = (function() { + + /** + * 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 ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListNotificationConfigsRequest. + * @implements IListNotificationConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest=} [properties] Properties to set + */ + function ListNotificationConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.parent = ""; + + /** + * ListNotificationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageToken = ""; + + /** + * ListNotificationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListNotificationConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance + */ + ListNotificationConfigsRequest.create = function create(properties) { + return new ListNotificationConfigsRequest(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @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 + */ + ListNotificationConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * 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.v1p1beta1.ListNotificationConfigsRequest + * @static + * @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 + */ + ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. + * @function decode + * @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.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + 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; + } + } + return message; + }; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + */ + ListNotificationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) + return object; + 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 ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} message ListNotificationConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.ListNotificationConfigsResponse = (function() { + + /** + * 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 ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListNotificationConfigsResponse. + * @implements IListNotificationConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse=} [properties] Properties to set + */ + function ListNotificationConfigsResponse(properties) { + this.notificationConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsResponse notificationConfigs. + * @member {Array.} notificationConfigs + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; + + /** + * ListNotificationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListNotificationConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance + */ + ListNotificationConfigsResponse.create = function create(properties) { + return new ListNotificationConfigsResponse(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @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 + */ + ListNotificationConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * 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.v1p1beta1.ListNotificationConfigsResponse + * @static + * @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 + */ + ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. + * @function decode + * @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.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNotificationConfigsResponse message. + * @function verify + * @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 + */ + ListNotificationConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * 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.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} message ListNotificationConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + 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.v1p1beta1.NotificationConfig.toObject(message.notificationConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.ListSourcesRequest = (function() { + + /** + * 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 ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @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 + */ + ListSourcesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v1p1beta1.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) + return object; + 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 ListSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.ListSourcesResponse = (function() { + + /** + * 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 ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @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 + */ + 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.v1p1beta1.Source.encode(message.sources[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 ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) + return object; + 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.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.v1p1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.ListAssetsRequest = (function() { + + /** + * 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 {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.v1p1beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * 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 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.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @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 + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @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 + */ + ListAssetsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + 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.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")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v1p1beta1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) + return object; + 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.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) + 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.v1p1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.ListAssetsResponse = (function() { + + /** + * 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 ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + + /** + * 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.v1p1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * 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.v1p1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @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 + */ + 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.v1p1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[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 ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) + return object; + 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); + }; + + /** + * 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() { + + /** + * 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 && 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; + 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 (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] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + 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); + }; + + /** + * 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 + * @enum {number} + * @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; + })(); + + v1p1beta1.ListFindingsRequest = (function() { + + /** + * 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 {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.v1p1beta1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; + + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; + + /** + * ListFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.compareDuration = null; + + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @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 + */ + ListFindingsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + 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.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")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v1p1beta1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.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.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.ListFindingsResponse = (function() { + + /** + * 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 ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; + + /** + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.readTime = null; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @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 + */ + 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.v1p1beta1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[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 ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) + return object; + 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.v1p1beta1.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.v1p1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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); + 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.v1p1beta1.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + 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() { + + /** + * 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 ListFindingsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @classdesc Represents a ListFindingsResult. + * @implements IListFindingsResult + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.finding = null; + + /** + * ListFindingsResult stateChange. + * @member {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.stateChange = 0; + + /** + * 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.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @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 + */ + ListFindingsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 && Object.hasOwnProperty.call(message, "stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + 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; + }; + + /** + * 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.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @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 + */ + 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.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.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.decode = function decode(reader, length, error) { + 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(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + 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.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) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; + 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 {google.cloud.securitycenter.v1p1beta1.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.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] === 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; + }; + + /** + * 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); + }; + + /** + * 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() { + + /** + * 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 + * @property {Array.|null} [folders] Resource folders + */ + + /** + * 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) { + 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]]; + } + + /** + * 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 = ""; + + /** + * 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 + * @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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.projectName != null && Object.hasOwnProperty.call(message, "projectName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parentName != null && Object.hasOwnProperty.call(message, "parentName")) + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + 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"; + 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; + }; + + /** + * 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); + 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; + }; + + /** + * 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.arrays || options.defaults) + object.folders = []; + 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; + 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1p1beta1.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; + })(); + + return ListFindingsResponse; + })(); + + v1p1beta1.SetFindingStateRequest = (function() { + + /** + * 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 SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1p1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @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 + */ + 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.v1p1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest(); + 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; + 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.v1p1beta1.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.v1p1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.RunAssetDiscoveryRequest = (function() { + + /** + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @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 + */ + RunAssetDiscoveryRequest.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); + return writer; + }; + + /** + * 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.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + */ + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) + return object; + 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 RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.UpdateFindingRequest = (function() { + + /** + * 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 UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @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 + */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 && 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 UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) + return object; + 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.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 an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.UpdateNotificationConfigRequest = (function() { + + /** + * 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 UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateNotificationConfigRequest. + * @implements IUpdateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * 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.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest instance + */ + UpdateNotificationConfigRequest.create = function create(properties) { + return new UpdateNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @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 + */ + UpdateNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 && 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 UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.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 an UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + */ + UpdateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) + return object; + 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 an UpdateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateNotificationConfigRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.UpdateOrganizationSettingsRequest = (function() { + + /** + * 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 UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + + /** + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + */ + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @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 + */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 && 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 UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) + return object; + 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.v1p1beta1.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.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.UpdateSourceRequest = (function() { + + /** + * 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 UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @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 + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 && 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 UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) + return object; + 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.v1p1beta1.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.v1p1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.UpdateSecurityMarksRequest = (function() { + + /** + * 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 UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; + + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; + + /** + * 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.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @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 + */ + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 && 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 && 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 UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + 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.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) + return object; + 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.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 UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + 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; + })(); + + v1p1beta1.Source = (function() { + + /** + * 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 + * @property {string|null} [canonicalName] Source canonicalName + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @instance + */ + 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 + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @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 + */ + 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.v1p1beta1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @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 + */ + 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.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.v1p1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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.v1p1beta1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + 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.v1p1beta1.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.v1p1beta1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Source) + return object; + 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); + 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.v1p1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + 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; + })(); + + return v1p1beta1; + })(); + + securitycenter.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v2 = {}; + + v2.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.securitycenter.v2 + * @interface IAccess + * @property {string|null} [principalEmail] Access principalEmail + * @property {string|null} [callerIp] Access callerIp + * @property {google.cloud.securitycenter.v2.IGeolocation|null} [callerIpGeo] Access callerIpGeo + * @property {string|null} [userAgentFamily] Access userAgentFamily + * @property {string|null} [userAgent] Access userAgent + * @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 + * @property {string|null} [userName] Access userName + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.securitycenter.v2.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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Access principalEmail. + * @member {string} principalEmail + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.principalEmail = ""; + + /** + * Access callerIp. + * @member {string} callerIp + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.callerIp = ""; + + /** + * Access callerIpGeo. + * @member {google.cloud.securitycenter.v2.IGeolocation|null|undefined} callerIpGeo + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.callerIpGeo = null; + + /** + * Access userAgentFamily. + * @member {string} userAgentFamily + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.userAgentFamily = ""; + + /** + * Access userAgent. + * @member {string} userAgent + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.userAgent = ""; + + /** + * Access serviceName. + * @member {string} serviceName + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.serviceName = ""; + + /** + * Access methodName. + * @member {string} methodName + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.methodName = ""; + + /** + * Access principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.principalSubject = ""; + + /** + * Access serviceAccountKeyName. + * @member {string} serviceAccountKeyName + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.serviceAccountKeyName = ""; + + /** + * Access serviceAccountDelegationInfo. + * @member {Array.} serviceAccountDelegationInfo + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.serviceAccountDelegationInfo = $util.emptyArray; + + /** + * Access userName. + * @member {string} userName + * @memberof google.cloud.securitycenter.v2.Access + * @instance + */ + Access.prototype.userName = ""; + + /** + * Creates a new Access instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Access + * @static + * @param {google.cloud.securitycenter.v2.IAccess=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Access} Access instance + */ + Access.create = function create(properties) { + return new Access(properties); + }; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.securitycenter.v2.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Access + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.userAgent); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceName); + if (message.methodName != null && Object.hasOwnProperty.call(message, "methodName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.methodName); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.principalSubject); + if (message.serviceAccountKeyName != null && Object.hasOwnProperty.call(message, "serviceAccountKeyName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccountKeyName); + if (message.serviceAccountDelegationInfo != null && message.serviceAccountDelegationInfo.length) + for (var i = 0; i < message.serviceAccountDelegationInfo.length; ++i) + $root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo.encode(message.serviceAccountDelegationInfo[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.userName); + return writer; + }; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Access + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Access(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Geolocation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.userAgentFamily = reader.string(); + break; + } + case 5: { + message.userAgent = reader.string(); + break; + } + case 6: { + message.serviceName = reader.string(); + break; + } + case 7: { + message.methodName = reader.string(); + break; + } + case 8: { + message.principalSubject = reader.string(); + break; + } + case 9: { + message.serviceAccountKeyName = reader.string(); + break; + } + case 10: { + if (!(message.serviceAccountDelegationInfo && message.serviceAccountDelegationInfo.length)) + message.serviceAccountDelegationInfo = []; + message.serviceAccountDelegationInfo.push($root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo.decode(reader, reader.uint32())); + break; + } + case 11: { + message.userName = 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.v2.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: 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"; + 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.v2.ServiceAccountDelegationInfo.verify(message.serviceAccountDelegationInfo[i]); + if (error) + return "serviceAccountDelegationInfo." + error; + } + } + if (message.userName != null && message.hasOwnProperty("userName")) + if (!$util.isString(message.userName)) + return "userName: 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.v2.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Access} Access + */ + Access.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Access) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Access.callerIpGeo: object expected"); + message.callerIpGeo = $root.google.cloud.securitycenter.v2.Geolocation.fromObject(object.callerIpGeo); + } + if (object.userAgentFamily != null) + message.userAgentFamily = String(object.userAgentFamily); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.serviceName != null) + 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.v2.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.v2.Access.serviceAccountDelegationInfo: object expected"); + message.serviceAccountDelegationInfo[i] = $root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo.fromObject(object.serviceAccountDelegationInfo[i]); + } + } + if (object.userName != null) + message.userName = String(object.userName); + return message; + }; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Access + * @static + * @param {google.cloud.securitycenter.v2.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.arrays || options.defaults) + object.serviceAccountDelegationInfo = []; + if (options.defaults) { + object.principalEmail = ""; + object.callerIp = ""; + object.callerIpGeo = null; + object.userAgentFamily = ""; + object.userAgent = ""; + object.serviceName = ""; + object.methodName = ""; + object.principalSubject = ""; + object.serviceAccountKeyName = ""; + object.userName = ""; + } + 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.v2.Geolocation.toObject(message.callerIpGeo, options); + if (message.userAgentFamily != null && message.hasOwnProperty("userAgentFamily")) + object.userAgentFamily = message.userAgentFamily; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + 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.v2.ServiceAccountDelegationInfo.toObject(message.serviceAccountDelegationInfo[j], options); + } + if (message.userName != null && message.hasOwnProperty("userName")) + object.userName = message.userName; + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Access + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Access"; + }; + + return Access; + })(); + + v2.ServiceAccountDelegationInfo = (function() { + + /** + * Properties of a ServiceAccountDelegationInfo. + * @memberof google.cloud.securitycenter.v2 + * @interface IServiceAccountDelegationInfo + * @property {string|null} [principalEmail] ServiceAccountDelegationInfo principalEmail + * @property {string|null} [principalSubject] ServiceAccountDelegationInfo principalSubject + */ + + /** + * Constructs a new ServiceAccountDelegationInfo. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ServiceAccountDelegationInfo. + * @implements IServiceAccountDelegationInfo + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ServiceAccountDelegationInfo + * @instance + */ + ServiceAccountDelegationInfo.prototype.principalEmail = ""; + + /** + * ServiceAccountDelegationInfo principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.securitycenter.v2.ServiceAccountDelegationInfo + * @instance + */ + ServiceAccountDelegationInfo.prototype.principalSubject = ""; + + /** + * Creates a new ServiceAccountDelegationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v2.IServiceAccountDelegationInfo=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo instance + */ + ServiceAccountDelegationInfo.create = function create(properties) { + return new ServiceAccountDelegationInfo(properties); + }; + + /** + * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.ServiceAccountDelegationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v2.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.v2.ServiceAccountDelegationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.ServiceAccountDelegationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.ServiceAccountDelegationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + */ + ServiceAccountDelegationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.ServiceAccountDelegationInfo"; + }; + + return ServiceAccountDelegationInfo; + })(); + + v2.Geolocation = (function() { + + /** + * Properties of a Geolocation. + * @memberof google.cloud.securitycenter.v2 + * @interface IGeolocation + * @property {string|null} [regionCode] Geolocation regionCode + */ + + /** + * Constructs a new Geolocation. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Geolocation. + * @implements IGeolocation + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Geolocation + * @instance + */ + Geolocation.prototype.regionCode = ""; + + /** + * Creates a new Geolocation instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Geolocation + * @static + * @param {google.cloud.securitycenter.v2.IGeolocation=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Geolocation} Geolocation instance + */ + Geolocation.create = function create(properties) { + return new Geolocation(properties); + }; + + /** + * Encodes the specified Geolocation message. Does not implicitly {@link google.cloud.securitycenter.v2.Geolocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Geolocation + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Geolocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Geolocation + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Geolocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Geolocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Geolocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Geolocation} Geolocation + */ + Geolocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Geolocation) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Geolocation + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Geolocation + * @instance + * @returns {Object.} JSON object + */ + Geolocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Geolocation + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Geolocation"; + }; + + return Geolocation; + })(); + + v2.AffectedResources = (function() { + + /** + * Properties of an AffectedResources. + * @memberof google.cloud.securitycenter.v2 + * @interface IAffectedResources + * @property {number|Long|null} [count] AffectedResources count + */ + + /** + * Constructs a new AffectedResources. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an AffectedResources. + * @implements IAffectedResources + * @constructor + * @param {google.cloud.securitycenter.v2.IAffectedResources=} [properties] Properties to set + */ + function AffectedResources(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AffectedResources count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @instance + */ + AffectedResources.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new AffectedResources instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {google.cloud.securitycenter.v2.IAffectedResources=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AffectedResources} AffectedResources instance + */ + AffectedResources.create = function create(properties) { + return new AffectedResources(properties); + }; + + /** + * Encodes the specified AffectedResources message. Does not implicitly {@link google.cloud.securitycenter.v2.AffectedResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {google.cloud.securitycenter.v2.IAffectedResources} message AffectedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AffectedResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); + return writer; + }; + + /** + * Encodes the specified AffectedResources message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AffectedResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {google.cloud.securitycenter.v2.IAffectedResources} message AffectedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AffectedResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AffectedResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AffectedResources} AffectedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AffectedResources.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AffectedResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AffectedResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AffectedResources} AffectedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AffectedResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AffectedResources message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AffectedResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 an AffectedResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AffectedResources} AffectedResources + */ + AffectedResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AffectedResources) + return object; + var message = new $root.google.cloud.securitycenter.v2.AffectedResources(); + 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 AffectedResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {google.cloud.securitycenter.v2.AffectedResources} message AffectedResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AffectedResources.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 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; + return object; + }; + + /** + * Converts this AffectedResources to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @instance + * @returns {Object.} JSON object + */ + AffectedResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AffectedResources + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AffectedResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AffectedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AffectedResources"; + }; + + return AffectedResources; + })(); + + v2.AiModel = (function() { + + /** + * Properties of an AiModel. + * @memberof google.cloud.securitycenter.v2 + * @interface IAiModel + * @property {string|null} [name] AiModel name + * @property {string|null} [domain] AiModel domain + * @property {string|null} [library] AiModel library + * @property {string|null} [location] AiModel location + * @property {string|null} [publisher] AiModel publisher + * @property {google.cloud.securitycenter.v2.AiModel.DeploymentPlatform|null} [deploymentPlatform] AiModel deploymentPlatform + * @property {string|null} [displayName] AiModel displayName + */ + + /** + * Constructs a new AiModel. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an AiModel. + * @implements IAiModel + * @constructor + * @param {google.cloud.securitycenter.v2.IAiModel=} [properties] Properties to set + */ + function AiModel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AiModel name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.AiModel + * @instance + */ + AiModel.prototype.name = ""; + + /** + * AiModel domain. + * @member {string} domain + * @memberof google.cloud.securitycenter.v2.AiModel + * @instance + */ + AiModel.prototype.domain = ""; + + /** + * AiModel library. + * @member {string} library + * @memberof google.cloud.securitycenter.v2.AiModel + * @instance + */ + AiModel.prototype.library = ""; + + /** + * AiModel location. + * @member {string} location + * @memberof google.cloud.securitycenter.v2.AiModel + * @instance + */ + AiModel.prototype.location = ""; + + /** + * AiModel publisher. + * @member {string} publisher + * @memberof google.cloud.securitycenter.v2.AiModel + * @instance + */ + AiModel.prototype.publisher = ""; + + /** + * AiModel deploymentPlatform. + * @member {google.cloud.securitycenter.v2.AiModel.DeploymentPlatform} deploymentPlatform + * @memberof google.cloud.securitycenter.v2.AiModel + * @instance + */ + AiModel.prototype.deploymentPlatform = 0; + + /** + * AiModel displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.AiModel + * @instance + */ + AiModel.prototype.displayName = ""; + + /** + * Creates a new AiModel instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {google.cloud.securitycenter.v2.IAiModel=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AiModel} AiModel instance + */ + AiModel.create = function create(properties) { + return new AiModel(properties); + }; + + /** + * Encodes the specified AiModel message. Does not implicitly {@link google.cloud.securitycenter.v2.AiModel.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {google.cloud.securitycenter.v2.IAiModel} message AiModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AiModel.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.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domain); + if (message.library != null && Object.hasOwnProperty.call(message, "library")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.library); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + if (message.publisher != null && Object.hasOwnProperty.call(message, "publisher")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publisher); + if (message.deploymentPlatform != null && Object.hasOwnProperty.call(message, "deploymentPlatform")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.deploymentPlatform); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AiModel message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AiModel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {google.cloud.securitycenter.v2.IAiModel} message AiModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AiModel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AiModel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AiModel} AiModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AiModel.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AiModel(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.domain = reader.string(); + break; + } + case 3: { + message.library = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + case 5: { + message.publisher = reader.string(); + break; + } + case 6: { + message.deploymentPlatform = reader.int32(); + break; + } + case 7: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AiModel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AiModel} AiModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AiModel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AiModel message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AiModel.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.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.library != null && message.hasOwnProperty("library")) + if (!$util.isString(message.library)) + return "library: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.publisher != null && message.hasOwnProperty("publisher")) + if (!$util.isString(message.publisher)) + return "publisher: string expected"; + if (message.deploymentPlatform != null && message.hasOwnProperty("deploymentPlatform")) + switch (message.deploymentPlatform) { + default: + return "deploymentPlatform: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AiModel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AiModel} AiModel + */ + AiModel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AiModel) + return object; + var message = new $root.google.cloud.securitycenter.v2.AiModel(); + if (object.name != null) + message.name = String(object.name); + if (object.domain != null) + message.domain = String(object.domain); + if (object.library != null) + message.library = String(object.library); + if (object.location != null) + message.location = String(object.location); + if (object.publisher != null) + message.publisher = String(object.publisher); + switch (object.deploymentPlatform) { + default: + if (typeof object.deploymentPlatform === "number") { + message.deploymentPlatform = object.deploymentPlatform; + break; + } + break; + case "DEPLOYMENT_PLATFORM_UNSPECIFIED": + case 0: + message.deploymentPlatform = 0; + break; + case "VERTEX_AI": + case 1: + message.deploymentPlatform = 1; + break; + case "GKE": + case 2: + message.deploymentPlatform = 2; + break; + case "GCE": + case 3: + message.deploymentPlatform = 3; + break; + case "FINE_TUNED_MODEL": + case 4: + message.deploymentPlatform = 4; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AiModel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {google.cloud.securitycenter.v2.AiModel} message AiModel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AiModel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.domain = ""; + object.library = ""; + object.location = ""; + object.publisher = ""; + object.deploymentPlatform = options.enums === String ? "DEPLOYMENT_PLATFORM_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.library != null && message.hasOwnProperty("library")) + object.library = message.library; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.publisher != null && message.hasOwnProperty("publisher")) + object.publisher = message.publisher; + if (message.deploymentPlatform != null && message.hasOwnProperty("deploymentPlatform")) + object.deploymentPlatform = options.enums === String ? $root.google.cloud.securitycenter.v2.AiModel.DeploymentPlatform[message.deploymentPlatform] === undefined ? message.deploymentPlatform : $root.google.cloud.securitycenter.v2.AiModel.DeploymentPlatform[message.deploymentPlatform] : message.deploymentPlatform; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AiModel to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AiModel + * @instance + * @returns {Object.} JSON object + */ + AiModel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AiModel + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AiModel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AiModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AiModel"; + }; + + /** + * DeploymentPlatform enum. + * @name google.cloud.securitycenter.v2.AiModel.DeploymentPlatform + * @enum {number} + * @property {number} DEPLOYMENT_PLATFORM_UNSPECIFIED=0 DEPLOYMENT_PLATFORM_UNSPECIFIED value + * @property {number} VERTEX_AI=1 VERTEX_AI value + * @property {number} GKE=2 GKE value + * @property {number} GCE=3 GCE value + * @property {number} FINE_TUNED_MODEL=4 FINE_TUNED_MODEL value + */ + AiModel.DeploymentPlatform = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEPLOYMENT_PLATFORM_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERTEX_AI"] = 1; + values[valuesById[2] = "GKE"] = 2; + values[valuesById[3] = "GCE"] = 3; + values[valuesById[4] = "FINE_TUNED_MODEL"] = 4; + return values; + })(); + + return AiModel; + })(); + + v2.Application = (function() { + + /** + * Properties of an Application. + * @memberof google.cloud.securitycenter.v2 + * @interface IApplication + * @property {string|null} [baseUri] Application baseUri + * @property {string|null} [fullUri] Application fullUri + */ + + /** + * Constructs a new Application. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an Application. + * @implements IApplication + * @constructor + * @param {google.cloud.securitycenter.v2.IApplication=} [properties] Properties to set + */ + function Application(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Application baseUri. + * @member {string} baseUri + * @memberof google.cloud.securitycenter.v2.Application + * @instance + */ + Application.prototype.baseUri = ""; + + /** + * Application fullUri. + * @member {string} fullUri + * @memberof google.cloud.securitycenter.v2.Application + * @instance + */ + Application.prototype.fullUri = ""; + + /** + * Creates a new Application instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {google.cloud.securitycenter.v2.IApplication=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Application} Application instance + */ + Application.create = function create(properties) { + return new Application(properties); + }; + + /** + * Encodes the specified Application message. Does not implicitly {@link google.cloud.securitycenter.v2.Application.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {google.cloud.securitycenter.v2.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseUri != null && Object.hasOwnProperty.call(message, "baseUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseUri); + if (message.fullUri != null && Object.hasOwnProperty.call(message, "fullUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullUri); + return writer; + }; + + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Application.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {google.cloud.securitycenter.v2.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Application message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Application(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseUri = reader.string(); + break; + } + case 2: { + message.fullUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Application message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Application.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseUri != null && message.hasOwnProperty("baseUri")) + if (!$util.isString(message.baseUri)) + return "baseUri: string expected"; + if (message.fullUri != null && message.hasOwnProperty("fullUri")) + if (!$util.isString(message.fullUri)) + return "fullUri: string expected"; + return null; + }; + + /** + * Creates an Application message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Application} Application + */ + Application.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Application) + return object; + var message = new $root.google.cloud.securitycenter.v2.Application(); + if (object.baseUri != null) + message.baseUri = String(object.baseUri); + if (object.fullUri != null) + message.fullUri = String(object.fullUri); + return message; + }; + + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {google.cloud.securitycenter.v2.Application} message Application + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Application.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseUri = ""; + object.fullUri = ""; + } + if (message.baseUri != null && message.hasOwnProperty("baseUri")) + object.baseUri = message.baseUri; + if (message.fullUri != null && message.hasOwnProperty("fullUri")) + object.fullUri = message.fullUri; + return object; + }; + + /** + * Converts this Application to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Application + * @instance + * @returns {Object.} JSON object + */ + Application.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Application + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Application + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Application.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Application"; + }; + + return Application; + })(); + + v2.AttackExposure = (function() { + + /** + * Properties of an AttackExposure. + * @memberof google.cloud.securitycenter.v2 + * @interface IAttackExposure + * @property {number|null} [score] AttackExposure score + * @property {google.protobuf.ITimestamp|null} [latestCalculationTime] AttackExposure latestCalculationTime + * @property {string|null} [attackExposureResult] AttackExposure attackExposureResult + * @property {google.cloud.securitycenter.v2.AttackExposure.State|null} [state] AttackExposure state + * @property {number|null} [exposedHighValueResourcesCount] AttackExposure exposedHighValueResourcesCount + * @property {number|null} [exposedMediumValueResourcesCount] AttackExposure exposedMediumValueResourcesCount + * @property {number|null} [exposedLowValueResourcesCount] AttackExposure exposedLowValueResourcesCount + */ + + /** + * Constructs a new AttackExposure. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an AttackExposure. + * @implements IAttackExposure + * @constructor + * @param {google.cloud.securitycenter.v2.IAttackExposure=} [properties] Properties to set + */ + function AttackExposure(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackExposure score. + * @member {number} score + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @instance + */ + AttackExposure.prototype.score = 0; + + /** + * AttackExposure latestCalculationTime. + * @member {google.protobuf.ITimestamp|null|undefined} latestCalculationTime + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @instance + */ + AttackExposure.prototype.latestCalculationTime = null; + + /** + * AttackExposure attackExposureResult. + * @member {string} attackExposureResult + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @instance + */ + AttackExposure.prototype.attackExposureResult = ""; + + /** + * AttackExposure state. + * @member {google.cloud.securitycenter.v2.AttackExposure.State} state + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @instance + */ + AttackExposure.prototype.state = 0; + + /** + * AttackExposure exposedHighValueResourcesCount. + * @member {number} exposedHighValueResourcesCount + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @instance + */ + AttackExposure.prototype.exposedHighValueResourcesCount = 0; + + /** + * AttackExposure exposedMediumValueResourcesCount. + * @member {number} exposedMediumValueResourcesCount + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @instance + */ + AttackExposure.prototype.exposedMediumValueResourcesCount = 0; + + /** + * AttackExposure exposedLowValueResourcesCount. + * @member {number} exposedLowValueResourcesCount + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @instance + */ + AttackExposure.prototype.exposedLowValueResourcesCount = 0; + + /** + * Creates a new AttackExposure instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {google.cloud.securitycenter.v2.IAttackExposure=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AttackExposure} AttackExposure instance + */ + AttackExposure.create = function create(properties) { + return new AttackExposure(properties); + }; + + /** + * Encodes the specified AttackExposure message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackExposure.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {google.cloud.securitycenter.v2.IAttackExposure} message AttackExposure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackExposure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.score); + if (message.latestCalculationTime != null && Object.hasOwnProperty.call(message, "latestCalculationTime")) + $root.google.protobuf.Timestamp.encode(message.latestCalculationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attackExposureResult != null && Object.hasOwnProperty.call(message, "attackExposureResult")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.attackExposureResult); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.exposedHighValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedHighValueResourcesCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.exposedHighValueResourcesCount); + if (message.exposedMediumValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedMediumValueResourcesCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.exposedMediumValueResourcesCount); + if (message.exposedLowValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedLowValueResourcesCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.exposedLowValueResourcesCount); + return writer; + }; + + /** + * Encodes the specified AttackExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackExposure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {google.cloud.securitycenter.v2.IAttackExposure} message AttackExposure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackExposure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackExposure message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AttackExposure} AttackExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackExposure.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackExposure(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.double(); + break; + } + case 2: { + message.latestCalculationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.attackExposureResult = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.exposedHighValueResourcesCount = reader.int32(); + break; + } + case 6: { + message.exposedMediumValueResourcesCount = reader.int32(); + break; + } + case 7: { + message.exposedLowValueResourcesCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackExposure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AttackExposure} AttackExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackExposure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackExposure message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackExposure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.latestCalculationTime != null && message.hasOwnProperty("latestCalculationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.latestCalculationTime); + if (error) + return "latestCalculationTime." + error; + } + if (message.attackExposureResult != null && message.hasOwnProperty("attackExposureResult")) + if (!$util.isString(message.attackExposureResult)) + return "attackExposureResult: 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.exposedHighValueResourcesCount != null && message.hasOwnProperty("exposedHighValueResourcesCount")) + if (!$util.isInteger(message.exposedHighValueResourcesCount)) + return "exposedHighValueResourcesCount: integer expected"; + if (message.exposedMediumValueResourcesCount != null && message.hasOwnProperty("exposedMediumValueResourcesCount")) + if (!$util.isInteger(message.exposedMediumValueResourcesCount)) + return "exposedMediumValueResourcesCount: integer expected"; + if (message.exposedLowValueResourcesCount != null && message.hasOwnProperty("exposedLowValueResourcesCount")) + if (!$util.isInteger(message.exposedLowValueResourcesCount)) + return "exposedLowValueResourcesCount: integer expected"; + return null; + }; + + /** + * Creates an AttackExposure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AttackExposure} AttackExposure + */ + AttackExposure.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AttackExposure) + return object; + var message = new $root.google.cloud.securitycenter.v2.AttackExposure(); + if (object.score != null) + message.score = Number(object.score); + if (object.latestCalculationTime != null) { + if (typeof object.latestCalculationTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AttackExposure.latestCalculationTime: object expected"); + message.latestCalculationTime = $root.google.protobuf.Timestamp.fromObject(object.latestCalculationTime); + } + if (object.attackExposureResult != null) + message.attackExposureResult = String(object.attackExposureResult); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CALCULATED": + case 1: + message.state = 1; + break; + case "NOT_CALCULATED": + case 2: + message.state = 2; + break; + } + if (object.exposedHighValueResourcesCount != null) + message.exposedHighValueResourcesCount = object.exposedHighValueResourcesCount | 0; + if (object.exposedMediumValueResourcesCount != null) + message.exposedMediumValueResourcesCount = object.exposedMediumValueResourcesCount | 0; + if (object.exposedLowValueResourcesCount != null) + message.exposedLowValueResourcesCount = object.exposedLowValueResourcesCount | 0; + return message; + }; + + /** + * Creates a plain object from an AttackExposure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {google.cloud.securitycenter.v2.AttackExposure} message AttackExposure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackExposure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.score = 0; + object.latestCalculationTime = null; + object.attackExposureResult = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.exposedHighValueResourcesCount = 0; + object.exposedMediumValueResourcesCount = 0; + object.exposedLowValueResourcesCount = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.latestCalculationTime != null && message.hasOwnProperty("latestCalculationTime")) + object.latestCalculationTime = $root.google.protobuf.Timestamp.toObject(message.latestCalculationTime, options); + if (message.attackExposureResult != null && message.hasOwnProperty("attackExposureResult")) + object.attackExposureResult = message.attackExposureResult; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v2.AttackExposure.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.AttackExposure.State[message.state] : message.state; + if (message.exposedHighValueResourcesCount != null && message.hasOwnProperty("exposedHighValueResourcesCount")) + object.exposedHighValueResourcesCount = message.exposedHighValueResourcesCount; + if (message.exposedMediumValueResourcesCount != null && message.hasOwnProperty("exposedMediumValueResourcesCount")) + object.exposedMediumValueResourcesCount = message.exposedMediumValueResourcesCount; + if (message.exposedLowValueResourcesCount != null && message.hasOwnProperty("exposedLowValueResourcesCount")) + object.exposedLowValueResourcesCount = message.exposedLowValueResourcesCount; + return object; + }; + + /** + * Converts this AttackExposure to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @instance + * @returns {Object.} JSON object + */ + AttackExposure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackExposure + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AttackExposure + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackExposure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackExposure"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v2.AttackExposure.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CALCULATED=1 CALCULATED value + * @property {number} NOT_CALCULATED=2 NOT_CALCULATED value + */ + AttackExposure.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CALCULATED"] = 1; + values[valuesById[2] = "NOT_CALCULATED"] = 2; + return values; + })(); + + return AttackExposure; + })(); + + v2.AttackPath = (function() { + + /** + * Properties of an AttackPath. + * @memberof google.cloud.securitycenter.v2 + * @interface IAttackPath + * @property {string|null} [name] AttackPath name + * @property {Array.|null} [pathNodes] AttackPath pathNodes + * @property {Array.|null} [edges] AttackPath edges + */ + + /** + * Constructs a new AttackPath. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an AttackPath. + * @implements IAttackPath + * @constructor + * @param {google.cloud.securitycenter.v2.IAttackPath=} [properties] Properties to set + */ + function AttackPath(properties) { + this.pathNodes = []; + this.edges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackPath name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.AttackPath + * @instance + */ + AttackPath.prototype.name = ""; + + /** + * AttackPath pathNodes. + * @member {Array.} pathNodes + * @memberof google.cloud.securitycenter.v2.AttackPath + * @instance + */ + AttackPath.prototype.pathNodes = $util.emptyArray; + + /** + * AttackPath edges. + * @member {Array.} edges + * @memberof google.cloud.securitycenter.v2.AttackPath + * @instance + */ + AttackPath.prototype.edges = $util.emptyArray; + + /** + * Creates a new AttackPath instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {google.cloud.securitycenter.v2.IAttackPath=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AttackPath} AttackPath instance + */ + AttackPath.create = function create(properties) { + return new AttackPath(properties); + }; + + /** + * Encodes the specified AttackPath message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {google.cloud.securitycenter.v2.IAttackPath} message AttackPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPath.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.pathNodes != null && message.pathNodes.length) + for (var i = 0; i < message.pathNodes.length; ++i) + $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.encode(message.pathNodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edges != null && message.edges.length) + for (var i = 0; i < message.edges.length; ++i) + $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.encode(message.edges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttackPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {google.cloud.securitycenter.v2.IAttackPath} message AttackPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackPath message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AttackPath} AttackPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPath.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.pathNodes && message.pathNodes.length)) + message.pathNodes = []; + message.pathNodes.push($root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.edges && message.edges.length)) + message.edges = []; + message.edges.push($root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackPath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AttackPath} AttackPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackPath message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackPath.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.pathNodes != null && message.hasOwnProperty("pathNodes")) { + if (!Array.isArray(message.pathNodes)) + return "pathNodes: array expected"; + for (var i = 0; i < message.pathNodes.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify(message.pathNodes[i]); + if (error) + return "pathNodes." + error; + } + } + if (message.edges != null && message.hasOwnProperty("edges")) { + if (!Array.isArray(message.edges)) + return "edges: array expected"; + for (var i = 0; i < message.edges.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify(message.edges[i]); + if (error) + return "edges." + error; + } + } + return null; + }; + + /** + * Creates an AttackPath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AttackPath} AttackPath + */ + AttackPath.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath) + return object; + var message = new $root.google.cloud.securitycenter.v2.AttackPath(); + if (object.name != null) + message.name = String(object.name); + if (object.pathNodes) { + if (!Array.isArray(object.pathNodes)) + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.pathNodes: array expected"); + message.pathNodes = []; + for (var i = 0; i < object.pathNodes.length; ++i) { + if (typeof object.pathNodes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.pathNodes: object expected"); + message.pathNodes[i] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.fromObject(object.pathNodes[i]); + } + } + if (object.edges) { + if (!Array.isArray(object.edges)) + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.edges: array expected"); + message.edges = []; + for (var i = 0; i < object.edges.length; ++i) { + if (typeof object.edges[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.edges: object expected"); + message.edges[i] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.fromObject(object.edges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AttackPath message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {google.cloud.securitycenter.v2.AttackPath} message AttackPath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackPath.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pathNodes = []; + object.edges = []; + } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pathNodes && message.pathNodes.length) { + object.pathNodes = []; + for (var j = 0; j < message.pathNodes.length; ++j) + object.pathNodes[j] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.toObject(message.pathNodes[j], options); + } + if (message.edges && message.edges.length) { + object.edges = []; + for (var j = 0; j < message.edges.length; ++j) + object.edges[j] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.toObject(message.edges[j], options); + } + return object; + }; + + /** + * Converts this AttackPath to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AttackPath + * @instance + * @returns {Object.} JSON object + */ + AttackPath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackPath + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AttackPath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath"; + }; + + AttackPath.AttackPathNode = (function() { + + /** + * Properties of an AttackPathNode. + * @memberof google.cloud.securitycenter.v2.AttackPath + * @interface IAttackPathNode + * @property {string|null} [resource] AttackPathNode resource + * @property {string|null} [resourceType] AttackPathNode resourceType + * @property {string|null} [displayName] AttackPathNode displayName + * @property {Array.|null} [associatedFindings] AttackPathNode associatedFindings + * @property {string|null} [uuid] AttackPathNode uuid + * @property {Array.|null} [attackSteps] AttackPathNode attackSteps + */ + + /** + * Constructs a new AttackPathNode. + * @memberof google.cloud.securitycenter.v2.AttackPath + * @classdesc Represents an AttackPathNode. + * @implements IAttackPathNode + * @constructor + * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathNode=} [properties] Properties to set + */ + function AttackPathNode(properties) { + this.associatedFindings = []; + this.attackSteps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackPathNode resource. + * @member {string} resource + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.resource = ""; + + /** + * AttackPathNode resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.resourceType = ""; + + /** + * AttackPathNode displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.displayName = ""; + + /** + * AttackPathNode associatedFindings. + * @member {Array.} associatedFindings + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.associatedFindings = $util.emptyArray; + + /** + * AttackPathNode uuid. + * @member {string} uuid + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.uuid = ""; + + /** + * AttackPathNode attackSteps. + * @member {Array.} attackSteps + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @instance + */ + AttackPathNode.prototype.attackSteps = $util.emptyArray; + + /** + * Creates a new AttackPathNode instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathNode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} AttackPathNode instance + */ + AttackPathNode.create = function create(properties) { + return new AttackPathNode(properties); + }; + + /** + * Encodes the specified AttackPathNode message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathNode} message AttackPathNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPathNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.associatedFindings != null && message.associatedFindings.length) + for (var i = 0; i < message.associatedFindings.length; ++i) + $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.encode(message.associatedFindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.uuid); + if (message.attackSteps != null && message.attackSteps.length) + for (var i = 0; i < message.attackSteps.length; ++i) + $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.encode(message.attackSteps[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttackPathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathNode} message AttackPathNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPathNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackPathNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} AttackPathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPathNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + if (!(message.associatedFindings && message.associatedFindings.length)) + message.associatedFindings = []; + message.associatedFindings.push($root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.decode(reader, reader.uint32())); + break; + } + case 5: { + message.uuid = reader.string(); + break; + } + case 6: { + if (!(message.attackSteps && message.attackSteps.length)) + message.attackSteps = []; + message.attackSteps.push($root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackPathNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} AttackPathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPathNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackPathNode message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackPathNode.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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.associatedFindings != null && message.hasOwnProperty("associatedFindings")) { + if (!Array.isArray(message.associatedFindings)) + return "associatedFindings: array expected"; + for (var i = 0; i < message.associatedFindings.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify(message.associatedFindings[i]); + if (error) + return "associatedFindings." + error; + } + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + if (message.attackSteps != null && message.hasOwnProperty("attackSteps")) { + if (!Array.isArray(message.attackSteps)) + return "attackSteps: array expected"; + for (var i = 0; i < message.attackSteps.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify(message.attackSteps[i]); + if (error) + return "attackSteps." + error; + } + } + return null; + }; + + /** + * Creates an AttackPathNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} AttackPathNode + */ + AttackPathNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode) + return object; + var message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.associatedFindings) { + if (!Array.isArray(object.associatedFindings)) + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.associatedFindings: array expected"); + message.associatedFindings = []; + for (var i = 0; i < object.associatedFindings.length; ++i) { + if (typeof object.associatedFindings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.associatedFindings: object expected"); + message.associatedFindings[i] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.fromObject(object.associatedFindings[i]); + } + } + if (object.uuid != null) + message.uuid = String(object.uuid); + if (object.attackSteps) { + if (!Array.isArray(object.attackSteps)) + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.attackSteps: array expected"); + message.attackSteps = []; + for (var i = 0; i < object.attackSteps.length; ++i) { + if (typeof object.attackSteps[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.attackSteps: object expected"); + message.attackSteps[i] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.fromObject(object.attackSteps[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AttackPathNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} message AttackPathNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackPathNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.associatedFindings = []; + object.attackSteps = []; + } + if (options.defaults) { + object.resource = ""; + object.resourceType = ""; + object.displayName = ""; + object.uuid = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.associatedFindings && message.associatedFindings.length) { + object.associatedFindings = []; + for (var j = 0; j < message.associatedFindings.length; ++j) + object.associatedFindings[j] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.toObject(message.associatedFindings[j], options); + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.attackSteps && message.attackSteps.length) { + object.attackSteps = []; + for (var j = 0; j < message.attackSteps.length; ++j) + object.attackSteps[j] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.toObject(message.attackSteps[j], options); + } + return object; + }; + + /** + * Converts this AttackPathNode to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @instance + * @returns {Object.} JSON object + */ + AttackPathNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackPathNode + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackPathNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath.AttackPathNode"; + }; + + AttackPathNode.PathNodeAssociatedFinding = (function() { + + /** + * Properties of a PathNodeAssociatedFinding. + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @interface IPathNodeAssociatedFinding + * @property {string|null} [canonicalFinding] PathNodeAssociatedFinding canonicalFinding + * @property {string|null} [findingCategory] PathNodeAssociatedFinding findingCategory + * @property {string|null} [name] PathNodeAssociatedFinding name + */ + + /** + * Constructs a new PathNodeAssociatedFinding. + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @classdesc Represents a PathNodeAssociatedFinding. + * @implements IPathNodeAssociatedFinding + * @constructor + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding=} [properties] Properties to set + */ + function PathNodeAssociatedFinding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PathNodeAssociatedFinding canonicalFinding. + * @member {string} canonicalFinding + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @instance + */ + PathNodeAssociatedFinding.prototype.canonicalFinding = ""; + + /** + * PathNodeAssociatedFinding findingCategory. + * @member {string} findingCategory + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @instance + */ + PathNodeAssociatedFinding.prototype.findingCategory = ""; + + /** + * PathNodeAssociatedFinding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @instance + */ + PathNodeAssociatedFinding.prototype.name = ""; + + /** + * Creates a new PathNodeAssociatedFinding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding instance + */ + PathNodeAssociatedFinding.create = function create(properties) { + return new PathNodeAssociatedFinding(properties); + }; + + /** + * Encodes the specified PathNodeAssociatedFinding message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding} message PathNodeAssociatedFinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathNodeAssociatedFinding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.canonicalFinding != null && Object.hasOwnProperty.call(message, "canonicalFinding")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.canonicalFinding); + if (message.findingCategory != null && Object.hasOwnProperty.call(message, "findingCategory")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingCategory); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified PathNodeAssociatedFinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding} message PathNodeAssociatedFinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathNodeAssociatedFinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathNodeAssociatedFinding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.canonicalFinding = reader.string(); + break; + } + case 2: { + message.findingCategory = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathNodeAssociatedFinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PathNodeAssociatedFinding message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PathNodeAssociatedFinding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.canonicalFinding != null && message.hasOwnProperty("canonicalFinding")) + if (!$util.isString(message.canonicalFinding)) + return "canonicalFinding: string expected"; + if (message.findingCategory != null && message.hasOwnProperty("findingCategory")) + if (!$util.isString(message.findingCategory)) + return "findingCategory: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a PathNodeAssociatedFinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding + */ + PathNodeAssociatedFinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding) + return object; + var message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding(); + if (object.canonicalFinding != null) + message.canonicalFinding = String(object.canonicalFinding); + if (object.findingCategory != null) + message.findingCategory = String(object.findingCategory); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PathNodeAssociatedFinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} message PathNodeAssociatedFinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PathNodeAssociatedFinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.canonicalFinding = ""; + object.findingCategory = ""; + object.name = ""; + } + if (message.canonicalFinding != null && message.hasOwnProperty("canonicalFinding")) + object.canonicalFinding = message.canonicalFinding; + if (message.findingCategory != null && message.hasOwnProperty("findingCategory")) + object.findingCategory = message.findingCategory; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this PathNodeAssociatedFinding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @instance + * @returns {Object.} JSON object + */ + PathNodeAssociatedFinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PathNodeAssociatedFinding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PathNodeAssociatedFinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding"; + }; + + return PathNodeAssociatedFinding; + })(); + + /** + * NodeType enum. + * @name google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType + * @enum {number} + * @property {number} NODE_TYPE_UNSPECIFIED=0 NODE_TYPE_UNSPECIFIED value + * @property {number} NODE_TYPE_AND=1 NODE_TYPE_AND value + * @property {number} NODE_TYPE_OR=2 NODE_TYPE_OR value + * @property {number} NODE_TYPE_DEFENSE=3 NODE_TYPE_DEFENSE value + * @property {number} NODE_TYPE_ATTACKER=4 NODE_TYPE_ATTACKER value + */ + AttackPathNode.NodeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NODE_TYPE_AND"] = 1; + values[valuesById[2] = "NODE_TYPE_OR"] = 2; + values[valuesById[3] = "NODE_TYPE_DEFENSE"] = 3; + values[valuesById[4] = "NODE_TYPE_ATTACKER"] = 4; + return values; + })(); + + AttackPathNode.AttackStepNode = (function() { + + /** + * Properties of an AttackStepNode. + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @interface IAttackStepNode + * @property {string|null} [uuid] AttackStepNode uuid + * @property {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType|null} [type] AttackStepNode type + * @property {string|null} [displayName] AttackStepNode displayName + * @property {Object.|null} [labels] AttackStepNode labels + * @property {string|null} [description] AttackStepNode description + */ + + /** + * Constructs a new AttackStepNode. + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode + * @classdesc Represents an AttackStepNode. + * @implements IAttackStepNode + * @constructor + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode=} [properties] Properties to set + */ + function AttackStepNode(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackStepNode uuid. + * @member {string} uuid + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.uuid = ""; + + /** + * AttackStepNode type. + * @member {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType} type + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.type = 0; + + /** + * AttackStepNode displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.displayName = ""; + + /** + * AttackStepNode labels. + * @member {Object.} labels + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.labels = $util.emptyObject; + + /** + * AttackStepNode description. + * @member {string} description + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @instance + */ + AttackStepNode.prototype.description = ""; + + /** + * Creates a new AttackStepNode instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode instance + */ + AttackStepNode.create = function create(properties) { + return new AttackStepNode(properties); + }; + + /** + * Encodes the specified AttackStepNode message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode} message AttackStepNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackStepNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uuid); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + return writer; + }; + + /** + * Encodes the specified AttackStepNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode} message AttackStepNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackStepNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackStepNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackStepNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uuid = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackStepNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackStepNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackStepNode message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackStepNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AttackStepNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode + */ + AttackStepNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode) + return object; + var message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode(); + if (object.uuid != null) + message.uuid = String(object.uuid); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "NODE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "NODE_TYPE_AND": + case 1: + message.type = 1; + break; + case "NODE_TYPE_OR": + case 2: + message.type = 2; + break; + case "NODE_TYPE_DEFENSE": + case 3: + message.type = 3; + break; + case "NODE_TYPE_ATTACKER": + case 4: + message.type = 4; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AttackStepNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} message AttackStepNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackStepNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.uuid = ""; + object.type = options.enums === String ? "NODE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.description = ""; + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType[message.type] : message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AttackStepNode to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @instance + * @returns {Object.} JSON object + */ + AttackStepNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackStepNode + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackStepNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode"; + }; + + return AttackStepNode; + })(); + + return AttackPathNode; + })(); + + AttackPath.AttackPathEdge = (function() { + + /** + * Properties of an AttackPathEdge. + * @memberof google.cloud.securitycenter.v2.AttackPath + * @interface IAttackPathEdge + * @property {string|null} [source] AttackPathEdge source + * @property {string|null} [destination] AttackPathEdge destination + */ + + /** + * Constructs a new AttackPathEdge. + * @memberof google.cloud.securitycenter.v2.AttackPath + * @classdesc Represents an AttackPathEdge. + * @implements IAttackPathEdge + * @constructor + * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge=} [properties] Properties to set + */ + function AttackPathEdge(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttackPathEdge source. + * @member {string} source + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @instance + */ + AttackPathEdge.prototype.source = ""; + + /** + * AttackPathEdge destination. + * @member {string} destination + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @instance + */ + AttackPathEdge.prototype.destination = ""; + + /** + * Creates a new AttackPathEdge instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} AttackPathEdge instance + */ + AttackPathEdge.create = function create(properties) { + return new AttackPathEdge(properties); + }; + + /** + * Encodes the specified AttackPathEdge message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge} message AttackPathEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPathEdge.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.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destination); + return writer; + }; + + /** + * Encodes the specified AttackPathEdge message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge} message AttackPathEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttackPathEdge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttackPathEdge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} AttackPathEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPathEdge.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.source = reader.string(); + break; + } + case 2: { + message.destination = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttackPathEdge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} AttackPathEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttackPathEdge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttackPathEdge message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttackPathEdge.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.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + return null; + }; + + /** + * Creates an AttackPathEdge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} AttackPathEdge + */ + AttackPathEdge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge) + return object; + var message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge(); + if (object.source != null) + message.source = String(object.source); + if (object.destination != null) + message.destination = String(object.destination); + return message; + }; + + /** + * Creates a plain object from an AttackPathEdge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} message AttackPathEdge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttackPathEdge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = ""; + object.destination = ""; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + return object; + }; + + /** + * Converts this AttackPathEdge to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @instance + * @returns {Object.} JSON object + */ + AttackPathEdge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttackPathEdge + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttackPathEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath.AttackPathEdge"; + }; + + return AttackPathEdge; + })(); + + return AttackPath; + })(); + + v2.BackupDisasterRecovery = (function() { + + /** + * Properties of a BackupDisasterRecovery. + * @memberof google.cloud.securitycenter.v2 + * @interface IBackupDisasterRecovery + * @property {string|null} [backupTemplate] BackupDisasterRecovery backupTemplate + * @property {Array.|null} [policies] BackupDisasterRecovery policies + * @property {string|null} [host] BackupDisasterRecovery host + * @property {Array.|null} [applications] BackupDisasterRecovery applications + * @property {string|null} [storagePool] BackupDisasterRecovery storagePool + * @property {Array.|null} [policyOptions] BackupDisasterRecovery policyOptions + * @property {string|null} [profile] BackupDisasterRecovery profile + * @property {string|null} [appliance] BackupDisasterRecovery appliance + * @property {string|null} [backupType] BackupDisasterRecovery backupType + * @property {google.protobuf.ITimestamp|null} [backupCreateTime] BackupDisasterRecovery backupCreateTime + */ + + /** + * Constructs a new BackupDisasterRecovery. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a BackupDisasterRecovery. + * @implements IBackupDisasterRecovery + * @constructor + * @param {google.cloud.securitycenter.v2.IBackupDisasterRecovery=} [properties] Properties to set + */ + function BackupDisasterRecovery(properties) { + this.policies = []; + this.applications = []; + this.policyOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupDisasterRecovery backupTemplate. + * @member {string} backupTemplate + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.backupTemplate = ""; + + /** + * BackupDisasterRecovery policies. + * @member {Array.} policies + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.policies = $util.emptyArray; + + /** + * BackupDisasterRecovery host. + * @member {string} host + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.host = ""; + + /** + * BackupDisasterRecovery applications. + * @member {Array.} applications + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.applications = $util.emptyArray; + + /** + * BackupDisasterRecovery storagePool. + * @member {string} storagePool + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.storagePool = ""; + + /** + * BackupDisasterRecovery policyOptions. + * @member {Array.} policyOptions + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.policyOptions = $util.emptyArray; + + /** + * BackupDisasterRecovery profile. + * @member {string} profile + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.profile = ""; + + /** + * BackupDisasterRecovery appliance. + * @member {string} appliance + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.appliance = ""; + + /** + * BackupDisasterRecovery backupType. + * @member {string} backupType + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.backupType = ""; + + /** + * BackupDisasterRecovery backupCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} backupCreateTime + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + */ + BackupDisasterRecovery.prototype.backupCreateTime = null; + + /** + * Creates a new BackupDisasterRecovery instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {google.cloud.securitycenter.v2.IBackupDisasterRecovery=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.BackupDisasterRecovery} BackupDisasterRecovery instance + */ + BackupDisasterRecovery.create = function create(properties) { + return new BackupDisasterRecovery(properties); + }; + + /** + * Encodes the specified BackupDisasterRecovery message. Does not implicitly {@link google.cloud.securitycenter.v2.BackupDisasterRecovery.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {google.cloud.securitycenter.v2.IBackupDisasterRecovery} message BackupDisasterRecovery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDisasterRecovery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupTemplate != null && Object.hasOwnProperty.call(message, "backupTemplate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupTemplate); + if (message.policies != null && message.policies.length) + for (var i = 0; i < message.policies.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.policies[i]); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.host); + if (message.applications != null && message.applications.length) + for (var i = 0; i < message.applications.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.applications[i]); + if (message.storagePool != null && Object.hasOwnProperty.call(message, "storagePool")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.storagePool); + if (message.policyOptions != null && message.policyOptions.length) + for (var i = 0; i < message.policyOptions.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.policyOptions[i]); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.profile); + if (message.appliance != null && Object.hasOwnProperty.call(message, "appliance")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.appliance); + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.backupType); + if (message.backupCreateTime != null && Object.hasOwnProperty.call(message, "backupCreateTime")) + $root.google.protobuf.Timestamp.encode(message.backupCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupDisasterRecovery message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BackupDisasterRecovery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {google.cloud.securitycenter.v2.IBackupDisasterRecovery} message BackupDisasterRecovery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDisasterRecovery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupDisasterRecovery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.BackupDisasterRecovery} BackupDisasterRecovery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDisasterRecovery.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BackupDisasterRecovery(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupTemplate = reader.string(); + break; + } + case 2: { + if (!(message.policies && message.policies.length)) + message.policies = []; + message.policies.push(reader.string()); + break; + } + case 3: { + message.host = reader.string(); + break; + } + case 4: { + if (!(message.applications && message.applications.length)) + message.applications = []; + message.applications.push(reader.string()); + break; + } + case 5: { + message.storagePool = reader.string(); + break; + } + case 6: { + if (!(message.policyOptions && message.policyOptions.length)) + message.policyOptions = []; + message.policyOptions.push(reader.string()); + break; + } + case 7: { + message.profile = reader.string(); + break; + } + case 8: { + message.appliance = reader.string(); + break; + } + case 9: { + message.backupType = reader.string(); + break; + } + case 10: { + message.backupCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupDisasterRecovery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.BackupDisasterRecovery} BackupDisasterRecovery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDisasterRecovery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupDisasterRecovery message. + * @function verify + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupDisasterRecovery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupTemplate != null && message.hasOwnProperty("backupTemplate")) + if (!$util.isString(message.backupTemplate)) + return "backupTemplate: string expected"; + if (message.policies != null && message.hasOwnProperty("policies")) { + if (!Array.isArray(message.policies)) + return "policies: array expected"; + for (var i = 0; i < message.policies.length; ++i) + if (!$util.isString(message.policies[i])) + return "policies: string[] expected"; + } + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.applications != null && message.hasOwnProperty("applications")) { + if (!Array.isArray(message.applications)) + return "applications: array expected"; + for (var i = 0; i < message.applications.length; ++i) + if (!$util.isString(message.applications[i])) + return "applications: string[] expected"; + } + if (message.storagePool != null && message.hasOwnProperty("storagePool")) + if (!$util.isString(message.storagePool)) + return "storagePool: string expected"; + if (message.policyOptions != null && message.hasOwnProperty("policyOptions")) { + if (!Array.isArray(message.policyOptions)) + return "policyOptions: array expected"; + for (var i = 0; i < message.policyOptions.length; ++i) + if (!$util.isString(message.policyOptions[i])) + return "policyOptions: string[] expected"; + } + if (message.profile != null && message.hasOwnProperty("profile")) + if (!$util.isString(message.profile)) + return "profile: string expected"; + if (message.appliance != null && message.hasOwnProperty("appliance")) + if (!$util.isString(message.appliance)) + return "appliance: string expected"; + if (message.backupType != null && message.hasOwnProperty("backupType")) + if (!$util.isString(message.backupType)) + return "backupType: string expected"; + if (message.backupCreateTime != null && message.hasOwnProperty("backupCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.backupCreateTime); + if (error) + return "backupCreateTime." + error; + } + return null; + }; + + /** + * Creates a BackupDisasterRecovery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.BackupDisasterRecovery} BackupDisasterRecovery + */ + BackupDisasterRecovery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.BackupDisasterRecovery) + return object; + var message = new $root.google.cloud.securitycenter.v2.BackupDisasterRecovery(); + if (object.backupTemplate != null) + message.backupTemplate = String(object.backupTemplate); + if (object.policies) { + if (!Array.isArray(object.policies)) + throw TypeError(".google.cloud.securitycenter.v2.BackupDisasterRecovery.policies: array expected"); + message.policies = []; + for (var i = 0; i < object.policies.length; ++i) + message.policies[i] = String(object.policies[i]); + } + if (object.host != null) + message.host = String(object.host); + if (object.applications) { + if (!Array.isArray(object.applications)) + throw TypeError(".google.cloud.securitycenter.v2.BackupDisasterRecovery.applications: array expected"); + message.applications = []; + for (var i = 0; i < object.applications.length; ++i) + message.applications[i] = String(object.applications[i]); + } + if (object.storagePool != null) + message.storagePool = String(object.storagePool); + if (object.policyOptions) { + if (!Array.isArray(object.policyOptions)) + throw TypeError(".google.cloud.securitycenter.v2.BackupDisasterRecovery.policyOptions: array expected"); + message.policyOptions = []; + for (var i = 0; i < object.policyOptions.length; ++i) + message.policyOptions[i] = String(object.policyOptions[i]); + } + if (object.profile != null) + message.profile = String(object.profile); + if (object.appliance != null) + message.appliance = String(object.appliance); + if (object.backupType != null) + message.backupType = String(object.backupType); + if (object.backupCreateTime != null) { + if (typeof object.backupCreateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.BackupDisasterRecovery.backupCreateTime: object expected"); + message.backupCreateTime = $root.google.protobuf.Timestamp.fromObject(object.backupCreateTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupDisasterRecovery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {google.cloud.securitycenter.v2.BackupDisasterRecovery} message BackupDisasterRecovery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupDisasterRecovery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policies = []; + object.applications = []; + object.policyOptions = []; + } + if (options.defaults) { + object.backupTemplate = ""; + object.host = ""; + object.storagePool = ""; + object.profile = ""; + object.appliance = ""; + object.backupType = ""; + object.backupCreateTime = null; + } + if (message.backupTemplate != null && message.hasOwnProperty("backupTemplate")) + object.backupTemplate = message.backupTemplate; + if (message.policies && message.policies.length) { + object.policies = []; + for (var j = 0; j < message.policies.length; ++j) + object.policies[j] = message.policies[j]; + } + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.applications && message.applications.length) { + object.applications = []; + for (var j = 0; j < message.applications.length; ++j) + object.applications[j] = message.applications[j]; + } + if (message.storagePool != null && message.hasOwnProperty("storagePool")) + object.storagePool = message.storagePool; + if (message.policyOptions && message.policyOptions.length) { + object.policyOptions = []; + for (var j = 0; j < message.policyOptions.length; ++j) + object.policyOptions[j] = message.policyOptions[j]; + } + if (message.profile != null && message.hasOwnProperty("profile")) + object.profile = message.profile; + if (message.appliance != null && message.hasOwnProperty("appliance")) + object.appliance = message.appliance; + if (message.backupType != null && message.hasOwnProperty("backupType")) + object.backupType = message.backupType; + if (message.backupCreateTime != null && message.hasOwnProperty("backupCreateTime")) + object.backupCreateTime = $root.google.protobuf.Timestamp.toObject(message.backupCreateTime, options); + return object; + }; + + /** + * Converts this BackupDisasterRecovery to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @instance + * @returns {Object.} JSON object + */ + BackupDisasterRecovery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupDisasterRecovery + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupDisasterRecovery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.BackupDisasterRecovery"; + }; + + return BackupDisasterRecovery; + })(); + + v2.BigQueryExport = (function() { + + /** + * Properties of a BigQueryExport. + * @memberof google.cloud.securitycenter.v2 + * @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.v2 + * @classdesc Represents a BigQueryExport. + * @implements IBigQueryExport + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.BigQueryExport + * @instance + */ + BigQueryExport.prototype.name = ""; + + /** + * BigQueryExport description. + * @member {string} description + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @instance + */ + BigQueryExport.prototype.description = ""; + + /** + * BigQueryExport filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @instance + */ + BigQueryExport.prototype.filter = ""; + + /** + * BigQueryExport dataset. + * @member {string} dataset + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @instance + */ + BigQueryExport.prototype.dataset = ""; + + /** + * BigQueryExport createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @instance + */ + BigQueryExport.prototype.createTime = null; + + /** + * BigQueryExport updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @instance + */ + BigQueryExport.prototype.updateTime = null; + + /** + * BigQueryExport mostRecentEditor. + * @member {string} mostRecentEditor + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @instance + */ + BigQueryExport.prototype.mostRecentEditor = ""; + + /** + * BigQueryExport principal. + * @member {string} principal + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @instance + */ + BigQueryExport.prototype.principal = ""; + + /** + * Creates a new BigQueryExport instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v2.IBigQueryExport=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.BigQueryExport} BigQueryExport instance + */ + BigQueryExport.create = function create(properties) { + return new BigQueryExport(properties); + }; + + /** + * Encodes the specified BigQueryExport message. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryExport.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v2.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.v2.BigQueryExport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BigQueryExport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.BigQueryExport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.BigQueryExport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.BigQueryExport} BigQueryExport + */ + BigQueryExport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.BigQueryExport) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v2.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.v2.BigQueryExport + * @instance + * @returns {Object.} JSON object + */ + BigQueryExport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryExport + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.BigQueryExport"; + }; + + return BigQueryExport; + })(); + + v2.Chokepoint = (function() { + + /** + * Properties of a Chokepoint. + * @memberof google.cloud.securitycenter.v2 + * @interface IChokepoint + * @property {Array.|null} [relatedFindings] Chokepoint relatedFindings + */ + + /** + * Constructs a new Chokepoint. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Chokepoint. + * @implements IChokepoint + * @constructor + * @param {google.cloud.securitycenter.v2.IChokepoint=} [properties] Properties to set + */ + function Chokepoint(properties) { + this.relatedFindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chokepoint relatedFindings. + * @member {Array.} relatedFindings + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @instance + */ + Chokepoint.prototype.relatedFindings = $util.emptyArray; + + /** + * Creates a new Chokepoint instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {google.cloud.securitycenter.v2.IChokepoint=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Chokepoint} Chokepoint instance + */ + Chokepoint.create = function create(properties) { + return new Chokepoint(properties); + }; + + /** + * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v2.Chokepoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {google.cloud.securitycenter.v2.IChokepoint} message Chokepoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chokepoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relatedFindings != null && message.relatedFindings.length) + for (var i = 0; i < message.relatedFindings.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.relatedFindings[i]); + return writer; + }; + + /** + * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Chokepoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {google.cloud.securitycenter.v2.IChokepoint} message Chokepoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chokepoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chokepoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Chokepoint} Chokepoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chokepoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Chokepoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.relatedFindings && message.relatedFindings.length)) + message.relatedFindings = []; + message.relatedFindings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chokepoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Chokepoint} Chokepoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chokepoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chokepoint message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chokepoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { + if (!Array.isArray(message.relatedFindings)) + return "relatedFindings: array expected"; + for (var i = 0; i < message.relatedFindings.length; ++i) + if (!$util.isString(message.relatedFindings[i])) + return "relatedFindings: string[] expected"; + } + return null; + }; + + /** + * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Chokepoint} Chokepoint + */ + Chokepoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Chokepoint) + return object; + var message = new $root.google.cloud.securitycenter.v2.Chokepoint(); + if (object.relatedFindings) { + if (!Array.isArray(object.relatedFindings)) + throw TypeError(".google.cloud.securitycenter.v2.Chokepoint.relatedFindings: array expected"); + message.relatedFindings = []; + for (var i = 0; i < object.relatedFindings.length; ++i) + message.relatedFindings[i] = String(object.relatedFindings[i]); + } + return message; + }; + + /** + * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {google.cloud.securitycenter.v2.Chokepoint} message Chokepoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chokepoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedFindings = []; + if (message.relatedFindings && message.relatedFindings.length) { + object.relatedFindings = []; + for (var j = 0; j < message.relatedFindings.length; ++j) + object.relatedFindings[j] = message.relatedFindings[j]; + } + return object; + }; + + /** + * Converts this Chokepoint to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @instance + * @returns {Object.} JSON object + */ + Chokepoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chokepoint + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Chokepoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chokepoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Chokepoint"; + }; + + return Chokepoint; + })(); + + v2.CloudArmor = (function() { + + /** + * Properties of a CloudArmor. + * @memberof google.cloud.securitycenter.v2 + * @interface ICloudArmor + * @property {google.cloud.securitycenter.v2.ISecurityPolicy|null} [securityPolicy] CloudArmor securityPolicy + * @property {google.cloud.securitycenter.v2.IRequests|null} [requests] CloudArmor requests + * @property {google.cloud.securitycenter.v2.IAdaptiveProtection|null} [adaptiveProtection] CloudArmor adaptiveProtection + * @property {google.cloud.securitycenter.v2.IAttack|null} [attack] CloudArmor attack + * @property {string|null} [threatVector] CloudArmor threatVector + * @property {google.protobuf.IDuration|null} [duration] CloudArmor duration + */ + + /** + * Constructs a new CloudArmor. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CloudArmor. + * @implements ICloudArmor + * @constructor + * @param {google.cloud.securitycenter.v2.ICloudArmor=} [properties] Properties to set + */ + function CloudArmor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudArmor securityPolicy. + * @member {google.cloud.securitycenter.v2.ISecurityPolicy|null|undefined} securityPolicy + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @instance + */ + CloudArmor.prototype.securityPolicy = null; + + /** + * CloudArmor requests. + * @member {google.cloud.securitycenter.v2.IRequests|null|undefined} requests + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @instance + */ + CloudArmor.prototype.requests = null; + + /** + * CloudArmor adaptiveProtection. + * @member {google.cloud.securitycenter.v2.IAdaptiveProtection|null|undefined} adaptiveProtection + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @instance + */ + CloudArmor.prototype.adaptiveProtection = null; + + /** + * CloudArmor attack. + * @member {google.cloud.securitycenter.v2.IAttack|null|undefined} attack + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @instance + */ + CloudArmor.prototype.attack = null; + + /** + * CloudArmor threatVector. + * @member {string} threatVector + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @instance + */ + CloudArmor.prototype.threatVector = ""; + + /** + * CloudArmor duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @instance + */ + CloudArmor.prototype.duration = null; + + /** + * Creates a new CloudArmor instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {google.cloud.securitycenter.v2.ICloudArmor=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CloudArmor} CloudArmor instance + */ + CloudArmor.create = function create(properties) { + return new CloudArmor(properties); + }; + + /** + * Encodes the specified CloudArmor message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudArmor.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {google.cloud.securitycenter.v2.ICloudArmor} message CloudArmor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudArmor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + $root.google.cloud.securitycenter.v2.SecurityPolicy.encode(message.securityPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) + $root.google.cloud.securitycenter.v2.Requests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.adaptiveProtection != null && Object.hasOwnProperty.call(message, "adaptiveProtection")) + $root.google.cloud.securitycenter.v2.AdaptiveProtection.encode(message.adaptiveProtection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attack != null && Object.hasOwnProperty.call(message, "attack")) + $root.google.cloud.securitycenter.v2.Attack.encode(message.attack, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.threatVector != null && Object.hasOwnProperty.call(message, "threatVector")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.threatVector); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudArmor message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudArmor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {google.cloud.securitycenter.v2.ICloudArmor} message CloudArmor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudArmor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudArmor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.CloudArmor} CloudArmor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudArmor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CloudArmor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.securityPolicy = $root.google.cloud.securitycenter.v2.SecurityPolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requests = $root.google.cloud.securitycenter.v2.Requests.decode(reader, reader.uint32()); + break; + } + case 3: { + message.adaptiveProtection = $root.google.cloud.securitycenter.v2.AdaptiveProtection.decode(reader, reader.uint32()); + break; + } + case 4: { + message.attack = $root.google.cloud.securitycenter.v2.Attack.decode(reader, reader.uint32()); + break; + } + case 5: { + message.threatVector = reader.string(); + break; + } + case 6: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudArmor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.CloudArmor} CloudArmor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudArmor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudArmor message. + * @function verify + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudArmor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) { + var error = $root.google.cloud.securitycenter.v2.SecurityPolicy.verify(message.securityPolicy); + if (error) + return "securityPolicy." + error; + } + if (message.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.securitycenter.v2.Requests.verify(message.requests); + if (error) + return "requests." + error; + } + if (message.adaptiveProtection != null && message.hasOwnProperty("adaptiveProtection")) { + var error = $root.google.cloud.securitycenter.v2.AdaptiveProtection.verify(message.adaptiveProtection); + if (error) + return "adaptiveProtection." + error; + } + if (message.attack != null && message.hasOwnProperty("attack")) { + var error = $root.google.cloud.securitycenter.v2.Attack.verify(message.attack); + if (error) + return "attack." + error; + } + if (message.threatVector != null && message.hasOwnProperty("threatVector")) + if (!$util.isString(message.threatVector)) + return "threatVector: string expected"; + 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 CloudArmor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CloudArmor} CloudArmor + */ + CloudArmor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CloudArmor) + return object; + var message = new $root.google.cloud.securitycenter.v2.CloudArmor(); + if (object.securityPolicy != null) { + if (typeof object.securityPolicy !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.securityPolicy: object expected"); + message.securityPolicy = $root.google.cloud.securitycenter.v2.SecurityPolicy.fromObject(object.securityPolicy); + } + if (object.requests != null) { + if (typeof object.requests !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.requests: object expected"); + message.requests = $root.google.cloud.securitycenter.v2.Requests.fromObject(object.requests); + } + if (object.adaptiveProtection != null) { + if (typeof object.adaptiveProtection !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.adaptiveProtection: object expected"); + message.adaptiveProtection = $root.google.cloud.securitycenter.v2.AdaptiveProtection.fromObject(object.adaptiveProtection); + } + if (object.attack != null) { + if (typeof object.attack !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.attack: object expected"); + message.attack = $root.google.cloud.securitycenter.v2.Attack.fromObject(object.attack); + } + if (object.threatVector != null) + message.threatVector = String(object.threatVector); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a CloudArmor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {google.cloud.securitycenter.v2.CloudArmor} message CloudArmor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudArmor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = null; + object.requests = null; + object.adaptiveProtection = null; + object.attack = null; + object.threatVector = ""; + object.duration = null; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = $root.google.cloud.securitycenter.v2.SecurityPolicy.toObject(message.securityPolicy, options); + if (message.requests != null && message.hasOwnProperty("requests")) + object.requests = $root.google.cloud.securitycenter.v2.Requests.toObject(message.requests, options); + if (message.adaptiveProtection != null && message.hasOwnProperty("adaptiveProtection")) + object.adaptiveProtection = $root.google.cloud.securitycenter.v2.AdaptiveProtection.toObject(message.adaptiveProtection, options); + if (message.attack != null && message.hasOwnProperty("attack")) + object.attack = $root.google.cloud.securitycenter.v2.Attack.toObject(message.attack, options); + if (message.threatVector != null && message.hasOwnProperty("threatVector")) + object.threatVector = message.threatVector; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this CloudArmor to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @instance + * @returns {Object.} JSON object + */ + CloudArmor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudArmor + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.CloudArmor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudArmor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.CloudArmor"; + }; + + return CloudArmor; + })(); + + v2.SecurityPolicy = (function() { + + /** + * Properties of a SecurityPolicy. + * @memberof google.cloud.securitycenter.v2 + * @interface ISecurityPolicy + * @property {string|null} [name] SecurityPolicy name + * @property {string|null} [type] SecurityPolicy type + * @property {boolean|null} [preview] SecurityPolicy preview + */ + + /** + * Constructs a new SecurityPolicy. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a SecurityPolicy. + * @implements ISecurityPolicy + * @constructor + * @param {google.cloud.securitycenter.v2.ISecurityPolicy=} [properties] Properties to set + */ + function SecurityPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPolicy name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.name = ""; + + /** + * SecurityPolicy type. + * @member {string} type + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.type = ""; + + /** + * SecurityPolicy preview. + * @member {boolean} preview + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.preview = false; + + /** + * Creates a new SecurityPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {google.cloud.securitycenter.v2.ISecurityPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.SecurityPolicy} SecurityPolicy instance + */ + SecurityPolicy.create = function create(properties) { + return new SecurityPolicy(properties); + }; + + /** + * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {google.cloud.securitycenter.v2.ISecurityPolicy} message SecurityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.preview != null && Object.hasOwnProperty.call(message, "preview")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.preview); + return writer; + }; + + /** + * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {google.cloud.securitycenter.v2.ISecurityPolicy} message SecurityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.SecurityPolicy} SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.preview = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.SecurityPolicy} SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.preview != null && message.hasOwnProperty("preview")) + if (typeof message.preview !== "boolean") + return "preview: boolean expected"; + return null; + }; + + /** + * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.SecurityPolicy} SecurityPolicy + */ + SecurityPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.SecurityPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v2.SecurityPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.preview != null) + message.preview = Boolean(object.preview); + return message; + }; + + /** + * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {google.cloud.securitycenter.v2.SecurityPolicy} message SecurityPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = ""; + object.preview = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.preview != null && message.hasOwnProperty("preview")) + object.preview = message.preview; + return object; + }; + + /** + * Converts this SecurityPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @instance + * @returns {Object.} JSON object + */ + SecurityPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityPolicy + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.SecurityPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.SecurityPolicy"; + }; + + return SecurityPolicy; + })(); + + v2.Requests = (function() { + + /** + * Properties of a Requests. + * @memberof google.cloud.securitycenter.v2 + * @interface IRequests + * @property {number|null} [ratio] Requests ratio + * @property {number|null} [shortTermAllowed] Requests shortTermAllowed + * @property {number|null} [longTermAllowed] Requests longTermAllowed + * @property {number|null} [longTermDenied] Requests longTermDenied + */ + + /** + * Constructs a new Requests. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Requests. + * @implements IRequests + * @constructor + * @param {google.cloud.securitycenter.v2.IRequests=} [properties] Properties to set + */ + function Requests(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Requests ratio. + * @member {number} ratio + * @memberof google.cloud.securitycenter.v2.Requests + * @instance + */ + Requests.prototype.ratio = 0; + + /** + * Requests shortTermAllowed. + * @member {number} shortTermAllowed + * @memberof google.cloud.securitycenter.v2.Requests + * @instance + */ + Requests.prototype.shortTermAllowed = 0; + + /** + * Requests longTermAllowed. + * @member {number} longTermAllowed + * @memberof google.cloud.securitycenter.v2.Requests + * @instance + */ + Requests.prototype.longTermAllowed = 0; + + /** + * Requests longTermDenied. + * @member {number} longTermDenied + * @memberof google.cloud.securitycenter.v2.Requests + * @instance + */ + Requests.prototype.longTermDenied = 0; + + /** + * Creates a new Requests instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {google.cloud.securitycenter.v2.IRequests=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Requests} Requests instance + */ + Requests.create = function create(properties) { + return new Requests(properties); + }; + + /** + * Encodes the specified Requests message. Does not implicitly {@link google.cloud.securitycenter.v2.Requests.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {google.cloud.securitycenter.v2.IRequests} message Requests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Requests.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.ratio); + if (message.shortTermAllowed != null && Object.hasOwnProperty.call(message, "shortTermAllowed")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.shortTermAllowed); + if (message.longTermAllowed != null && Object.hasOwnProperty.call(message, "longTermAllowed")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.longTermAllowed); + if (message.longTermDenied != null && Object.hasOwnProperty.call(message, "longTermDenied")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.longTermDenied); + return writer; + }; + + /** + * Encodes the specified Requests message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Requests.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {google.cloud.securitycenter.v2.IRequests} message Requests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Requests.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Requests message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Requests} Requests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Requests.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Requests(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ratio = reader.double(); + break; + } + case 2: { + message.shortTermAllowed = reader.int32(); + break; + } + case 3: { + message.longTermAllowed = reader.int32(); + break; + } + case 4: { + message.longTermDenied = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Requests message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Requests} Requests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Requests.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Requests message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Requests.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ratio != null && message.hasOwnProperty("ratio")) + if (typeof message.ratio !== "number") + return "ratio: number expected"; + if (message.shortTermAllowed != null && message.hasOwnProperty("shortTermAllowed")) + if (!$util.isInteger(message.shortTermAllowed)) + return "shortTermAllowed: integer expected"; + if (message.longTermAllowed != null && message.hasOwnProperty("longTermAllowed")) + if (!$util.isInteger(message.longTermAllowed)) + return "longTermAllowed: integer expected"; + if (message.longTermDenied != null && message.hasOwnProperty("longTermDenied")) + if (!$util.isInteger(message.longTermDenied)) + return "longTermDenied: integer expected"; + return null; + }; + + /** + * Creates a Requests message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Requests} Requests + */ + Requests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Requests) + return object; + var message = new $root.google.cloud.securitycenter.v2.Requests(); + if (object.ratio != null) + message.ratio = Number(object.ratio); + if (object.shortTermAllowed != null) + message.shortTermAllowed = object.shortTermAllowed | 0; + if (object.longTermAllowed != null) + message.longTermAllowed = object.longTermAllowed | 0; + if (object.longTermDenied != null) + message.longTermDenied = object.longTermDenied | 0; + return message; + }; + + /** + * Creates a plain object from a Requests message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {google.cloud.securitycenter.v2.Requests} message Requests + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Requests.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ratio = 0; + object.shortTermAllowed = 0; + object.longTermAllowed = 0; + object.longTermDenied = 0; + } + if (message.ratio != null && message.hasOwnProperty("ratio")) + object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; + if (message.shortTermAllowed != null && message.hasOwnProperty("shortTermAllowed")) + object.shortTermAllowed = message.shortTermAllowed; + if (message.longTermAllowed != null && message.hasOwnProperty("longTermAllowed")) + object.longTermAllowed = message.longTermAllowed; + if (message.longTermDenied != null && message.hasOwnProperty("longTermDenied")) + object.longTermDenied = message.longTermDenied; + return object; + }; + + /** + * Converts this Requests to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Requests + * @instance + * @returns {Object.} JSON object + */ + Requests.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Requests + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Requests + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Requests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Requests"; + }; + + return Requests; + })(); + + v2.AdaptiveProtection = (function() { + + /** + * Properties of an AdaptiveProtection. + * @memberof google.cloud.securitycenter.v2 + * @interface IAdaptiveProtection + * @property {number|null} [confidence] AdaptiveProtection confidence + */ + + /** + * Constructs a new AdaptiveProtection. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an AdaptiveProtection. + * @implements IAdaptiveProtection + * @constructor + * @param {google.cloud.securitycenter.v2.IAdaptiveProtection=} [properties] Properties to set + */ + function AdaptiveProtection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdaptiveProtection confidence. + * @member {number} confidence + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @instance + */ + AdaptiveProtection.prototype.confidence = 0; + + /** + * Creates a new AdaptiveProtection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {google.cloud.securitycenter.v2.IAdaptiveProtection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AdaptiveProtection} AdaptiveProtection instance + */ + AdaptiveProtection.create = function create(properties) { + return new AdaptiveProtection(properties); + }; + + /** + * Encodes the specified AdaptiveProtection message. Does not implicitly {@link google.cloud.securitycenter.v2.AdaptiveProtection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {google.cloud.securitycenter.v2.IAdaptiveProtection} message AdaptiveProtection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdaptiveProtection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.confidence); + return writer; + }; + + /** + * Encodes the specified AdaptiveProtection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AdaptiveProtection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {google.cloud.securitycenter.v2.IAdaptiveProtection} message AdaptiveProtection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdaptiveProtection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdaptiveProtection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AdaptiveProtection} AdaptiveProtection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdaptiveProtection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AdaptiveProtection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidence = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdaptiveProtection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AdaptiveProtection} AdaptiveProtection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdaptiveProtection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdaptiveProtection message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdaptiveProtection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates an AdaptiveProtection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AdaptiveProtection} AdaptiveProtection + */ + AdaptiveProtection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AdaptiveProtection) + return object; + var message = new $root.google.cloud.securitycenter.v2.AdaptiveProtection(); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from an AdaptiveProtection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {google.cloud.securitycenter.v2.AdaptiveProtection} message AdaptiveProtection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdaptiveProtection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.confidence = 0; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this AdaptiveProtection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @instance + * @returns {Object.} JSON object + */ + AdaptiveProtection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdaptiveProtection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AdaptiveProtection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdaptiveProtection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AdaptiveProtection"; + }; + + return AdaptiveProtection; + })(); + + v2.Attack = (function() { + + /** + * Properties of an Attack. + * @memberof google.cloud.securitycenter.v2 + * @interface IAttack + * @property {number|Long|null} [volumePpsLong] Attack volumePpsLong + * @property {number|Long|null} [volumeBpsLong] Attack volumeBpsLong + * @property {string|null} [classification] Attack classification + * @property {number|null} [volumePps] Attack volumePps + * @property {number|null} [volumeBps] Attack volumeBps + */ + + /** + * Constructs a new Attack. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an Attack. + * @implements IAttack + * @constructor + * @param {google.cloud.securitycenter.v2.IAttack=} [properties] Properties to set + */ + function Attack(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attack volumePpsLong. + * @member {number|Long} volumePpsLong + * @memberof google.cloud.securitycenter.v2.Attack + * @instance + */ + Attack.prototype.volumePpsLong = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Attack volumeBpsLong. + * @member {number|Long} volumeBpsLong + * @memberof google.cloud.securitycenter.v2.Attack + * @instance + */ + Attack.prototype.volumeBpsLong = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Attack classification. + * @member {string} classification + * @memberof google.cloud.securitycenter.v2.Attack + * @instance + */ + Attack.prototype.classification = ""; + + /** + * Attack volumePps. + * @member {number} volumePps + * @memberof google.cloud.securitycenter.v2.Attack + * @instance + */ + Attack.prototype.volumePps = 0; + + /** + * Attack volumeBps. + * @member {number} volumeBps + * @memberof google.cloud.securitycenter.v2.Attack + * @instance + */ + Attack.prototype.volumeBps = 0; + + /** + * Creates a new Attack instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {google.cloud.securitycenter.v2.IAttack=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Attack} Attack instance + */ + Attack.create = function create(properties) { + return new Attack(properties); + }; + + /** + * Encodes the specified Attack message. Does not implicitly {@link google.cloud.securitycenter.v2.Attack.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {google.cloud.securitycenter.v2.IAttack} message Attack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attack.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.volumePps != null && Object.hasOwnProperty.call(message, "volumePps")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.volumePps); + if (message.volumeBps != null && Object.hasOwnProperty.call(message, "volumeBps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.volumeBps); + if (message.classification != null && Object.hasOwnProperty.call(message, "classification")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.classification); + if (message.volumePpsLong != null && Object.hasOwnProperty.call(message, "volumePpsLong")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.volumePpsLong); + if (message.volumeBpsLong != null && Object.hasOwnProperty.call(message, "volumeBpsLong")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.volumeBpsLong); + return writer; + }; + + /** + * Encodes the specified Attack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Attack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {google.cloud.securitycenter.v2.IAttack} message Attack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attack.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attack message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Attack} Attack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attack.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Attack(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.volumePpsLong = reader.int64(); + break; + } + case 5: { + message.volumeBpsLong = reader.int64(); + break; + } + case 3: { + message.classification = reader.string(); + break; + } + case 1: { + message.volumePps = reader.int32(); + break; + } + case 2: { + message.volumeBps = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attack message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Attack} Attack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attack.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attack message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attack.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.volumePpsLong != null && message.hasOwnProperty("volumePpsLong")) + if (!$util.isInteger(message.volumePpsLong) && !(message.volumePpsLong && $util.isInteger(message.volumePpsLong.low) && $util.isInteger(message.volumePpsLong.high))) + return "volumePpsLong: integer|Long expected"; + if (message.volumeBpsLong != null && message.hasOwnProperty("volumeBpsLong")) + if (!$util.isInteger(message.volumeBpsLong) && !(message.volumeBpsLong && $util.isInteger(message.volumeBpsLong.low) && $util.isInteger(message.volumeBpsLong.high))) + return "volumeBpsLong: integer|Long expected"; + if (message.classification != null && message.hasOwnProperty("classification")) + if (!$util.isString(message.classification)) + return "classification: string expected"; + if (message.volumePps != null && message.hasOwnProperty("volumePps")) + if (!$util.isInteger(message.volumePps)) + return "volumePps: integer expected"; + if (message.volumeBps != null && message.hasOwnProperty("volumeBps")) + if (!$util.isInteger(message.volumeBps)) + return "volumeBps: integer expected"; + return null; + }; + + /** + * Creates an Attack message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Attack} Attack + */ + Attack.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Attack) + return object; + var message = new $root.google.cloud.securitycenter.v2.Attack(); + if (object.volumePpsLong != null) + if ($util.Long) + (message.volumePpsLong = $util.Long.fromValue(object.volumePpsLong)).unsigned = false; + else if (typeof object.volumePpsLong === "string") + message.volumePpsLong = parseInt(object.volumePpsLong, 10); + else if (typeof object.volumePpsLong === "number") + message.volumePpsLong = object.volumePpsLong; + else if (typeof object.volumePpsLong === "object") + message.volumePpsLong = new $util.LongBits(object.volumePpsLong.low >>> 0, object.volumePpsLong.high >>> 0).toNumber(); + if (object.volumeBpsLong != null) + if ($util.Long) + (message.volumeBpsLong = $util.Long.fromValue(object.volumeBpsLong)).unsigned = false; + else if (typeof object.volumeBpsLong === "string") + message.volumeBpsLong = parseInt(object.volumeBpsLong, 10); + else if (typeof object.volumeBpsLong === "number") + message.volumeBpsLong = object.volumeBpsLong; + else if (typeof object.volumeBpsLong === "object") + message.volumeBpsLong = new $util.LongBits(object.volumeBpsLong.low >>> 0, object.volumeBpsLong.high >>> 0).toNumber(); + if (object.classification != null) + message.classification = String(object.classification); + if (object.volumePps != null) + message.volumePps = object.volumePps | 0; + if (object.volumeBps != null) + message.volumeBps = object.volumeBps | 0; + return message; + }; + + /** + * Creates a plain object from an Attack message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {google.cloud.securitycenter.v2.Attack} message Attack + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attack.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.volumePps = 0; + object.volumeBps = 0; + object.classification = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.volumePpsLong = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.volumePpsLong = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.volumeBpsLong = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.volumeBpsLong = options.longs === String ? "0" : 0; + } + if (message.volumePps != null && message.hasOwnProperty("volumePps")) + object.volumePps = message.volumePps; + if (message.volumeBps != null && message.hasOwnProperty("volumeBps")) + object.volumeBps = message.volumeBps; + if (message.classification != null && message.hasOwnProperty("classification")) + object.classification = message.classification; + if (message.volumePpsLong != null && message.hasOwnProperty("volumePpsLong")) + if (typeof message.volumePpsLong === "number") + object.volumePpsLong = options.longs === String ? String(message.volumePpsLong) : message.volumePpsLong; + else + object.volumePpsLong = options.longs === String ? $util.Long.prototype.toString.call(message.volumePpsLong) : options.longs === Number ? new $util.LongBits(message.volumePpsLong.low >>> 0, message.volumePpsLong.high >>> 0).toNumber() : message.volumePpsLong; + if (message.volumeBpsLong != null && message.hasOwnProperty("volumeBpsLong")) + if (typeof message.volumeBpsLong === "number") + object.volumeBpsLong = options.longs === String ? String(message.volumeBpsLong) : message.volumeBpsLong; + else + object.volumeBpsLong = options.longs === String ? $util.Long.prototype.toString.call(message.volumeBpsLong) : options.longs === Number ? new $util.LongBits(message.volumeBpsLong.low >>> 0, message.volumeBpsLong.high >>> 0).toNumber() : message.volumeBpsLong; + return object; + }; + + /** + * Converts this Attack to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Attack + * @instance + * @returns {Object.} JSON object + */ + Attack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Attack + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Attack + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Attack"; + }; + + return Attack; + })(); + + v2.CloudDlpDataProfile = (function() { + + /** + * Properties of a CloudDlpDataProfile. + * @memberof google.cloud.securitycenter.v2 + * @interface ICloudDlpDataProfile + * @property {string|null} [dataProfile] CloudDlpDataProfile dataProfile + * @property {google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType|null} [parentType] CloudDlpDataProfile parentType + */ + + /** + * Constructs a new CloudDlpDataProfile. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CloudDlpDataProfile. + * @implements ICloudDlpDataProfile + * @constructor + * @param {google.cloud.securitycenter.v2.ICloudDlpDataProfile=} [properties] Properties to set + */ + function CloudDlpDataProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudDlpDataProfile dataProfile. + * @member {string} dataProfile + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @instance + */ + CloudDlpDataProfile.prototype.dataProfile = ""; + + /** + * CloudDlpDataProfile parentType. + * @member {google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType} parentType + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @instance + */ + CloudDlpDataProfile.prototype.parentType = 0; + + /** + * Creates a new CloudDlpDataProfile instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {google.cloud.securitycenter.v2.ICloudDlpDataProfile=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CloudDlpDataProfile} CloudDlpDataProfile instance + */ + CloudDlpDataProfile.create = function create(properties) { + return new CloudDlpDataProfile(properties); + }; + + /** + * Encodes the specified CloudDlpDataProfile message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpDataProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {google.cloud.securitycenter.v2.ICloudDlpDataProfile} message CloudDlpDataProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDlpDataProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataProfile != null && Object.hasOwnProperty.call(message, "dataProfile")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataProfile); + if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.parentType); + return writer; + }; + + /** + * Encodes the specified CloudDlpDataProfile message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpDataProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {google.cloud.securitycenter.v2.ICloudDlpDataProfile} message CloudDlpDataProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDlpDataProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudDlpDataProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.CloudDlpDataProfile} CloudDlpDataProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDlpDataProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CloudDlpDataProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataProfile = reader.string(); + break; + } + case 2: { + message.parentType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudDlpDataProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.CloudDlpDataProfile} CloudDlpDataProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDlpDataProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudDlpDataProfile message. + * @function verify + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudDlpDataProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) + if (!$util.isString(message.dataProfile)) + return "dataProfile: string expected"; + if (message.parentType != null && message.hasOwnProperty("parentType")) + switch (message.parentType) { + default: + return "parentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CloudDlpDataProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CloudDlpDataProfile} CloudDlpDataProfile + */ + CloudDlpDataProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CloudDlpDataProfile) + return object; + var message = new $root.google.cloud.securitycenter.v2.CloudDlpDataProfile(); + if (object.dataProfile != null) + message.dataProfile = String(object.dataProfile); + switch (object.parentType) { + default: + if (typeof object.parentType === "number") { + message.parentType = object.parentType; + break; + } + break; + case "PARENT_TYPE_UNSPECIFIED": + case 0: + message.parentType = 0; + break; + case "ORGANIZATION": + case 1: + message.parentType = 1; + break; + case "PROJECT": + case 2: + message.parentType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CloudDlpDataProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {google.cloud.securitycenter.v2.CloudDlpDataProfile} message CloudDlpDataProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudDlpDataProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataProfile = ""; + object.parentType = options.enums === String ? "PARENT_TYPE_UNSPECIFIED" : 0; + } + if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) + object.dataProfile = message.dataProfile; + if (message.parentType != null && message.hasOwnProperty("parentType")) + object.parentType = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType[message.parentType] === undefined ? message.parentType : $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType[message.parentType] : message.parentType; + return object; + }; + + /** + * Converts this CloudDlpDataProfile to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @instance + * @returns {Object.} JSON object + */ + CloudDlpDataProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudDlpDataProfile + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudDlpDataProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.CloudDlpDataProfile"; + }; + + /** + * ParentType enum. + * @name google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType + * @enum {number} + * @property {number} PARENT_TYPE_UNSPECIFIED=0 PARENT_TYPE_UNSPECIFIED value + * @property {number} ORGANIZATION=1 ORGANIZATION value + * @property {number} PROJECT=2 PROJECT value + */ + CloudDlpDataProfile.ParentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORGANIZATION"] = 1; + values[valuesById[2] = "PROJECT"] = 2; + return values; + })(); + + return CloudDlpDataProfile; + })(); + + v2.CloudDlpInspection = (function() { + + /** + * Properties of a CloudDlpInspection. + * @memberof google.cloud.securitycenter.v2 + * @interface ICloudDlpInspection + * @property {string|null} [inspectJob] CloudDlpInspection inspectJob + * @property {string|null} [infoType] CloudDlpInspection infoType + * @property {number|Long|null} [infoTypeCount] CloudDlpInspection infoTypeCount + * @property {boolean|null} [fullScan] CloudDlpInspection fullScan + */ + + /** + * Constructs a new CloudDlpInspection. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CloudDlpInspection. + * @implements ICloudDlpInspection + * @constructor + * @param {google.cloud.securitycenter.v2.ICloudDlpInspection=} [properties] Properties to set + */ + function CloudDlpInspection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudDlpInspection inspectJob. + * @member {string} inspectJob + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @instance + */ + CloudDlpInspection.prototype.inspectJob = ""; + + /** + * CloudDlpInspection infoType. + * @member {string} infoType + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @instance + */ + CloudDlpInspection.prototype.infoType = ""; + + /** + * CloudDlpInspection infoTypeCount. + * @member {number|Long} infoTypeCount + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @instance + */ + CloudDlpInspection.prototype.infoTypeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CloudDlpInspection fullScan. + * @member {boolean} fullScan + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @instance + */ + CloudDlpInspection.prototype.fullScan = false; + + /** + * Creates a new CloudDlpInspection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {google.cloud.securitycenter.v2.ICloudDlpInspection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CloudDlpInspection} CloudDlpInspection instance + */ + CloudDlpInspection.create = function create(properties) { + return new CloudDlpInspection(properties); + }; + + /** + * Encodes the specified CloudDlpInspection message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpInspection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {google.cloud.securitycenter.v2.ICloudDlpInspection} message CloudDlpInspection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDlpInspection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inspectJob != null && Object.hasOwnProperty.call(message, "inspectJob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inspectJob); + if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.infoType); + if (message.infoTypeCount != null && Object.hasOwnProperty.call(message, "infoTypeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.infoTypeCount); + if (message.fullScan != null && Object.hasOwnProperty.call(message, "fullScan")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.fullScan); + return writer; + }; + + /** + * Encodes the specified CloudDlpInspection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpInspection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {google.cloud.securitycenter.v2.ICloudDlpInspection} message CloudDlpInspection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDlpInspection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudDlpInspection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.CloudDlpInspection} CloudDlpInspection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDlpInspection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CloudDlpInspection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inspectJob = reader.string(); + break; + } + case 2: { + message.infoType = reader.string(); + break; + } + case 3: { + message.infoTypeCount = reader.int64(); + break; + } + case 4: { + message.fullScan = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudDlpInspection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.CloudDlpInspection} CloudDlpInspection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDlpInspection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudDlpInspection message. + * @function verify + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudDlpInspection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) + if (!$util.isString(message.inspectJob)) + return "inspectJob: string expected"; + if (message.infoType != null && message.hasOwnProperty("infoType")) + if (!$util.isString(message.infoType)) + return "infoType: string expected"; + if (message.infoTypeCount != null && message.hasOwnProperty("infoTypeCount")) + if (!$util.isInteger(message.infoTypeCount) && !(message.infoTypeCount && $util.isInteger(message.infoTypeCount.low) && $util.isInteger(message.infoTypeCount.high))) + return "infoTypeCount: integer|Long expected"; + if (message.fullScan != null && message.hasOwnProperty("fullScan")) + if (typeof message.fullScan !== "boolean") + return "fullScan: boolean expected"; + return null; + }; + + /** + * Creates a CloudDlpInspection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CloudDlpInspection} CloudDlpInspection + */ + CloudDlpInspection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CloudDlpInspection) + return object; + var message = new $root.google.cloud.securitycenter.v2.CloudDlpInspection(); + if (object.inspectJob != null) + message.inspectJob = String(object.inspectJob); + if (object.infoType != null) + message.infoType = String(object.infoType); + if (object.infoTypeCount != null) + if ($util.Long) + (message.infoTypeCount = $util.Long.fromValue(object.infoTypeCount)).unsigned = false; + else if (typeof object.infoTypeCount === "string") + message.infoTypeCount = parseInt(object.infoTypeCount, 10); + else if (typeof object.infoTypeCount === "number") + message.infoTypeCount = object.infoTypeCount; + else if (typeof object.infoTypeCount === "object") + message.infoTypeCount = new $util.LongBits(object.infoTypeCount.low >>> 0, object.infoTypeCount.high >>> 0).toNumber(); + if (object.fullScan != null) + message.fullScan = Boolean(object.fullScan); + return message; + }; + + /** + * Creates a plain object from a CloudDlpInspection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {google.cloud.securitycenter.v2.CloudDlpInspection} message CloudDlpInspection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudDlpInspection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inspectJob = ""; + object.infoType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.infoTypeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.infoTypeCount = options.longs === String ? "0" : 0; + object.fullScan = false; + } + if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) + object.inspectJob = message.inspectJob; + if (message.infoType != null && message.hasOwnProperty("infoType")) + object.infoType = message.infoType; + if (message.infoTypeCount != null && message.hasOwnProperty("infoTypeCount")) + if (typeof message.infoTypeCount === "number") + object.infoTypeCount = options.longs === String ? String(message.infoTypeCount) : message.infoTypeCount; + else + object.infoTypeCount = options.longs === String ? $util.Long.prototype.toString.call(message.infoTypeCount) : options.longs === Number ? new $util.LongBits(message.infoTypeCount.low >>> 0, message.infoTypeCount.high >>> 0).toNumber() : message.infoTypeCount; + if (message.fullScan != null && message.hasOwnProperty("fullScan")) + object.fullScan = message.fullScan; + return object; + }; + + /** + * Converts this CloudDlpInspection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @instance + * @returns {Object.} JSON object + */ + CloudDlpInspection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudDlpInspection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.CloudDlpInspection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudDlpInspection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.CloudDlpInspection"; + }; + + return CloudDlpInspection; + })(); + + v2.Compliance = (function() { + + /** + * Properties of a Compliance. + * @memberof google.cloud.securitycenter.v2 + * @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.v2 + * @classdesc Represents a Compliance. + * @implements ICompliance + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Compliance + * @instance + */ + Compliance.prototype.standard = ""; + + /** + * Compliance version. + * @member {string} version + * @memberof google.cloud.securitycenter.v2.Compliance + * @instance + */ + Compliance.prototype.version = ""; + + /** + * Compliance ids. + * @member {Array.} ids + * @memberof google.cloud.securitycenter.v2.Compliance + * @instance + */ + Compliance.prototype.ids = $util.emptyArray; + + /** + * Creates a new Compliance instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Compliance + * @static + * @param {google.cloud.securitycenter.v2.ICompliance=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Compliance} Compliance instance + */ + Compliance.create = function create(properties) { + return new Compliance(properties); + }; + + /** + * Encodes the specified Compliance message. Does not implicitly {@link google.cloud.securitycenter.v2.Compliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Compliance + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Compliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Compliance + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Compliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Compliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Compliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Compliance} Compliance + */ + Compliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Compliance) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.Compliance + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Compliance + * @instance + * @returns {Object.} JSON object + */ + Compliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Compliance + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Compliance"; + }; + + return Compliance; + })(); + + v2.Connection = (function() { + + /** + * Properties of a Connection. + * @memberof google.cloud.securitycenter.v2 + * @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.v2.Connection.Protocol|null} [protocol] Connection protocol + */ + + /** + * Constructs a new Connection. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Connection. + * @implements IConnection + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Connection + * @instance + */ + Connection.prototype.destinationIp = ""; + + /** + * Connection destinationPort. + * @member {number} destinationPort + * @memberof google.cloud.securitycenter.v2.Connection + * @instance + */ + Connection.prototype.destinationPort = 0; + + /** + * Connection sourceIp. + * @member {string} sourceIp + * @memberof google.cloud.securitycenter.v2.Connection + * @instance + */ + Connection.prototype.sourceIp = ""; + + /** + * Connection sourcePort. + * @member {number} sourcePort + * @memberof google.cloud.securitycenter.v2.Connection + * @instance + */ + Connection.prototype.sourcePort = 0; + + /** + * Connection protocol. + * @member {google.cloud.securitycenter.v2.Connection.Protocol} protocol + * @memberof google.cloud.securitycenter.v2.Connection + * @instance + */ + Connection.prototype.protocol = 0; + + /** + * Creates a new Connection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Connection + * @static + * @param {google.cloud.securitycenter.v2.IConnection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Connection} Connection instance + */ + Connection.create = function create(properties) { + return new Connection(properties); + }; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.securitycenter.v2.Connection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Connection + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Connection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Connection + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Connection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Connection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Connection} Connection + */ + Connection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Connection) + return object; + var message = new $root.google.cloud.securitycenter.v2.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) { + default: + if (typeof object.protocol === "number") { + message.protocol = object.protocol; + break; + } + break; + 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.v2.Connection + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Connection.Protocol[message.protocol] === undefined ? message.protocol : $root.google.cloud.securitycenter.v2.Connection.Protocol[message.protocol] : message.protocol; + return object; + }; + + /** + * Converts this Connection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Connection + * @instance + * @returns {Object.} JSON object + */ + Connection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Connection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Connection"; + }; + + /** + * Protocol enum. + * @name google.cloud.securitycenter.v2.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; + })(); + + v2.ContactDetails = (function() { + + /** + * Properties of a ContactDetails. + * @memberof google.cloud.securitycenter.v2 + * @interface IContactDetails + * @property {Array.|null} [contacts] ContactDetails contacts + */ + + /** + * Constructs a new ContactDetails. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ContactDetails. + * @implements IContactDetails + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ContactDetails + * @instance + */ + ContactDetails.prototype.contacts = $util.emptyArray; + + /** + * Creates a new ContactDetails instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ContactDetails + * @static + * @param {google.cloud.securitycenter.v2.IContactDetails=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ContactDetails} ContactDetails instance + */ + ContactDetails.create = function create(properties) { + return new ContactDetails(properties); + }; + + /** + * Encodes the specified ContactDetails message. Does not implicitly {@link google.cloud.securitycenter.v2.ContactDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ContactDetails + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.ContactDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ContactDetails + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ContactDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.google.cloud.securitycenter.v2.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.v2.ContactDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.ContactDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ContactDetails} ContactDetails + */ + ContactDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ContactDetails) + return object; + var message = new $root.google.cloud.securitycenter.v2.ContactDetails(); + if (object.contacts) { + if (!Array.isArray(object.contacts)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.ContactDetails.contacts: object expected"); + message.contacts[i] = $root.google.cloud.securitycenter.v2.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.v2.ContactDetails + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Contact.toObject(message.contacts[j], options); + } + return object; + }; + + /** + * Converts this ContactDetails to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ContactDetails + * @instance + * @returns {Object.} JSON object + */ + ContactDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContactDetails + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ContactDetails"; + }; + + return ContactDetails; + })(); + + v2.Contact = (function() { + + /** + * Properties of a Contact. + * @memberof google.cloud.securitycenter.v2 + * @interface IContact + * @property {string|null} [email] Contact email + */ + + /** + * Constructs a new Contact. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Contact. + * @implements IContact + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Contact + * @instance + */ + Contact.prototype.email = ""; + + /** + * Creates a new Contact instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Contact + * @static + * @param {google.cloud.securitycenter.v2.IContact=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Contact} Contact instance + */ + Contact.create = function create(properties) { + return new Contact(properties); + }; + + /** + * Encodes the specified Contact message. Does not implicitly {@link google.cloud.securitycenter.v2.Contact.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Contact + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Contact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Contact + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Contact(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Contact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Contact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Contact} Contact + */ + Contact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Contact) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Contact + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Contact + * @instance + * @returns {Object.} JSON object + */ + Contact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Contact + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Contact"; + }; + + return Contact; + })(); + + v2.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.securitycenter.v2 + * @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 + * @property {google.protobuf.ITimestamp|null} [createTime] Container createTime + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.securitycenter.v2.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Container + * @instance + */ + Container.prototype.name = ""; + + /** + * Container uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v2.Container + * @instance + */ + Container.prototype.uri = ""; + + /** + * Container imageId. + * @member {string} imageId + * @memberof google.cloud.securitycenter.v2.Container + * @instance + */ + Container.prototype.imageId = ""; + + /** + * Container labels. + * @member {Array.} labels + * @memberof google.cloud.securitycenter.v2.Container + * @instance + */ + Container.prototype.labels = $util.emptyArray; + + /** + * Container createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v2.Container + * @instance + */ + Container.prototype.createTime = null; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Container + * @static + * @param {google.cloud.securitycenter.v2.IContainer=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v2.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Container + * @static + * @param {google.cloud.securitycenter.v2.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.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.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.v2.Label.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + 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(); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Container + * @static + * @param {google.cloud.securitycenter.v2.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Container(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Label.decode(reader, reader.uint32())); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Container + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Container.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.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.v2.Label.verify(message.labels[i]); + if (error) + return "labels." + 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 Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Container) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.Container.labels: object expected"); + message.labels[i] = $root.google.cloud.securitycenter.v2.Label.fromObject(object.labels[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Container.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Container + * @static + * @param {google.cloud.securitycenter.v2.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + object.name = ""; + object.uri = ""; + object.imageId = ""; + object.createTime = null; + } + 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.v2.Label.toObject(message.labels[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Container + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Container"; + }; + + return Container; + })(); + + v2.Label = (function() { + + /** + * Properties of a Label. + * @memberof google.cloud.securitycenter.v2 + * @interface ILabel + * @property {string|null} [name] Label name + * @property {string|null} [value] Label value + */ + + /** + * Constructs a new Label. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Label. + * @implements ILabel + * @constructor + * @param {google.cloud.securitycenter.v2.ILabel=} [properties] Properties to set + */ + function Label(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Label name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Label + * @instance + */ + Label.prototype.name = ""; + + /** + * Label value. + * @member {string} value + * @memberof google.cloud.securitycenter.v2.Label + * @instance + */ + Label.prototype.value = ""; + + /** + * Creates a new Label instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Label + * @static + * @param {google.cloud.securitycenter.v2.ILabel=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Label} Label instance + */ + Label.create = function create(properties) { + return new Label(properties); + }; + + /** + * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v2.Label.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Label + * @static + * @param {google.cloud.securitycenter.v2.ILabel} message Label message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} 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.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified Label message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Label.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Label + * @static + * @param {google.cloud.securitycenter.v2.ILabel} message Label message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Label.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Label message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.Label} Label + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Label.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Label(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Label message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Label + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Label} Label + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Label.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Label message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Label + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + 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.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a Label message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Label + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Label} Label + */ + Label.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Label) + return object; + var message = new $root.google.cloud.securitycenter.v2.Label(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a Label message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Label + * @static + * @param {google.cloud.securitycenter.v2.Label} message Label + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Label.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Label to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Label + * @instance + * @returns {Object.} JSON object + */ + Label.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Label + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Label"; + }; + + return Label; + })(); + + v2.DataAccessEvent = (function() { + + /** + * Properties of a DataAccessEvent. + * @memberof google.cloud.securitycenter.v2 + * @interface IDataAccessEvent + * @property {string|null} [eventId] DataAccessEvent eventId + * @property {string|null} [principalEmail] DataAccessEvent principalEmail + * @property {google.cloud.securitycenter.v2.DataAccessEvent.Operation|null} [operation] DataAccessEvent operation + * @property {google.protobuf.ITimestamp|null} [eventTime] DataAccessEvent eventTime + */ + + /** + * Constructs a new DataAccessEvent. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a DataAccessEvent. + * @implements IDataAccessEvent + * @constructor + * @param {google.cloud.securitycenter.v2.IDataAccessEvent=} [properties] Properties to set + */ + function DataAccessEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataAccessEvent eventId. + * @member {string} eventId + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @instance + */ + DataAccessEvent.prototype.eventId = ""; + + /** + * DataAccessEvent principalEmail. + * @member {string} principalEmail + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @instance + */ + DataAccessEvent.prototype.principalEmail = ""; + + /** + * DataAccessEvent operation. + * @member {google.cloud.securitycenter.v2.DataAccessEvent.Operation} operation + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @instance + */ + DataAccessEvent.prototype.operation = 0; + + /** + * DataAccessEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @instance + */ + DataAccessEvent.prototype.eventTime = null; + + /** + * Creates a new DataAccessEvent instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataAccessEvent=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.DataAccessEvent} DataAccessEvent instance + */ + DataAccessEvent.create = function create(properties) { + return new DataAccessEvent(properties); + }; + + /** + * Encodes the specified DataAccessEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataAccessEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataAccessEvent} message DataAccessEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataAccessEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventId); + if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.principalEmail); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operation); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataAccessEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataAccessEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataAccessEvent} message DataAccessEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataAccessEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataAccessEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.DataAccessEvent} DataAccessEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataAccessEvent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DataAccessEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eventId = reader.string(); + break; + } + case 2: { + message.principalEmail = reader.string(); + break; + } + case 3: { + message.operation = reader.int32(); + break; + } + case 4: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataAccessEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.DataAccessEvent} DataAccessEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataAccessEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataAccessEvent message. + * @function verify + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataAccessEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventId != null && message.hasOwnProperty("eventId")) + if (!$util.isString(message.eventId)) + return "eventId: string expected"; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + if (!$util.isString(message.principalEmail)) + return "principalEmail: string expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { + default: + return "operation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + return null; + }; + + /** + * Creates a DataAccessEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.DataAccessEvent} DataAccessEvent + */ + DataAccessEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.DataAccessEvent) + return object; + var message = new $root.google.cloud.securitycenter.v2.DataAccessEvent(); + if (object.eventId != null) + message.eventId = String(object.eventId); + if (object.principalEmail != null) + message.principalEmail = String(object.principalEmail); + switch (object.operation) { + default: + if (typeof object.operation === "number") { + message.operation = object.operation; + break; + } + break; + case "OPERATION_UNSPECIFIED": + case 0: + message.operation = 0; + break; + case "READ": + case 1: + message.operation = 1; + break; + case "MOVE": + case 2: + message.operation = 2; + break; + case "COPY": + case 3: + message.operation = 3; + break; + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.DataAccessEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + return message; + }; + + /** + * Creates a plain object from a DataAccessEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {google.cloud.securitycenter.v2.DataAccessEvent} message DataAccessEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataAccessEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventId = ""; + object.principalEmail = ""; + object.operation = options.enums === String ? "OPERATION_UNSPECIFIED" : 0; + object.eventTime = null; + } + if (message.eventId != null && message.hasOwnProperty("eventId")) + object.eventId = message.eventId; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + object.principalEmail = message.principalEmail; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.google.cloud.securitycenter.v2.DataAccessEvent.Operation[message.operation] === undefined ? message.operation : $root.google.cloud.securitycenter.v2.DataAccessEvent.Operation[message.operation] : message.operation; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + return object; + }; + + /** + * Converts this DataAccessEvent to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @instance + * @returns {Object.} JSON object + */ + DataAccessEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataAccessEvent + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.DataAccessEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataAccessEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.DataAccessEvent"; + }; + + /** + * Operation enum. + * @name google.cloud.securitycenter.v2.DataAccessEvent.Operation + * @enum {number} + * @property {number} OPERATION_UNSPECIFIED=0 OPERATION_UNSPECIFIED value + * @property {number} READ=1 READ value + * @property {number} MOVE=2 MOVE value + * @property {number} COPY=3 COPY value + */ + DataAccessEvent.Operation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ"] = 1; + values[valuesById[2] = "MOVE"] = 2; + values[valuesById[3] = "COPY"] = 3; + return values; + })(); + + return DataAccessEvent; + })(); + + v2.DataFlowEvent = (function() { + + /** + * Properties of a DataFlowEvent. + * @memberof google.cloud.securitycenter.v2 + * @interface IDataFlowEvent + * @property {string|null} [eventId] DataFlowEvent eventId + * @property {string|null} [principalEmail] DataFlowEvent principalEmail + * @property {google.cloud.securitycenter.v2.DataFlowEvent.Operation|null} [operation] DataFlowEvent operation + * @property {string|null} [violatedLocation] DataFlowEvent violatedLocation + * @property {google.protobuf.ITimestamp|null} [eventTime] DataFlowEvent eventTime + */ + + /** + * Constructs a new DataFlowEvent. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a DataFlowEvent. + * @implements IDataFlowEvent + * @constructor + * @param {google.cloud.securitycenter.v2.IDataFlowEvent=} [properties] Properties to set + */ + function DataFlowEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataFlowEvent eventId. + * @member {string} eventId + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @instance + */ + DataFlowEvent.prototype.eventId = ""; + + /** + * DataFlowEvent principalEmail. + * @member {string} principalEmail + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @instance + */ + DataFlowEvent.prototype.principalEmail = ""; + + /** + * DataFlowEvent operation. + * @member {google.cloud.securitycenter.v2.DataFlowEvent.Operation} operation + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @instance + */ + DataFlowEvent.prototype.operation = 0; + + /** + * DataFlowEvent violatedLocation. + * @member {string} violatedLocation + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @instance + */ + DataFlowEvent.prototype.violatedLocation = ""; + + /** + * DataFlowEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @instance + */ + DataFlowEvent.prototype.eventTime = null; + + /** + * Creates a new DataFlowEvent instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataFlowEvent=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.DataFlowEvent} DataFlowEvent instance + */ + DataFlowEvent.create = function create(properties) { + return new DataFlowEvent(properties); + }; + + /** + * Encodes the specified DataFlowEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataFlowEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataFlowEvent} message DataFlowEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataFlowEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventId); + if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.principalEmail); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operation); + if (message.violatedLocation != null && Object.hasOwnProperty.call(message, "violatedLocation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.violatedLocation); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataFlowEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataFlowEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataFlowEvent} message DataFlowEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataFlowEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataFlowEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.DataFlowEvent} DataFlowEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataFlowEvent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DataFlowEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eventId = reader.string(); + break; + } + case 2: { + message.principalEmail = reader.string(); + break; + } + case 3: { + message.operation = reader.int32(); + break; + } + case 4: { + message.violatedLocation = reader.string(); + break; + } + case 5: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataFlowEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.DataFlowEvent} DataFlowEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataFlowEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataFlowEvent message. + * @function verify + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataFlowEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventId != null && message.hasOwnProperty("eventId")) + if (!$util.isString(message.eventId)) + return "eventId: string expected"; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + if (!$util.isString(message.principalEmail)) + return "principalEmail: string expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { + default: + return "operation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.violatedLocation != null && message.hasOwnProperty("violatedLocation")) + if (!$util.isString(message.violatedLocation)) + return "violatedLocation: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + return null; + }; + + /** + * Creates a DataFlowEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.DataFlowEvent} DataFlowEvent + */ + DataFlowEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.DataFlowEvent) + return object; + var message = new $root.google.cloud.securitycenter.v2.DataFlowEvent(); + if (object.eventId != null) + message.eventId = String(object.eventId); + if (object.principalEmail != null) + message.principalEmail = String(object.principalEmail); + switch (object.operation) { + default: + if (typeof object.operation === "number") { + message.operation = object.operation; + break; + } + break; + case "OPERATION_UNSPECIFIED": + case 0: + message.operation = 0; + break; + case "READ": + case 1: + message.operation = 1; + break; + case "MOVE": + case 2: + message.operation = 2; + break; + case "COPY": + case 3: + message.operation = 3; + break; + } + if (object.violatedLocation != null) + message.violatedLocation = String(object.violatedLocation); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.DataFlowEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + return message; + }; + + /** + * Creates a plain object from a DataFlowEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {google.cloud.securitycenter.v2.DataFlowEvent} message DataFlowEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataFlowEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventId = ""; + object.principalEmail = ""; + object.operation = options.enums === String ? "OPERATION_UNSPECIFIED" : 0; + object.violatedLocation = ""; + object.eventTime = null; + } + if (message.eventId != null && message.hasOwnProperty("eventId")) + object.eventId = message.eventId; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + object.principalEmail = message.principalEmail; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.google.cloud.securitycenter.v2.DataFlowEvent.Operation[message.operation] === undefined ? message.operation : $root.google.cloud.securitycenter.v2.DataFlowEvent.Operation[message.operation] : message.operation; + if (message.violatedLocation != null && message.hasOwnProperty("violatedLocation")) + object.violatedLocation = message.violatedLocation; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + return object; + }; + + /** + * Converts this DataFlowEvent to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @instance + * @returns {Object.} JSON object + */ + DataFlowEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataFlowEvent + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.DataFlowEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataFlowEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.DataFlowEvent"; + }; + + /** + * Operation enum. + * @name google.cloud.securitycenter.v2.DataFlowEvent.Operation + * @enum {number} + * @property {number} OPERATION_UNSPECIFIED=0 OPERATION_UNSPECIFIED value + * @property {number} READ=1 READ value + * @property {number} MOVE=2 MOVE value + * @property {number} COPY=3 COPY value + */ + DataFlowEvent.Operation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ"] = 1; + values[valuesById[2] = "MOVE"] = 2; + values[valuesById[3] = "COPY"] = 3; + return values; + })(); + + return DataFlowEvent; + })(); + + v2.DataRetentionDeletionEvent = (function() { + + /** + * Properties of a DataRetentionDeletionEvent. + * @memberof google.cloud.securitycenter.v2 + * @interface IDataRetentionDeletionEvent + * @property {google.protobuf.ITimestamp|null} [eventDetectionTime] DataRetentionDeletionEvent eventDetectionTime + * @property {number|Long|null} [dataObjectCount] DataRetentionDeletionEvent dataObjectCount + * @property {google.protobuf.IDuration|null} [maxRetentionAllowed] DataRetentionDeletionEvent maxRetentionAllowed + * @property {google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType|null} [eventType] DataRetentionDeletionEvent eventType + */ + + /** + * Constructs a new DataRetentionDeletionEvent. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a DataRetentionDeletionEvent. + * @implements IDataRetentionDeletionEvent + * @constructor + * @param {google.cloud.securitycenter.v2.IDataRetentionDeletionEvent=} [properties] Properties to set + */ + function DataRetentionDeletionEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataRetentionDeletionEvent eventDetectionTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventDetectionTime + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @instance + */ + DataRetentionDeletionEvent.prototype.eventDetectionTime = null; + + /** + * DataRetentionDeletionEvent dataObjectCount. + * @member {number|Long} dataObjectCount + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @instance + */ + DataRetentionDeletionEvent.prototype.dataObjectCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataRetentionDeletionEvent maxRetentionAllowed. + * @member {google.protobuf.IDuration|null|undefined} maxRetentionAllowed + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @instance + */ + DataRetentionDeletionEvent.prototype.maxRetentionAllowed = null; + + /** + * DataRetentionDeletionEvent eventType. + * @member {google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType} eventType + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @instance + */ + DataRetentionDeletionEvent.prototype.eventType = 0; + + /** + * Creates a new DataRetentionDeletionEvent instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataRetentionDeletionEvent=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} DataRetentionDeletionEvent instance + */ + DataRetentionDeletionEvent.create = function create(properties) { + return new DataRetentionDeletionEvent(properties); + }; + + /** + * Encodes the specified DataRetentionDeletionEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataRetentionDeletionEvent} message DataRetentionDeletionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataRetentionDeletionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventDetectionTime != null && Object.hasOwnProperty.call(message, "eventDetectionTime")) + $root.google.protobuf.Timestamp.encode(message.eventDetectionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dataObjectCount != null && Object.hasOwnProperty.call(message, "dataObjectCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.dataObjectCount); + if (message.maxRetentionAllowed != null && Object.hasOwnProperty.call(message, "maxRetentionAllowed")) + $root.google.protobuf.Duration.encode(message.maxRetentionAllowed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.eventType); + return writer; + }; + + /** + * Encodes the specified DataRetentionDeletionEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {google.cloud.securitycenter.v2.IDataRetentionDeletionEvent} message DataRetentionDeletionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataRetentionDeletionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataRetentionDeletionEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} DataRetentionDeletionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataRetentionDeletionEvent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.eventDetectionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dataObjectCount = reader.int64(); + break; + } + case 4: { + message.maxRetentionAllowed = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.eventType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataRetentionDeletionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} DataRetentionDeletionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataRetentionDeletionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataRetentionDeletionEvent message. + * @function verify + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataRetentionDeletionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventDetectionTime != null && message.hasOwnProperty("eventDetectionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventDetectionTime); + if (error) + return "eventDetectionTime." + error; + } + if (message.dataObjectCount != null && message.hasOwnProperty("dataObjectCount")) + if (!$util.isInteger(message.dataObjectCount) && !(message.dataObjectCount && $util.isInteger(message.dataObjectCount.low) && $util.isInteger(message.dataObjectCount.high))) + return "dataObjectCount: integer|Long expected"; + if (message.maxRetentionAllowed != null && message.hasOwnProperty("maxRetentionAllowed")) { + var error = $root.google.protobuf.Duration.verify(message.maxRetentionAllowed); + if (error) + return "maxRetentionAllowed." + error; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a DataRetentionDeletionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} DataRetentionDeletionEvent + */ + DataRetentionDeletionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent) + return object; + var message = new $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent(); + if (object.eventDetectionTime != null) { + if (typeof object.eventDetectionTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.eventDetectionTime: object expected"); + message.eventDetectionTime = $root.google.protobuf.Timestamp.fromObject(object.eventDetectionTime); + } + if (object.dataObjectCount != null) + if ($util.Long) + (message.dataObjectCount = $util.Long.fromValue(object.dataObjectCount)).unsigned = false; + else if (typeof object.dataObjectCount === "string") + message.dataObjectCount = parseInt(object.dataObjectCount, 10); + else if (typeof object.dataObjectCount === "number") + message.dataObjectCount = object.dataObjectCount; + else if (typeof object.dataObjectCount === "object") + message.dataObjectCount = new $util.LongBits(object.dataObjectCount.low >>> 0, object.dataObjectCount.high >>> 0).toNumber(); + if (object.maxRetentionAllowed != null) { + if (typeof object.maxRetentionAllowed !== "object") + throw TypeError(".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.maxRetentionAllowed: object expected"); + message.maxRetentionAllowed = $root.google.protobuf.Duration.fromObject(object.maxRetentionAllowed); + } + switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.eventType = 0; + break; + case "EVENT_TYPE_MAX_TTL_EXCEEDED": + case 1: + message.eventType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataRetentionDeletionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} message DataRetentionDeletionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataRetentionDeletionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventDetectionTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.dataObjectCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataObjectCount = options.longs === String ? "0" : 0; + object.maxRetentionAllowed = null; + object.eventType = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; + } + if (message.eventDetectionTime != null && message.hasOwnProperty("eventDetectionTime")) + object.eventDetectionTime = $root.google.protobuf.Timestamp.toObject(message.eventDetectionTime, options); + if (message.dataObjectCount != null && message.hasOwnProperty("dataObjectCount")) + if (typeof message.dataObjectCount === "number") + object.dataObjectCount = options.longs === String ? String(message.dataObjectCount) : message.dataObjectCount; + else + object.dataObjectCount = options.longs === String ? $util.Long.prototype.toString.call(message.dataObjectCount) : options.longs === Number ? new $util.LongBits(message.dataObjectCount.low >>> 0, message.dataObjectCount.high >>> 0).toNumber() : message.dataObjectCount; + if (message.maxRetentionAllowed != null && message.hasOwnProperty("maxRetentionAllowed")) + object.maxRetentionAllowed = $root.google.protobuf.Duration.toObject(message.maxRetentionAllowed, options); + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType[message.eventType] === undefined ? message.eventType : $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType[message.eventType] : message.eventType; + return object; + }; + + /** + * Converts this DataRetentionDeletionEvent to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @instance + * @returns {Object.} JSON object + */ + DataRetentionDeletionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataRetentionDeletionEvent + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataRetentionDeletionEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.DataRetentionDeletionEvent"; + }; + + /** + * EventType enum. + * @name google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} EVENT_TYPE_MAX_TTL_EXCEEDED=1 EVENT_TYPE_MAX_TTL_EXCEEDED value + */ + DataRetentionDeletionEvent.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EVENT_TYPE_MAX_TTL_EXCEEDED"] = 1; + return values; + })(); + + return DataRetentionDeletionEvent; + })(); + + v2.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.cloud.securitycenter.v2 + * @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 + * @property {string|null} [version] Database version + */ + + /** + * Constructs a new Database. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.Database + * @instance + */ + Database.prototype.displayName = ""; + + /** + * Database userName. + * @member {string} userName + * @memberof google.cloud.securitycenter.v2.Database + * @instance + */ + Database.prototype.userName = ""; + + /** + * Database query. + * @member {string} query + * @memberof google.cloud.securitycenter.v2.Database + * @instance + */ + Database.prototype.query = ""; + + /** + * Database grantees. + * @member {Array.} grantees + * @memberof google.cloud.securitycenter.v2.Database + * @instance + */ + Database.prototype.grantees = $util.emptyArray; + + /** + * Database version. + * @member {string} version + * @memberof google.cloud.securitycenter.v2.Database + * @instance + */ + Database.prototype.version = ""; + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Database + * @static + * @param {google.cloud.securitycenter.v2.IDatabase=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v2.Database.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Database + * @static + * @param {google.cloud.securitycenter.v2.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]); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.version); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Database + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Database(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + case 6: { + message.version = 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.v2.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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"; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: 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.v2.Database + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Database) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Database.grantees: array expected"); + message.grantees = []; + for (var i = 0; i < object.grantees.length; ++i) + message.grantees[i] = String(object.grantees[i]); + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Database + * @static + * @param {google.cloud.securitycenter.v2.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 = ""; + object.version = ""; + } + 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]; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.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.v2.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.v2.Database"; + }; + + return Database; + })(); + + v2.Disk = (function() { + + /** + * Properties of a Disk. + * @memberof google.cloud.securitycenter.v2 + * @interface IDisk + * @property {string|null} [name] Disk name + */ + + /** + * Constructs a new Disk. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Disk. + * @implements IDisk + * @constructor + * @param {google.cloud.securitycenter.v2.IDisk=} [properties] Properties to set + */ + function Disk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Disk name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Disk + * @instance + */ + Disk.prototype.name = ""; + + /** + * Creates a new Disk instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {google.cloud.securitycenter.v2.IDisk=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Disk} Disk instance + */ + Disk.create = function create(properties) { + return new Disk(properties); + }; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.securitycenter.v2.Disk.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {google.cloud.securitycenter.v2.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.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 Disk message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Disk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {google.cloud.securitycenter.v2.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Disk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Disk message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Disk.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 Disk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Disk} Disk + */ + Disk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Disk) + return object; + var message = new $root.google.cloud.securitycenter.v2.Disk(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {google.cloud.securitycenter.v2.Disk} message Disk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Disk.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 Disk to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Disk + * @instance + * @returns {Object.} JSON object + */ + Disk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Disk + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Disk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Disk"; + }; + + return Disk; + })(); + + v2.Exfiltration = (function() { + + /** + * Properties of an Exfiltration. + * @memberof google.cloud.securitycenter.v2 + * @interface IExfiltration + * @property {Array.|null} [sources] Exfiltration sources + * @property {Array.|null} [targets] Exfiltration targets + * @property {number|Long|null} [totalExfiltratedBytes] Exfiltration totalExfiltratedBytes + */ + + /** + * Constructs a new Exfiltration. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an Exfiltration. + * @implements IExfiltration + * @constructor + * @param {google.cloud.securitycenter.v2.IExfiltration=} [properties] Properties to set + */ + 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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Exfiltration sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @instance + */ + Exfiltration.prototype.sources = $util.emptyArray; + + /** + * Exfiltration targets. + * @member {Array.} targets + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @instance + */ + Exfiltration.prototype.targets = $util.emptyArray; + + /** + * Exfiltration totalExfiltratedBytes. + * @member {number|Long} totalExfiltratedBytes + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @instance + */ + Exfiltration.prototype.totalExfiltratedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Exfiltration instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @static + * @param {google.cloud.securitycenter.v2.IExfiltration=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Exfiltration} Exfiltration instance + */ + Exfiltration.create = function create(properties) { + return new Exfiltration(properties); + }; + + /** + * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v2.Exfiltration.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @static + * @param {google.cloud.securitycenter.v2.IExfiltration} message Exfiltration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exfiltration.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.v2.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.v2.ExfilResource.encode(message.targets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalExfiltratedBytes != null && Object.hasOwnProperty.call(message, "totalExfiltratedBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalExfiltratedBytes); + return writer; + }; + + /** + * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Exfiltration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @static + * @param {google.cloud.securitycenter.v2.IExfiltration} message Exfiltration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exfiltration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Exfiltration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.Exfiltration} Exfiltration + * @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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Exfiltration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v2.ExfilResource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.targets && message.targets.length)) + message.targets = []; + message.targets.push($root.google.cloud.securitycenter.v2.ExfilResource.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalExfiltratedBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Exfiltration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Exfiltration} Exfiltration + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Exfiltration message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @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) { + 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.v2.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.v2.ExfilResource.verify(message.targets[i]); + if (error) + return "targets." + error; + } + } + if (message.totalExfiltratedBytes != null && message.hasOwnProperty("totalExfiltratedBytes")) + if (!$util.isInteger(message.totalExfiltratedBytes) && !(message.totalExfiltratedBytes && $util.isInteger(message.totalExfiltratedBytes.low) && $util.isInteger(message.totalExfiltratedBytes.high))) + return "totalExfiltratedBytes: integer|Long expected"; + return null; + }; + + /** + * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Exfiltration} Exfiltration + */ + Exfiltration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Exfiltration) + return object; + var message = new $root.google.cloud.securitycenter.v2.Exfiltration(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Exfiltration.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v2.ExfilResource.fromObject(object.sources[i]); + } + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Exfiltration.targets: object expected"); + message.targets[i] = $root.google.cloud.securitycenter.v2.ExfilResource.fromObject(object.targets[i]); + } + } + if (object.totalExfiltratedBytes != null) + if ($util.Long) + (message.totalExfiltratedBytes = $util.Long.fromValue(object.totalExfiltratedBytes)).unsigned = false; + else if (typeof object.totalExfiltratedBytes === "string") + message.totalExfiltratedBytes = parseInt(object.totalExfiltratedBytes, 10); + else if (typeof object.totalExfiltratedBytes === "number") + message.totalExfiltratedBytes = object.totalExfiltratedBytes; + else if (typeof object.totalExfiltratedBytes === "object") + message.totalExfiltratedBytes = new $util.LongBits(object.totalExfiltratedBytes.low >>> 0, object.totalExfiltratedBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @static + * @param {google.cloud.securitycenter.v2.Exfiltration} message Exfiltration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exfiltration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.targets = []; + } + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalExfiltratedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalExfiltratedBytes = options.longs === String ? "0" : 0; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v2.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.v2.ExfilResource.toObject(message.targets[j], options); + } + if (message.totalExfiltratedBytes != null && message.hasOwnProperty("totalExfiltratedBytes")) + if (typeof message.totalExfiltratedBytes === "number") + object.totalExfiltratedBytes = options.longs === String ? String(message.totalExfiltratedBytes) : message.totalExfiltratedBytes; + else + object.totalExfiltratedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalExfiltratedBytes) : options.longs === Number ? new $util.LongBits(message.totalExfiltratedBytes.low >>> 0, message.totalExfiltratedBytes.high >>> 0).toNumber() : message.totalExfiltratedBytes; + return object; + }; + + /** + * Converts this Exfiltration to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Exfiltration + * @instance + * @returns {Object.} JSON object + */ + Exfiltration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Exfiltration + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Exfiltration"; + }; + + return Exfiltration; + })(); + + v2.ExfilResource = (function() { + + /** + * Properties of an ExfilResource. + * @memberof google.cloud.securitycenter.v2 + * @interface IExfilResource + * @property {string|null} [name] ExfilResource name + * @property {Array.|null} [components] ExfilResource components + */ + + /** + * Constructs a new ExfilResource. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an ExfilResource. + * @implements IExfilResource + * @constructor + * @param {google.cloud.securitycenter.v2.IExfilResource=} [properties] Properties to set + */ + function ExfilResource(properties) { + this.components = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExfilResource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @instance + */ + ExfilResource.prototype.name = ""; + + /** + * ExfilResource components. + * @member {Array.} components + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @instance + */ + ExfilResource.prototype.components = $util.emptyArray; + + /** + * Creates a new ExfilResource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @static + * @param {google.cloud.securitycenter.v2.IExfilResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ExfilResource} ExfilResource instance + */ + ExfilResource.create = function create(properties) { + return new ExfilResource(properties); + }; + + /** + * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v2.ExfilResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @static + * @param {google.cloud.securitycenter.v2.IExfilResource} message ExfilResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + 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; + }; + + /** + * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExfilResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @static + * @param {google.cloud.securitycenter.v2.IExfilResource} message ExfilResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExfilResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExfilResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.ExfilResource} ExfilResource + * @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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExfilResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + }; + + /** + * Decodes an ExfilResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ExfilResource} ExfilResource + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExfilResource message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @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) { + 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; + }; + + /** + * Creates an ExfilResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ExfilResource} ExfilResource + */ + ExfilResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ExfilResource) + return object; + var message = new $root.google.cloud.securitycenter.v2.ExfilResource(); + if (object.name != null) + message.name = String(object.name); + if (object.components) { + if (!Array.isArray(object.components)) + throw TypeError(".google.cloud.securitycenter.v2.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 an ExfilResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @static + * @param {google.cloud.securitycenter.v2.ExfilResource} message ExfilResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + 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; + }; + + /** + * Converts this ExfilResource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ExfilResource + * @instance + * @returns {Object.} JSON object + */ + ExfilResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExfilResource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ExfilResource"; + }; + + return ExfilResource; + })(); + + v2.ExternalSystem = (function() { + + /** + * Properties of an ExternalSystem. + * @memberof google.cloud.securitycenter.v2 + * @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 + * @property {string|null} [caseUri] ExternalSystem caseUri + * @property {string|null} [casePriority] ExternalSystem casePriority + * @property {google.protobuf.ITimestamp|null} [caseSla] ExternalSystem caseSla + * @property {google.protobuf.ITimestamp|null} [caseCreateTime] ExternalSystem caseCreateTime + * @property {google.protobuf.ITimestamp|null} [caseCloseTime] ExternalSystem caseCloseTime + * @property {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo|null} [ticketInfo] ExternalSystem ticketInfo + */ + + /** + * Constructs a new ExternalSystem. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an ExternalSystem. + * @implements IExternalSystem + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.name = ""; + + /** + * ExternalSystem assignees. + * @member {Array.} assignees + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.assignees = $util.emptyArray; + + /** + * ExternalSystem externalUid. + * @member {string} externalUid + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.externalUid = ""; + + /** + * ExternalSystem status. + * @member {string} status + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.status = ""; + + /** + * ExternalSystem externalSystemUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} externalSystemUpdateTime + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.externalSystemUpdateTime = null; + + /** + * ExternalSystem caseUri. + * @member {string} caseUri + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.caseUri = ""; + + /** + * ExternalSystem casePriority. + * @member {string} casePriority + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.casePriority = ""; + + /** + * ExternalSystem caseSla. + * @member {google.protobuf.ITimestamp|null|undefined} caseSla + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.caseSla = null; + + /** + * ExternalSystem caseCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} caseCreateTime + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.caseCreateTime = null; + + /** + * ExternalSystem caseCloseTime. + * @member {google.protobuf.ITimestamp|null|undefined} caseCloseTime + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.caseCloseTime = null; + + /** + * ExternalSystem ticketInfo. + * @member {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo|null|undefined} ticketInfo + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + */ + ExternalSystem.prototype.ticketInfo = null; + + /** + * Creates a new ExternalSystem instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v2.IExternalSystem=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ExternalSystem} ExternalSystem instance + */ + ExternalSystem.create = function create(properties) { + return new ExternalSystem(properties); + }; + + /** + * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v2.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(); + if (message.caseUri != null && Object.hasOwnProperty.call(message, "caseUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.caseUri); + if (message.casePriority != null && Object.hasOwnProperty.call(message, "casePriority")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.casePriority); + if (message.ticketInfo != null && Object.hasOwnProperty.call(message, "ticketInfo")) + $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.encode(message.ticketInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.caseSla != null && Object.hasOwnProperty.call(message, "caseSla")) + $root.google.protobuf.Timestamp.encode(message.caseSla, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.caseCreateTime != null && Object.hasOwnProperty.call(message, "caseCreateTime")) + $root.google.protobuf.Timestamp.encode(message.caseCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.caseCloseTime != null && Object.hasOwnProperty.call(message, "caseCloseTime")) + $root.google.protobuf.Timestamp.encode(message.caseCloseTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExternalSystem(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 6: { + message.caseUri = reader.string(); + break; + } + case 7: { + message.casePriority = reader.string(); + break; + } + case 9: { + message.caseSla = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.caseCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.caseCloseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.ticketInfo = $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.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.v2.ExternalSystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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; + } + if (message.caseUri != null && message.hasOwnProperty("caseUri")) + if (!$util.isString(message.caseUri)) + return "caseUri: string expected"; + if (message.casePriority != null && message.hasOwnProperty("casePriority")) + if (!$util.isString(message.casePriority)) + return "casePriority: string expected"; + if (message.caseSla != null && message.hasOwnProperty("caseSla")) { + var error = $root.google.protobuf.Timestamp.verify(message.caseSla); + if (error) + return "caseSla." + error; + } + if (message.caseCreateTime != null && message.hasOwnProperty("caseCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.caseCreateTime); + if (error) + return "caseCreateTime." + error; + } + if (message.caseCloseTime != null && message.hasOwnProperty("caseCloseTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.caseCloseTime); + if (error) + return "caseCloseTime." + error; + } + if (message.ticketInfo != null && message.hasOwnProperty("ticketInfo")) { + var error = $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify(message.ticketInfo); + if (error) + return "ticketInfo." + 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.v2.ExternalSystem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ExternalSystem} ExternalSystem + */ + ExternalSystem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ExternalSystem) + return object; + var message = new $root.google.cloud.securitycenter.v2.ExternalSystem(); + if (object.name != null) + message.name = String(object.name); + if (object.assignees) { + if (!Array.isArray(object.assignees)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.ExternalSystem.externalSystemUpdateTime: object expected"); + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.externalSystemUpdateTime); + } + if (object.caseUri != null) + message.caseUri = String(object.caseUri); + if (object.casePriority != null) + message.casePriority = String(object.casePriority); + if (object.caseSla != null) { + if (typeof object.caseSla !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.caseSla: object expected"); + message.caseSla = $root.google.protobuf.Timestamp.fromObject(object.caseSla); + } + if (object.caseCreateTime != null) { + if (typeof object.caseCreateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.caseCreateTime: object expected"); + message.caseCreateTime = $root.google.protobuf.Timestamp.fromObject(object.caseCreateTime); + } + if (object.caseCloseTime != null) { + if (typeof object.caseCloseTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.caseCloseTime: object expected"); + message.caseCloseTime = $root.google.protobuf.Timestamp.fromObject(object.caseCloseTime); + } + if (object.ticketInfo != null) { + if (typeof object.ticketInfo !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.ticketInfo: object expected"); + message.ticketInfo = $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.fromObject(object.ticketInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v2.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; + object.caseUri = ""; + object.casePriority = ""; + object.ticketInfo = null; + object.caseSla = null; + object.caseCreateTime = null; + object.caseCloseTime = 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); + if (message.caseUri != null && message.hasOwnProperty("caseUri")) + object.caseUri = message.caseUri; + if (message.casePriority != null && message.hasOwnProperty("casePriority")) + object.casePriority = message.casePriority; + if (message.ticketInfo != null && message.hasOwnProperty("ticketInfo")) + object.ticketInfo = $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.toObject(message.ticketInfo, options); + if (message.caseSla != null && message.hasOwnProperty("caseSla")) + object.caseSla = $root.google.protobuf.Timestamp.toObject(message.caseSla, options); + if (message.caseCreateTime != null && message.hasOwnProperty("caseCreateTime")) + object.caseCreateTime = $root.google.protobuf.Timestamp.toObject(message.caseCreateTime, options); + if (message.caseCloseTime != null && message.hasOwnProperty("caseCloseTime")) + object.caseCloseTime = $root.google.protobuf.Timestamp.toObject(message.caseCloseTime, options); + return object; + }; + + /** + * Converts this ExternalSystem to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @instance + * @returns {Object.} JSON object + */ + ExternalSystem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalSystem + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ExternalSystem"; + }; + + ExternalSystem.TicketInfo = (function() { + + /** + * Properties of a TicketInfo. + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @interface ITicketInfo + * @property {string|null} [id] TicketInfo id + * @property {string|null} [assignee] TicketInfo assignee + * @property {string|null} [description] TicketInfo description + * @property {string|null} [uri] TicketInfo uri + * @property {string|null} [status] TicketInfo status + * @property {google.protobuf.ITimestamp|null} [updateTime] TicketInfo updateTime + */ + + /** + * Constructs a new TicketInfo. + * @memberof google.cloud.securitycenter.v2.ExternalSystem + * @classdesc Represents a TicketInfo. + * @implements ITicketInfo + * @constructor + * @param {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo=} [properties] Properties to set + */ + function TicketInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TicketInfo id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.id = ""; + + /** + * TicketInfo assignee. + * @member {string} assignee + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.assignee = ""; + + /** + * TicketInfo description. + * @member {string} description + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.description = ""; + + /** + * TicketInfo uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.uri = ""; + + /** + * TicketInfo status. + * @member {string} status + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.status = ""; + + /** + * TicketInfo updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @instance + */ + TicketInfo.prototype.updateTime = null; + + /** + * Creates a new TicketInfo instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} TicketInfo instance + */ + TicketInfo.create = function create(properties) { + return new TicketInfo(properties); + }; + + /** + * Encodes the specified TicketInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo} message TicketInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TicketInfo.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.assignee != null && Object.hasOwnProperty.call(message, "assignee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignee); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.status); + 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(); + return writer; + }; + + /** + * Encodes the specified TicketInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo} message TicketInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TicketInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TicketInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} TicketInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TicketInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.assignee = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.uri = reader.string(); + break; + } + case 5: { + message.status = reader.string(); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TicketInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} TicketInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TicketInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TicketInfo message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TicketInfo.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.assignee != null && message.hasOwnProperty("assignee")) + if (!$util.isString(message.assignee)) + return "assignee: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a TicketInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} TicketInfo + */ + TicketInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo) + return object; + var message = new $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo(); + if (object.id != null) + message.id = String(object.id); + if (object.assignee != null) + message.assignee = String(object.assignee); + if (object.description != null) + message.description = String(object.description); + if (object.uri != null) + message.uri = String(object.uri); + if (object.status != null) + message.status = String(object.status); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a TicketInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} message TicketInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TicketInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.assignee = ""; + object.description = ""; + object.uri = ""; + object.status = ""; + object.updateTime = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.assignee != null && message.hasOwnProperty("assignee")) + object.assignee = message.assignee; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this TicketInfo to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @instance + * @returns {Object.} JSON object + */ + TicketInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TicketInfo + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TicketInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ExternalSystem.TicketInfo"; + }; + + return TicketInfo; + })(); + + return ExternalSystem; + })(); + + v2.File = (function() { + + /** + * Properties of a File. + * @memberof google.cloud.securitycenter.v2 + * @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 + * @property {google.cloud.securitycenter.v2.File.IDiskPath|null} [diskPath] File diskPath + * @property {Array.|null} [operations] File operations + */ + + /** + * Constructs a new File. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a File. + * @implements IFile + * @constructor + * @param {google.cloud.securitycenter.v2.IFile=} [properties] Properties to set + */ + function File(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]]; + } + + /** + * File path. + * @member {string} path + * @memberof google.cloud.securitycenter.v2.File + * @instance + */ + File.prototype.path = ""; + + /** + * File size. + * @member {number|Long} size + * @memberof google.cloud.securitycenter.v2.File + * @instance + */ + File.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * File sha256. + * @member {string} sha256 + * @memberof google.cloud.securitycenter.v2.File + * @instance + */ + File.prototype.sha256 = ""; + + /** + * File hashedSize. + * @member {number|Long} hashedSize + * @memberof google.cloud.securitycenter.v2.File + * @instance + */ + File.prototype.hashedSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * File partiallyHashed. + * @member {boolean} partiallyHashed + * @memberof google.cloud.securitycenter.v2.File + * @instance + */ + File.prototype.partiallyHashed = false; + + /** + * File contents. + * @member {string} contents + * @memberof google.cloud.securitycenter.v2.File + * @instance + */ + File.prototype.contents = ""; + + /** + * File diskPath. + * @member {google.cloud.securitycenter.v2.File.IDiskPath|null|undefined} diskPath + * @memberof google.cloud.securitycenter.v2.File + * @instance + */ + File.prototype.diskPath = null; + + /** + * File operations. + * @member {Array.} operations + * @memberof google.cloud.securitycenter.v2.File + * @instance + */ + File.prototype.operations = $util.emptyArray; + + /** + * Creates a new File instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.File + * @static + * @param {google.cloud.securitycenter.v2.IFile=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.File} File instance + */ + File.create = function create(properties) { + return new File(properties); + }; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v2.File.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.File + * @static + * @param {google.cloud.securitycenter.v2.IFile} message File message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + File.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.diskPath != null && Object.hasOwnProperty.call(message, "diskPath")) + $root.google.cloud.securitycenter.v2.File.DiskPath.encode(message.diskPath, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.cloud.securitycenter.v2.File.FileOperation.encode(message.operations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.File + * @static + * @param {google.cloud.securitycenter.v2.IFile} message File message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + File.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a File message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.File} File + * @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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.File(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 7: { + message.diskPath = $root.google.cloud.securitycenter.v2.File.DiskPath.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.cloud.securitycenter.v2.File.FileOperation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a File message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.File} File + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a File message. + * @function verify + * @memberof google.cloud.securitycenter.v2.File + * @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) { + 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.diskPath != null && message.hasOwnProperty("diskPath")) { + var error = $root.google.cloud.securitycenter.v2.File.DiskPath.verify(message.diskPath); + if (error) + return "diskPath." + error; + } + 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.cloud.securitycenter.v2.File.FileOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + return null; + }; + + /** + * Creates a File message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.File + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.File} File + */ + File.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.File) + return object; + var message = new $root.google.cloud.securitycenter.v2.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); + if (object.diskPath != null) { + if (typeof object.diskPath !== "object") + throw TypeError(".google.cloud.securitycenter.v2.File.diskPath: object expected"); + message.diskPath = $root.google.cloud.securitycenter.v2.File.DiskPath.fromObject(object.diskPath); + } + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.cloud.securitycenter.v2.File.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.File.operations: object expected"); + message.operations[i] = $root.google.cloud.securitycenter.v2.File.FileOperation.fromObject(object.operations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.File + * @static + * @param {google.cloud.securitycenter.v2.File} message File + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + File.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + 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 = ""; + object.diskPath = null; + } + 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; + if (message.diskPath != null && message.hasOwnProperty("diskPath")) + object.diskPath = $root.google.cloud.securitycenter.v2.File.DiskPath.toObject(message.diskPath, options); + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.cloud.securitycenter.v2.File.FileOperation.toObject(message.operations[j], options); + } + return object; + }; + + /** + * Converts this File to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.File + * @instance + * @returns {Object.} JSON object + */ + File.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for File + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.File"; + }; + + File.DiskPath = (function() { + + /** + * Properties of a DiskPath. + * @memberof google.cloud.securitycenter.v2.File + * @interface IDiskPath + * @property {string|null} [partitionUuid] DiskPath partitionUuid + * @property {string|null} [relativePath] DiskPath relativePath + */ + + /** + * Constructs a new DiskPath. + * @memberof google.cloud.securitycenter.v2.File + * @classdesc Represents a DiskPath. + * @implements IDiskPath + * @constructor + * @param {google.cloud.securitycenter.v2.File.IDiskPath=} [properties] Properties to set + */ + function DiskPath(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskPath partitionUuid. + * @member {string} partitionUuid + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @instance + */ + DiskPath.prototype.partitionUuid = ""; + + /** + * DiskPath relativePath. + * @member {string} relativePath + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @instance + */ + DiskPath.prototype.relativePath = ""; + + /** + * Creates a new DiskPath instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {google.cloud.securitycenter.v2.File.IDiskPath=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.File.DiskPath} DiskPath instance + */ + DiskPath.create = function create(properties) { + return new DiskPath(properties); + }; + + /** + * Encodes the specified DiskPath message. Does not implicitly {@link google.cloud.securitycenter.v2.File.DiskPath.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {google.cloud.securitycenter.v2.File.IDiskPath} message DiskPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskPath.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionUuid != null && Object.hasOwnProperty.call(message, "partitionUuid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.partitionUuid); + if (message.relativePath != null && Object.hasOwnProperty.call(message, "relativePath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.relativePath); + return writer; + }; + + /** + * Encodes the specified DiskPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.DiskPath.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {google.cloud.securitycenter.v2.File.IDiskPath} message DiskPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskPath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskPath message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.File.DiskPath} DiskPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskPath.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.File.DiskPath(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partitionUuid = reader.string(); + break; + } + case 2: { + message.relativePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskPath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.File.DiskPath} DiskPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskPath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskPath message. + * @function verify + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskPath.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionUuid != null && message.hasOwnProperty("partitionUuid")) + if (!$util.isString(message.partitionUuid)) + return "partitionUuid: string expected"; + if (message.relativePath != null && message.hasOwnProperty("relativePath")) + if (!$util.isString(message.relativePath)) + return "relativePath: string expected"; + return null; + }; + + /** + * Creates a DiskPath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.File.DiskPath} DiskPath + */ + DiskPath.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.File.DiskPath) + return object; + var message = new $root.google.cloud.securitycenter.v2.File.DiskPath(); + if (object.partitionUuid != null) + message.partitionUuid = String(object.partitionUuid); + if (object.relativePath != null) + message.relativePath = String(object.relativePath); + return message; + }; + + /** + * Creates a plain object from a DiskPath message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {google.cloud.securitycenter.v2.File.DiskPath} message DiskPath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskPath.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.partitionUuid = ""; + object.relativePath = ""; + } + if (message.partitionUuid != null && message.hasOwnProperty("partitionUuid")) + object.partitionUuid = message.partitionUuid; + if (message.relativePath != null && message.hasOwnProperty("relativePath")) + object.relativePath = message.relativePath; + return object; + }; + + /** + * Converts this DiskPath to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @instance + * @returns {Object.} JSON object + */ + DiskPath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiskPath + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.File.DiskPath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiskPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.File.DiskPath"; + }; + + return DiskPath; + })(); + + File.FileOperation = (function() { + + /** + * Properties of a FileOperation. + * @memberof google.cloud.securitycenter.v2.File + * @interface IFileOperation + * @property {google.cloud.securitycenter.v2.File.FileOperation.OperationType|null} [type] FileOperation type + */ + + /** + * Constructs a new FileOperation. + * @memberof google.cloud.securitycenter.v2.File + * @classdesc Represents a FileOperation. + * @implements IFileOperation + * @constructor + * @param {google.cloud.securitycenter.v2.File.IFileOperation=} [properties] Properties to set + */ + function FileOperation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOperation type. + * @member {google.cloud.securitycenter.v2.File.FileOperation.OperationType} type + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @instance + */ + FileOperation.prototype.type = 0; + + /** + * Creates a new FileOperation instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {google.cloud.securitycenter.v2.File.IFileOperation=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.File.FileOperation} FileOperation instance + */ + FileOperation.create = function create(properties) { + return new FileOperation(properties); + }; + + /** + * Encodes the specified FileOperation message. Does not implicitly {@link google.cloud.securitycenter.v2.File.FileOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {google.cloud.securitycenter.v2.File.IFileOperation} message FileOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + return writer; + }; + + /** + * Encodes the specified FileOperation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.FileOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {google.cloud.securitycenter.v2.File.IFileOperation} message FileOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.File.FileOperation} FileOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOperation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.File.FileOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.File.FileOperation} FileOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOperation message. + * @function verify + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FileOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.File.FileOperation} FileOperation + */ + FileOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.File.FileOperation) + return object; + var message = new $root.google.cloud.securitycenter.v2.File.FileOperation(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "OPEN": + case 1: + message.type = 1; + break; + case "READ": + case 2: + message.type = 2; + break; + case "RENAME": + case 3: + message.type = 3; + break; + case "WRITE": + case 4: + message.type = 4; + break; + case "EXECUTE": + case 5: + message.type = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {google.cloud.securitycenter.v2.File.FileOperation} message FileOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.securitycenter.v2.File.FileOperation.OperationType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v2.File.FileOperation.OperationType[message.type] : message.type; + return object; + }; + + /** + * Converts this FileOperation to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @instance + * @returns {Object.} JSON object + */ + FileOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOperation + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.File.FileOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.File.FileOperation"; + }; + + /** + * OperationType enum. + * @name google.cloud.securitycenter.v2.File.FileOperation.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} OPEN=1 OPEN value + * @property {number} READ=2 READ value + * @property {number} RENAME=3 RENAME value + * @property {number} WRITE=4 WRITE value + * @property {number} EXECUTE=5 EXECUTE value + */ + FileOperation.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "READ"] = 2; + values[valuesById[3] = "RENAME"] = 3; + values[valuesById[4] = "WRITE"] = 4; + values[valuesById[5] = "EXECUTE"] = 5; + return values; + })(); + + return FileOperation; + })(); + + return File; + })(); + + v2.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v2 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [canonicalName] Finding canonicalName + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v2.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.v2.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.v2.Finding.Severity|null} [severity] Finding severity + * @property {google.cloud.securitycenter.v2.Finding.Mute|null} [mute] Finding mute + * @property {google.cloud.securitycenter.v2.Finding.IMuteInfo|null} [muteInfo] Finding muteInfo + * @property {google.cloud.securitycenter.v2.Finding.FindingClass|null} [findingClass] Finding findingClass + * @property {google.cloud.securitycenter.v2.IIndicator|null} [indicator] Finding indicator + * @property {google.cloud.securitycenter.v2.IVulnerability|null} [vulnerability] Finding vulnerability + * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime + * @property {Object.|null} [externalSystems] Finding externalSystems + * @property {google.cloud.securitycenter.v2.IMitreAttack|null} [mitreAttack] Finding mitreAttack + * @property {google.cloud.securitycenter.v2.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} [parentDisplayName] Finding parentDisplayName + * @property {string|null} [description] Finding description + * @property {google.cloud.securitycenter.v2.IExfiltration|null} [exfiltration] Finding exfiltration + * @property {Array.|null} [iamBindings] Finding iamBindings + * @property {string|null} [nextSteps] Finding nextSteps + * @property {string|null} [moduleName] Finding moduleName + * @property {Array.|null} [containers] Finding containers + * @property {google.cloud.securitycenter.v2.IKubernetes|null} [kubernetes] Finding kubernetes + * @property {google.cloud.securitycenter.v2.IDatabase|null} [database] Finding database + * @property {google.cloud.securitycenter.v2.IAttackExposure|null} [attackExposure] Finding attackExposure + * @property {Array.|null} [files] Finding files + * @property {google.cloud.securitycenter.v2.ICloudDlpInspection|null} [cloudDlpInspection] Finding cloudDlpInspection + * @property {google.cloud.securitycenter.v2.ICloudDlpDataProfile|null} [cloudDlpDataProfile] Finding cloudDlpDataProfile + * @property {google.cloud.securitycenter.v2.IKernelRootkit|null} [kernelRootkit] Finding kernelRootkit + * @property {Array.|null} [orgPolicies] Finding orgPolicies + * @property {google.cloud.securitycenter.v2.IJob|null} [job] Finding job + * @property {google.cloud.securitycenter.v2.IApplication|null} [application] Finding application + * @property {google.cloud.securitycenter.v2.IIpRules|null} [ipRules] Finding ipRules + * @property {google.cloud.securitycenter.v2.IBackupDisasterRecovery|null} [backupDisasterRecovery] Finding backupDisasterRecovery + * @property {google.cloud.securitycenter.v2.ISecurityPosture|null} [securityPosture] Finding securityPosture + * @property {Array.|null} [logEntries] Finding logEntries + * @property {Array.|null} [loadBalancers] Finding loadBalancers + * @property {google.cloud.securitycenter.v2.ICloudArmor|null} [cloudArmor] Finding cloudArmor + * @property {google.cloud.securitycenter.v2.INotebook|null} [notebook] Finding notebook + * @property {google.cloud.securitycenter.v2.IToxicCombination|null} [toxicCombination] Finding toxicCombination + * @property {Array.|null} [groupMemberships] Finding groupMemberships + * @property {google.cloud.securitycenter.v2.IDisk|null} [disk] Finding disk + * @property {Array.|null} [dataAccessEvents] Finding dataAccessEvents + * @property {Array.|null} [dataFlowEvents] Finding dataFlowEvents + * @property {Array.|null} [networks] Finding networks + * @property {Array.|null} [dataRetentionDeletionEvents] Finding dataRetentionDeletionEvents + * @property {google.cloud.securitycenter.v2.IAffectedResources|null} [affectedResources] Finding affectedResources + * @property {google.cloud.securitycenter.v2.IAiModel|null} [aiModel] Finding aiModel + * @property {google.cloud.securitycenter.v2.IChokepoint|null} [chokepoint] Finding chokepoint + * @property {google.cloud.securitycenter.v2.IVertexAi|null} [vertexAi] Finding vertexAi + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v2.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.sourceProperties = {}; + this.externalSystems = {}; + this.connections = []; + this.processes = []; + this.contacts = {}; + this.compliances = []; + this.iamBindings = []; + this.containers = []; + this.files = []; + this.orgPolicies = []; + this.logEntries = []; + this.loadBalancers = []; + this.groupMemberships = []; + this.dataAccessEvents = []; + this.dataFlowEvents = []; + this.networks = []; + this.dataRetentionDeletionEvents = []; + if (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.v2.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.canonicalName = ""; + + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.parent = ""; + + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding state. + * @member {google.cloud.securitycenter.v2.Finding.State} state + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v2.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Finding severity. + * @member {google.cloud.securitycenter.v2.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.severity = 0; + + /** + * Finding mute. + * @member {google.cloud.securitycenter.v2.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.mute = 0; + + /** + * Finding muteInfo. + * @member {google.cloud.securitycenter.v2.Finding.IMuteInfo|null|undefined} muteInfo + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.muteInfo = null; + + /** + * Finding findingClass. + * @member {google.cloud.securitycenter.v2.Finding.FindingClass} findingClass + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.findingClass = 0; + + /** + * Finding indicator. + * @member {google.cloud.securitycenter.v2.IIndicator|null|undefined} indicator + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.indicator = null; + + /** + * Finding vulnerability. + * @member {google.cloud.securitycenter.v2.IVulnerability|null|undefined} vulnerability + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.vulnerability = null; + + /** + * Finding muteUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.muteUpdateTime = null; + + /** + * Finding externalSystems. + * @member {Object.} externalSystems + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.externalSystems = $util.emptyObject; + + /** + * Finding mitreAttack. + * @member {google.cloud.securitycenter.v2.IMitreAttack|null|undefined} mitreAttack + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.mitreAttack = null; + + /** + * Finding access. + * @member {google.cloud.securitycenter.v2.IAccess|null|undefined} access + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.access = null; + + /** + * Finding connections. + * @member {Array.} connections + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.connections = $util.emptyArray; + + /** + * Finding muteInitiator. + * @member {string} muteInitiator + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.muteInitiator = ""; + + /** + * Finding processes. + * @member {Array.} processes + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.processes = $util.emptyArray; + + /** + * Finding contacts. + * @member {Object.} contacts + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.contacts = $util.emptyObject; + + /** + * Finding compliances. + * @member {Array.} compliances + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.compliances = $util.emptyArray; + + /** + * Finding parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.parentDisplayName = ""; + + /** + * Finding description. + * @member {string} description + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.description = ""; + + /** + * Finding exfiltration. + * @member {google.cloud.securitycenter.v2.IExfiltration|null|undefined} exfiltration + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.exfiltration = null; + + /** + * Finding iamBindings. + * @member {Array.} iamBindings + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.iamBindings = $util.emptyArray; + + /** + * Finding nextSteps. + * @member {string} nextSteps + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.nextSteps = ""; + + /** + * Finding moduleName. + * @member {string} moduleName + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.moduleName = ""; + + /** + * Finding containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.containers = $util.emptyArray; + + /** + * Finding kubernetes. + * @member {google.cloud.securitycenter.v2.IKubernetes|null|undefined} kubernetes + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.kubernetes = null; + + /** + * Finding database. + * @member {google.cloud.securitycenter.v2.IDatabase|null|undefined} database + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.database = null; + + /** + * Finding attackExposure. + * @member {google.cloud.securitycenter.v2.IAttackExposure|null|undefined} attackExposure + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.attackExposure = null; + + /** + * Finding files. + * @member {Array.} files + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.files = $util.emptyArray; + + /** + * Finding cloudDlpInspection. + * @member {google.cloud.securitycenter.v2.ICloudDlpInspection|null|undefined} cloudDlpInspection + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.cloudDlpInspection = null; + + /** + * Finding cloudDlpDataProfile. + * @member {google.cloud.securitycenter.v2.ICloudDlpDataProfile|null|undefined} cloudDlpDataProfile + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.cloudDlpDataProfile = null; + + /** + * Finding kernelRootkit. + * @member {google.cloud.securitycenter.v2.IKernelRootkit|null|undefined} kernelRootkit + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.kernelRootkit = null; + + /** + * Finding orgPolicies. + * @member {Array.} orgPolicies + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.orgPolicies = $util.emptyArray; + + /** + * Finding job. + * @member {google.cloud.securitycenter.v2.IJob|null|undefined} job + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.job = null; + + /** + * Finding application. + * @member {google.cloud.securitycenter.v2.IApplication|null|undefined} application + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.application = null; + + /** + * Finding ipRules. + * @member {google.cloud.securitycenter.v2.IIpRules|null|undefined} ipRules + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.ipRules = null; + + /** + * Finding backupDisasterRecovery. + * @member {google.cloud.securitycenter.v2.IBackupDisasterRecovery|null|undefined} backupDisasterRecovery + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.backupDisasterRecovery = null; + + /** + * Finding securityPosture. + * @member {google.cloud.securitycenter.v2.ISecurityPosture|null|undefined} securityPosture + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.securityPosture = null; + + /** + * Finding logEntries. + * @member {Array.} logEntries + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.logEntries = $util.emptyArray; + + /** + * Finding loadBalancers. + * @member {Array.} loadBalancers + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.loadBalancers = $util.emptyArray; + + /** + * Finding cloudArmor. + * @member {google.cloud.securitycenter.v2.ICloudArmor|null|undefined} cloudArmor + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.cloudArmor = null; + + /** + * Finding notebook. + * @member {google.cloud.securitycenter.v2.INotebook|null|undefined} notebook + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.notebook = null; + + /** + * Finding toxicCombination. + * @member {google.cloud.securitycenter.v2.IToxicCombination|null|undefined} toxicCombination + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.toxicCombination = null; + + /** + * Finding groupMemberships. + * @member {Array.} groupMemberships + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.groupMemberships = $util.emptyArray; + + /** + * Finding disk. + * @member {google.cloud.securitycenter.v2.IDisk|null|undefined} disk + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.disk = null; + + /** + * Finding dataAccessEvents. + * @member {Array.} dataAccessEvents + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.dataAccessEvents = $util.emptyArray; + + /** + * Finding dataFlowEvents. + * @member {Array.} dataFlowEvents + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.dataFlowEvents = $util.emptyArray; + + /** + * Finding networks. + * @member {Array.} networks + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.networks = $util.emptyArray; + + /** + * Finding dataRetentionDeletionEvents. + * @member {Array.} dataRetentionDeletionEvents + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.dataRetentionDeletionEvents = $util.emptyArray; + + /** + * Finding affectedResources. + * @member {google.cloud.securitycenter.v2.IAffectedResources|null|undefined} affectedResources + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.affectedResources = null; + + /** + * Finding aiModel. + * @member {google.cloud.securitycenter.v2.IAiModel|null|undefined} aiModel + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.aiModel = null; + + /** + * Finding chokepoint. + * @member {google.cloud.securitycenter.v2.IChokepoint|null|undefined} chokepoint + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.chokepoint = null; + + /** + * Finding vertexAi. + * @member {google.cloud.securitycenter.v2.IVertexAi|null|undefined} vertexAi + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.vertexAi = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Finding + * @static + * @param {google.cloud.securitycenter.v2.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Finding + * @static + * @param {google.cloud.securitycenter.v2.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.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.canonicalName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.category); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 8, wireType 2 =*/66).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 9, wireType 2 =*/74).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.v2.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.severity); + 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 16, wireType 0 =*/128).int32(message.findingClass); + if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) + $root.google.cloud.securitycenter.v2.Indicator.encode(message.indicator, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) + $root.google.cloud.securitycenter.v2.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 19, wireType 2 =*/154).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 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v2.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.v2.MitreAttack.encode(message.mitreAttack, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + $root.google.cloud.securitycenter.v2.Access.encode(message.access, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.connections != null && message.connections.length) + for (var i = 0; i < message.connections.length; ++i) + $root.google.cloud.securitycenter.v2.Connection.encode(message.connections[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.muteInitiator); + if (message.processes != null && message.processes.length) + for (var i = 0; i < message.processes.length; ++i) + $root.google.cloud.securitycenter.v2.Process.encode(message.processes[i], writer.uint32(/* id 25, wireType 2 =*/202).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 26, wireType 2 =*/210).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v2.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.v2.Compliance.encode(message.compliances[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.parentDisplayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 30, wireType 2 =*/242).string(message.description); + if (message.exfiltration != null && Object.hasOwnProperty.call(message, "exfiltration")) + $root.google.cloud.securitycenter.v2.Exfiltration.encode(message.exfiltration, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.iamBindings != null && message.iamBindings.length) + for (var i = 0; i < message.iamBindings.length; ++i) + $root.google.cloud.securitycenter.v2.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.nextSteps != null && Object.hasOwnProperty.call(message, "nextSteps")) + writer.uint32(/* id 33, wireType 2 =*/266).string(message.nextSteps); + if (message.moduleName != null && Object.hasOwnProperty.call(message, "moduleName")) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.moduleName); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.securitycenter.v2.Container.encode(message.containers[i], writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.kubernetes != null && Object.hasOwnProperty.call(message, "kubernetes")) + $root.google.cloud.securitycenter.v2.Kubernetes.encode(message.kubernetes, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.cloud.securitycenter.v2.Database.encode(message.database, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.attackExposure != null && Object.hasOwnProperty.call(message, "attackExposure")) + $root.google.cloud.securitycenter.v2.AttackExposure.encode(message.attackExposure, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.files != null && message.files.length) + for (var i = 0; i < message.files.length; ++i) + $root.google.cloud.securitycenter.v2.File.encode(message.files[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.cloudDlpInspection != null && Object.hasOwnProperty.call(message, "cloudDlpInspection")) + $root.google.cloud.securitycenter.v2.CloudDlpInspection.encode(message.cloudDlpInspection, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.cloudDlpDataProfile != null && Object.hasOwnProperty.call(message, "cloudDlpDataProfile")) + $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.encode(message.cloudDlpDataProfile, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.kernelRootkit != null && Object.hasOwnProperty.call(message, "kernelRootkit")) + $root.google.cloud.securitycenter.v2.KernelRootkit.encode(message.kernelRootkit, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.orgPolicies != null && message.orgPolicies.length) + for (var i = 0; i < message.orgPolicies.length; ++i) + $root.google.cloud.securitycenter.v2.OrgPolicy.encode(message.orgPolicies[i], writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.securitycenter.v2.Job.encode(message.job, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.application != null && Object.hasOwnProperty.call(message, "application")) + $root.google.cloud.securitycenter.v2.Application.encode(message.application, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + if (message.ipRules != null && Object.hasOwnProperty.call(message, "ipRules")) + $root.google.cloud.securitycenter.v2.IpRules.encode(message.ipRules, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); + if (message.backupDisasterRecovery != null && Object.hasOwnProperty.call(message, "backupDisasterRecovery")) + $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.encode(message.backupDisasterRecovery, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + if (message.securityPosture != null && Object.hasOwnProperty.call(message, "securityPosture")) + $root.google.cloud.securitycenter.v2.SecurityPosture.encode(message.securityPosture, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); + if (message.logEntries != null && message.logEntries.length) + for (var i = 0; i < message.logEntries.length; ++i) + $root.google.cloud.securitycenter.v2.LogEntry.encode(message.logEntries[i], writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); + if (message.loadBalancers != null && message.loadBalancers.length) + for (var i = 0; i < message.loadBalancers.length; ++i) + $root.google.cloud.securitycenter.v2.LoadBalancer.encode(message.loadBalancers[i], writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.cloudArmor != null && Object.hasOwnProperty.call(message, "cloudArmor")) + $root.google.cloud.securitycenter.v2.CloudArmor.encode(message.cloudArmor, writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); + if (message.muteInfo != null && Object.hasOwnProperty.call(message, "muteInfo")) + $root.google.cloud.securitycenter.v2.Finding.MuteInfo.encode(message.muteInfo, writer.uint32(/* id 53, wireType 2 =*/426).fork()).ldelim(); + if (message.notebook != null && Object.hasOwnProperty.call(message, "notebook")) + $root.google.cloud.securitycenter.v2.Notebook.encode(message.notebook, writer.uint32(/* id 55, wireType 2 =*/442).fork()).ldelim(); + if (message.toxicCombination != null && Object.hasOwnProperty.call(message, "toxicCombination")) + $root.google.cloud.securitycenter.v2.ToxicCombination.encode(message.toxicCombination, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); + if (message.groupMemberships != null && message.groupMemberships.length) + for (var i = 0; i < message.groupMemberships.length; ++i) + $root.google.cloud.securitycenter.v2.GroupMembership.encode(message.groupMemberships[i], writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + $root.google.cloud.securitycenter.v2.Disk.encode(message.disk, writer.uint32(/* id 58, wireType 2 =*/466).fork()).ldelim(); + if (message.dataAccessEvents != null && message.dataAccessEvents.length) + for (var i = 0; i < message.dataAccessEvents.length; ++i) + $root.google.cloud.securitycenter.v2.DataAccessEvent.encode(message.dataAccessEvents[i], writer.uint32(/* id 61, wireType 2 =*/490).fork()).ldelim(); + if (message.dataFlowEvents != null && message.dataFlowEvents.length) + for (var i = 0; i < message.dataFlowEvents.length; ++i) + $root.google.cloud.securitycenter.v2.DataFlowEvent.encode(message.dataFlowEvents[i], writer.uint32(/* id 62, wireType 2 =*/498).fork()).ldelim(); + if (message.networks != null && message.networks.length) + for (var i = 0; i < message.networks.length; ++i) + $root.google.cloud.securitycenter.v2.Network.encode(message.networks[i], writer.uint32(/* id 63, wireType 2 =*/506).fork()).ldelim(); + if (message.dataRetentionDeletionEvents != null && message.dataRetentionDeletionEvents.length) + for (var i = 0; i < message.dataRetentionDeletionEvents.length; ++i) + $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.encode(message.dataRetentionDeletionEvents[i], writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + if (message.affectedResources != null && Object.hasOwnProperty.call(message, "affectedResources")) + $root.google.cloud.securitycenter.v2.AffectedResources.encode(message.affectedResources, writer.uint32(/* id 65, wireType 2 =*/522).fork()).ldelim(); + if (message.aiModel != null && Object.hasOwnProperty.call(message, "aiModel")) + $root.google.cloud.securitycenter.v2.AiModel.encode(message.aiModel, writer.uint32(/* id 66, wireType 2 =*/530).fork()).ldelim(); + if (message.chokepoint != null && Object.hasOwnProperty.call(message, "chokepoint")) + $root.google.cloud.securitycenter.v2.Chokepoint.encode(message.chokepoint, writer.uint32(/* id 69, wireType 2 =*/554).fork()).ldelim(); + if (message.vertexAi != null && Object.hasOwnProperty.call(message, "vertexAi")) + $root.google.cloud.securitycenter.v2.VertexAi.encode(message.vertexAi, writer.uint32(/* id 72, wireType 2 =*/578).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Finding + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Finding(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.canonicalName = reader.string(); + break; + } + case 3: { + message.parent = reader.string(); + break; + } + case 4: { + message.resourceName = reader.string(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.category = reader.string(); + break; + } + case 8: { + message.externalUri = reader.string(); + break; + } + case 9: { + 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 10: { + message.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 11: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.severity = reader.int32(); + break; + } + case 15: { + message.mute = reader.int32(); + break; + } + case 53: { + message.muteInfo = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.decode(reader, reader.uint32()); + break; + } + case 16: { + message.findingClass = reader.int32(); + break; + } + case 17: { + message.indicator = $root.google.cloud.securitycenter.v2.Indicator.decode(reader, reader.uint32()); + break; + } + case 18: { + message.vulnerability = $root.google.cloud.securitycenter.v2.Vulnerability.decode(reader, reader.uint32()); + break; + } + case 19: { + message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 20: { + 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.v2.ExternalSystem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.externalSystems[key] = value; + break; + } + case 21: { + message.mitreAttack = $root.google.cloud.securitycenter.v2.MitreAttack.decode(reader, reader.uint32()); + break; + } + case 22: { + message.access = $root.google.cloud.securitycenter.v2.Access.decode(reader, reader.uint32()); + break; + } + case 23: { + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.google.cloud.securitycenter.v2.Connection.decode(reader, reader.uint32())); + break; + } + case 24: { + message.muteInitiator = reader.string(); + break; + } + case 25: { + if (!(message.processes && message.processes.length)) + message.processes = []; + message.processes.push($root.google.cloud.securitycenter.v2.Process.decode(reader, reader.uint32())); + break; + } + case 26: { + 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.v2.ContactDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.contacts[key] = value; + break; + } + case 27: { + if (!(message.compliances && message.compliances.length)) + message.compliances = []; + message.compliances.push($root.google.cloud.securitycenter.v2.Compliance.decode(reader, reader.uint32())); + break; + } + case 29: { + message.parentDisplayName = reader.string(); + break; + } + case 30: { + message.description = reader.string(); + break; + } + case 31: { + message.exfiltration = $root.google.cloud.securitycenter.v2.Exfiltration.decode(reader, reader.uint32()); + break; + } + case 32: { + if (!(message.iamBindings && message.iamBindings.length)) + message.iamBindings = []; + message.iamBindings.push($root.google.cloud.securitycenter.v2.IamBinding.decode(reader, reader.uint32())); + break; + } + case 33: { + message.nextSteps = reader.string(); + break; + } + case 34: { + message.moduleName = reader.string(); + break; + } + case 35: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v2.Container.decode(reader, reader.uint32())); + break; + } + case 36: { + message.kubernetes = $root.google.cloud.securitycenter.v2.Kubernetes.decode(reader, reader.uint32()); + break; + } + case 37: { + message.database = $root.google.cloud.securitycenter.v2.Database.decode(reader, reader.uint32()); + break; + } + case 38: { + message.attackExposure = $root.google.cloud.securitycenter.v2.AttackExposure.decode(reader, reader.uint32()); + break; + } + case 39: { + if (!(message.files && message.files.length)) + message.files = []; + message.files.push($root.google.cloud.securitycenter.v2.File.decode(reader, reader.uint32())); + break; + } + case 40: { + message.cloudDlpInspection = $root.google.cloud.securitycenter.v2.CloudDlpInspection.decode(reader, reader.uint32()); + break; + } + case 41: { + message.cloudDlpDataProfile = $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.decode(reader, reader.uint32()); + break; + } + case 42: { + message.kernelRootkit = $root.google.cloud.securitycenter.v2.KernelRootkit.decode(reader, reader.uint32()); + break; + } + case 43: { + if (!(message.orgPolicies && message.orgPolicies.length)) + message.orgPolicies = []; + message.orgPolicies.push($root.google.cloud.securitycenter.v2.OrgPolicy.decode(reader, reader.uint32())); + break; + } + case 44: { + message.job = $root.google.cloud.securitycenter.v2.Job.decode(reader, reader.uint32()); + break; + } + case 45: { + message.application = $root.google.cloud.securitycenter.v2.Application.decode(reader, reader.uint32()); + break; + } + case 46: { + message.ipRules = $root.google.cloud.securitycenter.v2.IpRules.decode(reader, reader.uint32()); + break; + } + case 47: { + message.backupDisasterRecovery = $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.decode(reader, reader.uint32()); + break; + } + case 48: { + message.securityPosture = $root.google.cloud.securitycenter.v2.SecurityPosture.decode(reader, reader.uint32()); + break; + } + case 49: { + if (!(message.logEntries && message.logEntries.length)) + message.logEntries = []; + message.logEntries.push($root.google.cloud.securitycenter.v2.LogEntry.decode(reader, reader.uint32())); + break; + } + case 50: { + if (!(message.loadBalancers && message.loadBalancers.length)) + message.loadBalancers = []; + message.loadBalancers.push($root.google.cloud.securitycenter.v2.LoadBalancer.decode(reader, reader.uint32())); + break; + } + case 51: { + message.cloudArmor = $root.google.cloud.securitycenter.v2.CloudArmor.decode(reader, reader.uint32()); + break; + } + case 55: { + message.notebook = $root.google.cloud.securitycenter.v2.Notebook.decode(reader, reader.uint32()); + break; + } + case 56: { + message.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.decode(reader, reader.uint32()); + break; + } + case 57: { + if (!(message.groupMemberships && message.groupMemberships.length)) + message.groupMemberships = []; + message.groupMemberships.push($root.google.cloud.securitycenter.v2.GroupMembership.decode(reader, reader.uint32())); + break; + } + case 58: { + message.disk = $root.google.cloud.securitycenter.v2.Disk.decode(reader, reader.uint32()); + break; + } + case 61: { + if (!(message.dataAccessEvents && message.dataAccessEvents.length)) + message.dataAccessEvents = []; + message.dataAccessEvents.push($root.google.cloud.securitycenter.v2.DataAccessEvent.decode(reader, reader.uint32())); + break; + } + case 62: { + if (!(message.dataFlowEvents && message.dataFlowEvents.length)) + message.dataFlowEvents = []; + message.dataFlowEvents.push($root.google.cloud.securitycenter.v2.DataFlowEvent.decode(reader, reader.uint32())); + break; + } + case 63: { + if (!(message.networks && message.networks.length)) + message.networks = []; + message.networks.push($root.google.cloud.securitycenter.v2.Network.decode(reader, reader.uint32())); + break; + } + case 64: { + if (!(message.dataRetentionDeletionEvents && message.dataRetentionDeletionEvents.length)) + message.dataRetentionDeletionEvents = []; + message.dataRetentionDeletionEvents.push($root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.decode(reader, reader.uint32())); + break; + } + case 65: { + message.affectedResources = $root.google.cloud.securitycenter.v2.AffectedResources.decode(reader, reader.uint32()); + break; + } + case 66: { + message.aiModel = $root.google.cloud.securitycenter.v2.AiModel.decode(reader, reader.uint32()); + break; + } + case 69: { + message.chokepoint = $root.google.cloud.securitycenter.v2.Chokepoint.decode(reader, reader.uint32()); + break; + } + case 72: { + message.vertexAi = $root.google.cloud.securitycenter.v2.VertexAi.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.v2.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.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.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.v2.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.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.muteInfo != null && message.hasOwnProperty("muteInfo")) { + var error = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.verify(message.muteInfo); + if (error) + return "muteInfo." + error; + } + 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: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.indicator != null && message.hasOwnProperty("indicator")) { + var error = $root.google.cloud.securitycenter.v2.Indicator.verify(message.indicator); + if (error) + return "indicator." + error; + } + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) { + var error = $root.google.cloud.securitycenter.v2.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.v2.ExternalSystem.verify(message.externalSystems[key[i]]); + if (error) + return "externalSystems." + error; + } + } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) { + var error = $root.google.cloud.securitycenter.v2.MitreAttack.verify(message.mitreAttack); + if (error) + return "mitreAttack." + error; + } + if (message.access != null && message.hasOwnProperty("access")) { + var error = $root.google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.Compliance.verify(message.compliances[i]); + if (error) + 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"; + if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) { + var error = $root.google.cloud.securitycenter.v2.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.v2.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.moduleName != null && message.hasOwnProperty("moduleName")) + if (!$util.isString(message.moduleName)) + return "moduleName: 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.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) { + var error = $root.google.cloud.securitycenter.v2.Kubernetes.verify(message.kubernetes); + if (error) + return "kubernetes." + error; + } + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.cloud.securitycenter.v2.Database.verify(message.database); + if (error) + return "database." + error; + } + if (message.attackExposure != null && message.hasOwnProperty("attackExposure")) { + var error = $root.google.cloud.securitycenter.v2.AttackExposure.verify(message.attackExposure); + if (error) + return "attackExposure." + 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.v2.File.verify(message.files[i]); + if (error) + return "files." + error; + } + } + if (message.cloudDlpInspection != null && message.hasOwnProperty("cloudDlpInspection")) { + var error = $root.google.cloud.securitycenter.v2.CloudDlpInspection.verify(message.cloudDlpInspection); + if (error) + return "cloudDlpInspection." + error; + } + if (message.cloudDlpDataProfile != null && message.hasOwnProperty("cloudDlpDataProfile")) { + var error = $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.verify(message.cloudDlpDataProfile); + if (error) + return "cloudDlpDataProfile." + error; + } + if (message.kernelRootkit != null && message.hasOwnProperty("kernelRootkit")) { + var error = $root.google.cloud.securitycenter.v2.KernelRootkit.verify(message.kernelRootkit); + if (error) + return "kernelRootkit." + error; + } + if (message.orgPolicies != null && message.hasOwnProperty("orgPolicies")) { + if (!Array.isArray(message.orgPolicies)) + return "orgPolicies: array expected"; + for (var i = 0; i < message.orgPolicies.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.OrgPolicy.verify(message.orgPolicies[i]); + if (error) + return "orgPolicies." + error; + } + } + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.securitycenter.v2.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.application != null && message.hasOwnProperty("application")) { + var error = $root.google.cloud.securitycenter.v2.Application.verify(message.application); + if (error) + return "application." + error; + } + if (message.ipRules != null && message.hasOwnProperty("ipRules")) { + var error = $root.google.cloud.securitycenter.v2.IpRules.verify(message.ipRules); + if (error) + return "ipRules." + error; + } + if (message.backupDisasterRecovery != null && message.hasOwnProperty("backupDisasterRecovery")) { + var error = $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.verify(message.backupDisasterRecovery); + if (error) + return "backupDisasterRecovery." + error; + } + if (message.securityPosture != null && message.hasOwnProperty("securityPosture")) { + var error = $root.google.cloud.securitycenter.v2.SecurityPosture.verify(message.securityPosture); + if (error) + return "securityPosture." + error; + } + if (message.logEntries != null && message.hasOwnProperty("logEntries")) { + if (!Array.isArray(message.logEntries)) + return "logEntries: array expected"; + for (var i = 0; i < message.logEntries.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.LogEntry.verify(message.logEntries[i]); + if (error) + return "logEntries." + error; + } + } + if (message.loadBalancers != null && message.hasOwnProperty("loadBalancers")) { + if (!Array.isArray(message.loadBalancers)) + return "loadBalancers: array expected"; + for (var i = 0; i < message.loadBalancers.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.LoadBalancer.verify(message.loadBalancers[i]); + if (error) + return "loadBalancers." + error; + } + } + if (message.cloudArmor != null && message.hasOwnProperty("cloudArmor")) { + var error = $root.google.cloud.securitycenter.v2.CloudArmor.verify(message.cloudArmor); + if (error) + return "cloudArmor." + error; + } + if (message.notebook != null && message.hasOwnProperty("notebook")) { + var error = $root.google.cloud.securitycenter.v2.Notebook.verify(message.notebook); + if (error) + return "notebook." + error; + } + if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) { + var error = $root.google.cloud.securitycenter.v2.ToxicCombination.verify(message.toxicCombination); + if (error) + return "toxicCombination." + error; + } + if (message.groupMemberships != null && message.hasOwnProperty("groupMemberships")) { + if (!Array.isArray(message.groupMemberships)) + return "groupMemberships: array expected"; + for (var i = 0; i < message.groupMemberships.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.GroupMembership.verify(message.groupMemberships[i]); + if (error) + return "groupMemberships." + error; + } + } + if (message.disk != null && message.hasOwnProperty("disk")) { + var error = $root.google.cloud.securitycenter.v2.Disk.verify(message.disk); + if (error) + return "disk." + error; + } + if (message.dataAccessEvents != null && message.hasOwnProperty("dataAccessEvents")) { + if (!Array.isArray(message.dataAccessEvents)) + return "dataAccessEvents: array expected"; + for (var i = 0; i < message.dataAccessEvents.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.DataAccessEvent.verify(message.dataAccessEvents[i]); + if (error) + return "dataAccessEvents." + error; + } + } + if (message.dataFlowEvents != null && message.hasOwnProperty("dataFlowEvents")) { + if (!Array.isArray(message.dataFlowEvents)) + return "dataFlowEvents: array expected"; + for (var i = 0; i < message.dataFlowEvents.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.DataFlowEvent.verify(message.dataFlowEvents[i]); + if (error) + return "dataFlowEvents." + error; + } + } + if (message.networks != null && message.hasOwnProperty("networks")) { + if (!Array.isArray(message.networks)) + return "networks: array expected"; + for (var i = 0; i < message.networks.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.Network.verify(message.networks[i]); + if (error) + return "networks." + error; + } + } + if (message.dataRetentionDeletionEvents != null && message.hasOwnProperty("dataRetentionDeletionEvents")) { + if (!Array.isArray(message.dataRetentionDeletionEvents)) + return "dataRetentionDeletionEvents: array expected"; + for (var i = 0; i < message.dataRetentionDeletionEvents.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify(message.dataRetentionDeletionEvents[i]); + if (error) + return "dataRetentionDeletionEvents." + error; + } + } + if (message.affectedResources != null && message.hasOwnProperty("affectedResources")) { + var error = $root.google.cloud.securitycenter.v2.AffectedResources.verify(message.affectedResources); + if (error) + return "affectedResources." + error; + } + if (message.aiModel != null && message.hasOwnProperty("aiModel")) { + var error = $root.google.cloud.securitycenter.v2.AiModel.verify(message.aiModel); + if (error) + return "aiModel." + error; + } + if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) { + var error = $root.google.cloud.securitycenter.v2.Chokepoint.verify(message.chokepoint); + if (error) + return "chokepoint." + error; + } + if (message.vertexAi != null && message.hasOwnProperty("vertexAi")) { + var error = $root.google.cloud.securitycenter.v2.VertexAi.verify(message.vertexAi); + if (error) + return "vertexAi." + 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.v2.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v2.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + if (object.parent != null) + message.parent = String(object.parent); + 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; + 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.v2.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.v2.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.v2.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.createTime: object expected"); + 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; + 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; + } + switch (object.mute) { + default: + if (typeof object.mute === "number") { + message.mute = object.mute; + break; + } + break; + 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 3: + message.mute = 3; + break; + } + if (object.muteInfo != null) { + if (typeof object.muteInfo !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.muteInfo: object expected"); + message.muteInfo = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.fromObject(object.muteInfo); + } + switch (object.findingClass) { + default: + if (typeof object.findingClass === "number") { + message.findingClass = object.findingClass; + break; + } + break; + 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; + case "POSTURE_VIOLATION": + case 6: + message.findingClass = 6; + break; + case "TOXIC_COMBINATION": + case 7: + message.findingClass = 7; + break; + case "SENSITIVE_DATA_RISK": + case 8: + message.findingClass = 8; + break; + case "CHOKEPOINT": + case 9: + message.findingClass = 9; + break; + } + if (object.indicator != null) { + if (typeof object.indicator !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.indicator: object expected"); + message.indicator = $root.google.cloud.securitycenter.v2.Indicator.fromObject(object.indicator); + } + if (object.vulnerability != null) { + if (typeof object.vulnerability !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.vulnerability: object expected"); + message.vulnerability = $root.google.cloud.securitycenter.v2.Vulnerability.fromObject(object.vulnerability); + } + if (object.muteUpdateTime != null) { + if (typeof object.muteUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.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.v2.Finding.externalSystems: object expected"); + message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v2.ExternalSystem.fromObject(object.externalSystems[keys[i]]); + } + } + if (object.mitreAttack != null) { + if (typeof object.mitreAttack !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.mitreAttack: object expected"); + message.mitreAttack = $root.google.cloud.securitycenter.v2.MitreAttack.fromObject(object.mitreAttack); + } + if (object.access != null) { + if (typeof object.access !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.access: object expected"); + message.access = $root.google.cloud.securitycenter.v2.Access.fromObject(object.access); + } + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.connections: object expected"); + message.connections[i] = $root.google.cloud.securitycenter.v2.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.v2.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.v2.Finding.processes: object expected"); + message.processes[i] = $root.google.cloud.securitycenter.v2.Process.fromObject(object.processes[i]); + } + } + if (object.contacts) { + if (typeof object.contacts !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.contacts: object expected"); + message.contacts[keys[i]] = $root.google.cloud.securitycenter.v2.ContactDetails.fromObject(object.contacts[keys[i]]); + } + } + if (object.compliances) { + if (!Array.isArray(object.compliances)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.compliances: object expected"); + message.compliances[i] = $root.google.cloud.securitycenter.v2.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) { + if (typeof object.exfiltration !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.exfiltration: object expected"); + message.exfiltration = $root.google.cloud.securitycenter.v2.Exfiltration.fromObject(object.exfiltration); + } + if (object.iamBindings) { + if (!Array.isArray(object.iamBindings)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.iamBindings: object expected"); + message.iamBindings[i] = $root.google.cloud.securitycenter.v2.IamBinding.fromObject(object.iamBindings[i]); + } + } + if (object.nextSteps != null) + message.nextSteps = String(object.nextSteps); + if (object.moduleName != null) + message.moduleName = String(object.moduleName); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.containers: object expected"); + message.containers[i] = $root.google.cloud.securitycenter.v2.Container.fromObject(object.containers[i]); + } + } + if (object.kubernetes != null) { + if (typeof object.kubernetes !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.kubernetes: object expected"); + message.kubernetes = $root.google.cloud.securitycenter.v2.Kubernetes.fromObject(object.kubernetes); + } + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.database: object expected"); + message.database = $root.google.cloud.securitycenter.v2.Database.fromObject(object.database); + } + if (object.attackExposure != null) { + if (typeof object.attackExposure !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.attackExposure: object expected"); + message.attackExposure = $root.google.cloud.securitycenter.v2.AttackExposure.fromObject(object.attackExposure); + } + if (object.files) { + if (!Array.isArray(object.files)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.files: object expected"); + message.files[i] = $root.google.cloud.securitycenter.v2.File.fromObject(object.files[i]); + } + } + if (object.cloudDlpInspection != null) { + if (typeof object.cloudDlpInspection !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.cloudDlpInspection: object expected"); + message.cloudDlpInspection = $root.google.cloud.securitycenter.v2.CloudDlpInspection.fromObject(object.cloudDlpInspection); + } + if (object.cloudDlpDataProfile != null) { + if (typeof object.cloudDlpDataProfile !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.cloudDlpDataProfile: object expected"); + message.cloudDlpDataProfile = $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.fromObject(object.cloudDlpDataProfile); + } + if (object.kernelRootkit != null) { + if (typeof object.kernelRootkit !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.kernelRootkit: object expected"); + message.kernelRootkit = $root.google.cloud.securitycenter.v2.KernelRootkit.fromObject(object.kernelRootkit); + } + if (object.orgPolicies) { + if (!Array.isArray(object.orgPolicies)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.orgPolicies: array expected"); + message.orgPolicies = []; + for (var i = 0; i < object.orgPolicies.length; ++i) { + if (typeof object.orgPolicies[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.orgPolicies: object expected"); + message.orgPolicies[i] = $root.google.cloud.securitycenter.v2.OrgPolicy.fromObject(object.orgPolicies[i]); + } + } + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.job: object expected"); + message.job = $root.google.cloud.securitycenter.v2.Job.fromObject(object.job); + } + if (object.application != null) { + if (typeof object.application !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.application: object expected"); + message.application = $root.google.cloud.securitycenter.v2.Application.fromObject(object.application); + } + if (object.ipRules != null) { + if (typeof object.ipRules !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.ipRules: object expected"); + message.ipRules = $root.google.cloud.securitycenter.v2.IpRules.fromObject(object.ipRules); + } + if (object.backupDisasterRecovery != null) { + if (typeof object.backupDisasterRecovery !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.backupDisasterRecovery: object expected"); + message.backupDisasterRecovery = $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.fromObject(object.backupDisasterRecovery); + } + if (object.securityPosture != null) { + if (typeof object.securityPosture !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.securityPosture: object expected"); + message.securityPosture = $root.google.cloud.securitycenter.v2.SecurityPosture.fromObject(object.securityPosture); + } + if (object.logEntries) { + if (!Array.isArray(object.logEntries)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.logEntries: array expected"); + message.logEntries = []; + for (var i = 0; i < object.logEntries.length; ++i) { + if (typeof object.logEntries[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.logEntries: object expected"); + message.logEntries[i] = $root.google.cloud.securitycenter.v2.LogEntry.fromObject(object.logEntries[i]); + } + } + if (object.loadBalancers) { + if (!Array.isArray(object.loadBalancers)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.loadBalancers: array expected"); + message.loadBalancers = []; + for (var i = 0; i < object.loadBalancers.length; ++i) { + if (typeof object.loadBalancers[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.loadBalancers: object expected"); + message.loadBalancers[i] = $root.google.cloud.securitycenter.v2.LoadBalancer.fromObject(object.loadBalancers[i]); + } + } + if (object.cloudArmor != null) { + if (typeof object.cloudArmor !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.cloudArmor: object expected"); + message.cloudArmor = $root.google.cloud.securitycenter.v2.CloudArmor.fromObject(object.cloudArmor); + } + if (object.notebook != null) { + if (typeof object.notebook !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.notebook: object expected"); + message.notebook = $root.google.cloud.securitycenter.v2.Notebook.fromObject(object.notebook); + } + if (object.toxicCombination != null) { + if (typeof object.toxicCombination !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.toxicCombination: object expected"); + message.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.fromObject(object.toxicCombination); + } + if (object.groupMemberships) { + if (!Array.isArray(object.groupMemberships)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.groupMemberships: array expected"); + message.groupMemberships = []; + for (var i = 0; i < object.groupMemberships.length; ++i) { + if (typeof object.groupMemberships[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.groupMemberships: object expected"); + message.groupMemberships[i] = $root.google.cloud.securitycenter.v2.GroupMembership.fromObject(object.groupMemberships[i]); + } + } + if (object.disk != null) { + if (typeof object.disk !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.disk: object expected"); + message.disk = $root.google.cloud.securitycenter.v2.Disk.fromObject(object.disk); + } + if (object.dataAccessEvents) { + if (!Array.isArray(object.dataAccessEvents)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.dataAccessEvents: array expected"); + message.dataAccessEvents = []; + for (var i = 0; i < object.dataAccessEvents.length; ++i) { + if (typeof object.dataAccessEvents[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.dataAccessEvents: object expected"); + message.dataAccessEvents[i] = $root.google.cloud.securitycenter.v2.DataAccessEvent.fromObject(object.dataAccessEvents[i]); + } + } + if (object.dataFlowEvents) { + if (!Array.isArray(object.dataFlowEvents)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.dataFlowEvents: array expected"); + message.dataFlowEvents = []; + for (var i = 0; i < object.dataFlowEvents.length; ++i) { + if (typeof object.dataFlowEvents[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.dataFlowEvents: object expected"); + message.dataFlowEvents[i] = $root.google.cloud.securitycenter.v2.DataFlowEvent.fromObject(object.dataFlowEvents[i]); + } + } + if (object.networks) { + if (!Array.isArray(object.networks)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.networks: array expected"); + message.networks = []; + for (var i = 0; i < object.networks.length; ++i) { + if (typeof object.networks[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.networks: object expected"); + message.networks[i] = $root.google.cloud.securitycenter.v2.Network.fromObject(object.networks[i]); + } + } + if (object.dataRetentionDeletionEvents) { + if (!Array.isArray(object.dataRetentionDeletionEvents)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.dataRetentionDeletionEvents: array expected"); + message.dataRetentionDeletionEvents = []; + for (var i = 0; i < object.dataRetentionDeletionEvents.length; ++i) { + if (typeof object.dataRetentionDeletionEvents[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.dataRetentionDeletionEvents: object expected"); + message.dataRetentionDeletionEvents[i] = $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.fromObject(object.dataRetentionDeletionEvents[i]); + } + } + if (object.affectedResources != null) { + if (typeof object.affectedResources !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.affectedResources: object expected"); + message.affectedResources = $root.google.cloud.securitycenter.v2.AffectedResources.fromObject(object.affectedResources); + } + if (object.aiModel != null) { + if (typeof object.aiModel !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.aiModel: object expected"); + message.aiModel = $root.google.cloud.securitycenter.v2.AiModel.fromObject(object.aiModel); + } + if (object.chokepoint != null) { + if (typeof object.chokepoint !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.chokepoint: object expected"); + message.chokepoint = $root.google.cloud.securitycenter.v2.Chokepoint.fromObject(object.chokepoint); + } + if (object.vertexAi != null) { + if (typeof object.vertexAi !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.vertexAi: object expected"); + message.vertexAi = $root.google.cloud.securitycenter.v2.VertexAi.fromObject(object.vertexAi); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Finding + * @static + * @param {google.cloud.securitycenter.v2.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.connections = []; + object.processes = []; + object.compliances = []; + object.iamBindings = []; + object.containers = []; + object.files = []; + object.orgPolicies = []; + object.logEntries = []; + object.loadBalancers = []; + object.groupMemberships = []; + object.dataAccessEvents = []; + object.dataFlowEvents = []; + object.networks = []; + object.dataRetentionDeletionEvents = []; + } + if (options.objects || options.defaults) { + object.sourceProperties = {}; + object.externalSystems = {}; + object.contacts = {}; + } + if (options.defaults) { + object.name = ""; + object.canonicalName = ""; + 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.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.parentDisplayName = ""; + object.description = ""; + object.exfiltration = null; + object.nextSteps = ""; + object.moduleName = ""; + object.kubernetes = null; + object.database = null; + object.attackExposure = null; + object.cloudDlpInspection = null; + object.cloudDlpDataProfile = null; + object.kernelRootkit = null; + object.job = null; + object.application = null; + object.ipRules = null; + object.backupDisasterRecovery = null; + object.securityPosture = null; + object.cloudArmor = null; + object.muteInfo = null; + object.notebook = null; + object.toxicCombination = null; + object.disk = null; + object.affectedResources = null; + object.aiModel = null; + object.chokepoint = null; + object.vertexAi = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + 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.v2.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.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.v2.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.v2.Finding.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.securitycenter.v2.Finding.Severity[message.severity] : message.severity; + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v2.Finding.Mute[message.mute] === undefined ? message.mute : $root.google.cloud.securitycenter.v2.Finding.Mute[message.mute] : message.mute; + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v2.Finding.FindingClass[message.findingClass] === undefined ? message.findingClass : $root.google.cloud.securitycenter.v2.Finding.FindingClass[message.findingClass] : message.findingClass; + if (message.indicator != null && message.hasOwnProperty("indicator")) + object.indicator = $root.google.cloud.securitycenter.v2.Indicator.toObject(message.indicator, options); + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) + object.vulnerability = $root.google.cloud.securitycenter.v2.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.v2.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); + } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) + object.mitreAttack = $root.google.cloud.securitycenter.v2.MitreAttack.toObject(message.mitreAttack, options); + if (message.access != null && message.hasOwnProperty("access")) + object.access = $root.google.cloud.securitycenter.v2.Access.toObject(message.access, 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.v2.Connection.toObject(message.connections[j], 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.v2.Process.toObject(message.processes[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.v2.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.v2.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")) + object.exfiltration = $root.google.cloud.securitycenter.v2.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.v2.IamBinding.toObject(message.iamBindings[j], options); + } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + object.nextSteps = message.nextSteps; + if (message.moduleName != null && message.hasOwnProperty("moduleName")) + object.moduleName = message.moduleName; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.securitycenter.v2.Container.toObject(message.containers[j], options); + } + if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) + object.kubernetes = $root.google.cloud.securitycenter.v2.Kubernetes.toObject(message.kubernetes, options); + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.cloud.securitycenter.v2.Database.toObject(message.database, options); + if (message.attackExposure != null && message.hasOwnProperty("attackExposure")) + object.attackExposure = $root.google.cloud.securitycenter.v2.AttackExposure.toObject(message.attackExposure, 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.v2.File.toObject(message.files[j], options); + } + if (message.cloudDlpInspection != null && message.hasOwnProperty("cloudDlpInspection")) + object.cloudDlpInspection = $root.google.cloud.securitycenter.v2.CloudDlpInspection.toObject(message.cloudDlpInspection, options); + if (message.cloudDlpDataProfile != null && message.hasOwnProperty("cloudDlpDataProfile")) + object.cloudDlpDataProfile = $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.toObject(message.cloudDlpDataProfile, options); + if (message.kernelRootkit != null && message.hasOwnProperty("kernelRootkit")) + object.kernelRootkit = $root.google.cloud.securitycenter.v2.KernelRootkit.toObject(message.kernelRootkit, options); + if (message.orgPolicies && message.orgPolicies.length) { + object.orgPolicies = []; + for (var j = 0; j < message.orgPolicies.length; ++j) + object.orgPolicies[j] = $root.google.cloud.securitycenter.v2.OrgPolicy.toObject(message.orgPolicies[j], options); + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.securitycenter.v2.Job.toObject(message.job, options); + if (message.application != null && message.hasOwnProperty("application")) + object.application = $root.google.cloud.securitycenter.v2.Application.toObject(message.application, options); + if (message.ipRules != null && message.hasOwnProperty("ipRules")) + object.ipRules = $root.google.cloud.securitycenter.v2.IpRules.toObject(message.ipRules, options); + if (message.backupDisasterRecovery != null && message.hasOwnProperty("backupDisasterRecovery")) + object.backupDisasterRecovery = $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.toObject(message.backupDisasterRecovery, options); + if (message.securityPosture != null && message.hasOwnProperty("securityPosture")) + object.securityPosture = $root.google.cloud.securitycenter.v2.SecurityPosture.toObject(message.securityPosture, options); + if (message.logEntries && message.logEntries.length) { + object.logEntries = []; + for (var j = 0; j < message.logEntries.length; ++j) + object.logEntries[j] = $root.google.cloud.securitycenter.v2.LogEntry.toObject(message.logEntries[j], options); + } + if (message.loadBalancers && message.loadBalancers.length) { + object.loadBalancers = []; + for (var j = 0; j < message.loadBalancers.length; ++j) + object.loadBalancers[j] = $root.google.cloud.securitycenter.v2.LoadBalancer.toObject(message.loadBalancers[j], options); + } + if (message.cloudArmor != null && message.hasOwnProperty("cloudArmor")) + object.cloudArmor = $root.google.cloud.securitycenter.v2.CloudArmor.toObject(message.cloudArmor, options); + if (message.muteInfo != null && message.hasOwnProperty("muteInfo")) + object.muteInfo = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.toObject(message.muteInfo, options); + if (message.notebook != null && message.hasOwnProperty("notebook")) + object.notebook = $root.google.cloud.securitycenter.v2.Notebook.toObject(message.notebook, options); + if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) + object.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.toObject(message.toxicCombination, options); + if (message.groupMemberships && message.groupMemberships.length) { + object.groupMemberships = []; + for (var j = 0; j < message.groupMemberships.length; ++j) + object.groupMemberships[j] = $root.google.cloud.securitycenter.v2.GroupMembership.toObject(message.groupMemberships[j], options); + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = $root.google.cloud.securitycenter.v2.Disk.toObject(message.disk, options); + if (message.dataAccessEvents && message.dataAccessEvents.length) { + object.dataAccessEvents = []; + for (var j = 0; j < message.dataAccessEvents.length; ++j) + object.dataAccessEvents[j] = $root.google.cloud.securitycenter.v2.DataAccessEvent.toObject(message.dataAccessEvents[j], options); + } + if (message.dataFlowEvents && message.dataFlowEvents.length) { + object.dataFlowEvents = []; + for (var j = 0; j < message.dataFlowEvents.length; ++j) + object.dataFlowEvents[j] = $root.google.cloud.securitycenter.v2.DataFlowEvent.toObject(message.dataFlowEvents[j], options); + } + if (message.networks && message.networks.length) { + object.networks = []; + for (var j = 0; j < message.networks.length; ++j) + object.networks[j] = $root.google.cloud.securitycenter.v2.Network.toObject(message.networks[j], options); + } + if (message.dataRetentionDeletionEvents && message.dataRetentionDeletionEvents.length) { + object.dataRetentionDeletionEvents = []; + for (var j = 0; j < message.dataRetentionDeletionEvents.length; ++j) + object.dataRetentionDeletionEvents[j] = $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.toObject(message.dataRetentionDeletionEvents[j], options); + } + if (message.affectedResources != null && message.hasOwnProperty("affectedResources")) + object.affectedResources = $root.google.cloud.securitycenter.v2.AffectedResources.toObject(message.affectedResources, options); + if (message.aiModel != null && message.hasOwnProperty("aiModel")) + object.aiModel = $root.google.cloud.securitycenter.v2.AiModel.toObject(message.aiModel, options); + if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) + object.chokepoint = $root.google.cloud.securitycenter.v2.Chokepoint.toObject(message.chokepoint, options); + if (message.vertexAi != null && message.hasOwnProperty("vertexAi")) + object.vertexAi = $root.google.cloud.securitycenter.v2.VertexAi.toObject(message.vertexAi, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Finding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Finding"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v2.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.v2.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.v2.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=3 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[3] = "UNDEFINED"] = 3; + return values; + })(); + + Finding.MuteInfo = (function() { + + /** + * Properties of a MuteInfo. + * @memberof google.cloud.securitycenter.v2.Finding + * @interface IMuteInfo + * @property {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute|null} [staticMute] MuteInfo staticMute + * @property {Array.|null} [dynamicMuteRecords] MuteInfo dynamicMuteRecords + */ + + /** + * Constructs a new MuteInfo. + * @memberof google.cloud.securitycenter.v2.Finding + * @classdesc Represents a MuteInfo. + * @implements IMuteInfo + * @constructor + * @param {google.cloud.securitycenter.v2.Finding.IMuteInfo=} [properties] Properties to set + */ + function MuteInfo(properties) { + this.dynamicMuteRecords = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MuteInfo staticMute. + * @member {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute|null|undefined} staticMute + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @instance + */ + MuteInfo.prototype.staticMute = null; + + /** + * MuteInfo dynamicMuteRecords. + * @member {Array.} dynamicMuteRecords + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @instance + */ + MuteInfo.prototype.dynamicMuteRecords = $util.emptyArray; + + /** + * Creates a new MuteInfo instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {google.cloud.securitycenter.v2.Finding.IMuteInfo=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo} MuteInfo instance + */ + MuteInfo.create = function create(properties) { + return new MuteInfo(properties); + }; + + /** + * Encodes the specified MuteInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {google.cloud.securitycenter.v2.Finding.IMuteInfo} message MuteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.staticMute != null && Object.hasOwnProperty.call(message, "staticMute")) + $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.encode(message.staticMute, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dynamicMuteRecords != null && message.dynamicMuteRecords.length) + for (var i = 0; i < message.dynamicMuteRecords.length; ++i) + $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.encode(message.dynamicMuteRecords[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MuteInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {google.cloud.securitycenter.v2.Finding.IMuteInfo} message MuteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MuteInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo} MuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.staticMute = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.dynamicMuteRecords && message.dynamicMuteRecords.length)) + message.dynamicMuteRecords = []; + message.dynamicMuteRecords.push($root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MuteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo} MuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MuteInfo message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MuteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.staticMute != null && message.hasOwnProperty("staticMute")) { + var error = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify(message.staticMute); + if (error) + return "staticMute." + error; + } + if (message.dynamicMuteRecords != null && message.hasOwnProperty("dynamicMuteRecords")) { + if (!Array.isArray(message.dynamicMuteRecords)) + return "dynamicMuteRecords: array expected"; + for (var i = 0; i < message.dynamicMuteRecords.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify(message.dynamicMuteRecords[i]); + if (error) + return "dynamicMuteRecords." + error; + } + } + return null; + }; + + /** + * Creates a MuteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo} MuteInfo + */ + MuteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Finding.MuteInfo) + return object; + var message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo(); + if (object.staticMute != null) { + if (typeof object.staticMute !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.staticMute: object expected"); + message.staticMute = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.fromObject(object.staticMute); + } + if (object.dynamicMuteRecords) { + if (!Array.isArray(object.dynamicMuteRecords)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.dynamicMuteRecords: array expected"); + message.dynamicMuteRecords = []; + for (var i = 0; i < object.dynamicMuteRecords.length; ++i) { + if (typeof object.dynamicMuteRecords[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.dynamicMuteRecords: object expected"); + message.dynamicMuteRecords[i] = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.fromObject(object.dynamicMuteRecords[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MuteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo} message MuteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MuteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dynamicMuteRecords = []; + if (options.defaults) + object.staticMute = null; + if (message.staticMute != null && message.hasOwnProperty("staticMute")) + object.staticMute = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.toObject(message.staticMute, options); + if (message.dynamicMuteRecords && message.dynamicMuteRecords.length) { + object.dynamicMuteRecords = []; + for (var j = 0; j < message.dynamicMuteRecords.length; ++j) + object.dynamicMuteRecords[j] = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.toObject(message.dynamicMuteRecords[j], options); + } + return object; + }; + + /** + * Converts this MuteInfo to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @instance + * @returns {Object.} JSON object + */ + MuteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MuteInfo + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MuteInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Finding.MuteInfo"; + }; + + MuteInfo.StaticMute = (function() { + + /** + * Properties of a StaticMute. + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @interface IStaticMute + * @property {google.cloud.securitycenter.v2.Finding.Mute|null} [state] StaticMute state + * @property {google.protobuf.ITimestamp|null} [applyTime] StaticMute applyTime + */ + + /** + * Constructs a new StaticMute. + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @classdesc Represents a StaticMute. + * @implements IStaticMute + * @constructor + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute=} [properties] Properties to set + */ + function StaticMute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StaticMute state. + * @member {google.cloud.securitycenter.v2.Finding.Mute} state + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @instance + */ + StaticMute.prototype.state = 0; + + /** + * StaticMute applyTime. + * @member {google.protobuf.ITimestamp|null|undefined} applyTime + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @instance + */ + StaticMute.prototype.applyTime = null; + + /** + * Creates a new StaticMute instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} StaticMute instance + */ + StaticMute.create = function create(properties) { + return new StaticMute(properties); + }; + + /** + * Encodes the specified StaticMute message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute} message StaticMute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticMute.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.applyTime != null && Object.hasOwnProperty.call(message, "applyTime")) + $root.google.protobuf.Timestamp.encode(message.applyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StaticMute message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute} message StaticMute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticMute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StaticMute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} StaticMute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticMute.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.applyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StaticMute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} StaticMute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticMute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StaticMute message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StaticMute.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.applyTime != null && message.hasOwnProperty("applyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.applyTime); + if (error) + return "applyTime." + error; + } + return null; + }; + + /** + * Creates a StaticMute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} StaticMute + */ + StaticMute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute) + return object; + var message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "MUTE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "MUTED": + case 1: + message.state = 1; + break; + case "UNMUTED": + case 2: + message.state = 2; + break; + case "UNDEFINED": + case 3: + message.state = 3; + break; + } + if (object.applyTime != null) { + if (typeof object.applyTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.applyTime: object expected"); + message.applyTime = $root.google.protobuf.Timestamp.fromObject(object.applyTime); + } + return message; + }; + + /** + * Creates a plain object from a StaticMute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} message StaticMute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StaticMute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "MUTE_UNSPECIFIED" : 0; + object.applyTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v2.Finding.Mute[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.Finding.Mute[message.state] : message.state; + if (message.applyTime != null && message.hasOwnProperty("applyTime")) + object.applyTime = $root.google.protobuf.Timestamp.toObject(message.applyTime, options); + return object; + }; + + /** + * Converts this StaticMute to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @instance + * @returns {Object.} JSON object + */ + StaticMute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StaticMute + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StaticMute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute"; + }; + + return StaticMute; + })(); + + MuteInfo.DynamicMuteRecord = (function() { + + /** + * Properties of a DynamicMuteRecord. + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @interface IDynamicMuteRecord + * @property {string|null} [muteConfig] DynamicMuteRecord muteConfig + * @property {google.protobuf.ITimestamp|null} [matchTime] DynamicMuteRecord matchTime + */ + + /** + * Constructs a new DynamicMuteRecord. + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo + * @classdesc Represents a DynamicMuteRecord. + * @implements IDynamicMuteRecord + * @constructor + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord=} [properties] Properties to set + */ + function DynamicMuteRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DynamicMuteRecord muteConfig. + * @member {string} muteConfig + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @instance + */ + DynamicMuteRecord.prototype.muteConfig = ""; + + /** + * DynamicMuteRecord matchTime. + * @member {google.protobuf.ITimestamp|null|undefined} matchTime + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @instance + */ + DynamicMuteRecord.prototype.matchTime = null; + + /** + * Creates a new DynamicMuteRecord instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord instance + */ + DynamicMuteRecord.create = function create(properties) { + return new DynamicMuteRecord(properties); + }; + + /** + * Encodes the specified DynamicMuteRecord message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord} message DynamicMuteRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicMuteRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.muteConfig); + if (message.matchTime != null && Object.hasOwnProperty.call(message, "matchTime")) + $root.google.protobuf.Timestamp.encode(message.matchTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DynamicMuteRecord message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord} message DynamicMuteRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicMuteRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DynamicMuteRecord message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicMuteRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.muteConfig = reader.string(); + break; + } + case 2: { + message.matchTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DynamicMuteRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicMuteRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DynamicMuteRecord message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DynamicMuteRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + if (!$util.isString(message.muteConfig)) + return "muteConfig: string expected"; + if (message.matchTime != null && message.hasOwnProperty("matchTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.matchTime); + if (error) + return "matchTime." + error; + } + return null; + }; + + /** + * Creates a DynamicMuteRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord + */ + DynamicMuteRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord) + return object; + var message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord(); + if (object.muteConfig != null) + message.muteConfig = String(object.muteConfig); + if (object.matchTime != null) { + if (typeof object.matchTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.matchTime: object expected"); + message.matchTime = $root.google.protobuf.Timestamp.fromObject(object.matchTime); + } + return message; + }; + + /** + * Creates a plain object from a DynamicMuteRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} message DynamicMuteRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DynamicMuteRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.muteConfig = ""; + object.matchTime = null; + } + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + object.muteConfig = message.muteConfig; + if (message.matchTime != null && message.hasOwnProperty("matchTime")) + object.matchTime = $root.google.protobuf.Timestamp.toObject(message.matchTime, options); + return object; + }; + + /** + * Converts this DynamicMuteRecord to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @instance + * @returns {Object.} JSON object + */ + DynamicMuteRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DynamicMuteRecord + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DynamicMuteRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord"; + }; + + return DynamicMuteRecord; + })(); + + return MuteInfo; + })(); + + /** + * FindingClass enum. + * @name google.cloud.securitycenter.v2.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 + * @property {number} POSTURE_VIOLATION=6 POSTURE_VIOLATION value + * @property {number} TOXIC_COMBINATION=7 TOXIC_COMBINATION value + * @property {number} SENSITIVE_DATA_RISK=8 SENSITIVE_DATA_RISK value + * @property {number} CHOKEPOINT=9 CHOKEPOINT 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; + values[valuesById[6] = "POSTURE_VIOLATION"] = 6; + values[valuesById[7] = "TOXIC_COMBINATION"] = 7; + values[valuesById[8] = "SENSITIVE_DATA_RISK"] = 8; + values[valuesById[9] = "CHOKEPOINT"] = 9; + return values; + })(); + + return Finding; + })(); + + v2.GroupMembership = (function() { + + /** + * Properties of a GroupMembership. + * @memberof google.cloud.securitycenter.v2 + * @interface IGroupMembership + * @property {google.cloud.securitycenter.v2.GroupMembership.GroupType|null} [groupType] GroupMembership groupType + * @property {string|null} [groupId] GroupMembership groupId + */ + + /** + * Constructs a new GroupMembership. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GroupMembership. + * @implements IGroupMembership + * @constructor + * @param {google.cloud.securitycenter.v2.IGroupMembership=} [properties] Properties to set + */ + function GroupMembership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMembership groupType. + * @member {google.cloud.securitycenter.v2.GroupMembership.GroupType} groupType + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @instance + */ + GroupMembership.prototype.groupType = 0; + + /** + * GroupMembership groupId. + * @member {string} groupId + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @instance + */ + GroupMembership.prototype.groupId = ""; + + /** + * Creates a new GroupMembership instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {google.cloud.securitycenter.v2.IGroupMembership=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership instance + */ + GroupMembership.create = function create(properties) { + return new GroupMembership(properties); + }; + + /** + * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {google.cloud.securitycenter.v2.IGroupMembership} message GroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMembership.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupType != null && Object.hasOwnProperty.call(message, "groupType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.groupType); + if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId); + return writer; + }; + + /** + * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {google.cloud.securitycenter.v2.IGroupMembership} message GroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMembership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMembership message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMembership.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupMembership(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.groupType = reader.int32(); + break; + } + case 2: { + message.groupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMembership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMembership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMembership message. + * @function verify + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMembership.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupType != null && message.hasOwnProperty("groupType")) + switch (message.groupType) { + default: + return "groupType: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + return null; + }; + + /** + * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership + */ + GroupMembership.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GroupMembership) + return object; + var message = new $root.google.cloud.securitycenter.v2.GroupMembership(); + switch (object.groupType) { + default: + if (typeof object.groupType === "number") { + message.groupType = object.groupType; + break; + } + break; + case "GROUP_TYPE_UNSPECIFIED": + case 0: + message.groupType = 0; + break; + case "GROUP_TYPE_TOXIC_COMBINATION": + case 1: + message.groupType = 1; + break; + case "GROUP_TYPE_CHOKEPOINT": + case 3: + message.groupType = 3; + break; + } + if (object.groupId != null) + message.groupId = String(object.groupId); + return message; + }; + + /** + * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {google.cloud.securitycenter.v2.GroupMembership} message GroupMembership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMembership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groupType = options.enums === String ? "GROUP_TYPE_UNSPECIFIED" : 0; + object.groupId = ""; + } + if (message.groupType != null && message.hasOwnProperty("groupType")) + object.groupType = options.enums === String ? $root.google.cloud.securitycenter.v2.GroupMembership.GroupType[message.groupType] === undefined ? message.groupType : $root.google.cloud.securitycenter.v2.GroupMembership.GroupType[message.groupType] : message.groupType; + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + return object; + }; + + /** + * Converts this GroupMembership to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @instance + * @returns {Object.} JSON object + */ + GroupMembership.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupMembership + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.GroupMembership"; + }; + + /** + * GroupType enum. + * @name google.cloud.securitycenter.v2.GroupMembership.GroupType + * @enum {number} + * @property {number} GROUP_TYPE_UNSPECIFIED=0 GROUP_TYPE_UNSPECIFIED value + * @property {number} GROUP_TYPE_TOXIC_COMBINATION=1 GROUP_TYPE_TOXIC_COMBINATION value + * @property {number} GROUP_TYPE_CHOKEPOINT=3 GROUP_TYPE_CHOKEPOINT value + */ + GroupMembership.GroupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GROUP_TYPE_TOXIC_COMBINATION"] = 1; + values[valuesById[3] = "GROUP_TYPE_CHOKEPOINT"] = 3; + return values; + })(); + + return GroupMembership; + })(); + + v2.IamBinding = (function() { + + /** + * Properties of an IamBinding. + * @memberof google.cloud.securitycenter.v2 + * @interface IIamBinding + * @property {google.cloud.securitycenter.v2.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.v2 + * @classdesc Represents an IamBinding. + * @implements IIamBinding + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.IamBinding.Action} action + * @memberof google.cloud.securitycenter.v2.IamBinding + * @instance + */ + IamBinding.prototype.action = 0; + + /** + * IamBinding role. + * @member {string} role + * @memberof google.cloud.securitycenter.v2.IamBinding + * @instance + */ + IamBinding.prototype.role = ""; + + /** + * IamBinding member. + * @member {string} member + * @memberof google.cloud.securitycenter.v2.IamBinding + * @instance + */ + IamBinding.prototype.member = ""; + + /** + * Creates a new IamBinding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.IamBinding + * @static + * @param {google.cloud.securitycenter.v2.IIamBinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.IamBinding} IamBinding instance + */ + IamBinding.create = function create(properties) { + return new IamBinding(properties); + }; + + /** + * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v2.IamBinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.IamBinding + * @static + * @param {google.cloud.securitycenter.v2.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.v2.IamBinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.IamBinding + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.IamBinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.IamBinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.IamBinding} IamBinding + */ + IamBinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.IamBinding) + return object; + var message = new $root.google.cloud.securitycenter.v2.IamBinding(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + 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.v2.IamBinding + * @static + * @param {google.cloud.securitycenter.v2.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.v2.IamBinding.Action[message.action] === undefined ? message.action : $root.google.cloud.securitycenter.v2.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.v2.IamBinding + * @instance + * @returns {Object.} JSON object + */ + IamBinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamBinding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.IamBinding"; + }; + + /** + * Action enum. + * @name google.cloud.securitycenter.v2.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; + })(); + + v2.Indicator = (function() { + + /** + * Properties of an Indicator. + * @memberof google.cloud.securitycenter.v2 + * @interface IIndicator + * @property {Array.|null} [ipAddresses] Indicator ipAddresses + * @property {Array.|null} [domains] Indicator domains + * @property {Array.|null} [signatures] Indicator signatures + * @property {Array.|null} [uris] Indicator uris + */ + + /** + * Constructs a new Indicator. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an Indicator. + * @implements IIndicator + * @constructor + * @param {google.cloud.securitycenter.v2.IIndicator=} [properties] Properties to set + */ + function Indicator(properties) { + 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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Indicator ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.securitycenter.v2.Indicator + * @instance + */ + Indicator.prototype.ipAddresses = $util.emptyArray; + + /** + * Indicator domains. + * @member {Array.} domains + * @memberof google.cloud.securitycenter.v2.Indicator + * @instance + */ + Indicator.prototype.domains = $util.emptyArray; + + /** + * Indicator signatures. + * @member {Array.} signatures + * @memberof google.cloud.securitycenter.v2.Indicator + * @instance + */ + Indicator.prototype.signatures = $util.emptyArray; + + /** + * Indicator uris. + * @member {Array.} uris + * @memberof google.cloud.securitycenter.v2.Indicator + * @instance + */ + Indicator.prototype.uris = $util.emptyArray; + + /** + * Creates a new Indicator instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Indicator + * @static + * @param {google.cloud.securitycenter.v2.IIndicator=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Indicator} Indicator instance + */ + Indicator.create = function create(properties) { + return new Indicator(properties); + }; + + /** + * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v2.Indicator.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Indicator + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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; + }; + + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Indicator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Indicator + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.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; + } + } + return message; + }; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.verify(message.signatures[i]); + if (error) + 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; + }; + + /** + * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Indicator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Indicator} Indicator + */ + Indicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Indicator) + return object; + var message = new $root.google.cloud.securitycenter.v2.Indicator(); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.Indicator.signatures: object expected"); + message.signatures[i] = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.fromObject(object.signatures[i]); + } + } + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.securitycenter.v2.Indicator.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[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.v2.Indicator + * @static + * @param {google.cloud.securitycenter.v2.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 = []; + object.uris = []; + } + 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.v2.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; + }; + + /** + * Converts this Indicator to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Indicator + * @instance + * @returns {Object.} JSON object + */ + Indicator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Indicator + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Indicator"; + }; + + Indicator.ProcessSignature = (function() { + + /** + * Properties of a ProcessSignature. + * @memberof google.cloud.securitycenter.v2.Indicator + * @interface IProcessSignature + * @property {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IMemoryHashSignature|null} [memoryHashSignature] ProcessSignature memoryHashSignature + * @property {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature|null} [yaraRuleSignature] ProcessSignature yaraRuleSignature + * @property {google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType|null} [signatureType] ProcessSignature signatureType + */ + + /** + * Constructs a new ProcessSignature. + * @memberof google.cloud.securitycenter.v2.Indicator + * @classdesc Represents a ProcessSignature. + * @implements IProcessSignature + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IMemoryHashSignature|null|undefined} memoryHashSignature + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.memoryHashSignature = null; + + /** + * ProcessSignature yaraRuleSignature. + * @member {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature|null|undefined} yaraRuleSignature + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.yaraRuleSignature = null; + + /** + * ProcessSignature signatureType. + * @member {google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType} signatureType + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.signatureType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessSignature signature. + * @member {"memoryHashSignature"|"yaraRuleSignature"|undefined} signature + * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v2.Indicator.IProcessSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.encode(message.yaraRuleSignature, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.signatureType != null && Object.hasOwnProperty.call(message, "signatureType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.signatureType); + return writer; + }; + + /** + * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Indicator.ProcessSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.memoryHashSignature = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.decode(reader, reader.uint32()); + break; + } + case 7: { + message.yaraRuleSignature = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature.decode(reader, reader.uint32()); + break; + } + case 8: { + message.signatureType = reader.int32(); + 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.v2.Indicator.ProcessSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.verify(message.yaraRuleSignature); + if (error) + return "yaraRuleSignature." + error; + } + } + if (message.signatureType != null && message.hasOwnProperty("signatureType")) + switch (message.signatureType) { + default: + return "signatureType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ProcessSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Indicator.ProcessSignature} ProcessSignature + */ + ProcessSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature) + return object; + var message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature(); + if (object.memoryHashSignature != null) { + if (typeof object.memoryHashSignature !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Indicator.ProcessSignature.memoryHashSignature: object expected"); + message.memoryHashSignature = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.fromObject(object.memoryHashSignature); + } + if (object.yaraRuleSignature != null) { + if (typeof object.yaraRuleSignature !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Indicator.ProcessSignature.yaraRuleSignature: object expected"); + message.yaraRuleSignature = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature.fromObject(object.yaraRuleSignature); + } + switch (object.signatureType) { + default: + if (typeof object.signatureType === "number") { + message.signatureType = object.signatureType; + break; + } + break; + case "SIGNATURE_TYPE_UNSPECIFIED": + case 0: + message.signatureType = 0; + break; + case "SIGNATURE_TYPE_PROCESS": + case 1: + message.signatureType = 1; + break; + case "SIGNATURE_TYPE_FILE": + case 2: + message.signatureType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ProcessSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v2.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 (options.defaults) + object.signatureType = options.enums === String ? "SIGNATURE_TYPE_UNSPECIFIED" : 0; + if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { + object.memoryHashSignature = $root.google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.toObject(message.yaraRuleSignature, options); + if (options.oneofs) + object.signature = "yaraRuleSignature"; + } + if (message.signatureType != null && message.hasOwnProperty("signatureType")) + object.signatureType = options.enums === String ? $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType[message.signatureType] === undefined ? message.signatureType : $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType[message.signatureType] : message.signatureType; + return object; + }; + + /** + * Converts this ProcessSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @instance + * @returns {Object.} JSON object + */ + ProcessSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature"; + }; + + ProcessSignature.MemoryHashSignature = (function() { + + /** + * Properties of a MemoryHashSignature. + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @interface IMemoryHashSignature + * @property {string|null} [binaryFamily] MemoryHashSignature binaryFamily + * @property {Array.|null} [detections] MemoryHashSignature detections + */ + + /** + * Constructs a new MemoryHashSignature. + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @classdesc Represents a MemoryHashSignature. + * @implements IMemoryHashSignature + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature + * @instance + */ + MemoryHashSignature.prototype.binaryFamily = ""; + + /** + * MemoryHashSignature detections. + * @member {Array.} detections + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature + * @instance + */ + MemoryHashSignature.prototype.detections = $util.emptyArray; + + /** + * Creates a new MemoryHashSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + */ + MemoryHashSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.detections: object expected"); + message.detections[i] = $root.google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection.toObject(message.detections[j], options); + } + return object; + }; + + /** + * Converts this MemoryHashSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature + * @instance + * @returns {Object.} JSON object + */ + MemoryHashSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MemoryHashSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature"; + }; + + MemoryHashSignature.Detection = (function() { + + /** + * Properties of a Detection. + * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature + * @classdesc Represents a Detection. + * @implements IDetection + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + */ + Detection.prototype.binary = ""; + + /** + * Detection percentPagesMatched. + * @member {number} percentPagesMatched + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + */ + Detection.prototype.percentPagesMatched = 0; + + /** + * Creates a new Detection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + */ + Detection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + * @returns {Object.} JSON object + */ + Detection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Detection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection"; + }; + + return Detection; + })(); + + return MemoryHashSignature; + })(); + + ProcessSignature.YaraRuleSignature = (function() { + + /** + * Properties of a YaraRuleSignature. + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @interface IYaraRuleSignature + * @property {string|null} [yaraRule] YaraRuleSignature yaraRule + */ + + /** + * Constructs a new YaraRuleSignature. + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature + * @classdesc Represents a YaraRuleSignature. + * @implements IYaraRuleSignature + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature + * @instance + */ + YaraRuleSignature.prototype.yaraRule = ""; + + /** + * Creates a new YaraRuleSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + */ + YaraRuleSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature + * @instance + * @returns {Object.} JSON object + */ + YaraRuleSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for YaraRuleSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature"; + }; + + return YaraRuleSignature; + })(); + + /** + * SignatureType enum. + * @name google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType + * @enum {number} + * @property {number} SIGNATURE_TYPE_UNSPECIFIED=0 SIGNATURE_TYPE_UNSPECIFIED value + * @property {number} SIGNATURE_TYPE_PROCESS=1 SIGNATURE_TYPE_PROCESS value + * @property {number} SIGNATURE_TYPE_FILE=2 SIGNATURE_TYPE_FILE value + */ + ProcessSignature.SignatureType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGNATURE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIGNATURE_TYPE_PROCESS"] = 1; + values[valuesById[2] = "SIGNATURE_TYPE_FILE"] = 2; + return values; + })(); + + return ProcessSignature; + })(); + + return Indicator; + })(); + + v2.IpRules = (function() { + + /** + * Properties of an IpRules. + * @memberof google.cloud.securitycenter.v2 + * @interface IIpRules + * @property {google.cloud.securitycenter.v2.IpRules.Direction|null} [direction] IpRules direction + * @property {google.cloud.securitycenter.v2.IAllowed|null} [allowed] IpRules allowed + * @property {google.cloud.securitycenter.v2.IDenied|null} [denied] IpRules denied + * @property {Array.|null} [sourceIpRanges] IpRules sourceIpRanges + * @property {Array.|null} [destinationIpRanges] IpRules destinationIpRanges + * @property {Array.|null} [exposedServices] IpRules exposedServices + */ + + /** + * Constructs a new IpRules. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an IpRules. + * @implements IIpRules + * @constructor + * @param {google.cloud.securitycenter.v2.IIpRules=} [properties] Properties to set + */ + function IpRules(properties) { + this.sourceIpRanges = []; + this.destinationIpRanges = []; + this.exposedServices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IpRules direction. + * @member {google.cloud.securitycenter.v2.IpRules.Direction} direction + * @memberof google.cloud.securitycenter.v2.IpRules + * @instance + */ + IpRules.prototype.direction = 0; + + /** + * IpRules allowed. + * @member {google.cloud.securitycenter.v2.IAllowed|null|undefined} allowed + * @memberof google.cloud.securitycenter.v2.IpRules + * @instance + */ + IpRules.prototype.allowed = null; + + /** + * IpRules denied. + * @member {google.cloud.securitycenter.v2.IDenied|null|undefined} denied + * @memberof google.cloud.securitycenter.v2.IpRules + * @instance + */ + IpRules.prototype.denied = null; + + /** + * IpRules sourceIpRanges. + * @member {Array.} sourceIpRanges + * @memberof google.cloud.securitycenter.v2.IpRules + * @instance + */ + IpRules.prototype.sourceIpRanges = $util.emptyArray; + + /** + * IpRules destinationIpRanges. + * @member {Array.} destinationIpRanges + * @memberof google.cloud.securitycenter.v2.IpRules + * @instance + */ + IpRules.prototype.destinationIpRanges = $util.emptyArray; + + /** + * IpRules exposedServices. + * @member {Array.} exposedServices + * @memberof google.cloud.securitycenter.v2.IpRules + * @instance + */ + IpRules.prototype.exposedServices = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IpRules rules. + * @member {"allowed"|"denied"|undefined} rules + * @memberof google.cloud.securitycenter.v2.IpRules + * @instance + */ + Object.defineProperty(IpRules.prototype, "rules", { + get: $util.oneOfGetter($oneOfFields = ["allowed", "denied"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IpRules instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {google.cloud.securitycenter.v2.IIpRules=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.IpRules} IpRules instance + */ + IpRules.create = function create(properties) { + return new IpRules(properties); + }; + + /** + * Encodes the specified IpRules message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRules.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {google.cloud.securitycenter.v2.IIpRules} message IpRules message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpRules.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.direction); + if (message.allowed != null && Object.hasOwnProperty.call(message, "allowed")) + $root.google.cloud.securitycenter.v2.Allowed.encode(message.allowed, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.denied != null && Object.hasOwnProperty.call(message, "denied")) + $root.google.cloud.securitycenter.v2.Denied.encode(message.denied, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sourceIpRanges != null && message.sourceIpRanges.length) + for (var i = 0; i < message.sourceIpRanges.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceIpRanges[i]); + if (message.destinationIpRanges != null && message.destinationIpRanges.length) + for (var i = 0; i < message.destinationIpRanges.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.destinationIpRanges[i]); + if (message.exposedServices != null && message.exposedServices.length) + for (var i = 0; i < message.exposedServices.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.exposedServices[i]); + return writer; + }; + + /** + * Encodes the specified IpRules message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRules.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {google.cloud.securitycenter.v2.IIpRules} message IpRules message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpRules.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IpRules message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.IpRules} IpRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpRules.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.IpRules(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.direction = reader.int32(); + break; + } + case 2: { + message.allowed = $root.google.cloud.securitycenter.v2.Allowed.decode(reader, reader.uint32()); + break; + } + case 3: { + message.denied = $root.google.cloud.securitycenter.v2.Denied.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.sourceIpRanges && message.sourceIpRanges.length)) + message.sourceIpRanges = []; + message.sourceIpRanges.push(reader.string()); + break; + } + case 5: { + if (!(message.destinationIpRanges && message.destinationIpRanges.length)) + message.destinationIpRanges = []; + message.destinationIpRanges.push(reader.string()); + break; + } + case 6: { + if (!(message.exposedServices && message.exposedServices.length)) + message.exposedServices = []; + message.exposedServices.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IpRules message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.IpRules} IpRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpRules.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IpRules message. + * @function verify + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IpRules.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allowed != null && message.hasOwnProperty("allowed")) { + properties.rules = 1; + { + var error = $root.google.cloud.securitycenter.v2.Allowed.verify(message.allowed); + if (error) + return "allowed." + error; + } + } + if (message.denied != null && message.hasOwnProperty("denied")) { + if (properties.rules === 1) + return "rules: multiple values"; + properties.rules = 1; + { + var error = $root.google.cloud.securitycenter.v2.Denied.verify(message.denied); + if (error) + return "denied." + error; + } + } + if (message.sourceIpRanges != null && message.hasOwnProperty("sourceIpRanges")) { + if (!Array.isArray(message.sourceIpRanges)) + return "sourceIpRanges: array expected"; + for (var i = 0; i < message.sourceIpRanges.length; ++i) + if (!$util.isString(message.sourceIpRanges[i])) + return "sourceIpRanges: string[] expected"; + } + if (message.destinationIpRanges != null && message.hasOwnProperty("destinationIpRanges")) { + if (!Array.isArray(message.destinationIpRanges)) + return "destinationIpRanges: array expected"; + for (var i = 0; i < message.destinationIpRanges.length; ++i) + if (!$util.isString(message.destinationIpRanges[i])) + return "destinationIpRanges: string[] expected"; + } + if (message.exposedServices != null && message.hasOwnProperty("exposedServices")) { + if (!Array.isArray(message.exposedServices)) + return "exposedServices: array expected"; + for (var i = 0; i < message.exposedServices.length; ++i) + if (!$util.isString(message.exposedServices[i])) + return "exposedServices: string[] expected"; + } + return null; + }; + + /** + * Creates an IpRules message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.IpRules} IpRules + */ + IpRules.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.IpRules) + return object; + var message = new $root.google.cloud.securitycenter.v2.IpRules(); + switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "INGRESS": + case 1: + message.direction = 1; + break; + case "EGRESS": + case 2: + message.direction = 2; + break; + } + if (object.allowed != null) { + if (typeof object.allowed !== "object") + throw TypeError(".google.cloud.securitycenter.v2.IpRules.allowed: object expected"); + message.allowed = $root.google.cloud.securitycenter.v2.Allowed.fromObject(object.allowed); + } + if (object.denied != null) { + if (typeof object.denied !== "object") + throw TypeError(".google.cloud.securitycenter.v2.IpRules.denied: object expected"); + message.denied = $root.google.cloud.securitycenter.v2.Denied.fromObject(object.denied); + } + if (object.sourceIpRanges) { + if (!Array.isArray(object.sourceIpRanges)) + throw TypeError(".google.cloud.securitycenter.v2.IpRules.sourceIpRanges: array expected"); + message.sourceIpRanges = []; + for (var i = 0; i < object.sourceIpRanges.length; ++i) + message.sourceIpRanges[i] = String(object.sourceIpRanges[i]); + } + if (object.destinationIpRanges) { + if (!Array.isArray(object.destinationIpRanges)) + throw TypeError(".google.cloud.securitycenter.v2.IpRules.destinationIpRanges: array expected"); + message.destinationIpRanges = []; + for (var i = 0; i < object.destinationIpRanges.length; ++i) + message.destinationIpRanges[i] = String(object.destinationIpRanges[i]); + } + if (object.exposedServices) { + if (!Array.isArray(object.exposedServices)) + throw TypeError(".google.cloud.securitycenter.v2.IpRules.exposedServices: array expected"); + message.exposedServices = []; + for (var i = 0; i < object.exposedServices.length; ++i) + message.exposedServices[i] = String(object.exposedServices[i]); + } + return message; + }; + + /** + * Creates a plain object from an IpRules message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {google.cloud.securitycenter.v2.IpRules} message IpRules + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IpRules.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sourceIpRanges = []; + object.destinationIpRanges = []; + object.exposedServices = []; + } + if (options.defaults) + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.cloud.securitycenter.v2.IpRules.Direction[message.direction] === undefined ? message.direction : $root.google.cloud.securitycenter.v2.IpRules.Direction[message.direction] : message.direction; + if (message.allowed != null && message.hasOwnProperty("allowed")) { + object.allowed = $root.google.cloud.securitycenter.v2.Allowed.toObject(message.allowed, options); + if (options.oneofs) + object.rules = "allowed"; + } + if (message.denied != null && message.hasOwnProperty("denied")) { + object.denied = $root.google.cloud.securitycenter.v2.Denied.toObject(message.denied, options); + if (options.oneofs) + object.rules = "denied"; + } + if (message.sourceIpRanges && message.sourceIpRanges.length) { + object.sourceIpRanges = []; + for (var j = 0; j < message.sourceIpRanges.length; ++j) + object.sourceIpRanges[j] = message.sourceIpRanges[j]; + } + if (message.destinationIpRanges && message.destinationIpRanges.length) { + object.destinationIpRanges = []; + for (var j = 0; j < message.destinationIpRanges.length; ++j) + object.destinationIpRanges[j] = message.destinationIpRanges[j]; + } + if (message.exposedServices && message.exposedServices.length) { + object.exposedServices = []; + for (var j = 0; j < message.exposedServices.length; ++j) + object.exposedServices[j] = message.exposedServices[j]; + } + return object; + }; + + /** + * Converts this IpRules to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.IpRules + * @instance + * @returns {Object.} JSON object + */ + IpRules.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IpRules + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.IpRules + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IpRules.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.IpRules"; + }; + + /** + * Direction enum. + * @name google.cloud.securitycenter.v2.IpRules.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} INGRESS=1 INGRESS value + * @property {number} EGRESS=2 EGRESS value + */ + IpRules.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "INGRESS"] = 1; + values[valuesById[2] = "EGRESS"] = 2; + return values; + })(); + + return IpRules; + })(); + + v2.IpRule = (function() { + + /** + * Properties of an IpRule. + * @memberof google.cloud.securitycenter.v2 + * @interface IIpRule + * @property {string|null} [protocol] IpRule protocol + * @property {Array.|null} [portRanges] IpRule portRanges + */ + + /** + * Constructs a new IpRule. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an IpRule. + * @implements IIpRule + * @constructor + * @param {google.cloud.securitycenter.v2.IIpRule=} [properties] Properties to set + */ + function IpRule(properties) { + this.portRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IpRule protocol. + * @member {string} protocol + * @memberof google.cloud.securitycenter.v2.IpRule + * @instance + */ + IpRule.prototype.protocol = ""; + + /** + * IpRule portRanges. + * @member {Array.} portRanges + * @memberof google.cloud.securitycenter.v2.IpRule + * @instance + */ + IpRule.prototype.portRanges = $util.emptyArray; + + /** + * Creates a new IpRule instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {google.cloud.securitycenter.v2.IIpRule=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.IpRule} IpRule instance + */ + IpRule.create = function create(properties) { + return new IpRule(properties); + }; + + /** + * Encodes the specified IpRule message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {google.cloud.securitycenter.v2.IIpRule} message IpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.protocol); + if (message.portRanges != null && message.portRanges.length) + for (var i = 0; i < message.portRanges.length; ++i) + $root.google.cloud.securitycenter.v2.IpRule.PortRange.encode(message.portRanges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IpRule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {google.cloud.securitycenter.v2.IIpRule} message IpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IpRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.IpRule} IpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.IpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.protocol = reader.string(); + break; + } + case 2: { + if (!(message.portRanges && message.portRanges.length)) + message.portRanges = []; + message.portRanges.push($root.google.cloud.securitycenter.v2.IpRule.PortRange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.IpRule} IpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IpRule message. + * @function verify + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (!$util.isString(message.protocol)) + return "protocol: string expected"; + if (message.portRanges != null && message.hasOwnProperty("portRanges")) { + if (!Array.isArray(message.portRanges)) + return "portRanges: array expected"; + for (var i = 0; i < message.portRanges.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.IpRule.PortRange.verify(message.portRanges[i]); + if (error) + return "portRanges." + error; + } + } + return null; + }; + + /** + * Creates an IpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.IpRule} IpRule + */ + IpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.IpRule) + return object; + var message = new $root.google.cloud.securitycenter.v2.IpRule(); + if (object.protocol != null) + message.protocol = String(object.protocol); + if (object.portRanges) { + if (!Array.isArray(object.portRanges)) + throw TypeError(".google.cloud.securitycenter.v2.IpRule.portRanges: array expected"); + message.portRanges = []; + for (var i = 0; i < object.portRanges.length; ++i) { + if (typeof object.portRanges[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.IpRule.portRanges: object expected"); + message.portRanges[i] = $root.google.cloud.securitycenter.v2.IpRule.PortRange.fromObject(object.portRanges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {google.cloud.securitycenter.v2.IpRule} message IpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.portRanges = []; + if (options.defaults) + object.protocol = ""; + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = message.protocol; + if (message.portRanges && message.portRanges.length) { + object.portRanges = []; + for (var j = 0; j < message.portRanges.length; ++j) + object.portRanges[j] = $root.google.cloud.securitycenter.v2.IpRule.PortRange.toObject(message.portRanges[j], options); + } + return object; + }; + + /** + * Converts this IpRule to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.IpRule + * @instance + * @returns {Object.} JSON object + */ + IpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IpRule + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.IpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.IpRule"; + }; + + IpRule.PortRange = (function() { + + /** + * Properties of a PortRange. + * @memberof google.cloud.securitycenter.v2.IpRule + * @interface IPortRange + * @property {number|Long|null} [min] PortRange min + * @property {number|Long|null} [max] PortRange max + */ + + /** + * Constructs a new PortRange. + * @memberof google.cloud.securitycenter.v2.IpRule + * @classdesc Represents a PortRange. + * @implements IPortRange + * @constructor + * @param {google.cloud.securitycenter.v2.IpRule.IPortRange=} [properties] Properties to set + */ + function PortRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PortRange min. + * @member {number|Long} min + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @instance + */ + PortRange.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PortRange max. + * @member {number|Long} max + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @instance + */ + PortRange.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PortRange instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {google.cloud.securitycenter.v2.IpRule.IPortRange=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.IpRule.PortRange} PortRange instance + */ + PortRange.create = function create(properties) { + return new PortRange(properties); + }; + + /** + * Encodes the specified PortRange message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.PortRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {google.cloud.securitycenter.v2.IpRule.IPortRange} message PortRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PortRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.max); + return writer; + }; + + /** + * Encodes the specified PortRange message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.PortRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {google.cloud.securitycenter.v2.IpRule.IPortRange} message PortRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PortRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PortRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.IpRule.PortRange} PortRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PortRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.IpRule.PortRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.min = reader.int64(); + break; + } + case 2: { + message.max = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PortRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.IpRule.PortRange} PortRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PortRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PortRange message. + * @function verify + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PortRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.min != null && message.hasOwnProperty("min")) + if (!$util.isInteger(message.min) && !(message.min && $util.isInteger(message.min.low) && $util.isInteger(message.min.high))) + return "min: integer|Long expected"; + if (message.max != null && message.hasOwnProperty("max")) + if (!$util.isInteger(message.max) && !(message.max && $util.isInteger(message.max.low) && $util.isInteger(message.max.high))) + return "max: integer|Long expected"; + return null; + }; + + /** + * Creates a PortRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.IpRule.PortRange} PortRange + */ + PortRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.IpRule.PortRange) + return object; + var message = new $root.google.cloud.securitycenter.v2.IpRule.PortRange(); + if (object.min != null) + if ($util.Long) + (message.min = $util.Long.fromValue(object.min)).unsigned = false; + else if (typeof object.min === "string") + message.min = parseInt(object.min, 10); + else if (typeof object.min === "number") + message.min = object.min; + else if (typeof object.min === "object") + message.min = new $util.LongBits(object.min.low >>> 0, object.min.high >>> 0).toNumber(); + if (object.max != null) + if ($util.Long) + (message.max = $util.Long.fromValue(object.max)).unsigned = false; + else if (typeof object.max === "string") + message.max = parseInt(object.max, 10); + else if (typeof object.max === "number") + message.max = object.max; + else if (typeof object.max === "object") + message.max = new $util.LongBits(object.max.low >>> 0, object.max.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PortRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {google.cloud.securitycenter.v2.IpRule.PortRange} message PortRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PortRange.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.min = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.min = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.max = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.max = options.longs === String ? "0" : 0; + } + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min === "number") + object.min = options.longs === String ? String(message.min) : message.min; + else + object.min = options.longs === String ? $util.Long.prototype.toString.call(message.min) : options.longs === Number ? new $util.LongBits(message.min.low >>> 0, message.min.high >>> 0).toNumber() : message.min; + if (message.max != null && message.hasOwnProperty("max")) + if (typeof message.max === "number") + object.max = options.longs === String ? String(message.max) : message.max; + else + object.max = options.longs === String ? $util.Long.prototype.toString.call(message.max) : options.longs === Number ? new $util.LongBits(message.max.low >>> 0, message.max.high >>> 0).toNumber() : message.max; + return object; + }; + + /** + * Converts this PortRange to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @instance + * @returns {Object.} JSON object + */ + PortRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PortRange + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.IpRule.PortRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PortRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.IpRule.PortRange"; + }; + + return PortRange; + })(); + + return IpRule; + })(); + + v2.Allowed = (function() { + + /** + * Properties of an Allowed. + * @memberof google.cloud.securitycenter.v2 + * @interface IAllowed + * @property {Array.|null} [ipRules] Allowed ipRules + */ + + /** + * Constructs a new Allowed. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an Allowed. + * @implements IAllowed + * @constructor + * @param {google.cloud.securitycenter.v2.IAllowed=} [properties] Properties to set + */ + function Allowed(properties) { + this.ipRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Allowed ipRules. + * @member {Array.} ipRules + * @memberof google.cloud.securitycenter.v2.Allowed + * @instance + */ + Allowed.prototype.ipRules = $util.emptyArray; + + /** + * Creates a new Allowed instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {google.cloud.securitycenter.v2.IAllowed=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Allowed} Allowed instance + */ + Allowed.create = function create(properties) { + return new Allowed(properties); + }; + + /** + * Encodes the specified Allowed message. Does not implicitly {@link google.cloud.securitycenter.v2.Allowed.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {google.cloud.securitycenter.v2.IAllowed} message Allowed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Allowed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipRules != null && message.ipRules.length) + for (var i = 0; i < message.ipRules.length; ++i) + $root.google.cloud.securitycenter.v2.IpRule.encode(message.ipRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Allowed message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Allowed.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {google.cloud.securitycenter.v2.IAllowed} message Allowed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Allowed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Allowed message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Allowed} Allowed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Allowed.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Allowed(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ipRules && message.ipRules.length)) + message.ipRules = []; + message.ipRules.push($root.google.cloud.securitycenter.v2.IpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Allowed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Allowed} Allowed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Allowed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Allowed message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Allowed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipRules != null && message.hasOwnProperty("ipRules")) { + if (!Array.isArray(message.ipRules)) + return "ipRules: array expected"; + for (var i = 0; i < message.ipRules.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.IpRule.verify(message.ipRules[i]); + if (error) + return "ipRules." + error; + } + } + return null; + }; + + /** + * Creates an Allowed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Allowed} Allowed + */ + Allowed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Allowed) + return object; + var message = new $root.google.cloud.securitycenter.v2.Allowed(); + if (object.ipRules) { + if (!Array.isArray(object.ipRules)) + throw TypeError(".google.cloud.securitycenter.v2.Allowed.ipRules: array expected"); + message.ipRules = []; + for (var i = 0; i < object.ipRules.length; ++i) { + if (typeof object.ipRules[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Allowed.ipRules: object expected"); + message.ipRules[i] = $root.google.cloud.securitycenter.v2.IpRule.fromObject(object.ipRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Allowed message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {google.cloud.securitycenter.v2.Allowed} message Allowed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Allowed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ipRules = []; + if (message.ipRules && message.ipRules.length) { + object.ipRules = []; + for (var j = 0; j < message.ipRules.length; ++j) + object.ipRules[j] = $root.google.cloud.securitycenter.v2.IpRule.toObject(message.ipRules[j], options); + } + return object; + }; + + /** + * Converts this Allowed to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Allowed + * @instance + * @returns {Object.} JSON object + */ + Allowed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Allowed + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Allowed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Allowed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Allowed"; + }; + + return Allowed; + })(); + + v2.Denied = (function() { + + /** + * Properties of a Denied. + * @memberof google.cloud.securitycenter.v2 + * @interface IDenied + * @property {Array.|null} [ipRules] Denied ipRules + */ + + /** + * Constructs a new Denied. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Denied. + * @implements IDenied + * @constructor + * @param {google.cloud.securitycenter.v2.IDenied=} [properties] Properties to set + */ + function Denied(properties) { + this.ipRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Denied ipRules. + * @member {Array.} ipRules + * @memberof google.cloud.securitycenter.v2.Denied + * @instance + */ + Denied.prototype.ipRules = $util.emptyArray; + + /** + * Creates a new Denied instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {google.cloud.securitycenter.v2.IDenied=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Denied} Denied instance + */ + Denied.create = function create(properties) { + return new Denied(properties); + }; + + /** + * Encodes the specified Denied message. Does not implicitly {@link google.cloud.securitycenter.v2.Denied.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {google.cloud.securitycenter.v2.IDenied} message Denied message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Denied.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipRules != null && message.ipRules.length) + for (var i = 0; i < message.ipRules.length; ++i) + $root.google.cloud.securitycenter.v2.IpRule.encode(message.ipRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Denied message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Denied.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {google.cloud.securitycenter.v2.IDenied} message Denied message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Denied.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Denied message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Denied} Denied + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Denied.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Denied(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ipRules && message.ipRules.length)) + message.ipRules = []; + message.ipRules.push($root.google.cloud.securitycenter.v2.IpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Denied message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Denied} Denied + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Denied.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Denied message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Denied.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipRules != null && message.hasOwnProperty("ipRules")) { + if (!Array.isArray(message.ipRules)) + return "ipRules: array expected"; + for (var i = 0; i < message.ipRules.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.IpRule.verify(message.ipRules[i]); + if (error) + return "ipRules." + error; + } + } + return null; + }; + + /** + * Creates a Denied message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Denied} Denied + */ + Denied.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Denied) + return object; + var message = new $root.google.cloud.securitycenter.v2.Denied(); + if (object.ipRules) { + if (!Array.isArray(object.ipRules)) + throw TypeError(".google.cloud.securitycenter.v2.Denied.ipRules: array expected"); + message.ipRules = []; + for (var i = 0; i < object.ipRules.length; ++i) { + if (typeof object.ipRules[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Denied.ipRules: object expected"); + message.ipRules[i] = $root.google.cloud.securitycenter.v2.IpRule.fromObject(object.ipRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Denied message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {google.cloud.securitycenter.v2.Denied} message Denied + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Denied.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ipRules = []; + if (message.ipRules && message.ipRules.length) { + object.ipRules = []; + for (var j = 0; j < message.ipRules.length; ++j) + object.ipRules[j] = $root.google.cloud.securitycenter.v2.IpRule.toObject(message.ipRules[j], options); + } + return object; + }; + + /** + * Converts this Denied to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Denied + * @instance + * @returns {Object.} JSON object + */ + Denied.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Denied + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Denied + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Denied.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Denied"; + }; + + return Denied; + })(); + + v2.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.securitycenter.v2 + * @interface IJob + * @property {string|null} [name] Job name + * @property {google.cloud.securitycenter.v2.JobState|null} [state] Job state + * @property {number|null} [errorCode] Job errorCode + * @property {string|null} [location] Job location + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.securitycenter.v2.IJob=} [properties] Properties to set + */ + function Job(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job state. + * @member {google.cloud.securitycenter.v2.JobState} state + * @memberof google.cloud.securitycenter.v2.Job + * @instance + */ + Job.prototype.state = 0; + + /** + * Job errorCode. + * @member {number} errorCode + * @memberof google.cloud.securitycenter.v2.Job + * @instance + */ + Job.prototype.errorCode = 0; + + /** + * Job location. + * @member {string} location + * @memberof google.cloud.securitycenter.v2.Job + * @instance + */ + Job.prototype.location = ""; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {google.cloud.securitycenter.v2.IJob=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.securitycenter.v2.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {google.cloud.securitycenter.v2.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.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.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCode); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {google.cloud.securitycenter.v2.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Job(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.errorCode = reader.int32(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.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: + case 3: + case 4: + break; + } + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + if (!$util.isInteger(message.errorCode)) + return "errorCode: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Job) + return object; + var message = new $root.google.cloud.securitycenter.v2.Job(); + 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 "JOB_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + } + if (object.errorCode != null) + message.errorCode = object.errorCode | 0; + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {google.cloud.securitycenter.v2.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "JOB_STATE_UNSPECIFIED" : 0; + object.errorCode = 0; + object.location = ""; + } + 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.v2.JobState[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.JobState[message.state] : message.state; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = message.errorCode; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Job"; + }; + + return Job; + })(); + + /** + * JobState enum. + * @name google.cloud.securitycenter.v2.JobState + * @enum {number} + * @property {number} JOB_STATE_UNSPECIFIED=0 JOB_STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + */ + v2.JobState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + v2.KernelRootkit = (function() { + + /** + * Properties of a KernelRootkit. + * @memberof google.cloud.securitycenter.v2 + * @interface IKernelRootkit + * @property {string|null} [name] KernelRootkit name + * @property {boolean|null} [unexpectedCodeModification] KernelRootkit unexpectedCodeModification + * @property {boolean|null} [unexpectedReadOnlyDataModification] KernelRootkit unexpectedReadOnlyDataModification + * @property {boolean|null} [unexpectedFtraceHandler] KernelRootkit unexpectedFtraceHandler + * @property {boolean|null} [unexpectedKprobeHandler] KernelRootkit unexpectedKprobeHandler + * @property {boolean|null} [unexpectedKernelCodePages] KernelRootkit unexpectedKernelCodePages + * @property {boolean|null} [unexpectedSystemCallHandler] KernelRootkit unexpectedSystemCallHandler + * @property {boolean|null} [unexpectedInterruptHandler] KernelRootkit unexpectedInterruptHandler + * @property {boolean|null} [unexpectedProcessesInRunqueue] KernelRootkit unexpectedProcessesInRunqueue + */ + + /** + * Constructs a new KernelRootkit. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a KernelRootkit. + * @implements IKernelRootkit + * @constructor + * @param {google.cloud.securitycenter.v2.IKernelRootkit=} [properties] Properties to set + */ + function KernelRootkit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KernelRootkit name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.name = ""; + + /** + * KernelRootkit unexpectedCodeModification. + * @member {boolean} unexpectedCodeModification + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedCodeModification = false; + + /** + * KernelRootkit unexpectedReadOnlyDataModification. + * @member {boolean} unexpectedReadOnlyDataModification + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedReadOnlyDataModification = false; + + /** + * KernelRootkit unexpectedFtraceHandler. + * @member {boolean} unexpectedFtraceHandler + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedFtraceHandler = false; + + /** + * KernelRootkit unexpectedKprobeHandler. + * @member {boolean} unexpectedKprobeHandler + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedKprobeHandler = false; + + /** + * KernelRootkit unexpectedKernelCodePages. + * @member {boolean} unexpectedKernelCodePages + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedKernelCodePages = false; + + /** + * KernelRootkit unexpectedSystemCallHandler. + * @member {boolean} unexpectedSystemCallHandler + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedSystemCallHandler = false; + + /** + * KernelRootkit unexpectedInterruptHandler. + * @member {boolean} unexpectedInterruptHandler + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedInterruptHandler = false; + + /** + * KernelRootkit unexpectedProcessesInRunqueue. + * @member {boolean} unexpectedProcessesInRunqueue + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + */ + KernelRootkit.prototype.unexpectedProcessesInRunqueue = false; + + /** + * Creates a new KernelRootkit instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {google.cloud.securitycenter.v2.IKernelRootkit=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.KernelRootkit} KernelRootkit instance + */ + KernelRootkit.create = function create(properties) { + return new KernelRootkit(properties); + }; + + /** + * Encodes the specified KernelRootkit message. Does not implicitly {@link google.cloud.securitycenter.v2.KernelRootkit.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {google.cloud.securitycenter.v2.IKernelRootkit} message KernelRootkit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KernelRootkit.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.unexpectedCodeModification != null && Object.hasOwnProperty.call(message, "unexpectedCodeModification")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.unexpectedCodeModification); + if (message.unexpectedReadOnlyDataModification != null && Object.hasOwnProperty.call(message, "unexpectedReadOnlyDataModification")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unexpectedReadOnlyDataModification); + if (message.unexpectedFtraceHandler != null && Object.hasOwnProperty.call(message, "unexpectedFtraceHandler")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.unexpectedFtraceHandler); + if (message.unexpectedKprobeHandler != null && Object.hasOwnProperty.call(message, "unexpectedKprobeHandler")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.unexpectedKprobeHandler); + if (message.unexpectedKernelCodePages != null && Object.hasOwnProperty.call(message, "unexpectedKernelCodePages")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.unexpectedKernelCodePages); + if (message.unexpectedSystemCallHandler != null && Object.hasOwnProperty.call(message, "unexpectedSystemCallHandler")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.unexpectedSystemCallHandler); + if (message.unexpectedInterruptHandler != null && Object.hasOwnProperty.call(message, "unexpectedInterruptHandler")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.unexpectedInterruptHandler); + if (message.unexpectedProcessesInRunqueue != null && Object.hasOwnProperty.call(message, "unexpectedProcessesInRunqueue")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.unexpectedProcessesInRunqueue); + return writer; + }; + + /** + * Encodes the specified KernelRootkit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.KernelRootkit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {google.cloud.securitycenter.v2.IKernelRootkit} message KernelRootkit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KernelRootkit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KernelRootkit message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.KernelRootkit} KernelRootkit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KernelRootkit.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.KernelRootkit(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.unexpectedCodeModification = reader.bool(); + break; + } + case 3: { + message.unexpectedReadOnlyDataModification = reader.bool(); + break; + } + case 4: { + message.unexpectedFtraceHandler = reader.bool(); + break; + } + case 5: { + message.unexpectedKprobeHandler = reader.bool(); + break; + } + case 6: { + message.unexpectedKernelCodePages = reader.bool(); + break; + } + case 7: { + message.unexpectedSystemCallHandler = reader.bool(); + break; + } + case 8: { + message.unexpectedInterruptHandler = reader.bool(); + break; + } + case 9: { + message.unexpectedProcessesInRunqueue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KernelRootkit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.KernelRootkit} KernelRootkit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KernelRootkit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KernelRootkit message. + * @function verify + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KernelRootkit.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.unexpectedCodeModification != null && message.hasOwnProperty("unexpectedCodeModification")) + if (typeof message.unexpectedCodeModification !== "boolean") + return "unexpectedCodeModification: boolean expected"; + if (message.unexpectedReadOnlyDataModification != null && message.hasOwnProperty("unexpectedReadOnlyDataModification")) + if (typeof message.unexpectedReadOnlyDataModification !== "boolean") + return "unexpectedReadOnlyDataModification: boolean expected"; + if (message.unexpectedFtraceHandler != null && message.hasOwnProperty("unexpectedFtraceHandler")) + if (typeof message.unexpectedFtraceHandler !== "boolean") + return "unexpectedFtraceHandler: boolean expected"; + if (message.unexpectedKprobeHandler != null && message.hasOwnProperty("unexpectedKprobeHandler")) + if (typeof message.unexpectedKprobeHandler !== "boolean") + return "unexpectedKprobeHandler: boolean expected"; + if (message.unexpectedKernelCodePages != null && message.hasOwnProperty("unexpectedKernelCodePages")) + if (typeof message.unexpectedKernelCodePages !== "boolean") + return "unexpectedKernelCodePages: boolean expected"; + if (message.unexpectedSystemCallHandler != null && message.hasOwnProperty("unexpectedSystemCallHandler")) + if (typeof message.unexpectedSystemCallHandler !== "boolean") + return "unexpectedSystemCallHandler: boolean expected"; + if (message.unexpectedInterruptHandler != null && message.hasOwnProperty("unexpectedInterruptHandler")) + if (typeof message.unexpectedInterruptHandler !== "boolean") + return "unexpectedInterruptHandler: boolean expected"; + if (message.unexpectedProcessesInRunqueue != null && message.hasOwnProperty("unexpectedProcessesInRunqueue")) + if (typeof message.unexpectedProcessesInRunqueue !== "boolean") + return "unexpectedProcessesInRunqueue: boolean expected"; + return null; + }; + + /** + * Creates a KernelRootkit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.KernelRootkit} KernelRootkit + */ + KernelRootkit.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.KernelRootkit) + return object; + var message = new $root.google.cloud.securitycenter.v2.KernelRootkit(); + if (object.name != null) + message.name = String(object.name); + if (object.unexpectedCodeModification != null) + message.unexpectedCodeModification = Boolean(object.unexpectedCodeModification); + if (object.unexpectedReadOnlyDataModification != null) + message.unexpectedReadOnlyDataModification = Boolean(object.unexpectedReadOnlyDataModification); + if (object.unexpectedFtraceHandler != null) + message.unexpectedFtraceHandler = Boolean(object.unexpectedFtraceHandler); + if (object.unexpectedKprobeHandler != null) + message.unexpectedKprobeHandler = Boolean(object.unexpectedKprobeHandler); + if (object.unexpectedKernelCodePages != null) + message.unexpectedKernelCodePages = Boolean(object.unexpectedKernelCodePages); + if (object.unexpectedSystemCallHandler != null) + message.unexpectedSystemCallHandler = Boolean(object.unexpectedSystemCallHandler); + if (object.unexpectedInterruptHandler != null) + message.unexpectedInterruptHandler = Boolean(object.unexpectedInterruptHandler); + if (object.unexpectedProcessesInRunqueue != null) + message.unexpectedProcessesInRunqueue = Boolean(object.unexpectedProcessesInRunqueue); + return message; + }; + + /** + * Creates a plain object from a KernelRootkit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {google.cloud.securitycenter.v2.KernelRootkit} message KernelRootkit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KernelRootkit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.unexpectedCodeModification = false; + object.unexpectedReadOnlyDataModification = false; + object.unexpectedFtraceHandler = false; + object.unexpectedKprobeHandler = false; + object.unexpectedKernelCodePages = false; + object.unexpectedSystemCallHandler = false; + object.unexpectedInterruptHandler = false; + object.unexpectedProcessesInRunqueue = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.unexpectedCodeModification != null && message.hasOwnProperty("unexpectedCodeModification")) + object.unexpectedCodeModification = message.unexpectedCodeModification; + if (message.unexpectedReadOnlyDataModification != null && message.hasOwnProperty("unexpectedReadOnlyDataModification")) + object.unexpectedReadOnlyDataModification = message.unexpectedReadOnlyDataModification; + if (message.unexpectedFtraceHandler != null && message.hasOwnProperty("unexpectedFtraceHandler")) + object.unexpectedFtraceHandler = message.unexpectedFtraceHandler; + if (message.unexpectedKprobeHandler != null && message.hasOwnProperty("unexpectedKprobeHandler")) + object.unexpectedKprobeHandler = message.unexpectedKprobeHandler; + if (message.unexpectedKernelCodePages != null && message.hasOwnProperty("unexpectedKernelCodePages")) + object.unexpectedKernelCodePages = message.unexpectedKernelCodePages; + if (message.unexpectedSystemCallHandler != null && message.hasOwnProperty("unexpectedSystemCallHandler")) + object.unexpectedSystemCallHandler = message.unexpectedSystemCallHandler; + if (message.unexpectedInterruptHandler != null && message.hasOwnProperty("unexpectedInterruptHandler")) + object.unexpectedInterruptHandler = message.unexpectedInterruptHandler; + if (message.unexpectedProcessesInRunqueue != null && message.hasOwnProperty("unexpectedProcessesInRunqueue")) + object.unexpectedProcessesInRunqueue = message.unexpectedProcessesInRunqueue; + return object; + }; + + /** + * Converts this KernelRootkit to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @instance + * @returns {Object.} JSON object + */ + KernelRootkit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KernelRootkit + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.KernelRootkit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KernelRootkit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.KernelRootkit"; + }; + + return KernelRootkit; + })(); + + v2.Kubernetes = (function() { + + /** + * Properties of a Kubernetes. + * @memberof google.cloud.securitycenter.v2 + * @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 + * @property {Array.|null} [objects] Kubernetes objects + */ + + /** + * Constructs a new Kubernetes. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Kubernetes. + * @implements IKubernetes + * @constructor + * @param {google.cloud.securitycenter.v2.IKubernetes=} [properties] Properties to set + */ + function Kubernetes(properties) { + this.pods = []; + this.nodes = []; + this.nodePools = []; + this.roles = []; + this.bindings = []; + this.accessReviews = []; + this.objects = []; + if (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.v2.Kubernetes + * @instance + */ + Kubernetes.prototype.pods = $util.emptyArray; + + /** + * Kubernetes nodes. + * @member {Array.} nodes + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @instance + */ + Kubernetes.prototype.nodes = $util.emptyArray; + + /** + * Kubernetes nodePools. + * @member {Array.} nodePools + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @instance + */ + Kubernetes.prototype.nodePools = $util.emptyArray; + + /** + * Kubernetes roles. + * @member {Array.} roles + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @instance + */ + Kubernetes.prototype.roles = $util.emptyArray; + + /** + * Kubernetes bindings. + * @member {Array.} bindings + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @instance + */ + Kubernetes.prototype.bindings = $util.emptyArray; + + /** + * Kubernetes accessReviews. + * @member {Array.} accessReviews + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @instance + */ + Kubernetes.prototype.accessReviews = $util.emptyArray; + + /** + * Kubernetes objects. + * @member {Array.} objects + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @instance + */ + Kubernetes.prototype.objects = $util.emptyArray; + + /** + * Creates a new Kubernetes instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @static + * @param {google.cloud.securitycenter.v2.IKubernetes=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Kubernetes} Kubernetes instance + */ + Kubernetes.create = function create(properties) { + return new Kubernetes(properties); + }; + + /** + * Encodes the specified Kubernetes message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.AccessReview.encode(message.accessReviews[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.objects != null && message.objects.length) + for (var i = 0; i < message.objects.length; ++i) + $root.google.cloud.securitycenter.v2.Kubernetes.Object.encode(message.objects[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Kubernetes message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.pods && message.pods.length)) + message.pods = []; + message.pods.push($root.google.cloud.securitycenter.v2.Kubernetes.Pod.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v2.Kubernetes.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nodePools && message.nodePools.length)) + message.nodePools = []; + message.nodePools.push($root.google.cloud.securitycenter.v2.Kubernetes.NodePool.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.google.cloud.securitycenter.v2.Kubernetes.Role.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.securitycenter.v2.Kubernetes.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.accessReviews && message.accessReviews.length)) + message.accessReviews = []; + message.accessReviews.push($root.google.cloud.securitycenter.v2.Kubernetes.AccessReview.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.objects && message.objects.length)) + message.objects = []; + message.objects.push($root.google.cloud.securitycenter.v2.Kubernetes.Object.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.v2.Kubernetes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.AccessReview.verify(message.accessReviews[i]); + if (error) + return "accessReviews." + error; + } + } + if (message.objects != null && message.hasOwnProperty("objects")) { + if (!Array.isArray(message.objects)) + return "objects: array expected"; + for (var i = 0; i < message.objects.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.Kubernetes.Object.verify(message.objects[i]); + if (error) + return "objects." + 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.v2.Kubernetes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes} Kubernetes + */ + Kubernetes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes) + return object; + var message = new $root.google.cloud.securitycenter.v2.Kubernetes(); + if (object.pods) { + if (!Array.isArray(object.pods)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.pods: object expected"); + message.pods[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Pod.fromObject(object.pods[i]); + } + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.nodes: object expected"); + message.nodes[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Node.fromObject(object.nodes[i]); + } + } + if (object.nodePools) { + if (!Array.isArray(object.nodePools)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.nodePools: object expected"); + message.nodePools[i] = $root.google.cloud.securitycenter.v2.Kubernetes.NodePool.fromObject(object.nodePools[i]); + } + } + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.roles: object expected"); + message.roles[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Role.fromObject(object.roles[i]); + } + } + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.bindings: object expected"); + message.bindings[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Binding.fromObject(object.bindings[i]); + } + } + if (object.accessReviews) { + if (!Array.isArray(object.accessReviews)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.accessReviews: object expected"); + message.accessReviews[i] = $root.google.cloud.securitycenter.v2.Kubernetes.AccessReview.fromObject(object.accessReviews[i]); + } + } + if (object.objects) { + if (!Array.isArray(object.objects)) + throw TypeError(".google.cloud.securitycenter.v2.Kubernetes.objects: array expected"); + message.objects = []; + for (var i = 0; i < object.objects.length; ++i) { + if (typeof object.objects[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Kubernetes.objects: object expected"); + message.objects[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Object.fromObject(object.objects[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.v2.Kubernetes + * @static + * @param {google.cloud.securitycenter.v2.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 = []; + object.objects = []; + } + if (message.pods && message.pods.length) { + object.pods = []; + for (var j = 0; j < message.pods.length; ++j) + object.pods[j] = $root.google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.AccessReview.toObject(message.accessReviews[j], options); + } + if (message.objects && message.objects.length) { + object.objects = []; + for (var j = 0; j < message.objects.length; ++j) + object.objects[j] = $root.google.cloud.securitycenter.v2.Kubernetes.Object.toObject(message.objects[j], options); + } + return object; + }; + + /** + * Converts this Kubernetes to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @instance + * @returns {Object.} JSON object + */ + Kubernetes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Kubernetes + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes"; + }; + + Kubernetes.Pod = (function() { + + /** + * Properties of a Pod. + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes + * @classdesc Represents a Pod. + * @implements IPod + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod + * @instance + */ + Pod.prototype.ns = ""; + + /** + * Pod name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod + * @instance + */ + Pod.prototype.name = ""; + + /** + * Pod labels. + * @member {Array.} labels + * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod + * @instance + */ + Pod.prototype.labels = $util.emptyArray; + + /** + * Pod containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod + * @instance + */ + Pod.prototype.containers = $util.emptyArray; + + /** + * Creates a new Pod instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.IPod=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.Kubernetes.Pod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Pod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Label.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Pod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes.Pod} Pod + */ + Pod.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Pod) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.Kubernetes.Pod.labels: object expected"); + message.labels[i] = $root.google.cloud.securitycenter.v2.Label.fromObject(object.labels[i]); + } + } + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod.containers: object expected"); + message.containers[i] = $root.google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Container.toObject(message.containers[j], options); + } + return object; + }; + + /** + * Converts this Pod to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod + * @instance + * @returns {Object.} JSON object + */ + Pod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Pod + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod"; + }; + + return Pod; + })(); + + Kubernetes.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @interface INode + * @property {string|null} [name] Node name + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node + * @instance + */ + Node.prototype.name = ""; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.INode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Kubernetes.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Kubernetes.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Node) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Node"; + }; + + return Node; + })(); + + Kubernetes.NodePool = (function() { + + /** + * Properties of a NodePool. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @interface INodePool + * @property {string|null} [name] NodePool name + * @property {Array.|null} [nodes] NodePool nodes + */ + + /** + * Constructs a new NodePool. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @classdesc Represents a NodePool. + * @implements INodePool + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool + * @instance + */ + NodePool.prototype.name = ""; + + /** + * NodePool nodes. + * @member {Array.} nodes + * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool + * @instance + */ + NodePool.prototype.nodes = $util.emptyArray; + + /** + * Creates a new NodePool instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.INodePool=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Kubernetes.NodePool} NodePool instance + */ + NodePool.create = function create(properties) { + return new NodePool(properties); + }; + + /** + * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.NodePool.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.INodePool} message NodePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodePool.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.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.securitycenter.v2.Kubernetes.Node.encode(message.nodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.NodePool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.INodePool} message NodePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodePool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodePool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool} NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodePool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.NodePool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Kubernetes.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodePool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Kubernetes.NodePool} NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodePool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodePool message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodePool.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.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.v2.Kubernetes.Node.verify(message.nodes[i]); + if (error) + return "nodes." + 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.v2.Kubernetes.NodePool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes.NodePool} NodePool + */ + NodePool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.NodePool) + return object; + var message = new $root.google.cloud.securitycenter.v2.Kubernetes.NodePool(); + if (object.name != null) + message.name = String(object.name); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool.nodes: object expected"); + message.nodes[i] = $root.google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this NodePool to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool + * @instance + * @returns {Object.} JSON object + */ + NodePool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodePool + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool"; + }; + + return NodePool; + })(); + + Kubernetes.Role = (function() { + + /** + * Properties of a Role. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @interface IRole + * @property {google.cloud.securitycenter.v2.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.v2.Kubernetes + * @classdesc Represents a Role. + * @implements IRole + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Role.Kind} kind + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @instance + */ + Role.prototype.kind = 0; + + /** + * Role ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @instance + */ + Role.prototype.ns = ""; + + /** + * Role name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @instance + */ + Role.prototype.name = ""; + + /** + * Creates a new Role instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.IRole=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.Kubernetes.Role.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Role.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Role(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Kubernetes.Role + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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 Role message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes.Role} Role + */ + Role.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Role) + return object; + var message = new $root.google.cloud.securitycenter.v2.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; + 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 Role message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.Role} message Role + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Role.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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.v2.Kubernetes.Role.Kind[message.kind] === undefined ? message.kind : $root.google.cloud.securitycenter.v2.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 Role to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Kubernetes.Role + * @instance + * @returns {Object.} JSON object + */ + Role.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Role + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Role"; + }; + + /** + * Kind enum. + * @name google.cloud.securitycenter.v2.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; + })(); + + return Role; + })(); + + Kubernetes.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @interface IBinding + * @property {string|null} [ns] Binding ns + * @property {string|null} [name] Binding name + * @property {google.cloud.securitycenter.v2.Kubernetes.IRole|null} [role] Binding role + * @property {Array.|null} [subjects] Binding subjects + */ + + /** + * Constructs a new Binding. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.cloud.securitycenter.v2.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]]; + } + + /** + * Binding ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @instance + */ + Binding.prototype.ns = ""; + + /** + * Binding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @instance + */ + Binding.prototype.name = ""; + + /** + * Binding role. + * @member {google.cloud.securitycenter.v2.Kubernetes.IRole|null|undefined} role + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @instance + */ + Binding.prototype.role = null; + + /** + * Binding subjects. + * @member {Array.} subjects + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @instance + */ + Binding.prototype.subjects = $util.emptyArray; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.IBinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Kubernetes.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Binding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Kubernetes.Subject.encode(message.subjects[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Kubernetes.Role.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.subjects && message.subjects.length)) + message.subjects = []; + message.subjects.push($root.google.cloud.securitycenter.v2.Kubernetes.Subject.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.cloud.securitycenter.v2.Kubernetes.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Binding) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Kubernetes.Binding.role: object expected"); + message.role = $root.google.cloud.securitycenter.v2.Kubernetes.Role.fromObject(object.role); + } + if (object.subjects) { + if (!Array.isArray(object.subjects)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.Binding.subjects: object expected"); + message.subjects[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Subject.fromObject(object.subjects[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Kubernetes.Subject.toObject(message.subjects[j], options); + } + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Binding"; + }; + + return Binding; + })(); + + Kubernetes.Subject = (function() { + + /** + * Properties of a Subject. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @interface ISubject + * @property {google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType|null} [kind] Subject kind + * @property {string|null} [ns] Subject ns + * @property {string|null} [name] Subject name + */ + + /** + * Constructs a new Subject. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @classdesc Represents a Subject. + * @implements ISubject + * @constructor + * @param {google.cloud.securitycenter.v2.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]]; + } + + /** + * Subject kind. + * @member {google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType} kind + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @instance + */ + Subject.prototype.kind = 0; + + /** + * Subject ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @instance + */ + Subject.prototype.ns = ""; + + /** + * Subject name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @instance + */ + Subject.prototype.name = ""; + + /** + * Creates a new Subject instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.ISubject=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.Kubernetes.Subject.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Subject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Subject(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Kubernetes.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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; + }; + + /** + * Creates a Subject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes.Subject} Subject + */ + Subject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Subject) + return object; + var message = new $root.google.cloud.securitycenter.v2.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; + 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; + }; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Subject.AuthType[message.kind] === undefined ? message.kind : $root.google.cloud.securitycenter.v2.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; + }; + + /** + * Converts this Subject to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject + * @instance + * @returns {Object.} JSON object + */ + Subject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Subject + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Subject"; + }; + + /** + * AuthType enum. + * @name google.cloud.securitycenter.v2.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; + })(); + + return Subject; + })(); + + Kubernetes.AccessReview = (function() { + + /** + * Properties of an AccessReview. + * @memberof google.cloud.securitycenter.v2.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 + */ + + /** + * Constructs a new AccessReview. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @classdesc Represents an AccessReview. + * @implements IAccessReview + * @constructor + * @param {google.cloud.securitycenter.v2.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]]; + } + + /** + * AccessReview group. + * @member {string} group + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.group = ""; + + /** + * AccessReview ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.ns = ""; + + /** + * AccessReview name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.name = ""; + + /** + * AccessReview resource. + * @member {string} resource + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.resource = ""; + + /** + * AccessReview subresource. + * @member {string} subresource + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.subresource = ""; + + /** + * AccessReview verb. + * @member {string} verb + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.verb = ""; + + /** + * AccessReview version. + * @member {string} version + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.version = ""; + + /** + * Creates a new AccessReview instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.IAccessReview=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Kubernetes.AccessReview} AccessReview instance + */ + AccessReview.create = function create(properties) { + return new AccessReview(properties); + }; + + /** + * Encodes the specified AccessReview message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.AccessReview.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v2.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 AccessReview message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.AccessReview.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v2.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 an AccessReview message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.AccessReview(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 an AccessReview message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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()); + }; + + /** + * Verifies an AccessReview message. + * @function verify + * @memberof google.cloud.securitycenter.v2.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 an AccessReview message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes.AccessReview} AccessReview + */ + AccessReview.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.AccessReview) + return object; + var message = new $root.google.cloud.securitycenter.v2.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; + }; + + /** + * Creates a plain object from an AccessReview message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v2.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; + }; + + /** + * Converts this AccessReview to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview + * @instance + * @returns {Object.} JSON object + */ + AccessReview.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessReview + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.AccessReview"; + }; + + return AccessReview; + })(); + + Kubernetes.Object = (function() { + + /** + * Properties of an Object. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @interface IObject + * @property {string|null} [group] Object group + * @property {string|null} [kind] Object kind + * @property {string|null} [ns] Object ns + * @property {string|null} [name] Object name + * @property {Array.|null} [containers] Object containers + */ + + /** + * Constructs a new Object. + * @memberof google.cloud.securitycenter.v2.Kubernetes + * @classdesc Represents an Object. + * @implements IObject + * @constructor + * @param {google.cloud.securitycenter.v2.Kubernetes.IObject=} [properties] Properties to set + */ + function Object(properties) { + 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]]; + } + + /** + * Object group. + * @member {string} group + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @instance + */ + Object.prototype.group = ""; + + /** + * Object kind. + * @member {string} kind + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @instance + */ + Object.prototype.kind = ""; + + /** + * Object ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @instance + */ + Object.prototype.ns = ""; + + /** + * Object name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @instance + */ + Object.prototype.name = ""; + + /** + * Object containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @instance + */ + Object.prototype.containers = $util.emptyArray; + + /** + * Creates a new Object instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.IObject=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Kubernetes.Object} Object instance + */ + Object.create = function create(properties) { + return new Object(properties); + }; + + /** + * Encodes the specified Object message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Object.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.IObject} message Object message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Object.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.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.securitycenter.v2.Container.encode(message.containers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Object message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Object.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.IObject} message Object message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Object.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Object message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Kubernetes.Object} Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Object.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Object(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + message.kind = reader.string(); + break; + } + case 3: { + message.ns = reader.string(); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v2.Container.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Object message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Kubernetes.Object} Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Object.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Object message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Object.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.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: 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.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.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + return null; + }; + + /** + * Creates an Object message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Kubernetes.Object} Object + */ + Object.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Object) + return object; + var message = new $root.google.cloud.securitycenter.v2.Kubernetes.Object(); + if (object.group != null) + message.group = String(object.group); + if (object.kind != null) + message.kind = String(object.kind); + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.securitycenter.v2.Kubernetes.Object.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.v2.Kubernetes.Object.containers: object expected"); + message.containers[i] = $root.google.cloud.securitycenter.v2.Container.fromObject(object.containers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Object message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {google.cloud.securitycenter.v2.Kubernetes.Object} message Object + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Object.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.containers = []; + if (options.defaults) { + object.group = ""; + object.kind = ""; + object.ns = ""; + object.name = ""; + } + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.kind != null && message.hasOwnProperty("kind")) + object.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; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.securitycenter.v2.Container.toObject(message.containers[j], options); + } + return object; + }; + + /** + * Converts this Object to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @instance + * @returns {Object.} JSON object + */ + Object.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Object + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Kubernetes.Object + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Object.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Kubernetes.Object"; + }; + + return Object; + })(); + + return Kubernetes; + })(); + + v2.LoadBalancer = (function() { + + /** + * Properties of a LoadBalancer. + * @memberof google.cloud.securitycenter.v2 + * @interface ILoadBalancer + * @property {string|null} [name] LoadBalancer name + */ + + /** + * Constructs a new LoadBalancer. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a LoadBalancer. + * @implements ILoadBalancer + * @constructor + * @param {google.cloud.securitycenter.v2.ILoadBalancer=} [properties] Properties to set + */ + function LoadBalancer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoadBalancer name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @instance + */ + LoadBalancer.prototype.name = ""; + + /** + * Creates a new LoadBalancer instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {google.cloud.securitycenter.v2.ILoadBalancer=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.LoadBalancer} LoadBalancer instance + */ + LoadBalancer.create = function create(properties) { + return new LoadBalancer(properties); + }; + + /** + * Encodes the specified LoadBalancer message. Does not implicitly {@link google.cloud.securitycenter.v2.LoadBalancer.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {google.cloud.securitycenter.v2.ILoadBalancer} message LoadBalancer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadBalancer.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 LoadBalancer message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.LoadBalancer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {google.cloud.securitycenter.v2.ILoadBalancer} message LoadBalancer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadBalancer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoadBalancer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.LoadBalancer} LoadBalancer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadBalancer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.LoadBalancer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoadBalancer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.LoadBalancer} LoadBalancer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadBalancer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadBalancer message. + * @function verify + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadBalancer.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 LoadBalancer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.LoadBalancer} LoadBalancer + */ + LoadBalancer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.LoadBalancer) + return object; + var message = new $root.google.cloud.securitycenter.v2.LoadBalancer(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a LoadBalancer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {google.cloud.securitycenter.v2.LoadBalancer} message LoadBalancer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadBalancer.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 LoadBalancer to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @instance + * @returns {Object.} JSON object + */ + LoadBalancer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadBalancer + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.LoadBalancer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadBalancer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.LoadBalancer"; + }; + + return LoadBalancer; + })(); + + v2.LogEntry = (function() { + + /** + * Properties of a LogEntry. + * @memberof google.cloud.securitycenter.v2 + * @interface ILogEntry + * @property {google.cloud.securitycenter.v2.ICloudLoggingEntry|null} [cloudLoggingEntry] LogEntry cloudLoggingEntry + */ + + /** + * Constructs a new LogEntry. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a LogEntry. + * @implements ILogEntry + * @constructor + * @param {google.cloud.securitycenter.v2.ILogEntry=} [properties] Properties to set + */ + function LogEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogEntry cloudLoggingEntry. + * @member {google.cloud.securitycenter.v2.ICloudLoggingEntry|null|undefined} cloudLoggingEntry + * @memberof google.cloud.securitycenter.v2.LogEntry + * @instance + */ + LogEntry.prototype.cloudLoggingEntry = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogEntry logEntry. + * @member {"cloudLoggingEntry"|undefined} logEntry + * @memberof google.cloud.securitycenter.v2.LogEntry + * @instance + */ + Object.defineProperty(LogEntry.prototype, "logEntry", { + get: $util.oneOfGetter($oneOfFields = ["cloudLoggingEntry"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogEntry instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {google.cloud.securitycenter.v2.ILogEntry=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.LogEntry} LogEntry instance + */ + LogEntry.create = function create(properties) { + return new LogEntry(properties); + }; + + /** + * Encodes the specified LogEntry message. Does not implicitly {@link google.cloud.securitycenter.v2.LogEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {google.cloud.securitycenter.v2.ILogEntry} message LogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudLoggingEntry != null && Object.hasOwnProperty.call(message, "cloudLoggingEntry")) + $root.google.cloud.securitycenter.v2.CloudLoggingEntry.encode(message.cloudLoggingEntry, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.LogEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {google.cloud.securitycenter.v2.ILogEntry} message LogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.LogEntry} LogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.LogEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cloudLoggingEntry = $root.google.cloud.securitycenter.v2.CloudLoggingEntry.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.LogEntry} LogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogEntry message. + * @function verify + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudLoggingEntry != null && message.hasOwnProperty("cloudLoggingEntry")) { + properties.logEntry = 1; + { + var error = $root.google.cloud.securitycenter.v2.CloudLoggingEntry.verify(message.cloudLoggingEntry); + if (error) + return "cloudLoggingEntry." + error; + } + } + return null; + }; + + /** + * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.LogEntry} LogEntry + */ + LogEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.LogEntry) + return object; + var message = new $root.google.cloud.securitycenter.v2.LogEntry(); + if (object.cloudLoggingEntry != null) { + if (typeof object.cloudLoggingEntry !== "object") + throw TypeError(".google.cloud.securitycenter.v2.LogEntry.cloudLoggingEntry: object expected"); + message.cloudLoggingEntry = $root.google.cloud.securitycenter.v2.CloudLoggingEntry.fromObject(object.cloudLoggingEntry); + } + return message; + }; + + /** + * Creates a plain object from a LogEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {google.cloud.securitycenter.v2.LogEntry} message LogEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cloudLoggingEntry != null && message.hasOwnProperty("cloudLoggingEntry")) { + object.cloudLoggingEntry = $root.google.cloud.securitycenter.v2.CloudLoggingEntry.toObject(message.cloudLoggingEntry, options); + if (options.oneofs) + object.logEntry = "cloudLoggingEntry"; + } + return object; + }; + + /** + * Converts this LogEntry to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.LogEntry + * @instance + * @returns {Object.} JSON object + */ + LogEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogEntry + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.LogEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.LogEntry"; + }; + + return LogEntry; + })(); + + v2.CloudLoggingEntry = (function() { + + /** + * Properties of a CloudLoggingEntry. + * @memberof google.cloud.securitycenter.v2 + * @interface ICloudLoggingEntry + * @property {string|null} [insertId] CloudLoggingEntry insertId + * @property {string|null} [logId] CloudLoggingEntry logId + * @property {string|null} [resourceContainer] CloudLoggingEntry resourceContainer + * @property {google.protobuf.ITimestamp|null} [timestamp] CloudLoggingEntry timestamp + */ + + /** + * Constructs a new CloudLoggingEntry. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CloudLoggingEntry. + * @implements ICloudLoggingEntry + * @constructor + * @param {google.cloud.securitycenter.v2.ICloudLoggingEntry=} [properties] Properties to set + */ + function CloudLoggingEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingEntry insertId. + * @member {string} insertId + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @instance + */ + CloudLoggingEntry.prototype.insertId = ""; + + /** + * CloudLoggingEntry logId. + * @member {string} logId + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @instance + */ + CloudLoggingEntry.prototype.logId = ""; + + /** + * CloudLoggingEntry resourceContainer. + * @member {string} resourceContainer + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @instance + */ + CloudLoggingEntry.prototype.resourceContainer = ""; + + /** + * CloudLoggingEntry timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @instance + */ + CloudLoggingEntry.prototype.timestamp = null; + + /** + * Creates a new CloudLoggingEntry instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {google.cloud.securitycenter.v2.ICloudLoggingEntry=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CloudLoggingEntry} CloudLoggingEntry instance + */ + CloudLoggingEntry.create = function create(properties) { + return new CloudLoggingEntry(properties); + }; + + /** + * Encodes the specified CloudLoggingEntry message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudLoggingEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {google.cloud.securitycenter.v2.ICloudLoggingEntry} message CloudLoggingEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.insertId != null && Object.hasOwnProperty.call(message, "insertId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.insertId); + if (message.logId != null && Object.hasOwnProperty.call(message, "logId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logId); + if (message.resourceContainer != null && Object.hasOwnProperty.call(message, "resourceContainer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceContainer); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudLoggingEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudLoggingEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {google.cloud.securitycenter.v2.ICloudLoggingEntry} message CloudLoggingEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.CloudLoggingEntry} CloudLoggingEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingEntry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CloudLoggingEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.insertId = reader.string(); + break; + } + case 2: { + message.logId = reader.string(); + break; + } + case 3: { + message.resourceContainer = reader.string(); + break; + } + case 4: { + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.CloudLoggingEntry} CloudLoggingEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingEntry message. + * @function verify + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.insertId != null && message.hasOwnProperty("insertId")) + if (!$util.isString(message.insertId)) + return "insertId: string expected"; + if (message.logId != null && message.hasOwnProperty("logId")) + if (!$util.isString(message.logId)) + return "logId: string expected"; + if (message.resourceContainer != null && message.hasOwnProperty("resourceContainer")) + if (!$util.isString(message.resourceContainer)) + return "resourceContainer: string expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a CloudLoggingEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CloudLoggingEntry} CloudLoggingEntry + */ + CloudLoggingEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CloudLoggingEntry) + return object; + var message = new $root.google.cloud.securitycenter.v2.CloudLoggingEntry(); + if (object.insertId != null) + message.insertId = String(object.insertId); + if (object.logId != null) + message.logId = String(object.logId); + if (object.resourceContainer != null) + message.resourceContainer = String(object.resourceContainer); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CloudLoggingEntry.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a CloudLoggingEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {google.cloud.securitycenter.v2.CloudLoggingEntry} message CloudLoggingEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.insertId = ""; + object.logId = ""; + object.resourceContainer = ""; + object.timestamp = null; + } + if (message.insertId != null && message.hasOwnProperty("insertId")) + object.insertId = message.insertId; + if (message.logId != null && message.hasOwnProperty("logId")) + object.logId = message.logId; + if (message.resourceContainer != null && message.hasOwnProperty("resourceContainer")) + object.resourceContainer = message.resourceContainer; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this CloudLoggingEntry to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingEntry + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.CloudLoggingEntry"; + }; + + return CloudLoggingEntry; + })(); + + v2.MitreAttack = (function() { + + /** + * Properties of a MitreAttack. + * @memberof google.cloud.securitycenter.v2 + * @interface IMitreAttack + * @property {google.cloud.securitycenter.v2.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.v2 + * @classdesc Represents a MitreAttack. + * @implements IMitreAttack + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.MitreAttack.Tactic} primaryTactic + * @memberof google.cloud.securitycenter.v2.MitreAttack + * @instance + */ + MitreAttack.prototype.primaryTactic = 0; + + /** + * MitreAttack primaryTechniques. + * @member {Array.} primaryTechniques + * @memberof google.cloud.securitycenter.v2.MitreAttack + * @instance + */ + MitreAttack.prototype.primaryTechniques = $util.emptyArray; + + /** + * MitreAttack additionalTactics. + * @member {Array.} additionalTactics + * @memberof google.cloud.securitycenter.v2.MitreAttack + * @instance + */ + MitreAttack.prototype.additionalTactics = $util.emptyArray; + + /** + * MitreAttack additionalTechniques. + * @member {Array.} additionalTechniques + * @memberof google.cloud.securitycenter.v2.MitreAttack + * @instance + */ + MitreAttack.prototype.additionalTechniques = $util.emptyArray; + + /** + * MitreAttack version. + * @member {string} version + * @memberof google.cloud.securitycenter.v2.MitreAttack + * @instance + */ + MitreAttack.prototype.version = ""; + + /** + * Creates a new MitreAttack instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.MitreAttack + * @static + * @param {google.cloud.securitycenter.v2.IMitreAttack=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.MitreAttack} MitreAttack instance + */ + MitreAttack.create = function create(properties) { + return new MitreAttack(properties); + }; + + /** + * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v2.MitreAttack.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.MitreAttack + * @static + * @param {google.cloud.securitycenter.v2.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.v2.MitreAttack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.MitreAttack + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.MitreAttack(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.MitreAttack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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 70: + case 71: + case 114: + case 115: + case 122: + case 117: + case 68: + case 72: + case 73: + case 74: + case 75: + case 120: + case 118: + case 49: + case 50: + case 37: + case 38: + case 32: + case 89: + case 119: + case 90: + case 93: + case 103: + case 104: + case 56: + case 6: + case 7: + case 59: + case 63: + case 18: + case 19: + case 123: + case 124: + case 125: + case 64: + case 128: + case 126: + case 45: + case 46: + case 47: + case 14: + case 35: + case 15: + case 16: + case 121: + case 116: + case 9: + case 10: + case 11: + case 22: + case 40: + case 67: + case 23: + case 58: + case 76: + case 3: + case 4: + case 44: + case 94: + case 5: + case 77: + case 78: + case 33: + case 39: + case 79: + case 80: + case 95: + case 27: + case 129: + case 130: + case 134: + case 69: + case 135: + case 30: + case 29: + case 132: + case 52: + case 36: + case 81: + case 8: + case 17: + case 48: + case 42: + case 51: + case 91: + case 25: + case 24: + case 65: + case 82: + case 83: + case 127: + case 34: + case 136: + case 109: + case 13: + case 105: + case 96: + case 97: + case 106: + case 107: + case 84: + case 98: + case 28: + case 108: + case 137: + case 31: + case 55: + case 110: + case 111: + case 85: + case 86: + case 87: + case 20: + case 21: + case 12: + case 41: + case 112: + case 113: + case 26: + case 54: + case 53: + case 99: + case 100: + case 43: + case 101: + case 133: + case 1: + case 2: + case 88: + case 102: + case 60: + case 66: + case 61: + case 57: + case 92: + case 62: + case 131: + 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 70: + case 71: + case 114: + case 115: + case 122: + case 117: + case 68: + case 72: + case 73: + case 74: + case 75: + case 120: + case 118: + case 49: + case 50: + case 37: + case 38: + case 32: + case 89: + case 119: + case 90: + case 93: + case 103: + case 104: + case 56: + case 6: + case 7: + case 59: + case 63: + case 18: + case 19: + case 123: + case 124: + case 125: + case 64: + case 128: + case 126: + case 45: + case 46: + case 47: + case 14: + case 35: + case 15: + case 16: + case 121: + case 116: + case 9: + case 10: + case 11: + case 22: + case 40: + case 67: + case 23: + case 58: + case 76: + case 3: + case 4: + case 44: + case 94: + case 5: + case 77: + case 78: + case 33: + case 39: + case 79: + case 80: + case 95: + case 27: + case 129: + case 130: + case 134: + case 69: + case 135: + case 30: + case 29: + case 132: + case 52: + case 36: + case 81: + case 8: + case 17: + case 48: + case 42: + case 51: + case 91: + case 25: + case 24: + case 65: + case 82: + case 83: + case 127: + case 34: + case 136: + case 109: + case 13: + case 105: + case 96: + case 97: + case 106: + case 107: + case 84: + case 98: + case 28: + case 108: + case 137: + case 31: + case 55: + case 110: + case 111: + case 85: + case 86: + case 87: + case 20: + case 21: + case 12: + case 41: + case 112: + case 113: + case 26: + case 54: + case 53: + case 99: + case 100: + case 43: + case 101: + case 133: + case 1: + case 2: + case 88: + case 102: + case 60: + case 66: + case 61: + case 57: + case 92: + case 62: + case 131: + 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.v2.MitreAttack + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.MitreAttack} MitreAttack + */ + MitreAttack.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.MitreAttack) + return object; + var message = new $root.google.cloud.securitycenter.v2.MitreAttack(); + switch (object.primaryTactic) { + default: + if (typeof object.primaryTactic === "number") { + message.primaryTactic = object.primaryTactic; + break; + } + break; + 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.v2.MitreAttack.primaryTechniques: array expected"); + message.primaryTechniques = []; + 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; + break; + case "DATA_OBFUSCATION": + case 70: + message.primaryTechniques[i] = 70; + break; + case "DATA_OBFUSCATION_STEGANOGRAPHY": + case 71: + message.primaryTechniques[i] = 71; + break; + case "OS_CREDENTIAL_DUMPING": + case 114: + message.primaryTechniques[i] = 114; + break; + case "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM": + case 115: + message.primaryTechniques[i] = 115; + break; + case "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW": + case 122: + message.primaryTechniques[i] = 122; + break; + case "DATA_FROM_LOCAL_SYSTEM": + case 117: + message.primaryTechniques[i] = 117; + break; + case "AUTOMATED_EXFILTRATION": + case 68: + message.primaryTechniques[i] = 68; + break; + case "OBFUSCATED_FILES_OR_INFO": + case 72: + message.primaryTechniques[i] = 72; + break; + case "STEGANOGRAPHY": + case 73: + message.primaryTechniques[i] = 73; + break; + case "COMPILE_AFTER_DELIVERY": + case 74: + message.primaryTechniques[i] = 74; + break; + case "COMMAND_OBFUSCATION": + case 75: + message.primaryTechniques[i] = 75; + break; + case "SCHEDULED_TRANSFER": + case 120: + message.primaryTechniques[i] = 120; + break; + case "SYSTEM_OWNER_USER_DISCOVERY": + case 118: + message.primaryTechniques[i] = 118; + break; + case "MASQUERADING": + case 49: + message.primaryTechniques[i] = 49; + break; + case "MATCH_LEGITIMATE_NAME_OR_LOCATION": + case 50: + message.primaryTechniques[i] = 50; + break; + case "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": + case 37: + message.primaryTechniques[i] = 37; + break; + case "STARTUP_ITEMS": + case 38: + message.primaryTechniques[i] = 38; + break; + case "NETWORK_SERVICE_DISCOVERY": + case 32: + message.primaryTechniques[i] = 32; + break; + case "SCHEDULED_TASK_JOB": + case 89: + message.primaryTechniques[i] = 89; + break; + case "SCHEDULED_TASK_JOB_CRON": + case 119: + message.primaryTechniques[i] = 119; + break; + case "CONTAINER_ORCHESTRATION_JOB": + case 90: + message.primaryTechniques[i] = 90; + break; + case "PROCESS_INJECTION": + case 93: + message.primaryTechniques[i] = 93; + break; + case "INPUT_CAPTURE": + case 103: + message.primaryTechniques[i] = 103; + break; + case "INPUT_CAPTURE_KEYLOGGING": + case 104: + message.primaryTechniques[i] = 104; + break; + case "PROCESS_DISCOVERY": + case 56: + message.primaryTechniques[i] = 56; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.primaryTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.primaryTechniques[i] = 7; + break; + case "PYTHON": + case 59: + message.primaryTechniques[i] = 59; + break; + case "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": + case 63: + message.primaryTechniques[i] = 63; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.primaryTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.primaryTechniques[i] = 19; + break; + case "INDICATOR_REMOVAL": + case 123: + message.primaryTechniques[i] = 123; + break; + case "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS": + case 124: + message.primaryTechniques[i] = 124; + break; + case "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY": + case 125: + message.primaryTechniques[i] = 125; + break; + case "INDICATOR_REMOVAL_FILE_DELETION": + case 64: + message.primaryTechniques[i] = 64; + break; + case "INDICATOR_REMOVAL_TIMESTOMP": + case 128: + message.primaryTechniques[i] = 128; + break; + case "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA": + case 126: + message.primaryTechniques[i] = 126; + break; + case "APPLICATION_LAYER_PROTOCOL": + case 45: + message.primaryTechniques[i] = 45; + break; + case "DNS": + case 46: + message.primaryTechniques[i] = 46; + break; + case "SOFTWARE_DEPLOYMENT_TOOLS": + case 47: + message.primaryTechniques[i] = 47; + break; + case "VALID_ACCOUNTS": + case 14: + message.primaryTechniques[i] = 14; + break; + case "DEFAULT_ACCOUNTS": + case 35: + message.primaryTechniques[i] = 35; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.primaryTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.primaryTechniques[i] = 16; + break; + case "FILE_AND_DIRECTORY_DISCOVERY": + case 121: + message.primaryTechniques[i] = 121; + break; + case "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT": + case 116: + message.primaryTechniques[i] = 116; + 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 "ACCOUNT_MANIPULATION": + case 22: + message.primaryTechniques[i] = 22; + break; + case "ADDITIONAL_CLOUD_CREDENTIALS": + case 40: + message.primaryTechniques[i] = 40; + break; + case "ADDITIONAL_CLOUD_ROLES": + case 67: + message.primaryTechniques[i] = 67; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.primaryTechniques[i] = 23; + break; + case "ADDITIONAL_CONTAINER_CLUSTER_ROLES": + case 58: + message.primaryTechniques[i] = 58; + break; + case "MULTI_STAGE_CHANNELS": + case 76: + message.primaryTechniques[i] = 76; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.primaryTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.primaryTechniques[i] = 4; + break; + case "BRUTE_FORCE": + case 44: + message.primaryTechniques[i] = 44; + break; + case "AUTOMATED_COLLECTION": + case 94: + message.primaryTechniques[i] = 94; + break; + case "SHARED_MODULES": + case 5: + message.primaryTechniques[i] = 5; + break; + case "DATA_ENCODING": + case 77: + message.primaryTechniques[i] = 77; + break; + case "STANDARD_ENCODING": + case 78: + message.primaryTechniques[i] = 78; + break; + case "ACCESS_TOKEN_MANIPULATION": + case 33: + message.primaryTechniques[i] = 33; + break; + case "TOKEN_IMPERSONATION_OR_THEFT": + case 39: + message.primaryTechniques[i] = 39; + break; + case "CREATE_ACCOUNT": + case 79: + message.primaryTechniques[i] = 79; + break; + case "LOCAL_ACCOUNT": + case 80: + message.primaryTechniques[i] = 80; + break; + case "DEOBFUSCATE_DECODE_FILES_OR_INFO": + case 95: + message.primaryTechniques[i] = 95; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.primaryTechniques[i] = 27; + break; + case "SUPPLY_CHAIN_COMPROMISE": + case 129: + message.primaryTechniques[i] = 129; + break; + case "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS": + case 130: + message.primaryTechniques[i] = 130; + break; + case "EXPLOITATION_FOR_CLIENT_EXECUTION": + case 134: + message.primaryTechniques[i] = 134; + break; + case "USER_EXECUTION": + case 69: + message.primaryTechniques[i] = 69; + break; + case "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION": + case 135: + message.primaryTechniques[i] = 135; + break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.primaryTechniques[i] = 30; + break; + case "DATA_DESTRUCTION": + case 29: + message.primaryTechniques[i] = 29; + break; + case "DATA_ENCRYPTED_FOR_IMPACT": + case 132: + message.primaryTechniques[i] = 132; + break; + case "SERVICE_STOP": + case 52: + message.primaryTechniques[i] = 52; + break; + case "INHIBIT_SYSTEM_RECOVERY": + case 36: + message.primaryTechniques[i] = 36; + break; + case "FIRMWARE_CORRUPTION": + case 81: + message.primaryTechniques[i] = 81; + break; + case "RESOURCE_HIJACKING": + case 8: + message.primaryTechniques[i] = 8; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.primaryTechniques[i] = 17; + break; + case "CLOUD_SERVICE_DISCOVERY": + case 48: + message.primaryTechniques[i] = 48; + break; + case "STEAL_APPLICATION_ACCESS_TOKEN": + case 42: + message.primaryTechniques[i] = 42; + break; + case "ACCOUNT_ACCESS_REMOVAL": + case 51: + message.primaryTechniques[i] = 51; + break; + case "TRANSFER_DATA_TO_CLOUD_ACCOUNT": + case 91: + message.primaryTechniques[i] = 91; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.primaryTechniques[i] = 25; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.primaryTechniques[i] = 24; + break; + case "EVENT_TRIGGERED_EXECUTION": + case 65: + message.primaryTechniques[i] = 65; + break; + case "BOOT_OR_LOGON_AUTOSTART_EXECUTION": + case 82: + message.primaryTechniques[i] = 82; + break; + case "KERNEL_MODULES_AND_EXTENSIONS": + case 83: + message.primaryTechniques[i] = 83; + break; + case "SHORTCUT_MODIFICATION": + case 127: + message.primaryTechniques[i] = 127; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM": + case 34: + message.primaryTechniques[i] = 34; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID": + case 136: + message.primaryTechniques[i] = 136; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING": + case 109: + message.primaryTechniques[i] = 109; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.primaryTechniques[i] = 13; + break; + case "CREDENTIALS_IN_FILES": + case 105: + message.primaryTechniques[i] = 105; + break; + case "BASH_HISTORY": + case 96: + message.primaryTechniques[i] = 96; + break; + case "PRIVATE_KEYS": + case 97: + message.primaryTechniques[i] = 97; + break; + case "SUBVERT_TRUST_CONTROL": + case 106: + message.primaryTechniques[i] = 106; + break; + case "INSTALL_ROOT_CERTIFICATE": + case 107: + message.primaryTechniques[i] = 107; + break; + case "COMPROMISE_HOST_SOFTWARE_BINARY": + case 84: + message.primaryTechniques[i] = 84; + break; + case "CREDENTIALS_FROM_PASSWORD_STORES": + case 98: + message.primaryTechniques[i] = 98; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.primaryTechniques[i] = 28; + break; + case "PLUGGABLE_AUTHENTICATION_MODULES": + case 108: + message.primaryTechniques[i] = 108; + break; + case "MULTI_FACTOR_AUTHENTICATION": + case 137: + message.primaryTechniques[i] = 137; + break; + case "IMPAIR_DEFENSES": + case 31: + message.primaryTechniques[i] = 31; + break; + case "DISABLE_OR_MODIFY_TOOLS": + case 55: + message.primaryTechniques[i] = 55; + break; + case "INDICATOR_BLOCKING": + case 110: + message.primaryTechniques[i] = 110; + break; + case "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM": + case 111: + message.primaryTechniques[i] = 111; + break; + case "HIDE_ARTIFACTS": + case 85: + message.primaryTechniques[i] = 85; + break; + case "HIDDEN_FILES_AND_DIRECTORIES": + case 86: + message.primaryTechniques[i] = 86; + break; + case "HIDDEN_USERS": + case 87: + message.primaryTechniques[i] = 87; + 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 "DYNAMIC_RESOLUTION": + case 12: + message.primaryTechniques[i] = 12; + break; + case "LATERAL_TOOL_TRANSFER": + case 41: + message.primaryTechniques[i] = 41; + break; + case "HIJACK_EXECUTION_FLOW": + case 112: + message.primaryTechniques[i] = 112; + break; + case "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING": + case 113: + message.primaryTechniques[i] = 113; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.primaryTechniques[i] = 26; + break; + case "CREATE_SNAPSHOT": + case 54: + message.primaryTechniques[i] = 54; + break; + case "CLOUD_INFRASTRUCTURE_DISCOVERY": + case 53: + message.primaryTechniques[i] = 53; + break; + case "DEVELOP_CAPABILITIES": + case 99: + message.primaryTechniques[i] = 99; + break; + case "DEVELOP_CAPABILITIES_MALWARE": + case 100: + message.primaryTechniques[i] = 100; + break; + case "OBTAIN_CAPABILITIES": + case 43: + message.primaryTechniques[i] = 43; + break; + case "OBTAIN_CAPABILITIES_MALWARE": + case 101: + message.primaryTechniques[i] = 101; + break; + case "OBTAIN_CAPABILITIES_VULNERABILITIES": + case 133: + message.primaryTechniques[i] = 133; + break; + case "ACTIVE_SCANNING": + case 1: + message.primaryTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.primaryTechniques[i] = 2; + break; + case "STAGE_CAPABILITIES": + case 88: + message.primaryTechniques[i] = 88; + break; + case "UPLOAD_MALWARE": + case 102: + message.primaryTechniques[i] = 102; + break; + case "CONTAINER_ADMINISTRATION_COMMAND": + case 60: + message.primaryTechniques[i] = 60; + break; + case "DEPLOY_CONTAINER": + case 66: + message.primaryTechniques[i] = 66; + break; + case "ESCAPE_TO_HOST": + case 61: + message.primaryTechniques[i] = 61; + break; + case "CONTAINER_AND_RESOURCE_DISCOVERY": + case 57: + message.primaryTechniques[i] = 57; + break; + case "REFLECTIVE_CODE_LOADING": + case 92: + message.primaryTechniques[i] = 92; + break; + case "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": + case 62: + message.primaryTechniques[i] = 62; + break; + case "FINANCIAL_THEFT": + case 131: + message.primaryTechniques[i] = 131; + break; + } + } + if (object.additionalTactics) { + if (!Array.isArray(object.additionalTactics)) + throw TypeError(".google.cloud.securitycenter.v2.MitreAttack.additionalTactics: array expected"); + message.additionalTactics = []; + 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; + 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.v2.MitreAttack.additionalTechniques: array expected"); + message.additionalTechniques = []; + 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; + break; + case "DATA_OBFUSCATION": + case 70: + message.additionalTechniques[i] = 70; + break; + case "DATA_OBFUSCATION_STEGANOGRAPHY": + case 71: + message.additionalTechniques[i] = 71; + break; + case "OS_CREDENTIAL_DUMPING": + case 114: + message.additionalTechniques[i] = 114; + break; + case "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM": + case 115: + message.additionalTechniques[i] = 115; + break; + case "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW": + case 122: + message.additionalTechniques[i] = 122; + break; + case "DATA_FROM_LOCAL_SYSTEM": + case 117: + message.additionalTechniques[i] = 117; + break; + case "AUTOMATED_EXFILTRATION": + case 68: + message.additionalTechniques[i] = 68; + break; + case "OBFUSCATED_FILES_OR_INFO": + case 72: + message.additionalTechniques[i] = 72; + break; + case "STEGANOGRAPHY": + case 73: + message.additionalTechniques[i] = 73; + break; + case "COMPILE_AFTER_DELIVERY": + case 74: + message.additionalTechniques[i] = 74; + break; + case "COMMAND_OBFUSCATION": + case 75: + message.additionalTechniques[i] = 75; + break; + case "SCHEDULED_TRANSFER": + case 120: + message.additionalTechniques[i] = 120; + break; + case "SYSTEM_OWNER_USER_DISCOVERY": + case 118: + message.additionalTechniques[i] = 118; + break; + case "MASQUERADING": + case 49: + message.additionalTechniques[i] = 49; + break; + case "MATCH_LEGITIMATE_NAME_OR_LOCATION": + case 50: + message.additionalTechniques[i] = 50; + break; + case "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": + case 37: + message.additionalTechniques[i] = 37; + break; + case "STARTUP_ITEMS": + case 38: + message.additionalTechniques[i] = 38; + break; + case "NETWORK_SERVICE_DISCOVERY": + case 32: + message.additionalTechniques[i] = 32; + break; + case "SCHEDULED_TASK_JOB": + case 89: + message.additionalTechniques[i] = 89; + break; + case "SCHEDULED_TASK_JOB_CRON": + case 119: + message.additionalTechniques[i] = 119; + break; + case "CONTAINER_ORCHESTRATION_JOB": + case 90: + message.additionalTechniques[i] = 90; + break; + case "PROCESS_INJECTION": + case 93: + message.additionalTechniques[i] = 93; + break; + case "INPUT_CAPTURE": + case 103: + message.additionalTechniques[i] = 103; + break; + case "INPUT_CAPTURE_KEYLOGGING": + case 104: + message.additionalTechniques[i] = 104; + break; + case "PROCESS_DISCOVERY": + case 56: + message.additionalTechniques[i] = 56; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.additionalTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.additionalTechniques[i] = 7; + break; + case "PYTHON": + case 59: + message.additionalTechniques[i] = 59; + break; + case "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": + case 63: + message.additionalTechniques[i] = 63; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.additionalTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.additionalTechniques[i] = 19; + break; + case "INDICATOR_REMOVAL": + case 123: + message.additionalTechniques[i] = 123; + break; + case "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS": + case 124: + message.additionalTechniques[i] = 124; + break; + case "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY": + case 125: + message.additionalTechniques[i] = 125; + break; + case "INDICATOR_REMOVAL_FILE_DELETION": + case 64: + message.additionalTechniques[i] = 64; + break; + case "INDICATOR_REMOVAL_TIMESTOMP": + case 128: + message.additionalTechniques[i] = 128; + break; + case "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA": + case 126: + message.additionalTechniques[i] = 126; + break; + case "APPLICATION_LAYER_PROTOCOL": + case 45: + message.additionalTechniques[i] = 45; + break; + case "DNS": + case 46: + message.additionalTechniques[i] = 46; + break; + case "SOFTWARE_DEPLOYMENT_TOOLS": + case 47: + message.additionalTechniques[i] = 47; + break; + case "VALID_ACCOUNTS": + case 14: + message.additionalTechniques[i] = 14; + break; + case "DEFAULT_ACCOUNTS": + case 35: + message.additionalTechniques[i] = 35; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.additionalTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.additionalTechniques[i] = 16; + break; + case "FILE_AND_DIRECTORY_DISCOVERY": + case 121: + message.additionalTechniques[i] = 121; + break; + case "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT": + case 116: + message.additionalTechniques[i] = 116; + 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 "ACCOUNT_MANIPULATION": + case 22: + message.additionalTechniques[i] = 22; + break; + case "ADDITIONAL_CLOUD_CREDENTIALS": + case 40: + message.additionalTechniques[i] = 40; + break; + case "ADDITIONAL_CLOUD_ROLES": + case 67: + message.additionalTechniques[i] = 67; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.additionalTechniques[i] = 23; + break; + case "ADDITIONAL_CONTAINER_CLUSTER_ROLES": + case 58: + message.additionalTechniques[i] = 58; + break; + case "MULTI_STAGE_CHANNELS": + case 76: + message.additionalTechniques[i] = 76; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.additionalTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.additionalTechniques[i] = 4; + break; + case "BRUTE_FORCE": + case 44: + message.additionalTechniques[i] = 44; + break; + case "AUTOMATED_COLLECTION": + case 94: + message.additionalTechniques[i] = 94; + break; + case "SHARED_MODULES": + case 5: + message.additionalTechniques[i] = 5; + break; + case "DATA_ENCODING": + case 77: + message.additionalTechniques[i] = 77; + break; + case "STANDARD_ENCODING": + case 78: + message.additionalTechniques[i] = 78; + break; + case "ACCESS_TOKEN_MANIPULATION": + case 33: + message.additionalTechniques[i] = 33; + break; + case "TOKEN_IMPERSONATION_OR_THEFT": + case 39: + message.additionalTechniques[i] = 39; + break; + case "CREATE_ACCOUNT": + case 79: + message.additionalTechniques[i] = 79; + break; + case "LOCAL_ACCOUNT": + case 80: + message.additionalTechniques[i] = 80; + break; + case "DEOBFUSCATE_DECODE_FILES_OR_INFO": + case 95: + message.additionalTechniques[i] = 95; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.additionalTechniques[i] = 27; + break; + case "SUPPLY_CHAIN_COMPROMISE": + case 129: + message.additionalTechniques[i] = 129; + break; + case "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS": + case 130: + message.additionalTechniques[i] = 130; + break; + case "EXPLOITATION_FOR_CLIENT_EXECUTION": + case 134: + message.additionalTechniques[i] = 134; + break; + case "USER_EXECUTION": + case 69: + message.additionalTechniques[i] = 69; + break; + case "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION": + case 135: + message.additionalTechniques[i] = 135; + break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.additionalTechniques[i] = 30; + break; + case "DATA_DESTRUCTION": + case 29: + message.additionalTechniques[i] = 29; + break; + case "DATA_ENCRYPTED_FOR_IMPACT": + case 132: + message.additionalTechniques[i] = 132; + break; + case "SERVICE_STOP": + case 52: + message.additionalTechniques[i] = 52; + break; + case "INHIBIT_SYSTEM_RECOVERY": + case 36: + message.additionalTechniques[i] = 36; + break; + case "FIRMWARE_CORRUPTION": + case 81: + message.additionalTechniques[i] = 81; + break; + case "RESOURCE_HIJACKING": + case 8: + message.additionalTechniques[i] = 8; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.additionalTechniques[i] = 17; + break; + case "CLOUD_SERVICE_DISCOVERY": + case 48: + message.additionalTechniques[i] = 48; + break; + case "STEAL_APPLICATION_ACCESS_TOKEN": + case 42: + message.additionalTechniques[i] = 42; + break; + case "ACCOUNT_ACCESS_REMOVAL": + case 51: + message.additionalTechniques[i] = 51; + break; + case "TRANSFER_DATA_TO_CLOUD_ACCOUNT": + case 91: + message.additionalTechniques[i] = 91; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.additionalTechniques[i] = 25; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.additionalTechniques[i] = 24; + break; + case "EVENT_TRIGGERED_EXECUTION": + case 65: + message.additionalTechniques[i] = 65; + break; + case "BOOT_OR_LOGON_AUTOSTART_EXECUTION": + case 82: + message.additionalTechniques[i] = 82; + break; + case "KERNEL_MODULES_AND_EXTENSIONS": + case 83: + message.additionalTechniques[i] = 83; + break; + case "SHORTCUT_MODIFICATION": + case 127: + message.additionalTechniques[i] = 127; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM": + case 34: + message.additionalTechniques[i] = 34; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID": + case 136: + message.additionalTechniques[i] = 136; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING": + case 109: + message.additionalTechniques[i] = 109; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.additionalTechniques[i] = 13; + break; + case "CREDENTIALS_IN_FILES": + case 105: + message.additionalTechniques[i] = 105; + break; + case "BASH_HISTORY": + case 96: + message.additionalTechniques[i] = 96; + break; + case "PRIVATE_KEYS": + case 97: + message.additionalTechniques[i] = 97; + break; + case "SUBVERT_TRUST_CONTROL": + case 106: + message.additionalTechniques[i] = 106; + break; + case "INSTALL_ROOT_CERTIFICATE": + case 107: + message.additionalTechniques[i] = 107; + break; + case "COMPROMISE_HOST_SOFTWARE_BINARY": + case 84: + message.additionalTechniques[i] = 84; + break; + case "CREDENTIALS_FROM_PASSWORD_STORES": + case 98: + message.additionalTechniques[i] = 98; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.additionalTechniques[i] = 28; + break; + case "PLUGGABLE_AUTHENTICATION_MODULES": + case 108: + message.additionalTechniques[i] = 108; + break; + case "MULTI_FACTOR_AUTHENTICATION": + case 137: + message.additionalTechniques[i] = 137; + break; + case "IMPAIR_DEFENSES": + case 31: + message.additionalTechniques[i] = 31; + break; + case "DISABLE_OR_MODIFY_TOOLS": + case 55: + message.additionalTechniques[i] = 55; + break; + case "INDICATOR_BLOCKING": + case 110: + message.additionalTechniques[i] = 110; + break; + case "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM": + case 111: + message.additionalTechniques[i] = 111; + break; + case "HIDE_ARTIFACTS": + case 85: + message.additionalTechniques[i] = 85; + break; + case "HIDDEN_FILES_AND_DIRECTORIES": + case 86: + message.additionalTechniques[i] = 86; + break; + case "HIDDEN_USERS": + case 87: + message.additionalTechniques[i] = 87; + 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 "DYNAMIC_RESOLUTION": + case 12: + message.additionalTechniques[i] = 12; + break; + case "LATERAL_TOOL_TRANSFER": + case 41: + message.additionalTechniques[i] = 41; + break; + case "HIJACK_EXECUTION_FLOW": + case 112: + message.additionalTechniques[i] = 112; + break; + case "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING": + case 113: + message.additionalTechniques[i] = 113; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.additionalTechniques[i] = 26; + break; + case "CREATE_SNAPSHOT": + case 54: + message.additionalTechniques[i] = 54; + break; + case "CLOUD_INFRASTRUCTURE_DISCOVERY": + case 53: + message.additionalTechniques[i] = 53; + break; + case "DEVELOP_CAPABILITIES": + case 99: + message.additionalTechniques[i] = 99; + break; + case "DEVELOP_CAPABILITIES_MALWARE": + case 100: + message.additionalTechniques[i] = 100; + break; + case "OBTAIN_CAPABILITIES": + case 43: + message.additionalTechniques[i] = 43; + break; + case "OBTAIN_CAPABILITIES_MALWARE": + case 101: + message.additionalTechniques[i] = 101; + break; + case "OBTAIN_CAPABILITIES_VULNERABILITIES": + case 133: + message.additionalTechniques[i] = 133; + break; + case "ACTIVE_SCANNING": + case 1: + message.additionalTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.additionalTechniques[i] = 2; + break; + case "STAGE_CAPABILITIES": + case 88: + message.additionalTechniques[i] = 88; + break; + case "UPLOAD_MALWARE": + case 102: + message.additionalTechniques[i] = 102; + break; + case "CONTAINER_ADMINISTRATION_COMMAND": + case 60: + message.additionalTechniques[i] = 60; + break; + case "DEPLOY_CONTAINER": + case 66: + message.additionalTechniques[i] = 66; + break; + case "ESCAPE_TO_HOST": + case 61: + message.additionalTechniques[i] = 61; + break; + case "CONTAINER_AND_RESOURCE_DISCOVERY": + case 57: + message.additionalTechniques[i] = 57; + break; + case "REFLECTIVE_CODE_LOADING": + case 92: + message.additionalTechniques[i] = 92; + break; + case "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": + case 62: + message.additionalTechniques[i] = 62; + break; + case "FINANCIAL_THEFT": + case 131: + message.additionalTechniques[i] = 131; + 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.v2.MitreAttack + * @static + * @param {google.cloud.securitycenter.v2.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.v2.MitreAttack.Tactic[message.primaryTactic] === undefined ? message.primaryTactic : $root.google.cloud.securitycenter.v2.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.v2.MitreAttack.Technique[message.primaryTechniques[j]] === undefined ? message.primaryTechniques[j] : $root.google.cloud.securitycenter.v2.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.v2.MitreAttack.Tactic[message.additionalTactics[j]] === undefined ? message.additionalTactics[j] : $root.google.cloud.securitycenter.v2.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.v2.MitreAttack.Technique[message.additionalTechniques[j]] === undefined ? message.additionalTechniques[j] : $root.google.cloud.securitycenter.v2.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.v2.MitreAttack + * @instance + * @returns {Object.} JSON object + */ + MitreAttack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MitreAttack + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.MitreAttack"; + }; + + /** + * Tactic enum. + * @name google.cloud.securitycenter.v2.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.v2.MitreAttack.Technique + * @enum {number} + * @property {number} TECHNIQUE_UNSPECIFIED=0 TECHNIQUE_UNSPECIFIED value + * @property {number} DATA_OBFUSCATION=70 DATA_OBFUSCATION value + * @property {number} DATA_OBFUSCATION_STEGANOGRAPHY=71 DATA_OBFUSCATION_STEGANOGRAPHY value + * @property {number} OS_CREDENTIAL_DUMPING=114 OS_CREDENTIAL_DUMPING value + * @property {number} OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM=115 OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM value + * @property {number} OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW=122 OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW value + * @property {number} DATA_FROM_LOCAL_SYSTEM=117 DATA_FROM_LOCAL_SYSTEM value + * @property {number} AUTOMATED_EXFILTRATION=68 AUTOMATED_EXFILTRATION value + * @property {number} OBFUSCATED_FILES_OR_INFO=72 OBFUSCATED_FILES_OR_INFO value + * @property {number} STEGANOGRAPHY=73 STEGANOGRAPHY value + * @property {number} COMPILE_AFTER_DELIVERY=74 COMPILE_AFTER_DELIVERY value + * @property {number} COMMAND_OBFUSCATION=75 COMMAND_OBFUSCATION value + * @property {number} SCHEDULED_TRANSFER=120 SCHEDULED_TRANSFER value + * @property {number} SYSTEM_OWNER_USER_DISCOVERY=118 SYSTEM_OWNER_USER_DISCOVERY value + * @property {number} MASQUERADING=49 MASQUERADING value + * @property {number} MATCH_LEGITIMATE_NAME_OR_LOCATION=50 MATCH_LEGITIMATE_NAME_OR_LOCATION value + * @property {number} BOOT_OR_LOGON_INITIALIZATION_SCRIPTS=37 BOOT_OR_LOGON_INITIALIZATION_SCRIPTS value + * @property {number} STARTUP_ITEMS=38 STARTUP_ITEMS value + * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value + * @property {number} SCHEDULED_TASK_JOB=89 SCHEDULED_TASK_JOB value + * @property {number} SCHEDULED_TASK_JOB_CRON=119 SCHEDULED_TASK_JOB_CRON value + * @property {number} CONTAINER_ORCHESTRATION_JOB=90 CONTAINER_ORCHESTRATION_JOB value + * @property {number} PROCESS_INJECTION=93 PROCESS_INJECTION value + * @property {number} INPUT_CAPTURE=103 INPUT_CAPTURE value + * @property {number} INPUT_CAPTURE_KEYLOGGING=104 INPUT_CAPTURE_KEYLOGGING value + * @property {number} PROCESS_DISCOVERY=56 PROCESS_DISCOVERY value + * @property {number} COMMAND_AND_SCRIPTING_INTERPRETER=6 COMMAND_AND_SCRIPTING_INTERPRETER value + * @property {number} UNIX_SHELL=7 UNIX_SHELL value + * @property {number} PYTHON=59 PYTHON value + * @property {number} EXPLOITATION_FOR_PRIVILEGE_ESCALATION=63 EXPLOITATION_FOR_PRIVILEGE_ESCALATION value + * @property {number} PERMISSION_GROUPS_DISCOVERY=18 PERMISSION_GROUPS_DISCOVERY value + * @property {number} CLOUD_GROUPS=19 CLOUD_GROUPS value + * @property {number} INDICATOR_REMOVAL=123 INDICATOR_REMOVAL value + * @property {number} INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS=124 INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS value + * @property {number} INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY=125 INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY value + * @property {number} INDICATOR_REMOVAL_FILE_DELETION=64 INDICATOR_REMOVAL_FILE_DELETION value + * @property {number} INDICATOR_REMOVAL_TIMESTOMP=128 INDICATOR_REMOVAL_TIMESTOMP value + * @property {number} INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA=126 INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA value + * @property {number} APPLICATION_LAYER_PROTOCOL=45 APPLICATION_LAYER_PROTOCOL value + * @property {number} DNS=46 DNS value + * @property {number} SOFTWARE_DEPLOYMENT_TOOLS=47 SOFTWARE_DEPLOYMENT_TOOLS value + * @property {number} VALID_ACCOUNTS=14 VALID_ACCOUNTS value + * @property {number} DEFAULT_ACCOUNTS=35 DEFAULT_ACCOUNTS value + * @property {number} LOCAL_ACCOUNTS=15 LOCAL_ACCOUNTS value + * @property {number} CLOUD_ACCOUNTS=16 CLOUD_ACCOUNTS value + * @property {number} FILE_AND_DIRECTORY_DISCOVERY=121 FILE_AND_DIRECTORY_DISCOVERY value + * @property {number} ACCOUNT_DISCOVERY_LOCAL_ACCOUNT=116 ACCOUNT_DISCOVERY_LOCAL_ACCOUNT 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} ACCOUNT_MANIPULATION=22 ACCOUNT_MANIPULATION value + * @property {number} ADDITIONAL_CLOUD_CREDENTIALS=40 ADDITIONAL_CLOUD_CREDENTIALS value + * @property {number} ADDITIONAL_CLOUD_ROLES=67 ADDITIONAL_CLOUD_ROLES value + * @property {number} SSH_AUTHORIZED_KEYS=23 SSH_AUTHORIZED_KEYS value + * @property {number} ADDITIONAL_CONTAINER_CLUSTER_ROLES=58 ADDITIONAL_CONTAINER_CLUSTER_ROLES value + * @property {number} MULTI_STAGE_CHANNELS=76 MULTI_STAGE_CHANNELS value + * @property {number} INGRESS_TOOL_TRANSFER=3 INGRESS_TOOL_TRANSFER value + * @property {number} NATIVE_API=4 NATIVE_API value + * @property {number} BRUTE_FORCE=44 BRUTE_FORCE value + * @property {number} AUTOMATED_COLLECTION=94 AUTOMATED_COLLECTION value + * @property {number} SHARED_MODULES=5 SHARED_MODULES value + * @property {number} DATA_ENCODING=77 DATA_ENCODING value + * @property {number} STANDARD_ENCODING=78 STANDARD_ENCODING value + * @property {number} ACCESS_TOKEN_MANIPULATION=33 ACCESS_TOKEN_MANIPULATION value + * @property {number} TOKEN_IMPERSONATION_OR_THEFT=39 TOKEN_IMPERSONATION_OR_THEFT value + * @property {number} CREATE_ACCOUNT=79 CREATE_ACCOUNT value + * @property {number} LOCAL_ACCOUNT=80 LOCAL_ACCOUNT value + * @property {number} DEOBFUSCATE_DECODE_FILES_OR_INFO=95 DEOBFUSCATE_DECODE_FILES_OR_INFO value + * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value + * @property {number} SUPPLY_CHAIN_COMPROMISE=129 SUPPLY_CHAIN_COMPROMISE value + * @property {number} COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS=130 COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS value + * @property {number} EXPLOITATION_FOR_CLIENT_EXECUTION=134 EXPLOITATION_FOR_CLIENT_EXECUTION value + * @property {number} USER_EXECUTION=69 USER_EXECUTION value + * @property {number} LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION=135 LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION value + * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value + * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value + * @property {number} DATA_ENCRYPTED_FOR_IMPACT=132 DATA_ENCRYPTED_FOR_IMPACT value + * @property {number} SERVICE_STOP=52 SERVICE_STOP value + * @property {number} INHIBIT_SYSTEM_RECOVERY=36 INHIBIT_SYSTEM_RECOVERY value + * @property {number} FIRMWARE_CORRUPTION=81 FIRMWARE_CORRUPTION value + * @property {number} RESOURCE_HIJACKING=8 RESOURCE_HIJACKING value + * @property {number} NETWORK_DENIAL_OF_SERVICE=17 NETWORK_DENIAL_OF_SERVICE value + * @property {number} CLOUD_SERVICE_DISCOVERY=48 CLOUD_SERVICE_DISCOVERY value + * @property {number} STEAL_APPLICATION_ACCESS_TOKEN=42 STEAL_APPLICATION_ACCESS_TOKEN value + * @property {number} ACCOUNT_ACCESS_REMOVAL=51 ACCOUNT_ACCESS_REMOVAL value + * @property {number} TRANSFER_DATA_TO_CLOUD_ACCOUNT=91 TRANSFER_DATA_TO_CLOUD_ACCOUNT value + * @property {number} STEAL_WEB_SESSION_COOKIE=25 STEAL_WEB_SESSION_COOKIE value + * @property {number} CREATE_OR_MODIFY_SYSTEM_PROCESS=24 CREATE_OR_MODIFY_SYSTEM_PROCESS value + * @property {number} EVENT_TRIGGERED_EXECUTION=65 EVENT_TRIGGERED_EXECUTION value + * @property {number} BOOT_OR_LOGON_AUTOSTART_EXECUTION=82 BOOT_OR_LOGON_AUTOSTART_EXECUTION value + * @property {number} KERNEL_MODULES_AND_EXTENSIONS=83 KERNEL_MODULES_AND_EXTENSIONS value + * @property {number} SHORTCUT_MODIFICATION=127 SHORTCUT_MODIFICATION value + * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM=34 ABUSE_ELEVATION_CONTROL_MECHANISM value + * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID=136 ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID value + * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING=109 ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING value + * @property {number} UNSECURED_CREDENTIALS=13 UNSECURED_CREDENTIALS value + * @property {number} CREDENTIALS_IN_FILES=105 CREDENTIALS_IN_FILES value + * @property {number} BASH_HISTORY=96 BASH_HISTORY value + * @property {number} PRIVATE_KEYS=97 PRIVATE_KEYS value + * @property {number} SUBVERT_TRUST_CONTROL=106 SUBVERT_TRUST_CONTROL value + * @property {number} INSTALL_ROOT_CERTIFICATE=107 INSTALL_ROOT_CERTIFICATE value + * @property {number} COMPROMISE_HOST_SOFTWARE_BINARY=84 COMPROMISE_HOST_SOFTWARE_BINARY value + * @property {number} CREDENTIALS_FROM_PASSWORD_STORES=98 CREDENTIALS_FROM_PASSWORD_STORES value + * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value + * @property {number} PLUGGABLE_AUTHENTICATION_MODULES=108 PLUGGABLE_AUTHENTICATION_MODULES value + * @property {number} MULTI_FACTOR_AUTHENTICATION=137 MULTI_FACTOR_AUTHENTICATION value + * @property {number} IMPAIR_DEFENSES=31 IMPAIR_DEFENSES value + * @property {number} DISABLE_OR_MODIFY_TOOLS=55 DISABLE_OR_MODIFY_TOOLS value + * @property {number} INDICATOR_BLOCKING=110 INDICATOR_BLOCKING value + * @property {number} DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM=111 DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM value + * @property {number} HIDE_ARTIFACTS=85 HIDE_ARTIFACTS value + * @property {number} HIDDEN_FILES_AND_DIRECTORIES=86 HIDDEN_FILES_AND_DIRECTORIES value + * @property {number} HIDDEN_USERS=87 HIDDEN_USERS 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} DYNAMIC_RESOLUTION=12 DYNAMIC_RESOLUTION value + * @property {number} LATERAL_TOOL_TRANSFER=41 LATERAL_TOOL_TRANSFER value + * @property {number} HIJACK_EXECUTION_FLOW=112 HIJACK_EXECUTION_FLOW value + * @property {number} HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING=113 HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING value + * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value + * @property {number} CREATE_SNAPSHOT=54 CREATE_SNAPSHOT value + * @property {number} CLOUD_INFRASTRUCTURE_DISCOVERY=53 CLOUD_INFRASTRUCTURE_DISCOVERY value + * @property {number} DEVELOP_CAPABILITIES=99 DEVELOP_CAPABILITIES value + * @property {number} DEVELOP_CAPABILITIES_MALWARE=100 DEVELOP_CAPABILITIES_MALWARE value + * @property {number} OBTAIN_CAPABILITIES=43 OBTAIN_CAPABILITIES value + * @property {number} OBTAIN_CAPABILITIES_MALWARE=101 OBTAIN_CAPABILITIES_MALWARE value + * @property {number} OBTAIN_CAPABILITIES_VULNERABILITIES=133 OBTAIN_CAPABILITIES_VULNERABILITIES value + * @property {number} ACTIVE_SCANNING=1 ACTIVE_SCANNING value + * @property {number} SCANNING_IP_BLOCKS=2 SCANNING_IP_BLOCKS value + * @property {number} STAGE_CAPABILITIES=88 STAGE_CAPABILITIES value + * @property {number} UPLOAD_MALWARE=102 UPLOAD_MALWARE value + * @property {number} CONTAINER_ADMINISTRATION_COMMAND=60 CONTAINER_ADMINISTRATION_COMMAND value + * @property {number} DEPLOY_CONTAINER=66 DEPLOY_CONTAINER value + * @property {number} ESCAPE_TO_HOST=61 ESCAPE_TO_HOST value + * @property {number} CONTAINER_AND_RESOURCE_DISCOVERY=57 CONTAINER_AND_RESOURCE_DISCOVERY value + * @property {number} REFLECTIVE_CODE_LOADING=92 REFLECTIVE_CODE_LOADING value + * @property {number} STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES=62 STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES value + * @property {number} FINANCIAL_THEFT=131 FINANCIAL_THEFT value + */ + MitreAttack.Technique = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TECHNIQUE_UNSPECIFIED"] = 0; + values[valuesById[70] = "DATA_OBFUSCATION"] = 70; + values[valuesById[71] = "DATA_OBFUSCATION_STEGANOGRAPHY"] = 71; + values[valuesById[114] = "OS_CREDENTIAL_DUMPING"] = 114; + values[valuesById[115] = "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM"] = 115; + values[valuesById[122] = "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW"] = 122; + values[valuesById[117] = "DATA_FROM_LOCAL_SYSTEM"] = 117; + values[valuesById[68] = "AUTOMATED_EXFILTRATION"] = 68; + values[valuesById[72] = "OBFUSCATED_FILES_OR_INFO"] = 72; + values[valuesById[73] = "STEGANOGRAPHY"] = 73; + values[valuesById[74] = "COMPILE_AFTER_DELIVERY"] = 74; + values[valuesById[75] = "COMMAND_OBFUSCATION"] = 75; + values[valuesById[120] = "SCHEDULED_TRANSFER"] = 120; + values[valuesById[118] = "SYSTEM_OWNER_USER_DISCOVERY"] = 118; + values[valuesById[49] = "MASQUERADING"] = 49; + values[valuesById[50] = "MATCH_LEGITIMATE_NAME_OR_LOCATION"] = 50; + values[valuesById[37] = "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS"] = 37; + values[valuesById[38] = "STARTUP_ITEMS"] = 38; + values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; + values[valuesById[89] = "SCHEDULED_TASK_JOB"] = 89; + values[valuesById[119] = "SCHEDULED_TASK_JOB_CRON"] = 119; + values[valuesById[90] = "CONTAINER_ORCHESTRATION_JOB"] = 90; + values[valuesById[93] = "PROCESS_INJECTION"] = 93; + values[valuesById[103] = "INPUT_CAPTURE"] = 103; + values[valuesById[104] = "INPUT_CAPTURE_KEYLOGGING"] = 104; + values[valuesById[56] = "PROCESS_DISCOVERY"] = 56; + values[valuesById[6] = "COMMAND_AND_SCRIPTING_INTERPRETER"] = 6; + values[valuesById[7] = "UNIX_SHELL"] = 7; + values[valuesById[59] = "PYTHON"] = 59; + values[valuesById[63] = "EXPLOITATION_FOR_PRIVILEGE_ESCALATION"] = 63; + values[valuesById[18] = "PERMISSION_GROUPS_DISCOVERY"] = 18; + values[valuesById[19] = "CLOUD_GROUPS"] = 19; + values[valuesById[123] = "INDICATOR_REMOVAL"] = 123; + values[valuesById[124] = "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS"] = 124; + values[valuesById[125] = "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY"] = 125; + values[valuesById[64] = "INDICATOR_REMOVAL_FILE_DELETION"] = 64; + values[valuesById[128] = "INDICATOR_REMOVAL_TIMESTOMP"] = 128; + values[valuesById[126] = "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA"] = 126; + values[valuesById[45] = "APPLICATION_LAYER_PROTOCOL"] = 45; + values[valuesById[46] = "DNS"] = 46; + values[valuesById[47] = "SOFTWARE_DEPLOYMENT_TOOLS"] = 47; + values[valuesById[14] = "VALID_ACCOUNTS"] = 14; + values[valuesById[35] = "DEFAULT_ACCOUNTS"] = 35; + values[valuesById[15] = "LOCAL_ACCOUNTS"] = 15; + values[valuesById[16] = "CLOUD_ACCOUNTS"] = 16; + values[valuesById[121] = "FILE_AND_DIRECTORY_DISCOVERY"] = 121; + values[valuesById[116] = "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT"] = 116; + values[valuesById[9] = "PROXY"] = 9; + values[valuesById[10] = "EXTERNAL_PROXY"] = 10; + values[valuesById[11] = "MULTI_HOP_PROXY"] = 11; + values[valuesById[22] = "ACCOUNT_MANIPULATION"] = 22; + values[valuesById[40] = "ADDITIONAL_CLOUD_CREDENTIALS"] = 40; + values[valuesById[67] = "ADDITIONAL_CLOUD_ROLES"] = 67; + values[valuesById[23] = "SSH_AUTHORIZED_KEYS"] = 23; + values[valuesById[58] = "ADDITIONAL_CONTAINER_CLUSTER_ROLES"] = 58; + values[valuesById[76] = "MULTI_STAGE_CHANNELS"] = 76; + values[valuesById[3] = "INGRESS_TOOL_TRANSFER"] = 3; + values[valuesById[4] = "NATIVE_API"] = 4; + values[valuesById[44] = "BRUTE_FORCE"] = 44; + values[valuesById[94] = "AUTOMATED_COLLECTION"] = 94; + values[valuesById[5] = "SHARED_MODULES"] = 5; + values[valuesById[77] = "DATA_ENCODING"] = 77; + values[valuesById[78] = "STANDARD_ENCODING"] = 78; + values[valuesById[33] = "ACCESS_TOKEN_MANIPULATION"] = 33; + values[valuesById[39] = "TOKEN_IMPERSONATION_OR_THEFT"] = 39; + values[valuesById[79] = "CREATE_ACCOUNT"] = 79; + values[valuesById[80] = "LOCAL_ACCOUNT"] = 80; + values[valuesById[95] = "DEOBFUSCATE_DECODE_FILES_OR_INFO"] = 95; + values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; + values[valuesById[129] = "SUPPLY_CHAIN_COMPROMISE"] = 129; + values[valuesById[130] = "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS"] = 130; + values[valuesById[134] = "EXPLOITATION_FOR_CLIENT_EXECUTION"] = 134; + values[valuesById[69] = "USER_EXECUTION"] = 69; + values[valuesById[135] = "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION"] = 135; + values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; + values[valuesById[29] = "DATA_DESTRUCTION"] = 29; + values[valuesById[132] = "DATA_ENCRYPTED_FOR_IMPACT"] = 132; + values[valuesById[52] = "SERVICE_STOP"] = 52; + values[valuesById[36] = "INHIBIT_SYSTEM_RECOVERY"] = 36; + values[valuesById[81] = "FIRMWARE_CORRUPTION"] = 81; + values[valuesById[8] = "RESOURCE_HIJACKING"] = 8; + values[valuesById[17] = "NETWORK_DENIAL_OF_SERVICE"] = 17; + values[valuesById[48] = "CLOUD_SERVICE_DISCOVERY"] = 48; + values[valuesById[42] = "STEAL_APPLICATION_ACCESS_TOKEN"] = 42; + values[valuesById[51] = "ACCOUNT_ACCESS_REMOVAL"] = 51; + values[valuesById[91] = "TRANSFER_DATA_TO_CLOUD_ACCOUNT"] = 91; + values[valuesById[25] = "STEAL_WEB_SESSION_COOKIE"] = 25; + values[valuesById[24] = "CREATE_OR_MODIFY_SYSTEM_PROCESS"] = 24; + values[valuesById[65] = "EVENT_TRIGGERED_EXECUTION"] = 65; + values[valuesById[82] = "BOOT_OR_LOGON_AUTOSTART_EXECUTION"] = 82; + values[valuesById[83] = "KERNEL_MODULES_AND_EXTENSIONS"] = 83; + values[valuesById[127] = "SHORTCUT_MODIFICATION"] = 127; + values[valuesById[34] = "ABUSE_ELEVATION_CONTROL_MECHANISM"] = 34; + values[valuesById[136] = "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID"] = 136; + values[valuesById[109] = "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING"] = 109; + values[valuesById[13] = "UNSECURED_CREDENTIALS"] = 13; + values[valuesById[105] = "CREDENTIALS_IN_FILES"] = 105; + values[valuesById[96] = "BASH_HISTORY"] = 96; + values[valuesById[97] = "PRIVATE_KEYS"] = 97; + values[valuesById[106] = "SUBVERT_TRUST_CONTROL"] = 106; + values[valuesById[107] = "INSTALL_ROOT_CERTIFICATE"] = 107; + values[valuesById[84] = "COMPROMISE_HOST_SOFTWARE_BINARY"] = 84; + values[valuesById[98] = "CREDENTIALS_FROM_PASSWORD_STORES"] = 98; + values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; + values[valuesById[108] = "PLUGGABLE_AUTHENTICATION_MODULES"] = 108; + values[valuesById[137] = "MULTI_FACTOR_AUTHENTICATION"] = 137; + values[valuesById[31] = "IMPAIR_DEFENSES"] = 31; + values[valuesById[55] = "DISABLE_OR_MODIFY_TOOLS"] = 55; + values[valuesById[110] = "INDICATOR_BLOCKING"] = 110; + values[valuesById[111] = "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM"] = 111; + values[valuesById[85] = "HIDE_ARTIFACTS"] = 85; + values[valuesById[86] = "HIDDEN_FILES_AND_DIRECTORIES"] = 86; + values[valuesById[87] = "HIDDEN_USERS"] = 87; + values[valuesById[20] = "EXFILTRATION_OVER_WEB_SERVICE"] = 20; + values[valuesById[21] = "EXFILTRATION_TO_CLOUD_STORAGE"] = 21; + values[valuesById[12] = "DYNAMIC_RESOLUTION"] = 12; + values[valuesById[41] = "LATERAL_TOOL_TRANSFER"] = 41; + values[valuesById[112] = "HIJACK_EXECUTION_FLOW"] = 112; + values[valuesById[113] = "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING"] = 113; + values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; + values[valuesById[54] = "CREATE_SNAPSHOT"] = 54; + values[valuesById[53] = "CLOUD_INFRASTRUCTURE_DISCOVERY"] = 53; + values[valuesById[99] = "DEVELOP_CAPABILITIES"] = 99; + values[valuesById[100] = "DEVELOP_CAPABILITIES_MALWARE"] = 100; + values[valuesById[43] = "OBTAIN_CAPABILITIES"] = 43; + values[valuesById[101] = "OBTAIN_CAPABILITIES_MALWARE"] = 101; + values[valuesById[133] = "OBTAIN_CAPABILITIES_VULNERABILITIES"] = 133; + values[valuesById[1] = "ACTIVE_SCANNING"] = 1; + values[valuesById[2] = "SCANNING_IP_BLOCKS"] = 2; + values[valuesById[88] = "STAGE_CAPABILITIES"] = 88; + values[valuesById[102] = "UPLOAD_MALWARE"] = 102; + values[valuesById[60] = "CONTAINER_ADMINISTRATION_COMMAND"] = 60; + values[valuesById[66] = "DEPLOY_CONTAINER"] = 66; + values[valuesById[61] = "ESCAPE_TO_HOST"] = 61; + values[valuesById[57] = "CONTAINER_AND_RESOURCE_DISCOVERY"] = 57; + values[valuesById[92] = "REFLECTIVE_CODE_LOADING"] = 92; + values[valuesById[62] = "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES"] = 62; + values[valuesById[131] = "FINANCIAL_THEFT"] = 131; + return values; + })(); + + return MitreAttack; + })(); + + v2.Network = (function() { + + /** + * Properties of a Network. + * @memberof google.cloud.securitycenter.v2 + * @interface INetwork + * @property {string|null} [name] Network name + */ + + /** + * Constructs a new Network. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Network. + * @implements INetwork + * @constructor + * @param {google.cloud.securitycenter.v2.INetwork=} [properties] Properties to set + */ + function Network(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Network name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Network + * @instance + */ + Network.prototype.name = ""; + + /** + * Creates a new Network instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {google.cloud.securitycenter.v2.INetwork=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Network} Network instance + */ + Network.create = function create(properties) { + return new Network(properties); + }; + + /** + * Encodes the specified Network message. Does not implicitly {@link google.cloud.securitycenter.v2.Network.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {google.cloud.securitycenter.v2.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.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 Network message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Network.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {google.cloud.securitycenter.v2.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Network message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Network(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Network message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Network.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 Network message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Network} Network + */ + Network.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Network) + return object; + var message = new $root.google.cloud.securitycenter.v2.Network(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {google.cloud.securitycenter.v2.Network} message Network + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Network.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 Network to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Network + * @instance + * @returns {Object.} JSON object + */ + Network.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Network + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Network + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Network.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Network"; + }; + + return Network; + })(); + + v2.Notebook = (function() { + + /** + * Properties of a Notebook. + * @memberof google.cloud.securitycenter.v2 + * @interface INotebook + * @property {string|null} [name] Notebook name + * @property {string|null} [service] Notebook service + * @property {string|null} [lastAuthor] Notebook lastAuthor + * @property {google.protobuf.ITimestamp|null} [notebookUpdateTime] Notebook notebookUpdateTime + */ + + /** + * Constructs a new Notebook. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Notebook. + * @implements INotebook + * @constructor + * @param {google.cloud.securitycenter.v2.INotebook=} [properties] Properties to set + */ + function Notebook(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Notebook name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Notebook + * @instance + */ + Notebook.prototype.name = ""; + + /** + * Notebook service. + * @member {string} service + * @memberof google.cloud.securitycenter.v2.Notebook + * @instance + */ + Notebook.prototype.service = ""; + + /** + * Notebook lastAuthor. + * @member {string} lastAuthor + * @memberof google.cloud.securitycenter.v2.Notebook + * @instance + */ + Notebook.prototype.lastAuthor = ""; + + /** + * Notebook notebookUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} notebookUpdateTime + * @memberof google.cloud.securitycenter.v2.Notebook + * @instance + */ + Notebook.prototype.notebookUpdateTime = null; + + /** + * Creates a new Notebook instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {google.cloud.securitycenter.v2.INotebook=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Notebook} Notebook instance + */ + Notebook.create = function create(properties) { + return new Notebook(properties); + }; + + /** + * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.securitycenter.v2.Notebook.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {google.cloud.securitycenter.v2.INotebook} message Notebook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notebook.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.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.lastAuthor != null && Object.hasOwnProperty.call(message, "lastAuthor")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.lastAuthor); + if (message.notebookUpdateTime != null && Object.hasOwnProperty.call(message, "notebookUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.notebookUpdateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Notebook.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {google.cloud.securitycenter.v2.INotebook} message Notebook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notebook.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Notebook message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Notebook} Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notebook.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Notebook(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.lastAuthor = reader.string(); + break; + } + case 4: { + message.notebookUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Notebook message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Notebook} Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notebook.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Notebook message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Notebook.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.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.lastAuthor != null && message.hasOwnProperty("lastAuthor")) + if (!$util.isString(message.lastAuthor)) + return "lastAuthor: string expected"; + if (message.notebookUpdateTime != null && message.hasOwnProperty("notebookUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.notebookUpdateTime); + if (error) + return "notebookUpdateTime." + error; + } + return null; + }; + + /** + * Creates a Notebook message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Notebook} Notebook + */ + Notebook.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Notebook) + return object; + var message = new $root.google.cloud.securitycenter.v2.Notebook(); + if (object.name != null) + message.name = String(object.name); + if (object.service != null) + message.service = String(object.service); + if (object.lastAuthor != null) + message.lastAuthor = String(object.lastAuthor); + if (object.notebookUpdateTime != null) { + if (typeof object.notebookUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Notebook.notebookUpdateTime: object expected"); + message.notebookUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.notebookUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from a Notebook message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {google.cloud.securitycenter.v2.Notebook} message Notebook + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Notebook.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.service = ""; + object.lastAuthor = ""; + object.notebookUpdateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.lastAuthor != null && message.hasOwnProperty("lastAuthor")) + object.lastAuthor = message.lastAuthor; + if (message.notebookUpdateTime != null && message.hasOwnProperty("notebookUpdateTime")) + object.notebookUpdateTime = $root.google.protobuf.Timestamp.toObject(message.notebookUpdateTime, options); + return object; + }; + + /** + * Converts this Notebook to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Notebook + * @instance + * @returns {Object.} JSON object + */ + Notebook.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Notebook + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Notebook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Notebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Notebook"; + }; + + return Notebook; + })(); + + v2.OrgPolicy = (function() { + + /** + * Properties of an OrgPolicy. + * @memberof google.cloud.securitycenter.v2 + * @interface IOrgPolicy + * @property {string|null} [name] OrgPolicy name + */ + + /** + * Constructs a new OrgPolicy. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an OrgPolicy. + * @implements IOrgPolicy + * @constructor + * @param {google.cloud.securitycenter.v2.IOrgPolicy=} [properties] Properties to set + */ + function OrgPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OrgPolicy name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @instance + */ + OrgPolicy.prototype.name = ""; + + /** + * Creates a new OrgPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {google.cloud.securitycenter.v2.IOrgPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.OrgPolicy} OrgPolicy instance + */ + OrgPolicy.create = function create(properties) { + return new OrgPolicy(properties); + }; + + /** + * Encodes the specified OrgPolicy message. Does not implicitly {@link google.cloud.securitycenter.v2.OrgPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {google.cloud.securitycenter.v2.IOrgPolicy} message OrgPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrgPolicy.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 OrgPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.OrgPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {google.cloud.securitycenter.v2.IOrgPolicy} message OrgPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrgPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrgPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.OrgPolicy} OrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrgPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.OrgPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrgPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.OrgPolicy} OrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrgPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrgPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrgPolicy.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 an OrgPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.OrgPolicy} OrgPolicy + */ + OrgPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.OrgPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v2.OrgPolicy(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an OrgPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {google.cloud.securitycenter.v2.OrgPolicy} message OrgPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrgPolicy.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 OrgPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @instance + * @returns {Object.} JSON object + */ + OrgPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrgPolicy + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.OrgPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrgPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.OrgPolicy"; + }; + + return OrgPolicy; + })(); + + v2.Process = (function() { + + /** + * Properties of a Process. + * @memberof google.cloud.securitycenter.v2 + * @interface IProcess + * @property {string|null} [name] Process name + * @property {google.cloud.securitycenter.v2.IFile|null} [binary] Process binary + * @property {Array.|null} [libraries] Process libraries + * @property {google.cloud.securitycenter.v2.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 + * @property {number|Long|null} [userId] Process userId + */ + + /** + * Constructs a new Process. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Process. + * @implements IProcess + * @constructor + * @param {google.cloud.securitycenter.v2.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 name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.name = ""; + + /** + * Process binary. + * @member {google.cloud.securitycenter.v2.IFile|null|undefined} binary + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.binary = null; + + /** + * Process libraries. + * @member {Array.} libraries + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.libraries = $util.emptyArray; + + /** + * Process script. + * @member {google.cloud.securitycenter.v2.IFile|null|undefined} script + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.script = null; + + /** + * Process args. + * @member {Array.} args + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.args = $util.emptyArray; + + /** + * Process argumentsTruncated. + * @member {boolean} argumentsTruncated + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.argumentsTruncated = false; + + /** + * Process envVariables. + * @member {Array.} envVariables + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.envVariables = $util.emptyArray; + + /** + * Process envVariablesTruncated. + * @member {boolean} envVariablesTruncated + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.envVariablesTruncated = false; + + /** + * Process pid. + * @member {number|Long} pid + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.pid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Process parentPid. + * @member {number|Long} parentPid + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.parentPid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Process userId. + * @member {number|Long} userId + * @memberof google.cloud.securitycenter.v2.Process + * @instance + */ + Process.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Process instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Process + * @static + * @param {google.cloud.securitycenter.v2.IProcess=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Process} Process instance + */ + Process.create = function create(properties) { + return new Process(properties); + }; + + /** + * Encodes the specified Process message. Does not implicitly {@link google.cloud.securitycenter.v2.Process.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Process + * @static + * @param {google.cloud.securitycenter.v2.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.binary != null && Object.hasOwnProperty.call(message, "binary")) + $root.google.cloud.securitycenter.v2.File.encode(message.binary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.libraries != null && message.libraries.length) + for (var i = 0; i < message.libraries.length; ++i) + $root.google.cloud.securitycenter.v2.File.encode(message.libraries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + $root.google.cloud.securitycenter.v2.File.encode(message.script, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.args[i]); + if (message.argumentsTruncated != null && Object.hasOwnProperty.call(message, "argumentsTruncated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.argumentsTruncated); + if (message.envVariables != null && message.envVariables.length) + for (var i = 0; i < message.envVariables.length; ++i) + $root.google.cloud.securitycenter.v2.EnvironmentVariable.encode(message.envVariables[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.envVariablesTruncated != null && Object.hasOwnProperty.call(message, "envVariablesTruncated")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.envVariablesTruncated); + if (message.pid != null && Object.hasOwnProperty.call(message, "pid")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.pid); + if (message.parentPid != null && Object.hasOwnProperty.call(message, "parentPid")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.parentPid); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.userId); + return writer; + }; + + /** + * Encodes the specified Process message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Process.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Process + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Process(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.binary = $root.google.cloud.securitycenter.v2.File.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.libraries && message.libraries.length)) + message.libraries = []; + message.libraries.push($root.google.cloud.securitycenter.v2.File.decode(reader, reader.uint32())); + break; + } + case 4: { + message.script = $root.google.cloud.securitycenter.v2.File.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 6: { + message.argumentsTruncated = reader.bool(); + break; + } + case 7: { + if (!(message.envVariables && message.envVariables.length)) + message.envVariables = []; + message.envVariables.push($root.google.cloud.securitycenter.v2.EnvironmentVariable.decode(reader, reader.uint32())); + break; + } + case 8: { + message.envVariablesTruncated = reader.bool(); + break; + } + case 9: { + message.pid = reader.int64(); + break; + } + case 10: { + message.parentPid = reader.int64(); + break; + } + case 11: { + message.userId = 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.v2.Process + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.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.v2.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.v2.File.verify(message.libraries[i]); + if (error) + return "libraries." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + var error = $root.google.cloud.securitycenter.v2.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.v2.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"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high))) + return "userId: 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.v2.Process + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Process} Process + */ + Process.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Process) + return object; + var message = new $root.google.cloud.securitycenter.v2.Process(); + if (object.name != null) + message.name = String(object.name); + if (object.binary != null) { + if (typeof object.binary !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Process.binary: object expected"); + message.binary = $root.google.cloud.securitycenter.v2.File.fromObject(object.binary); + } + if (object.libraries) { + if (!Array.isArray(object.libraries)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Process.libraries: object expected"); + message.libraries[i] = $root.google.cloud.securitycenter.v2.File.fromObject(object.libraries[i]); + } + } + if (object.script != null) { + if (typeof object.script !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Process.script: object expected"); + message.script = $root.google.cloud.securitycenter.v2.File.fromObject(object.script); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.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.v2.Process.envVariables: object expected"); + message.envVariables[i] = $root.google.cloud.securitycenter.v2.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(); + if (object.userId != null) + if ($util.Long) + (message.userId = $util.Long.fromValue(object.userId)).unsigned = false; + else if (typeof object.userId === "string") + message.userId = parseInt(object.userId, 10); + else if (typeof object.userId === "number") + message.userId = object.userId; + else if (typeof object.userId === "object") + message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.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.v2.Process + * @static + * @param {google.cloud.securitycenter.v2.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 (options.defaults) { + object.name = ""; + 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 ($util.Long) { + var long = new $util.Long(0, 0, false); + object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.userId = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.binary != null && message.hasOwnProperty("binary")) + object.binary = $root.google.cloud.securitycenter.v2.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.v2.File.toObject(message.libraries[j], options); + } + if (message.script != null && message.hasOwnProperty("script")) + object.script = $root.google.cloud.securitycenter.v2.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.v2.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; + if (message.userId != null && message.hasOwnProperty("userId")) + if (typeof message.userId === "number") + object.userId = options.longs === String ? String(message.userId) : message.userId; + else + object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId; + return object; + }; + + /** + * Converts this Process to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Process + * @instance + * @returns {Object.} JSON object + */ + Process.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Process + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Process"; + }; + + return Process; + })(); + + v2.EnvironmentVariable = (function() { + + /** + * Properties of an EnvironmentVariable. + * @memberof google.cloud.securitycenter.v2 + * @interface IEnvironmentVariable + * @property {string|null} [name] EnvironmentVariable name + * @property {string|null} [val] EnvironmentVariable val + */ + + /** + * Constructs a new EnvironmentVariable. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an EnvironmentVariable. + * @implements IEnvironmentVariable + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.EnvironmentVariable + * @instance + */ + EnvironmentVariable.prototype.name = ""; + + /** + * EnvironmentVariable val. + * @member {string} val + * @memberof google.cloud.securitycenter.v2.EnvironmentVariable + * @instance + */ + EnvironmentVariable.prototype.val = ""; + + /** + * Creates a new EnvironmentVariable instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v2.IEnvironmentVariable=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.EnvironmentVariable} EnvironmentVariable instance + */ + EnvironmentVariable.create = function create(properties) { + return new EnvironmentVariable(properties); + }; + + /** + * Encodes the specified EnvironmentVariable message. Does not implicitly {@link google.cloud.securitycenter.v2.EnvironmentVariable.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v2.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.v2.EnvironmentVariable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.EnvironmentVariable(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.val = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnvironmentVariable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.EnvironmentVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.EnvironmentVariable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.EnvironmentVariable} EnvironmentVariable + */ + EnvironmentVariable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.EnvironmentVariable) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v2.EnvironmentVariable} message EnvironmentVariable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnvironmentVariable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.val = ""; + } + 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 EnvironmentVariable to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.EnvironmentVariable + * @instance + * @returns {Object.} JSON object + */ + EnvironmentVariable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnvironmentVariable + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.EnvironmentVariable"; + }; + + return EnvironmentVariable; + })(); + + v2.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v2 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks + * @property {string|null} [canonicalName] SecurityMarks canonicalName + */ + + /** + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.SecurityMarks + * @instance + */ + SecurityMarks.prototype.name = ""; + + /** + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v2.SecurityMarks + * @instance + */ + SecurityMarks.prototype.marks = $util.emptyObject; + + /** + * SecurityMarks canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v2.SecurityMarks + * @instance + */ + SecurityMarks.prototype.canonicalName = ""; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v2.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.SecurityMarks} SecurityMarks instance + */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + 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; + }; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityMarks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityMarks(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + } + } + message.marks[key] = value; + break; + } + case 3: { + message.canonicalName = 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.v2.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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"; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: 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.v2.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.SecurityMarks} SecurityMarks + */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.SecurityMarks) + return object; + var message = new $root.google.cloud.securitycenter.v2.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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]]); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v2.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 = ""; + object.canonicalName = ""; + } + 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.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.SecurityMarks + * @instance + * @returns {Object.} JSON object + */ + SecurityMarks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityMarks + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.SecurityMarks"; + }; + + return SecurityMarks; + })(); + + v2.SecurityPosture = (function() { + + /** + * Properties of a SecurityPosture. + * @memberof google.cloud.securitycenter.v2 + * @interface ISecurityPosture + * @property {string|null} [name] SecurityPosture name + * @property {string|null} [revisionId] SecurityPosture revisionId + * @property {string|null} [postureDeploymentResource] SecurityPosture postureDeploymentResource + * @property {string|null} [postureDeployment] SecurityPosture postureDeployment + * @property {string|null} [changedPolicy] SecurityPosture changedPolicy + * @property {string|null} [policySet] SecurityPosture policySet + * @property {string|null} [policy] SecurityPosture policy + * @property {Array.|null} [policyDriftDetails] SecurityPosture policyDriftDetails + */ + + /** + * Constructs a new SecurityPosture. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a SecurityPosture. + * @implements ISecurityPosture + * @constructor + * @param {google.cloud.securitycenter.v2.ISecurityPosture=} [properties] Properties to set + */ + function SecurityPosture(properties) { + this.policyDriftDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPosture name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + */ + SecurityPosture.prototype.name = ""; + + /** + * SecurityPosture revisionId. + * @member {string} revisionId + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + */ + SecurityPosture.prototype.revisionId = ""; + + /** + * SecurityPosture postureDeploymentResource. + * @member {string} postureDeploymentResource + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + */ + SecurityPosture.prototype.postureDeploymentResource = ""; + + /** + * SecurityPosture postureDeployment. + * @member {string} postureDeployment + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + */ + SecurityPosture.prototype.postureDeployment = ""; + + /** + * SecurityPosture changedPolicy. + * @member {string} changedPolicy + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + */ + SecurityPosture.prototype.changedPolicy = ""; + + /** + * SecurityPosture policySet. + * @member {string} policySet + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + */ + SecurityPosture.prototype.policySet = ""; + + /** + * SecurityPosture policy. + * @member {string} policy + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + */ + SecurityPosture.prototype.policy = ""; + + /** + * SecurityPosture policyDriftDetails. + * @member {Array.} policyDriftDetails + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + */ + SecurityPosture.prototype.policyDriftDetails = $util.emptyArray; + + /** + * Creates a new SecurityPosture instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {google.cloud.securitycenter.v2.ISecurityPosture=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.SecurityPosture} SecurityPosture instance + */ + SecurityPosture.create = function create(properties) { + return new SecurityPosture(properties); + }; + + /** + * Encodes the specified SecurityPosture message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {google.cloud.securitycenter.v2.ISecurityPosture} message SecurityPosture message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPosture.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + if (message.postureDeploymentResource != null && Object.hasOwnProperty.call(message, "postureDeploymentResource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.postureDeploymentResource); + if (message.postureDeployment != null && Object.hasOwnProperty.call(message, "postureDeployment")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.postureDeployment); + if (message.changedPolicy != null && Object.hasOwnProperty.call(message, "changedPolicy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.changedPolicy); + if (message.policySet != null && Object.hasOwnProperty.call(message, "policySet")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.policySet); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.policy); + if (message.policyDriftDetails != null && message.policyDriftDetails.length) + for (var i = 0; i < message.policyDriftDetails.length; ++i) + $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.encode(message.policyDriftDetails[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityPosture message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {google.cloud.securitycenter.v2.ISecurityPosture} message SecurityPosture message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPosture.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPosture message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.SecurityPosture} SecurityPosture + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPosture.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityPosture(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + case 3: { + message.postureDeploymentResource = reader.string(); + break; + } + case 4: { + message.postureDeployment = reader.string(); + break; + } + case 5: { + message.changedPolicy = reader.string(); + break; + } + case 6: { + message.policySet = reader.string(); + break; + } + case 7: { + message.policy = reader.string(); + break; + } + case 8: { + if (!(message.policyDriftDetails && message.policyDriftDetails.length)) + message.policyDriftDetails = []; + message.policyDriftDetails.push($root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPosture message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.SecurityPosture} SecurityPosture + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPosture.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPosture message. + * @function verify + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPosture.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.postureDeploymentResource != null && message.hasOwnProperty("postureDeploymentResource")) + if (!$util.isString(message.postureDeploymentResource)) + return "postureDeploymentResource: string expected"; + if (message.postureDeployment != null && message.hasOwnProperty("postureDeployment")) + if (!$util.isString(message.postureDeployment)) + return "postureDeployment: string expected"; + if (message.changedPolicy != null && message.hasOwnProperty("changedPolicy")) + if (!$util.isString(message.changedPolicy)) + return "changedPolicy: string expected"; + if (message.policySet != null && message.hasOwnProperty("policySet")) + if (!$util.isString(message.policySet)) + return "policySet: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) + if (!$util.isString(message.policy)) + return "policy: string expected"; + if (message.policyDriftDetails != null && message.hasOwnProperty("policyDriftDetails")) { + if (!Array.isArray(message.policyDriftDetails)) + return "policyDriftDetails: array expected"; + for (var i = 0; i < message.policyDriftDetails.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify(message.policyDriftDetails[i]); + if (error) + return "policyDriftDetails." + error; + } + } + return null; + }; + + /** + * Creates a SecurityPosture message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.SecurityPosture} SecurityPosture + */ + SecurityPosture.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.SecurityPosture) + return object; + var message = new $root.google.cloud.securitycenter.v2.SecurityPosture(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.postureDeploymentResource != null) + message.postureDeploymentResource = String(object.postureDeploymentResource); + if (object.postureDeployment != null) + message.postureDeployment = String(object.postureDeployment); + if (object.changedPolicy != null) + message.changedPolicy = String(object.changedPolicy); + if (object.policySet != null) + message.policySet = String(object.policySet); + if (object.policy != null) + message.policy = String(object.policy); + if (object.policyDriftDetails) { + if (!Array.isArray(object.policyDriftDetails)) + throw TypeError(".google.cloud.securitycenter.v2.SecurityPosture.policyDriftDetails: array expected"); + message.policyDriftDetails = []; + for (var i = 0; i < object.policyDriftDetails.length; ++i) { + if (typeof object.policyDriftDetails[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.SecurityPosture.policyDriftDetails: object expected"); + message.policyDriftDetails[i] = $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.fromObject(object.policyDriftDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SecurityPosture message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {google.cloud.securitycenter.v2.SecurityPosture} message SecurityPosture + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPosture.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policyDriftDetails = []; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + object.postureDeploymentResource = ""; + object.postureDeployment = ""; + object.changedPolicy = ""; + object.policySet = ""; + object.policy = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.postureDeploymentResource != null && message.hasOwnProperty("postureDeploymentResource")) + object.postureDeploymentResource = message.postureDeploymentResource; + if (message.postureDeployment != null && message.hasOwnProperty("postureDeployment")) + object.postureDeployment = message.postureDeployment; + if (message.changedPolicy != null && message.hasOwnProperty("changedPolicy")) + object.changedPolicy = message.changedPolicy; + if (message.policySet != null && message.hasOwnProperty("policySet")) + object.policySet = message.policySet; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = message.policy; + if (message.policyDriftDetails && message.policyDriftDetails.length) { + object.policyDriftDetails = []; + for (var j = 0; j < message.policyDriftDetails.length; ++j) + object.policyDriftDetails[j] = $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.toObject(message.policyDriftDetails[j], options); + } + return object; + }; + + /** + * Converts this SecurityPosture to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @instance + * @returns {Object.} JSON object + */ + SecurityPosture.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityPosture + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityPosture.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.SecurityPosture"; + }; + + SecurityPosture.PolicyDriftDetails = (function() { + + /** + * Properties of a PolicyDriftDetails. + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @interface IPolicyDriftDetails + * @property {string|null} [field] PolicyDriftDetails field + * @property {string|null} [expectedValue] PolicyDriftDetails expectedValue + * @property {string|null} [detectedValue] PolicyDriftDetails detectedValue + */ + + /** + * Constructs a new PolicyDriftDetails. + * @memberof google.cloud.securitycenter.v2.SecurityPosture + * @classdesc Represents a PolicyDriftDetails. + * @implements IPolicyDriftDetails + * @constructor + * @param {google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails=} [properties] Properties to set + */ + function PolicyDriftDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDriftDetails field. + * @member {string} field + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @instance + */ + PolicyDriftDetails.prototype.field = ""; + + /** + * PolicyDriftDetails expectedValue. + * @member {string} expectedValue + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @instance + */ + PolicyDriftDetails.prototype.expectedValue = ""; + + /** + * PolicyDriftDetails detectedValue. + * @member {string} detectedValue + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @instance + */ + PolicyDriftDetails.prototype.detectedValue = ""; + + /** + * Creates a new PolicyDriftDetails instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails instance + */ + PolicyDriftDetails.create = function create(properties) { + return new PolicyDriftDetails(properties); + }; + + /** + * Encodes the specified PolicyDriftDetails message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails} message PolicyDriftDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDriftDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.expectedValue != null && Object.hasOwnProperty.call(message, "expectedValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.expectedValue); + if (message.detectedValue != null && Object.hasOwnProperty.call(message, "detectedValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedValue); + return writer; + }; + + /** + * Encodes the specified PolicyDriftDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails} message PolicyDriftDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDriftDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDriftDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDriftDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.expectedValue = reader.string(); + break; + } + case 3: { + message.detectedValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDriftDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDriftDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDriftDetails message. + * @function verify + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDriftDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.expectedValue != null && message.hasOwnProperty("expectedValue")) + if (!$util.isString(message.expectedValue)) + return "expectedValue: string expected"; + if (message.detectedValue != null && message.hasOwnProperty("detectedValue")) + if (!$util.isString(message.detectedValue)) + return "detectedValue: string expected"; + return null; + }; + + /** + * Creates a PolicyDriftDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails + */ + PolicyDriftDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails) + return object; + var message = new $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails(); + if (object.field != null) + message.field = String(object.field); + if (object.expectedValue != null) + message.expectedValue = String(object.expectedValue); + if (object.detectedValue != null) + message.detectedValue = String(object.detectedValue); + return message; + }; + + /** + * Creates a plain object from a PolicyDriftDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} message PolicyDriftDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDriftDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.expectedValue = ""; + object.detectedValue = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.expectedValue != null && message.hasOwnProperty("expectedValue")) + object.expectedValue = message.expectedValue; + if (message.detectedValue != null && message.hasOwnProperty("detectedValue")) + object.detectedValue = message.detectedValue; + return object; + }; + + /** + * Converts this PolicyDriftDetails to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @instance + * @returns {Object.} JSON object + */ + PolicyDriftDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDriftDetails + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDriftDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails"; + }; + + return PolicyDriftDetails; + })(); + + return SecurityPosture; + })(); + + v2.ToxicCombination = (function() { + + /** + * Properties of a ToxicCombination. + * @memberof google.cloud.securitycenter.v2 + * @interface IToxicCombination + * @property {number|null} [attackExposureScore] ToxicCombination attackExposureScore + * @property {Array.|null} [relatedFindings] ToxicCombination relatedFindings + */ + + /** + * Constructs a new ToxicCombination. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ToxicCombination. + * @implements IToxicCombination + * @constructor + * @param {google.cloud.securitycenter.v2.IToxicCombination=} [properties] Properties to set + */ + function ToxicCombination(properties) { + this.relatedFindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToxicCombination attackExposureScore. + * @member {number} attackExposureScore + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @instance + */ + ToxicCombination.prototype.attackExposureScore = 0; + + /** + * ToxicCombination relatedFindings. + * @member {Array.} relatedFindings + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @instance + */ + ToxicCombination.prototype.relatedFindings = $util.emptyArray; + + /** + * Creates a new ToxicCombination instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v2.IToxicCombination=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination instance + */ + ToxicCombination.create = function create(properties) { + return new ToxicCombination(properties); + }; + + /** + * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v2.IToxicCombination} message ToxicCombination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToxicCombination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attackExposureScore != null && Object.hasOwnProperty.call(message, "attackExposureScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.attackExposureScore); + if (message.relatedFindings != null && message.relatedFindings.length) + for (var i = 0; i < message.relatedFindings.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.relatedFindings[i]); + return writer; + }; + + /** + * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v2.IToxicCombination} message ToxicCombination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToxicCombination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToxicCombination.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ToxicCombination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.attackExposureScore = reader.double(); + break; + } + case 2: { + if (!(message.relatedFindings && message.relatedFindings.length)) + message.relatedFindings = []; + message.relatedFindings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToxicCombination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToxicCombination message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToxicCombination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) + if (typeof message.attackExposureScore !== "number") + return "attackExposureScore: number expected"; + if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { + if (!Array.isArray(message.relatedFindings)) + return "relatedFindings: array expected"; + for (var i = 0; i < message.relatedFindings.length; ++i) + if (!$util.isString(message.relatedFindings[i])) + return "relatedFindings: string[] expected"; + } + return null; + }; + + /** + * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination + */ + ToxicCombination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ToxicCombination) + return object; + var message = new $root.google.cloud.securitycenter.v2.ToxicCombination(); + if (object.attackExposureScore != null) + message.attackExposureScore = Number(object.attackExposureScore); + if (object.relatedFindings) { + if (!Array.isArray(object.relatedFindings)) + throw TypeError(".google.cloud.securitycenter.v2.ToxicCombination.relatedFindings: array expected"); + message.relatedFindings = []; + for (var i = 0; i < object.relatedFindings.length; ++i) + message.relatedFindings[i] = String(object.relatedFindings[i]); + } + return message; + }; + + /** + * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v2.ToxicCombination} message ToxicCombination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToxicCombination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedFindings = []; + if (options.defaults) + object.attackExposureScore = 0; + if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) + object.attackExposureScore = options.json && !isFinite(message.attackExposureScore) ? String(message.attackExposureScore) : message.attackExposureScore; + if (message.relatedFindings && message.relatedFindings.length) { + object.relatedFindings = []; + for (var j = 0; j < message.relatedFindings.length; ++j) + object.relatedFindings[j] = message.relatedFindings[j]; + } + return object; + }; + + /** + * Converts this ToxicCombination to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @instance + * @returns {Object.} JSON object + */ + ToxicCombination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToxicCombination + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToxicCombination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ToxicCombination"; + }; + + return ToxicCombination; + })(); + + v2.VertexAi = (function() { + + /** + * Properties of a VertexAi. + * @memberof google.cloud.securitycenter.v2 + * @interface IVertexAi + * @property {Array.|null} [datasets] VertexAi datasets + * @property {Array.|null} [pipelines] VertexAi pipelines + */ + + /** + * Constructs a new VertexAi. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a VertexAi. + * @implements IVertexAi + * @constructor + * @param {google.cloud.securitycenter.v2.IVertexAi=} [properties] Properties to set + */ + function VertexAi(properties) { + this.datasets = []; + this.pipelines = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VertexAi datasets. + * @member {Array.} datasets + * @memberof google.cloud.securitycenter.v2.VertexAi + * @instance + */ + VertexAi.prototype.datasets = $util.emptyArray; + + /** + * VertexAi pipelines. + * @member {Array.} pipelines + * @memberof google.cloud.securitycenter.v2.VertexAi + * @instance + */ + VertexAi.prototype.pipelines = $util.emptyArray; + + /** + * Creates a new VertexAi instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {google.cloud.securitycenter.v2.IVertexAi=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.VertexAi} VertexAi instance + */ + VertexAi.create = function create(properties) { + return new VertexAi(properties); + }; + + /** + * Encodes the specified VertexAi message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {google.cloud.securitycenter.v2.IVertexAi} message VertexAi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexAi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasets != null && message.datasets.length) + for (var i = 0; i < message.datasets.length; ++i) + $root.google.cloud.securitycenter.v2.VertexAi.Dataset.encode(message.datasets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pipelines != null && message.pipelines.length) + for (var i = 0; i < message.pipelines.length; ++i) + $root.google.cloud.securitycenter.v2.VertexAi.Pipeline.encode(message.pipelines[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VertexAi message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {google.cloud.securitycenter.v2.IVertexAi} message VertexAi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexAi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VertexAi message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.VertexAi} VertexAi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexAi.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.VertexAi(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.datasets && message.datasets.length)) + message.datasets = []; + message.datasets.push($root.google.cloud.securitycenter.v2.VertexAi.Dataset.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.pipelines && message.pipelines.length)) + message.pipelines = []; + message.pipelines.push($root.google.cloud.securitycenter.v2.VertexAi.Pipeline.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VertexAi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.VertexAi} VertexAi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexAi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VertexAi message. + * @function verify + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexAi.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasets != null && message.hasOwnProperty("datasets")) { + if (!Array.isArray(message.datasets)) + return "datasets: array expected"; + for (var i = 0; i < message.datasets.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.VertexAi.Dataset.verify(message.datasets[i]); + if (error) + return "datasets." + error; + } + } + if (message.pipelines != null && message.hasOwnProperty("pipelines")) { + if (!Array.isArray(message.pipelines)) + return "pipelines: array expected"; + for (var i = 0; i < message.pipelines.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.VertexAi.Pipeline.verify(message.pipelines[i]); + if (error) + return "pipelines." + error; + } + } + return null; + }; + + /** + * Creates a VertexAi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.VertexAi} VertexAi + */ + VertexAi.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.VertexAi) + return object; + var message = new $root.google.cloud.securitycenter.v2.VertexAi(); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.cloud.securitycenter.v2.VertexAi.datasets: array expected"); + message.datasets = []; + for (var i = 0; i < object.datasets.length; ++i) { + if (typeof object.datasets[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.VertexAi.datasets: object expected"); + message.datasets[i] = $root.google.cloud.securitycenter.v2.VertexAi.Dataset.fromObject(object.datasets[i]); + } + } + if (object.pipelines) { + if (!Array.isArray(object.pipelines)) + throw TypeError(".google.cloud.securitycenter.v2.VertexAi.pipelines: array expected"); + message.pipelines = []; + for (var i = 0; i < object.pipelines.length; ++i) { + if (typeof object.pipelines[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.VertexAi.pipelines: object expected"); + message.pipelines[i] = $root.google.cloud.securitycenter.v2.VertexAi.Pipeline.fromObject(object.pipelines[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VertexAi message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {google.cloud.securitycenter.v2.VertexAi} message VertexAi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexAi.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.datasets = []; + object.pipelines = []; + } + if (message.datasets && message.datasets.length) { + object.datasets = []; + for (var j = 0; j < message.datasets.length; ++j) + object.datasets[j] = $root.google.cloud.securitycenter.v2.VertexAi.Dataset.toObject(message.datasets[j], options); + } + if (message.pipelines && message.pipelines.length) { + object.pipelines = []; + for (var j = 0; j < message.pipelines.length; ++j) + object.pipelines[j] = $root.google.cloud.securitycenter.v2.VertexAi.Pipeline.toObject(message.pipelines[j], options); + } + return object; + }; + + /** + * Converts this VertexAi to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.VertexAi + * @instance + * @returns {Object.} JSON object + */ + VertexAi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VertexAi + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.VertexAi + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexAi.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.VertexAi"; + }; + + VertexAi.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.cloud.securitycenter.v2.VertexAi + * @interface IDataset + * @property {string|null} [name] Dataset name + * @property {string|null} [displayName] Dataset displayName + * @property {string|null} [source] Dataset source + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.securitycenter.v2.VertexAi + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.cloud.securitycenter.v2.VertexAi.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @instance + */ + Dataset.prototype.displayName = ""; + + /** + * Dataset source. + * @member {string} source + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @instance + */ + Dataset.prototype.source = ""; + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {google.cloud.securitycenter.v2.VertexAi.IDataset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.VertexAi.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Dataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {google.cloud.securitycenter.v2.VertexAi.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.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.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.source); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {google.cloud.securitycenter.v2.VertexAi.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.VertexAi.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.VertexAi.Dataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.source = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.VertexAi.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.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.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.VertexAi.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.VertexAi.Dataset) + return object; + var message = new $root.google.cloud.securitycenter.v2.VertexAi.Dataset(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {google.cloud.securitycenter.v2.VertexAi.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.source = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.VertexAi.Dataset"; + }; + + return Dataset; + })(); + + VertexAi.Pipeline = (function() { + + /** + * Properties of a Pipeline. + * @memberof google.cloud.securitycenter.v2.VertexAi + * @interface IPipeline + * @property {string|null} [name] Pipeline name + * @property {string|null} [displayName] Pipeline displayName + */ + + /** + * Constructs a new Pipeline. + * @memberof google.cloud.securitycenter.v2.VertexAi + * @classdesc Represents a Pipeline. + * @implements IPipeline + * @constructor + * @param {google.cloud.securitycenter.v2.VertexAi.IPipeline=} [properties] Properties to set + */ + function Pipeline(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Pipeline name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @instance + */ + Pipeline.prototype.name = ""; + + /** + * Pipeline displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @instance + */ + Pipeline.prototype.displayName = ""; + + /** + * Creates a new Pipeline instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {google.cloud.securitycenter.v2.VertexAi.IPipeline=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.VertexAi.Pipeline} Pipeline instance + */ + Pipeline.create = function create(properties) { + return new Pipeline(properties); + }; + + /** + * Encodes the specified Pipeline message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Pipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {google.cloud.securitycenter.v2.VertexAi.IPipeline} message Pipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pipeline.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); + return writer; + }; + + /** + * Encodes the specified Pipeline message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Pipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {google.cloud.securitycenter.v2.VertexAi.IPipeline} message Pipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.VertexAi.Pipeline} Pipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pipeline.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.VertexAi.Pipeline(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.VertexAi.Pipeline} Pipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pipeline message. + * @function verify + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pipeline.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"; + return null; + }; + + /** + * Creates a Pipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.VertexAi.Pipeline} Pipeline + */ + Pipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.VertexAi.Pipeline) + return object; + var message = new $root.google.cloud.securitycenter.v2.VertexAi.Pipeline(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a Pipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {google.cloud.securitycenter.v2.VertexAi.Pipeline} message Pipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Pipeline to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @instance + * @returns {Object.} JSON object + */ + Pipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Pipeline + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Pipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.VertexAi.Pipeline"; + }; + + return Pipeline; + })(); + + return VertexAi; + })(); + + v2.Vulnerability = (function() { + + /** + * Properties of a Vulnerability. + * @memberof google.cloud.securitycenter.v2 + * @interface IVulnerability + * @property {google.cloud.securitycenter.v2.ICve|null} [cve] Vulnerability cve + * @property {google.cloud.securitycenter.v2.IPackage|null} [offendingPackage] Vulnerability offendingPackage + * @property {google.cloud.securitycenter.v2.IPackage|null} [fixedPackage] Vulnerability fixedPackage + * @property {google.cloud.securitycenter.v2.ISecurityBulletin|null} [securityBulletin] Vulnerability securityBulletin + * @property {number|Long|null} [providerRiskScore] Vulnerability providerRiskScore + * @property {boolean|null} [reachable] Vulnerability reachable + * @property {Array.|null} [cwes] Vulnerability cwes + */ + + /** + * Constructs a new Vulnerability. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Vulnerability. + * @implements IVulnerability + * @constructor + * @param {google.cloud.securitycenter.v2.IVulnerability=} [properties] Properties to set + */ + function Vulnerability(properties) { + this.cwes = []; + if (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.v2.ICve|null|undefined} cve + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @instance + */ + Vulnerability.prototype.cve = null; + + /** + * Vulnerability offendingPackage. + * @member {google.cloud.securitycenter.v2.IPackage|null|undefined} offendingPackage + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @instance + */ + Vulnerability.prototype.offendingPackage = null; + + /** + * Vulnerability fixedPackage. + * @member {google.cloud.securitycenter.v2.IPackage|null|undefined} fixedPackage + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @instance + */ + Vulnerability.prototype.fixedPackage = null; + + /** + * Vulnerability securityBulletin. + * @member {google.cloud.securitycenter.v2.ISecurityBulletin|null|undefined} securityBulletin + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @instance + */ + Vulnerability.prototype.securityBulletin = null; + + /** + * Vulnerability providerRiskScore. + * @member {number|Long} providerRiskScore + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @instance + */ + Vulnerability.prototype.providerRiskScore = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Vulnerability reachable. + * @member {boolean} reachable + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @instance + */ + Vulnerability.prototype.reachable = false; + + /** + * Vulnerability cwes. + * @member {Array.} cwes + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @instance + */ + Vulnerability.prototype.cwes = $util.emptyArray; + + /** + * Creates a new Vulnerability instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @static + * @param {google.cloud.securitycenter.v2.IVulnerability=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Vulnerability} Vulnerability instance + */ + Vulnerability.create = function create(properties) { + return new Vulnerability(properties); + }; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.securitycenter.v2.Vulnerability.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Cve.encode(message.cve, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.offendingPackage != null && Object.hasOwnProperty.call(message, "offendingPackage")) + $root.google.cloud.securitycenter.v2.Package.encode(message.offendingPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fixedPackage != null && Object.hasOwnProperty.call(message, "fixedPackage")) + $root.google.cloud.securitycenter.v2.Package.encode(message.fixedPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.securityBulletin != null && Object.hasOwnProperty.call(message, "securityBulletin")) + $root.google.cloud.securitycenter.v2.SecurityBulletin.encode(message.securityBulletin, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.providerRiskScore != null && Object.hasOwnProperty.call(message, "providerRiskScore")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.providerRiskScore); + if (message.reachable != null && Object.hasOwnProperty.call(message, "reachable")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.reachable); + if (message.cwes != null && message.cwes.length) + for (var i = 0; i < message.cwes.length; ++i) + $root.google.cloud.securitycenter.v2.Cwe.encode(message.cwes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Vulnerability.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Vulnerability(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cve = $root.google.cloud.securitycenter.v2.Cve.decode(reader, reader.uint32()); + break; + } + case 2: { + message.offendingPackage = $root.google.cloud.securitycenter.v2.Package.decode(reader, reader.uint32()); + break; + } + case 3: { + message.fixedPackage = $root.google.cloud.securitycenter.v2.Package.decode(reader, reader.uint32()); + break; + } + case 4: { + message.securityBulletin = $root.google.cloud.securitycenter.v2.SecurityBulletin.decode(reader, reader.uint32()); + break; + } + case 5: { + message.providerRiskScore = reader.int64(); + break; + } + case 6: { + message.reachable = reader.bool(); + break; + } + case 7: { + if (!(message.cwes && message.cwes.length)) + message.cwes = []; + message.cwes.push($root.google.cloud.securitycenter.v2.Cwe.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.v2.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Cve.verify(message.cve); + if (error) + return "cve." + error; + } + if (message.offendingPackage != null && message.hasOwnProperty("offendingPackage")) { + var error = $root.google.cloud.securitycenter.v2.Package.verify(message.offendingPackage); + if (error) + return "offendingPackage." + error; + } + if (message.fixedPackage != null && message.hasOwnProperty("fixedPackage")) { + var error = $root.google.cloud.securitycenter.v2.Package.verify(message.fixedPackage); + if (error) + return "fixedPackage." + error; + } + if (message.securityBulletin != null && message.hasOwnProperty("securityBulletin")) { + var error = $root.google.cloud.securitycenter.v2.SecurityBulletin.verify(message.securityBulletin); + if (error) + return "securityBulletin." + error; + } + if (message.providerRiskScore != null && message.hasOwnProperty("providerRiskScore")) + if (!$util.isInteger(message.providerRiskScore) && !(message.providerRiskScore && $util.isInteger(message.providerRiskScore.low) && $util.isInteger(message.providerRiskScore.high))) + return "providerRiskScore: integer|Long expected"; + if (message.reachable != null && message.hasOwnProperty("reachable")) + if (typeof message.reachable !== "boolean") + return "reachable: boolean expected"; + if (message.cwes != null && message.hasOwnProperty("cwes")) { + if (!Array.isArray(message.cwes)) + return "cwes: array expected"; + for (var i = 0; i < message.cwes.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.Cwe.verify(message.cwes[i]); + if (error) + return "cwes." + 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.v2.Vulnerability + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Vulnerability} Vulnerability + */ + Vulnerability.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Vulnerability) + return object; + var message = new $root.google.cloud.securitycenter.v2.Vulnerability(); + if (object.cve != null) { + if (typeof object.cve !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.cve: object expected"); + message.cve = $root.google.cloud.securitycenter.v2.Cve.fromObject(object.cve); + } + if (object.offendingPackage != null) { + if (typeof object.offendingPackage !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.offendingPackage: object expected"); + message.offendingPackage = $root.google.cloud.securitycenter.v2.Package.fromObject(object.offendingPackage); + } + if (object.fixedPackage != null) { + if (typeof object.fixedPackage !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.fixedPackage: object expected"); + message.fixedPackage = $root.google.cloud.securitycenter.v2.Package.fromObject(object.fixedPackage); + } + if (object.securityBulletin != null) { + if (typeof object.securityBulletin !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.securityBulletin: object expected"); + message.securityBulletin = $root.google.cloud.securitycenter.v2.SecurityBulletin.fromObject(object.securityBulletin); + } + if (object.providerRiskScore != null) + if ($util.Long) + (message.providerRiskScore = $util.Long.fromValue(object.providerRiskScore)).unsigned = false; + else if (typeof object.providerRiskScore === "string") + message.providerRiskScore = parseInt(object.providerRiskScore, 10); + else if (typeof object.providerRiskScore === "number") + message.providerRiskScore = object.providerRiskScore; + else if (typeof object.providerRiskScore === "object") + message.providerRiskScore = new $util.LongBits(object.providerRiskScore.low >>> 0, object.providerRiskScore.high >>> 0).toNumber(); + if (object.reachable != null) + message.reachable = Boolean(object.reachable); + if (object.cwes) { + if (!Array.isArray(object.cwes)) + throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.cwes: array expected"); + message.cwes = []; + for (var i = 0; i < object.cwes.length; ++i) { + if (typeof object.cwes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.cwes: object expected"); + message.cwes[i] = $root.google.cloud.securitycenter.v2.Cwe.fromObject(object.cwes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Vulnerability message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @static + * @param {google.cloud.securitycenter.v2.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.arrays || options.defaults) + object.cwes = []; + if (options.defaults) { + object.cve = null; + object.offendingPackage = null; + object.fixedPackage = null; + object.securityBulletin = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.providerRiskScore = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.providerRiskScore = options.longs === String ? "0" : 0; + object.reachable = false; + } + if (message.cve != null && message.hasOwnProperty("cve")) + object.cve = $root.google.cloud.securitycenter.v2.Cve.toObject(message.cve, options); + if (message.offendingPackage != null && message.hasOwnProperty("offendingPackage")) + object.offendingPackage = $root.google.cloud.securitycenter.v2.Package.toObject(message.offendingPackage, options); + if (message.fixedPackage != null && message.hasOwnProperty("fixedPackage")) + object.fixedPackage = $root.google.cloud.securitycenter.v2.Package.toObject(message.fixedPackage, options); + if (message.securityBulletin != null && message.hasOwnProperty("securityBulletin")) + object.securityBulletin = $root.google.cloud.securitycenter.v2.SecurityBulletin.toObject(message.securityBulletin, options); + if (message.providerRiskScore != null && message.hasOwnProperty("providerRiskScore")) + if (typeof message.providerRiskScore === "number") + object.providerRiskScore = options.longs === String ? String(message.providerRiskScore) : message.providerRiskScore; + else + object.providerRiskScore = options.longs === String ? $util.Long.prototype.toString.call(message.providerRiskScore) : options.longs === Number ? new $util.LongBits(message.providerRiskScore.low >>> 0, message.providerRiskScore.high >>> 0).toNumber() : message.providerRiskScore; + if (message.reachable != null && message.hasOwnProperty("reachable")) + object.reachable = message.reachable; + if (message.cwes && message.cwes.length) { + object.cwes = []; + for (var j = 0; j < message.cwes.length; ++j) + object.cwes[j] = $root.google.cloud.securitycenter.v2.Cwe.toObject(message.cwes[j], options); + } + return object; + }; + + /** + * Converts this Vulnerability to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Vulnerability + * @instance + * @returns {Object.} JSON object + */ + Vulnerability.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Vulnerability + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Vulnerability"; + }; + + return Vulnerability; + })(); + + v2.Cve = (function() { + + /** + * Properties of a Cve. + * @memberof google.cloud.securitycenter.v2 + * @interface ICve + * @property {string|null} [id] Cve id + * @property {Array.|null} [references] Cve references + * @property {google.cloud.securitycenter.v2.ICvssv3|null} [cvssv3] Cve cvssv3 + * @property {boolean|null} [upstreamFixAvailable] Cve upstreamFixAvailable + * @property {google.cloud.securitycenter.v2.Cve.RiskRating|null} [impact] Cve impact + * @property {google.cloud.securitycenter.v2.Cve.ExploitationActivity|null} [exploitationActivity] Cve exploitationActivity + * @property {boolean|null} [observedInTheWild] Cve observedInTheWild + * @property {boolean|null} [zeroDay] Cve zeroDay + * @property {google.protobuf.ITimestamp|null} [exploitReleaseDate] Cve exploitReleaseDate + * @property {google.protobuf.ITimestamp|null} [firstExploitationDate] Cve firstExploitationDate + */ + + /** + * Constructs a new Cve. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Cve. + * @implements ICve + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Cve + * @instance + */ + Cve.prototype.id = ""; + + /** + * Cve references. + * @member {Array.} references + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.references = $util.emptyArray; + + /** + * Cve cvssv3. + * @member {google.cloud.securitycenter.v2.ICvssv3|null|undefined} cvssv3 + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.cvssv3 = null; + + /** + * Cve upstreamFixAvailable. + * @member {boolean} upstreamFixAvailable + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.upstreamFixAvailable = false; + + /** + * Cve impact. + * @member {google.cloud.securitycenter.v2.Cve.RiskRating} impact + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.impact = 0; + + /** + * Cve exploitationActivity. + * @member {google.cloud.securitycenter.v2.Cve.ExploitationActivity} exploitationActivity + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.exploitationActivity = 0; + + /** + * Cve observedInTheWild. + * @member {boolean} observedInTheWild + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.observedInTheWild = false; + + /** + * Cve zeroDay. + * @member {boolean} zeroDay + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.zeroDay = false; + + /** + * Cve exploitReleaseDate. + * @member {google.protobuf.ITimestamp|null|undefined} exploitReleaseDate + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.exploitReleaseDate = null; + + /** + * Cve firstExploitationDate. + * @member {google.protobuf.ITimestamp|null|undefined} firstExploitationDate + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + */ + Cve.prototype.firstExploitationDate = null; + + /** + * Creates a new Cve instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Cve + * @static + * @param {google.cloud.securitycenter.v2.ICve=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Cve} Cve instance + */ + Cve.create = function create(properties) { + return new Cve(properties); + }; + + /** + * Encodes the specified Cve message. Does not implicitly {@link google.cloud.securitycenter.v2.Cve.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Cve + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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); + if (message.impact != null && Object.hasOwnProperty.call(message, "impact")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.impact); + if (message.exploitationActivity != null && Object.hasOwnProperty.call(message, "exploitationActivity")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.exploitationActivity); + if (message.observedInTheWild != null && Object.hasOwnProperty.call(message, "observedInTheWild")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.observedInTheWild); + if (message.zeroDay != null && Object.hasOwnProperty.call(message, "zeroDay")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.zeroDay); + if (message.exploitReleaseDate != null && Object.hasOwnProperty.call(message, "exploitReleaseDate")) + $root.google.protobuf.Timestamp.encode(message.exploitReleaseDate, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.firstExploitationDate != null && Object.hasOwnProperty.call(message, "firstExploitationDate")) + $root.google.protobuf.Timestamp.encode(message.firstExploitationDate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cve message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Cve.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Cve + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Cve(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Reference.decode(reader, reader.uint32())); + break; + } + case 3: { + message.cvssv3 = $root.google.cloud.securitycenter.v2.Cvssv3.decode(reader, reader.uint32()); + break; + } + case 4: { + message.upstreamFixAvailable = reader.bool(); + break; + } + case 5: { + message.impact = reader.int32(); + break; + } + case 6: { + message.exploitationActivity = reader.int32(); + break; + } + case 7: { + message.observedInTheWild = reader.bool(); + break; + } + case 8: { + message.zeroDay = reader.bool(); + break; + } + case 9: { + message.exploitReleaseDate = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.firstExploitationDate = $root.google.protobuf.Timestamp.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.v2.Cve + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Reference.verify(message.references[i]); + if (error) + return "references." + error; + } + } + if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) { + var error = $root.google.cloud.securitycenter.v2.Cvssv3.verify(message.cvssv3); + if (error) + return "cvssv3." + error; + } + if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) + if (typeof message.upstreamFixAvailable !== "boolean") + return "upstreamFixAvailable: boolean expected"; + if (message.impact != null && message.hasOwnProperty("impact")) + switch (message.impact) { + default: + return "impact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.exploitationActivity != null && message.hasOwnProperty("exploitationActivity")) + switch (message.exploitationActivity) { + default: + return "exploitationActivity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.observedInTheWild != null && message.hasOwnProperty("observedInTheWild")) + if (typeof message.observedInTheWild !== "boolean") + return "observedInTheWild: boolean expected"; + if (message.zeroDay != null && message.hasOwnProperty("zeroDay")) + if (typeof message.zeroDay !== "boolean") + return "zeroDay: boolean expected"; + if (message.exploitReleaseDate != null && message.hasOwnProperty("exploitReleaseDate")) { + var error = $root.google.protobuf.Timestamp.verify(message.exploitReleaseDate); + if (error) + return "exploitReleaseDate." + error; + } + if (message.firstExploitationDate != null && message.hasOwnProperty("firstExploitationDate")) { + var error = $root.google.protobuf.Timestamp.verify(message.firstExploitationDate); + if (error) + return "firstExploitationDate." + 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.v2.Cve + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Cve} Cve + */ + Cve.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Cve) + return object; + var message = new $root.google.cloud.securitycenter.v2.Cve(); + if (object.id != null) + message.id = String(object.id); + if (object.references) { + if (!Array.isArray(object.references)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.Cve.references: object expected"); + message.references[i] = $root.google.cloud.securitycenter.v2.Reference.fromObject(object.references[i]); + } + } + if (object.cvssv3 != null) { + if (typeof object.cvssv3 !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Cve.cvssv3: object expected"); + message.cvssv3 = $root.google.cloud.securitycenter.v2.Cvssv3.fromObject(object.cvssv3); + } + if (object.upstreamFixAvailable != null) + message.upstreamFixAvailable = Boolean(object.upstreamFixAvailable); + switch (object.impact) { + default: + if (typeof object.impact === "number") { + message.impact = object.impact; + break; + } + break; + case "RISK_RATING_UNSPECIFIED": + case 0: + message.impact = 0; + break; + case "LOW": + case 1: + message.impact = 1; + break; + case "MEDIUM": + case 2: + message.impact = 2; + break; + case "HIGH": + case 3: + message.impact = 3; + break; + case "CRITICAL": + case 4: + message.impact = 4; + break; + } + switch (object.exploitationActivity) { + default: + if (typeof object.exploitationActivity === "number") { + message.exploitationActivity = object.exploitationActivity; + break; + } + break; + case "EXPLOITATION_ACTIVITY_UNSPECIFIED": + case 0: + message.exploitationActivity = 0; + break; + case "WIDE": + case 1: + message.exploitationActivity = 1; + break; + case "CONFIRMED": + case 2: + message.exploitationActivity = 2; + break; + case "AVAILABLE": + case 3: + message.exploitationActivity = 3; + break; + case "ANTICIPATED": + case 4: + message.exploitationActivity = 4; + break; + case "NO_KNOWN": + case 5: + message.exploitationActivity = 5; + break; + } + if (object.observedInTheWild != null) + message.observedInTheWild = Boolean(object.observedInTheWild); + if (object.zeroDay != null) + message.zeroDay = Boolean(object.zeroDay); + if (object.exploitReleaseDate != null) { + if (typeof object.exploitReleaseDate !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Cve.exploitReleaseDate: object expected"); + message.exploitReleaseDate = $root.google.protobuf.Timestamp.fromObject(object.exploitReleaseDate); + } + if (object.firstExploitationDate != null) { + if (typeof object.firstExploitationDate !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Cve.firstExploitationDate: object expected"); + message.firstExploitationDate = $root.google.protobuf.Timestamp.fromObject(object.firstExploitationDate); + } + return message; + }; + + /** + * Creates a plain object from a Cve message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Cve + * @static + * @param {google.cloud.securitycenter.v2.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; + object.upstreamFixAvailable = false; + object.impact = options.enums === String ? "RISK_RATING_UNSPECIFIED" : 0; + object.exploitationActivity = options.enums === String ? "EXPLOITATION_ACTIVITY_UNSPECIFIED" : 0; + object.observedInTheWild = false; + object.zeroDay = false; + object.exploitReleaseDate = null; + object.firstExploitationDate = 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.v2.Reference.toObject(message.references[j], options); + } + if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) + object.cvssv3 = $root.google.cloud.securitycenter.v2.Cvssv3.toObject(message.cvssv3, options); + if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) + object.upstreamFixAvailable = message.upstreamFixAvailable; + if (message.impact != null && message.hasOwnProperty("impact")) + object.impact = options.enums === String ? $root.google.cloud.securitycenter.v2.Cve.RiskRating[message.impact] === undefined ? message.impact : $root.google.cloud.securitycenter.v2.Cve.RiskRating[message.impact] : message.impact; + if (message.exploitationActivity != null && message.hasOwnProperty("exploitationActivity")) + object.exploitationActivity = options.enums === String ? $root.google.cloud.securitycenter.v2.Cve.ExploitationActivity[message.exploitationActivity] === undefined ? message.exploitationActivity : $root.google.cloud.securitycenter.v2.Cve.ExploitationActivity[message.exploitationActivity] : message.exploitationActivity; + if (message.observedInTheWild != null && message.hasOwnProperty("observedInTheWild")) + object.observedInTheWild = message.observedInTheWild; + if (message.zeroDay != null && message.hasOwnProperty("zeroDay")) + object.zeroDay = message.zeroDay; + if (message.exploitReleaseDate != null && message.hasOwnProperty("exploitReleaseDate")) + object.exploitReleaseDate = $root.google.protobuf.Timestamp.toObject(message.exploitReleaseDate, options); + if (message.firstExploitationDate != null && message.hasOwnProperty("firstExploitationDate")) + object.firstExploitationDate = $root.google.protobuf.Timestamp.toObject(message.firstExploitationDate, options); + return object; + }; + + /** + * Converts this Cve to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Cve + * @instance + * @returns {Object.} JSON object + */ + Cve.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cve + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Cve"; + }; + + /** + * RiskRating enum. + * @name google.cloud.securitycenter.v2.Cve.RiskRating + * @enum {number} + * @property {number} RISK_RATING_UNSPECIFIED=0 RISK_RATING_UNSPECIFIED value + * @property {number} LOW=1 LOW value + * @property {number} MEDIUM=2 MEDIUM value + * @property {number} HIGH=3 HIGH value + * @property {number} CRITICAL=4 CRITICAL value + */ + Cve.RiskRating = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RISK_RATING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOW"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + values[valuesById[3] = "HIGH"] = 3; + values[valuesById[4] = "CRITICAL"] = 4; + return values; + })(); + + /** + * ExploitationActivity enum. + * @name google.cloud.securitycenter.v2.Cve.ExploitationActivity + * @enum {number} + * @property {number} EXPLOITATION_ACTIVITY_UNSPECIFIED=0 EXPLOITATION_ACTIVITY_UNSPECIFIED value + * @property {number} WIDE=1 WIDE value + * @property {number} CONFIRMED=2 CONFIRMED value + * @property {number} AVAILABLE=3 AVAILABLE value + * @property {number} ANTICIPATED=4 ANTICIPATED value + * @property {number} NO_KNOWN=5 NO_KNOWN value + */ + Cve.ExploitationActivity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPLOITATION_ACTIVITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "WIDE"] = 1; + values[valuesById[2] = "CONFIRMED"] = 2; + values[valuesById[3] = "AVAILABLE"] = 3; + values[valuesById[4] = "ANTICIPATED"] = 4; + values[valuesById[5] = "NO_KNOWN"] = 5; + return values; + })(); + + return Cve; + })(); + + v2.Reference = (function() { + + /** + * Properties of a Reference. + * @memberof google.cloud.securitycenter.v2 + * @interface IReference + * @property {string|null} [source] Reference source + * @property {string|null} [uri] Reference uri + */ + + /** + * Constructs a new Reference. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Reference. + * @implements IReference + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Reference + * @instance + */ + Reference.prototype.source = ""; + + /** + * Reference uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v2.Reference + * @instance + */ + Reference.prototype.uri = ""; + + /** + * Creates a new Reference instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Reference + * @static + * @param {google.cloud.securitycenter.v2.IReference=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Reference} Reference instance + */ + Reference.create = function create(properties) { + return new Reference(properties); + }; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.securitycenter.v2.Reference.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Reference + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Reference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Reference + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Reference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Reference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Reference} Reference + */ + Reference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Reference) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Reference + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Reference + * @instance + * @returns {Object.} JSON object + */ + Reference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Reference + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Reference"; + }; + + return Reference; + })(); + + v2.Cvssv3 = (function() { + + /** + * Properties of a Cvssv3. + * @memberof google.cloud.securitycenter.v2 + * @interface ICvssv3 + * @property {number|null} [baseScore] Cvssv3 baseScore + * @property {google.cloud.securitycenter.v2.Cvssv3.AttackVector|null} [attackVector] Cvssv3 attackVector + * @property {google.cloud.securitycenter.v2.Cvssv3.AttackComplexity|null} [attackComplexity] Cvssv3 attackComplexity + * @property {google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired|null} [privilegesRequired] Cvssv3 privilegesRequired + * @property {google.cloud.securitycenter.v2.Cvssv3.UserInteraction|null} [userInteraction] Cvssv3 userInteraction + * @property {google.cloud.securitycenter.v2.Cvssv3.Scope|null} [scope] Cvssv3 scope + * @property {google.cloud.securitycenter.v2.Cvssv3.Impact|null} [confidentialityImpact] Cvssv3 confidentialityImpact + * @property {google.cloud.securitycenter.v2.Cvssv3.Impact|null} [integrityImpact] Cvssv3 integrityImpact + * @property {google.cloud.securitycenter.v2.Cvssv3.Impact|null} [availabilityImpact] Cvssv3 availabilityImpact + */ + + /** + * Constructs a new Cvssv3. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Cvssv3. + * @implements ICvssv3 + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.baseScore = 0; + + /** + * Cvssv3 attackVector. + * @member {google.cloud.securitycenter.v2.Cvssv3.AttackVector} attackVector + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.attackVector = 0; + + /** + * Cvssv3 attackComplexity. + * @member {google.cloud.securitycenter.v2.Cvssv3.AttackComplexity} attackComplexity + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.attackComplexity = 0; + + /** + * Cvssv3 privilegesRequired. + * @member {google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired} privilegesRequired + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.privilegesRequired = 0; + + /** + * Cvssv3 userInteraction. + * @member {google.cloud.securitycenter.v2.Cvssv3.UserInteraction} userInteraction + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.userInteraction = 0; + + /** + * Cvssv3 scope. + * @member {google.cloud.securitycenter.v2.Cvssv3.Scope} scope + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.scope = 0; + + /** + * Cvssv3 confidentialityImpact. + * @member {google.cloud.securitycenter.v2.Cvssv3.Impact} confidentialityImpact + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.confidentialityImpact = 0; + + /** + * Cvssv3 integrityImpact. + * @member {google.cloud.securitycenter.v2.Cvssv3.Impact} integrityImpact + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.integrityImpact = 0; + + /** + * Cvssv3 availabilityImpact. + * @member {google.cloud.securitycenter.v2.Cvssv3.Impact} availabilityImpact + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + */ + Cvssv3.prototype.availabilityImpact = 0; + + /** + * Creates a new Cvssv3 instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v2.ICvssv3=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Cvssv3} Cvssv3 instance + */ + Cvssv3.create = function create(properties) { + return new Cvssv3(properties); + }; + + /** + * Encodes the specified Cvssv3 message. Does not implicitly {@link google.cloud.securitycenter.v2.Cvssv3.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v2.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 2, wireType 0 =*/16).int32(message.attackVector); + if (message.attackComplexity != null && Object.hasOwnProperty.call(message, "attackComplexity")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.attackComplexity); + if (message.privilegesRequired != null && Object.hasOwnProperty.call(message, "privilegesRequired")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.privilegesRequired); + if (message.userInteraction != null && Object.hasOwnProperty.call(message, "userInteraction")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userInteraction); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); + if (message.confidentialityImpact != null && Object.hasOwnProperty.call(message, "confidentialityImpact")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.confidentialityImpact); + if (message.integrityImpact != null && Object.hasOwnProperty.call(message, "integrityImpact")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.integrityImpact); + if (message.availabilityImpact != null && Object.hasOwnProperty.call(message, "availabilityImpact")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.availabilityImpact); + return writer; + }; + + /** + * Encodes the specified Cvssv3 message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Cvssv3.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Cvssv3} Cvssv3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cvssv3.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Cvssv3(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseScore = reader.double(); + break; + } + case 2: { + message.attackVector = reader.int32(); + break; + } + case 3: { + message.attackComplexity = reader.int32(); + break; + } + case 4: { + message.privilegesRequired = reader.int32(); + break; + } + case 5: { + message.userInteraction = reader.int32(); + break; + } + case 6: { + message.scope = reader.int32(); + break; + } + case 7: { + message.confidentialityImpact = reader.int32(); + break; + } + case 8: { + message.integrityImpact = reader.int32(); + break; + } + case 9: { + message.availabilityImpact = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Cvssv3} Cvssv3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cvssv3.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cvssv3 message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cvssv3.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 a Cvssv3 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Cvssv3} Cvssv3 + */ + Cvssv3.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Cvssv3) + return object; + var message = new $root.google.cloud.securitycenter.v2.Cvssv3(); + 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; + 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; + } + switch (object.attackComplexity) { + default: + if (typeof object.attackComplexity === "number") { + message.attackComplexity = object.attackComplexity; + break; + } + break; + 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) { + default: + if (typeof object.privilegesRequired === "number") { + message.privilegesRequired = object.privilegesRequired; + break; + } + break; + 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) { + default: + if (typeof object.userInteraction === "number") { + message.userInteraction = object.userInteraction; + break; + } + break; + 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) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + 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) { + default: + if (typeof object.confidentialityImpact === "number") { + message.confidentialityImpact = object.confidentialityImpact; + break; + } + break; + 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) { + default: + if (typeof object.integrityImpact === "number") { + message.integrityImpact = object.integrityImpact; + break; + } + break; + 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) { + default: + if (typeof object.availabilityImpact === "number") { + message.availabilityImpact = object.availabilityImpact; + break; + } + break; + 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 a Cvssv3 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v2.Cvssv3} message Cvssv3 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cvssv3.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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.v2.Cvssv3.AttackVector[message.attackVector] === undefined ? message.attackVector : $root.google.cloud.securitycenter.v2.Cvssv3.AttackVector[message.attackVector] : message.attackVector; + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + object.attackComplexity = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.AttackComplexity[message.attackComplexity] === undefined ? message.attackComplexity : $root.google.cloud.securitycenter.v2.Cvssv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + object.privilegesRequired = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired[message.privilegesRequired] === undefined ? message.privilegesRequired : $root.google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + object.userInteraction = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.UserInteraction[message.userInteraction] === undefined ? message.userInteraction : $root.google.cloud.securitycenter.v2.Cvssv3.UserInteraction[message.userInteraction] : message.userInteraction; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.securitycenter.v2.Cvssv3.Scope[message.scope] : message.scope; + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + object.confidentialityImpact = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.confidentialityImpact] === undefined ? message.confidentialityImpact : $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + object.integrityImpact = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.integrityImpact] === undefined ? message.integrityImpact : $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.integrityImpact] : message.integrityImpact; + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + object.availabilityImpact = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.availabilityImpact] === undefined ? message.availabilityImpact : $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.availabilityImpact] : message.availabilityImpact; + return object; + }; + + /** + * Converts this Cvssv3 to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Cvssv3 + * @instance + * @returns {Object.} JSON object + */ + Cvssv3.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cvssv3 + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Cvssv3"; + }; + + /** + * AttackVector enum. + * @name google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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; + })(); + + v2.Package = (function() { + + /** + * Properties of a Package. + * @memberof google.cloud.securitycenter.v2 + * @interface IPackage + * @property {string|null} [packageName] Package packageName + * @property {string|null} [cpeUri] Package cpeUri + * @property {string|null} [packageType] Package packageType + * @property {string|null} [packageVersion] Package packageVersion + */ + + /** + * Constructs a new Package. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Package. + * @implements IPackage + * @constructor + * @param {google.cloud.securitycenter.v2.IPackage=} [properties] Properties to set + */ + function Package(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Package packageName. + * @member {string} packageName + * @memberof google.cloud.securitycenter.v2.Package + * @instance + */ + Package.prototype.packageName = ""; + + /** + * Package cpeUri. + * @member {string} cpeUri + * @memberof google.cloud.securitycenter.v2.Package + * @instance + */ + Package.prototype.cpeUri = ""; + + /** + * Package packageType. + * @member {string} packageType + * @memberof google.cloud.securitycenter.v2.Package + * @instance + */ + Package.prototype.packageType = ""; + + /** + * Package packageVersion. + * @member {string} packageVersion + * @memberof google.cloud.securitycenter.v2.Package + * @instance + */ + Package.prototype.packageVersion = ""; + + /** + * Creates a new Package instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {google.cloud.securitycenter.v2.IPackage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Package} Package instance + */ + Package.create = function create(properties) { + return new Package(properties); + }; + + /** + * Encodes the specified Package message. Does not implicitly {@link google.cloud.securitycenter.v2.Package.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {google.cloud.securitycenter.v2.IPackage} message Package message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Package.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.packageName); + if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cpeUri); + if (message.packageType != null && Object.hasOwnProperty.call(message, "packageType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.packageType); + if (message.packageVersion != null && Object.hasOwnProperty.call(message, "packageVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageVersion); + return writer; + }; + + /** + * Encodes the specified Package message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Package.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {google.cloud.securitycenter.v2.IPackage} message Package message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Package.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Package message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Package} Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Package.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Package(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.packageName = reader.string(); + break; + } + case 2: { + message.cpeUri = reader.string(); + break; + } + case 3: { + message.packageType = reader.string(); + break; + } + case 4: { + message.packageVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Package message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Package} Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Package.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Package message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Package.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageName != null && message.hasOwnProperty("packageName")) + if (!$util.isString(message.packageName)) + return "packageName: string expected"; + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + if (!$util.isString(message.cpeUri)) + return "cpeUri: string expected"; + if (message.packageType != null && message.hasOwnProperty("packageType")) + if (!$util.isString(message.packageType)) + return "packageType: string expected"; + if (message.packageVersion != null && message.hasOwnProperty("packageVersion")) + if (!$util.isString(message.packageVersion)) + return "packageVersion: string expected"; + return null; + }; + + /** + * Creates a Package message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Package} Package + */ + Package.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Package) + return object; + var message = new $root.google.cloud.securitycenter.v2.Package(); + if (object.packageName != null) + message.packageName = String(object.packageName); + if (object.cpeUri != null) + message.cpeUri = String(object.cpeUri); + if (object.packageType != null) + message.packageType = String(object.packageType); + if (object.packageVersion != null) + message.packageVersion = String(object.packageVersion); + return message; + }; + + /** + * Creates a plain object from a Package message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {google.cloud.securitycenter.v2.Package} message Package + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Package.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.packageName = ""; + object.cpeUri = ""; + object.packageType = ""; + object.packageVersion = ""; + } + if (message.packageName != null && message.hasOwnProperty("packageName")) + object.packageName = message.packageName; + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + object.cpeUri = message.cpeUri; + if (message.packageType != null && message.hasOwnProperty("packageType")) + object.packageType = message.packageType; + if (message.packageVersion != null && message.hasOwnProperty("packageVersion")) + object.packageVersion = message.packageVersion; + return object; + }; + + /** + * Converts this Package to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Package + * @instance + * @returns {Object.} JSON object + */ + Package.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Package + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Package + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Package.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Package"; + }; + + return Package; + })(); + + v2.SecurityBulletin = (function() { + + /** + * Properties of a SecurityBulletin. + * @memberof google.cloud.securitycenter.v2 + * @interface ISecurityBulletin + * @property {string|null} [bulletinId] SecurityBulletin bulletinId + * @property {google.protobuf.ITimestamp|null} [submissionTime] SecurityBulletin submissionTime + * @property {string|null} [suggestedUpgradeVersion] SecurityBulletin suggestedUpgradeVersion + */ + + /** + * Constructs a new SecurityBulletin. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a SecurityBulletin. + * @implements ISecurityBulletin + * @constructor + * @param {google.cloud.securitycenter.v2.ISecurityBulletin=} [properties] Properties to set + */ + function SecurityBulletin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityBulletin bulletinId. + * @member {string} bulletinId + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @instance + */ + SecurityBulletin.prototype.bulletinId = ""; + + /** + * SecurityBulletin submissionTime. + * @member {google.protobuf.ITimestamp|null|undefined} submissionTime + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @instance + */ + SecurityBulletin.prototype.submissionTime = null; + + /** + * SecurityBulletin suggestedUpgradeVersion. + * @member {string} suggestedUpgradeVersion + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @instance + */ + SecurityBulletin.prototype.suggestedUpgradeVersion = ""; + + /** + * Creates a new SecurityBulletin instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {google.cloud.securitycenter.v2.ISecurityBulletin=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.SecurityBulletin} SecurityBulletin instance + */ + SecurityBulletin.create = function create(properties) { + return new SecurityBulletin(properties); + }; + + /** + * Encodes the specified SecurityBulletin message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityBulletin.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {google.cloud.securitycenter.v2.ISecurityBulletin} message SecurityBulletin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityBulletin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bulletinId != null && Object.hasOwnProperty.call(message, "bulletinId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bulletinId); + if (message.submissionTime != null && Object.hasOwnProperty.call(message, "submissionTime")) + $root.google.protobuf.Timestamp.encode(message.submissionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.suggestedUpgradeVersion != null && Object.hasOwnProperty.call(message, "suggestedUpgradeVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.suggestedUpgradeVersion); + return writer; + }; + + /** + * Encodes the specified SecurityBulletin message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityBulletin.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {google.cloud.securitycenter.v2.ISecurityBulletin} message SecurityBulletin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityBulletin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityBulletin message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.SecurityBulletin} SecurityBulletin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityBulletin.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityBulletin(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bulletinId = reader.string(); + break; + } + case 2: { + message.submissionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.suggestedUpgradeVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityBulletin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.SecurityBulletin} SecurityBulletin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityBulletin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityBulletin message. + * @function verify + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityBulletin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bulletinId != null && message.hasOwnProperty("bulletinId")) + if (!$util.isString(message.bulletinId)) + return "bulletinId: string expected"; + if (message.submissionTime != null && message.hasOwnProperty("submissionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submissionTime); + if (error) + return "submissionTime." + error; + } + if (message.suggestedUpgradeVersion != null && message.hasOwnProperty("suggestedUpgradeVersion")) + if (!$util.isString(message.suggestedUpgradeVersion)) + return "suggestedUpgradeVersion: string expected"; + return null; + }; + + /** + * Creates a SecurityBulletin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.SecurityBulletin} SecurityBulletin + */ + SecurityBulletin.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.SecurityBulletin) + return object; + var message = new $root.google.cloud.securitycenter.v2.SecurityBulletin(); + if (object.bulletinId != null) + message.bulletinId = String(object.bulletinId); + if (object.submissionTime != null) { + if (typeof object.submissionTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.SecurityBulletin.submissionTime: object expected"); + message.submissionTime = $root.google.protobuf.Timestamp.fromObject(object.submissionTime); + } + if (object.suggestedUpgradeVersion != null) + message.suggestedUpgradeVersion = String(object.suggestedUpgradeVersion); + return message; + }; + + /** + * Creates a plain object from a SecurityBulletin message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {google.cloud.securitycenter.v2.SecurityBulletin} message SecurityBulletin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityBulletin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bulletinId = ""; + object.submissionTime = null; + object.suggestedUpgradeVersion = ""; + } + if (message.bulletinId != null && message.hasOwnProperty("bulletinId")) + object.bulletinId = message.bulletinId; + if (message.submissionTime != null && message.hasOwnProperty("submissionTime")) + object.submissionTime = $root.google.protobuf.Timestamp.toObject(message.submissionTime, options); + if (message.suggestedUpgradeVersion != null && message.hasOwnProperty("suggestedUpgradeVersion")) + object.suggestedUpgradeVersion = message.suggestedUpgradeVersion; + return object; + }; + + /** + * Converts this SecurityBulletin to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @instance + * @returns {Object.} JSON object + */ + SecurityBulletin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityBulletin + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.SecurityBulletin + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityBulletin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.SecurityBulletin"; + }; + + return SecurityBulletin; + })(); + + v2.Cwe = (function() { + + /** + * Properties of a Cwe. + * @memberof google.cloud.securitycenter.v2 + * @interface ICwe + * @property {string|null} [id] Cwe id + * @property {Array.|null} [references] Cwe references + */ + + /** + * Constructs a new Cwe. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Cwe. + * @implements ICwe + * @constructor + * @param {google.cloud.securitycenter.v2.ICwe=} [properties] Properties to set + */ + function Cwe(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]]; + } + + /** + * Cwe id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.Cwe + * @instance + */ + Cwe.prototype.id = ""; + + /** + * Cwe references. + * @member {Array.} references + * @memberof google.cloud.securitycenter.v2.Cwe + * @instance + */ + Cwe.prototype.references = $util.emptyArray; + + /** + * Creates a new Cwe instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {google.cloud.securitycenter.v2.ICwe=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Cwe} Cwe instance + */ + Cwe.create = function create(properties) { + return new Cwe(properties); + }; + + /** + * Encodes the specified Cwe message. Does not implicitly {@link google.cloud.securitycenter.v2.Cwe.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {google.cloud.securitycenter.v2.ICwe} message Cwe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cwe.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.v2.Reference.encode(message.references[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cwe message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Cwe.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {google.cloud.securitycenter.v2.ICwe} message Cwe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cwe.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cwe message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Cwe} Cwe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cwe.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Cwe(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Reference.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cwe message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Cwe} Cwe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cwe.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cwe message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cwe.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.v2.Reference.verify(message.references[i]); + if (error) + return "references." + error; + } + } + return null; + }; + + /** + * Creates a Cwe message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Cwe} Cwe + */ + Cwe.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Cwe) + return object; + var message = new $root.google.cloud.securitycenter.v2.Cwe(); + if (object.id != null) + message.id = String(object.id); + if (object.references) { + if (!Array.isArray(object.references)) + throw TypeError(".google.cloud.securitycenter.v2.Cwe.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.v2.Cwe.references: object expected"); + message.references[i] = $root.google.cloud.securitycenter.v2.Reference.fromObject(object.references[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Cwe message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {google.cloud.securitycenter.v2.Cwe} message Cwe + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cwe.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.references = []; + if (options.defaults) + object.id = ""; + 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.v2.Reference.toObject(message.references[j], options); + } + return object; + }; + + /** + * Converts this Cwe to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Cwe + * @instance + * @returns {Object.} JSON object + */ + Cwe.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cwe + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Cwe + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cwe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Cwe"; + }; + + return Cwe; + })(); + + v2.Folder = (function() { + + /** + * Properties of a Folder. + * @memberof google.cloud.securitycenter.v2 + * @interface IFolder + * @property {string|null} [resourceFolder] Folder resourceFolder + * @property {string|null} [resourceFolderDisplayName] Folder resourceFolderDisplayName + */ + + /** + * Constructs a new Folder. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Folder. + * @implements IFolder + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Folder + * @instance + */ + Folder.prototype.resourceFolder = ""; + + /** + * Folder resourceFolderDisplayName. + * @member {string} resourceFolderDisplayName + * @memberof google.cloud.securitycenter.v2.Folder + * @instance + */ + Folder.prototype.resourceFolderDisplayName = ""; + + /** + * Creates a new Folder instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Folder + * @static + * @param {google.cloud.securitycenter.v2.IFolder=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Folder} Folder instance + */ + Folder.create = function create(properties) { + return new Folder(properties); + }; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v2.Folder.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Folder + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Folder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Folder + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Folder(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Folder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Folder} Folder + */ + Folder.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Folder) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Folder + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Folder + * @instance + * @returns {Object.} JSON object + */ + Folder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Folder + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Folder"; + }; + + return Folder; + })(); + + v2.MuteConfig = (function() { + + /** + * Properties of a MuteConfig. + * @memberof google.cloud.securitycenter.v2 + * @interface IMuteConfig + * @property {string|null} [name] MuteConfig name + * @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 + * @property {google.cloud.securitycenter.v2.MuteConfig.MuteConfigType|null} [type] MuteConfig type + * @property {google.protobuf.ITimestamp|null} [expiryTime] MuteConfig expiryTime + */ + + /** + * Constructs a new MuteConfig. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a MuteConfig. + * @implements IMuteConfig + * @constructor + * @param {google.cloud.securitycenter.v2.IMuteConfig=} [properties] Properties to set + */ + function MuteConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MuteConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + */ + MuteConfig.prototype.name = ""; + + /** + * MuteConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + */ + MuteConfig.prototype.description = ""; + + /** + * MuteConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + */ + MuteConfig.prototype.filter = ""; + + /** + * MuteConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + */ + MuteConfig.prototype.createTime = null; + + /** + * MuteConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + */ + MuteConfig.prototype.updateTime = null; + + /** + * MuteConfig mostRecentEditor. + * @member {string} mostRecentEditor + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + */ + MuteConfig.prototype.mostRecentEditor = ""; + + /** + * MuteConfig type. + * @member {google.cloud.securitycenter.v2.MuteConfig.MuteConfigType} type + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + */ + MuteConfig.prototype.type = 0; + + /** + * MuteConfig expiryTime. + * @member {google.protobuf.ITimestamp|null|undefined} expiryTime + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + */ + MuteConfig.prototype.expiryTime = null; + + /** + * Creates a new MuteConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @static + * @param {google.cloud.securitycenter.v2.IMuteConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.MuteConfig} MuteConfig instance + */ + MuteConfig.create = function create(properties) { + return new MuteConfig(properties); + }; + + /** + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.MuteConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @static + * @param {google.cloud.securitycenter.v2.IMuteConfig} message MuteConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} 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.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.mostRecentEditor != null && Object.hasOwnProperty.call(message, "mostRecentEditor")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.mostRecentEditor); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.MuteConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @static + * @param {google.cloud.securitycenter.v2.IMuteConfig} message MuteConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MuteConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.MuteConfig} MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.MuteConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.mostRecentEditor = reader.string(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MuteConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.MuteConfig} MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MuteConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MuteConfig.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.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.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); + if (error) + return "expiryTime." + error; + } + return null; + }; + + /** + * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.MuteConfig} MuteConfig + */ + MuteConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.MuteConfig) + return object; + var message = new $root.google.cloud.securitycenter.v2.MuteConfig(); + 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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.MuteConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.mostRecentEditor != null) + message.mostRecentEditor = String(object.mostRecentEditor); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "MUTE_CONFIG_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STATIC": + case 1: + message.type = 1; + break; + case "DYNAMIC": + case 2: + message.type = 2; + break; + } + if (object.expiryTime != null) { + if (typeof object.expiryTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.MuteConfig.expiryTime: object expected"); + message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); + } + return message; + }; + + /** + * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @static + * @param {google.cloud.securitycenter.v2.MuteConfig} message MuteConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MuteConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.filter = ""; + object.createTime = null; + object.updateTime = null; + object.mostRecentEditor = ""; + object.type = options.enums === String ? "MUTE_CONFIG_TYPE_UNSPECIFIED" : 0; + object.expiryTime = null; + } + 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.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.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.securitycenter.v2.MuteConfig.MuteConfigType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v2.MuteConfig.MuteConfigType[message.type] : message.type; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + return object; + }; + + /** + * Converts this MuteConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.MuteConfig + * @instance + * @returns {Object.} JSON object + */ + MuteConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MuteConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.MuteConfig"; + }; + + /** + * MuteConfigType enum. + * @name google.cloud.securitycenter.v2.MuteConfig.MuteConfigType + * @enum {number} + * @property {number} MUTE_CONFIG_TYPE_UNSPECIFIED=0 MUTE_CONFIG_TYPE_UNSPECIFIED value + * @property {number} STATIC=1 STATIC value + * @property {number} DYNAMIC=2 DYNAMIC value + */ + MuteConfig.MuteConfigType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_CONFIG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATIC"] = 1; + values[valuesById[2] = "DYNAMIC"] = 2; + return values; + })(); + + return MuteConfig; + })(); + + v2.NotificationConfig = (function() { + + /** + * Properties of a NotificationConfig. + * @memberof google.cloud.securitycenter.v2 + * @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.v2.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig + * @property {google.protobuf.ITimestamp|null} [updateTime] NotificationConfig updateTime + */ + + /** + * Constructs a new NotificationConfig. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig + * @constructor + * @param {google.cloud.securitycenter.v2.INotificationConfig=} [properties] Properties to set + */ + function NotificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @instance + */ + NotificationConfig.prototype.name = ""; + + /** + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @instance + */ + NotificationConfig.prototype.description = ""; + + /** + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @instance + */ + NotificationConfig.prototype.pubsubTopic = ""; + + /** + * NotificationConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @instance + */ + NotificationConfig.prototype.serviceAccount = ""; + + /** + * NotificationConfig streamingConfig. + * @member {google.cloud.securitycenter.v2.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @instance + */ + NotificationConfig.prototype.streamingConfig = null; + + /** + * NotificationConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @instance + */ + NotificationConfig.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationConfig notifyConfig. + * @member {"streamingConfig"|undefined} notifyConfig + * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v2.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.NotificationConfig} NotificationConfig instance + */ + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); + }; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.NotificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v2.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.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.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.v2.NotificationConfig.StreamingConfig.encode(message.streamingConfig, 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 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.NotificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v2.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig} NotificationConfig + * @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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.NotificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.NotificationConfig} NotificationConfig + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @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) { + 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.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.v2.NotificationConfig.StreamingConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + 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 a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.NotificationConfig} NotificationConfig + */ + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.NotificationConfig) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.NotificationConfig.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.NotificationConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v2.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.pubsubTopic = ""; + object.serviceAccount = ""; + object.updateTime = null; + } + 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.v2.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.notifyConfig = "streamingConfig"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this NotificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @instance + * @returns {Object.} JSON object + */ + NotificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotificationConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig"; + }; + + NotificationConfig.StreamingConfig = (function() { + + /** + * Properties of a StreamingConfig. + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @interface IStreamingConfig + * @property {string|null} [filter] StreamingConfig filter + */ + + /** + * Constructs a new StreamingConfig. + * @memberof google.cloud.securitycenter.v2.NotificationConfig + * @classdesc Represents a StreamingConfig. + * @implements IStreamingConfig + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig + * @instance + */ + StreamingConfig.prototype.filter = ""; + + /** + * Creates a new StreamingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v2.NotificationConfig.IStreamingConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.NotificationConfig.StreamingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig} StreamingConfig + */ + StreamingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig"; + }; + + return StreamingConfig; + })(); + + return NotificationConfig; + })(); + + v2.NotificationMessage = (function() { + + /** + * Properties of a NotificationMessage. + * @memberof google.cloud.securitycenter.v2 + * @interface INotificationMessage + * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName + * @property {google.cloud.securitycenter.v2.IFinding|null} [finding] NotificationMessage finding + * @property {google.cloud.securitycenter.v2.IResource|null} [resource] NotificationMessage resource + */ + + /** + * Constructs a new NotificationMessage. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a NotificationMessage. + * @implements INotificationMessage + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.NotificationMessage + * @instance + */ + NotificationMessage.prototype.notificationConfigName = ""; + + /** + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v2.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @instance + */ + NotificationMessage.prototype.finding = null; + + /** + * NotificationMessage resource. + * @member {google.cloud.securitycenter.v2.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @instance + */ + NotificationMessage.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationMessage event. + * @member {"finding"|undefined} event + * @memberof google.cloud.securitycenter.v2.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.v2.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v2.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.NotificationMessage} NotificationMessage instance + */ + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); + }; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v2.NotificationMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v2.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessage.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.v2.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.v2.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.NotificationMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v2.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.NotificationMessage} NotificationMessage + * @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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.NotificationMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.notificationConfigName = reader.string(); + break; + } + case 2: { + message.finding = $root.google.cloud.securitycenter.v2.Finding.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v2.Resource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.NotificationMessage} NotificationMessage + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationMessage message. + * @function verify + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @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) { + 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; + { + var error = $root.google.cloud.securitycenter.v2.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v2.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. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.NotificationMessage} NotificationMessage + */ + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.NotificationMessage) + return object; + var message = new $root.google.cloud.securitycenter.v2.NotificationMessage(); + if (object.notificationConfigName != null) + message.notificationConfigName = String(object.notificationConfigName); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v2.NotificationMessage.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v2.Finding.fromObject(object.finding); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v2.NotificationMessage.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v2.Resource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v2.NotificationMessage} message NotificationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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")) { + object.finding = $root.google.cloud.securitycenter.v2.Finding.toObject(message.finding, options); + if (options.oneofs) + object.event = "finding"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v2.Resource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this NotificationMessage to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.NotificationMessage + * @instance + * @returns {Object.} JSON object + */ + NotificationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotificationMessage + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.NotificationMessage"; + }; + + return NotificationMessage; + })(); + + v2.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v2 + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [displayName] Resource displayName + * @property {string|null} [type] Resource type + * @property {google.cloud.securitycenter.v2.CloudProvider|null} [cloudProvider] Resource cloudProvider + * @property {string|null} [service] Resource service + * @property {string|null} [location] Resource location + * @property {google.cloud.securitycenter.v2.IGcpMetadata|null} [gcpMetadata] Resource gcpMetadata + * @property {google.cloud.securitycenter.v2.IAwsMetadata|null} [awsMetadata] Resource awsMetadata + * @property {google.cloud.securitycenter.v2.IAzureMetadata|null} [azureMetadata] Resource azureMetadata + * @property {google.cloud.securitycenter.v2.IResourcePath|null} [resourcePath] Resource resourcePath + * @property {string|null} [resourcePathString] Resource resourcePathString + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.displayName = ""; + + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.type = ""; + + /** + * Resource cloudProvider. + * @member {google.cloud.securitycenter.v2.CloudProvider} cloudProvider + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.cloudProvider = 0; + + /** + * Resource service. + * @member {string} service + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.service = ""; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Resource gcpMetadata. + * @member {google.cloud.securitycenter.v2.IGcpMetadata|null|undefined} gcpMetadata + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.gcpMetadata = null; + + /** + * Resource awsMetadata. + * @member {google.cloud.securitycenter.v2.IAwsMetadata|null|undefined} awsMetadata + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.awsMetadata = null; + + /** + * Resource azureMetadata. + * @member {google.cloud.securitycenter.v2.IAzureMetadata|null|undefined} azureMetadata + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.azureMetadata = null; + + /** + * Resource resourcePath. + * @member {google.cloud.securitycenter.v2.IResourcePath|null|undefined} resourcePath + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.resourcePath = null; + + /** + * Resource resourcePathString. + * @member {string} resourcePathString + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Resource.prototype.resourcePathString = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Resource cloudProviderMetadata. + * @member {"gcpMetadata"|"awsMetadata"|"azureMetadata"|undefined} cloudProviderMetadata + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + */ + Object.defineProperty(Resource.prototype, "cloudProviderMetadata", { + get: $util.oneOfGetter($oneOfFields = ["gcpMetadata", "awsMetadata", "azureMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Resource + * @static + * @param {google.cloud.securitycenter.v2.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v2.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Resource + * @static + * @param {google.cloud.securitycenter.v2.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cloudProvider); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.service); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + if (message.gcpMetadata != null && Object.hasOwnProperty.call(message, "gcpMetadata")) + $root.google.cloud.securitycenter.v2.GcpMetadata.encode(message.gcpMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.awsMetadata != null && Object.hasOwnProperty.call(message, "awsMetadata")) + $root.google.cloud.securitycenter.v2.AwsMetadata.encode(message.awsMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.azureMetadata != null && Object.hasOwnProperty.call(message, "azureMetadata")) + $root.google.cloud.securitycenter.v2.AzureMetadata.encode(message.azureMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.resourcePath != null && Object.hasOwnProperty.call(message, "resourcePath")) + $root.google.cloud.securitycenter.v2.ResourcePath.encode(message.resourcePath, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.resourcePathString != null && Object.hasOwnProperty.call(message, "resourcePathString")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.resourcePathString); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Resource + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 4: { + message.cloudProvider = reader.int32(); + break; + } + case 5: { + message.service = reader.string(); + break; + } + case 6: { + message.location = reader.string(); + break; + } + case 7: { + message.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.decode(reader, reader.uint32()); + break; + } + case 8: { + message.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.decode(reader, reader.uint32()); + break; + } + case 9: { + message.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.decode(reader, reader.uint32()); + break; + } + case 10: { + message.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.decode(reader, reader.uint32()); + break; + } + case 11: { + message.resourcePathString = 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.v2.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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"; + 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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + switch (message.cloudProvider) { + default: + return "cloudProvider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.gcpMetadata != null && message.hasOwnProperty("gcpMetadata")) { + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v2.GcpMetadata.verify(message.gcpMetadata); + if (error) + return "gcpMetadata." + error; + } + } + if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { + if (properties.cloudProviderMetadata === 1) + return "cloudProviderMetadata: multiple values"; + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v2.AwsMetadata.verify(message.awsMetadata); + if (error) + return "awsMetadata." + error; + } + } + if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { + if (properties.cloudProviderMetadata === 1) + return "cloudProviderMetadata: multiple values"; + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v2.AzureMetadata.verify(message.azureMetadata); + if (error) + return "azureMetadata." + error; + } + } + if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) { + var error = $root.google.cloud.securitycenter.v2.ResourcePath.verify(message.resourcePath); + if (error) + return "resourcePath." + error; + } + if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) + if (!$util.isString(message.resourcePathString)) + return "resourcePathString: 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.v2.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v2.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); + switch (object.cloudProvider) { + default: + if (typeof object.cloudProvider === "number") { + message.cloudProvider = object.cloudProvider; + break; + } + break; + case "CLOUD_PROVIDER_UNSPECIFIED": + case 0: + message.cloudProvider = 0; + break; + case "GOOGLE_CLOUD_PLATFORM": + case 1: + message.cloudProvider = 1; + break; + case "AMAZON_WEB_SERVICES": + case 2: + message.cloudProvider = 2; + break; + case "MICROSOFT_AZURE": + case 3: + message.cloudProvider = 3; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.location != null) + message.location = String(object.location); + if (object.gcpMetadata != null) { + if (typeof object.gcpMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Resource.gcpMetadata: object expected"); + message.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.fromObject(object.gcpMetadata); + } + if (object.awsMetadata != null) { + if (typeof object.awsMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Resource.awsMetadata: object expected"); + message.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.fromObject(object.awsMetadata); + } + if (object.azureMetadata != null) { + if (typeof object.azureMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Resource.azureMetadata: object expected"); + message.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.fromObject(object.azureMetadata); + } + if (object.resourcePath != null) { + if (typeof object.resourcePath !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Resource.resourcePath: object expected"); + message.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.fromObject(object.resourcePath); + } + if (object.resourcePathString != null) + message.resourcePathString = String(object.resourcePathString); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Resource + * @static + * @param {google.cloud.securitycenter.v2.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.displayName = ""; + object.type = ""; + object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; + object.service = ""; + object.location = ""; + object.resourcePath = null; + object.resourcePathString = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] : message.cloudProvider; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.gcpMetadata != null && message.hasOwnProperty("gcpMetadata")) { + object.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.toObject(message.gcpMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "gcpMetadata"; + } + if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { + object.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.toObject(message.awsMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "awsMetadata"; + } + if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { + object.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.toObject(message.azureMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "azureMetadata"; + } + if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) + object.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.toObject(message.resourcePath, options); + if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) + object.resourcePathString = message.resourcePathString; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Resource"; + }; + + return Resource; + })(); + + /** + * CloudProvider enum. + * @name google.cloud.securitycenter.v2.CloudProvider + * @enum {number} + * @property {number} CLOUD_PROVIDER_UNSPECIFIED=0 CLOUD_PROVIDER_UNSPECIFIED value + * @property {number} GOOGLE_CLOUD_PLATFORM=1 GOOGLE_CLOUD_PLATFORM value + * @property {number} AMAZON_WEB_SERVICES=2 AMAZON_WEB_SERVICES value + * @property {number} MICROSOFT_AZURE=3 MICROSOFT_AZURE value + */ + v2.CloudProvider = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLOUD_PROVIDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_CLOUD_PLATFORM"] = 1; + values[valuesById[2] = "AMAZON_WEB_SERVICES"] = 2; + values[valuesById[3] = "MICROSOFT_AZURE"] = 3; + return values; + })(); + + v2.GcpMetadata = (function() { + + /** + * Properties of a GcpMetadata. + * @memberof google.cloud.securitycenter.v2 + * @interface IGcpMetadata + * @property {string|null} [project] GcpMetadata project + * @property {string|null} [projectDisplayName] GcpMetadata projectDisplayName + * @property {string|null} [parent] GcpMetadata parent + * @property {string|null} [parentDisplayName] GcpMetadata parentDisplayName + * @property {Array.|null} [folders] GcpMetadata folders + * @property {string|null} [organization] GcpMetadata organization + */ + + /** + * Constructs a new GcpMetadata. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GcpMetadata. + * @implements IGcpMetadata + * @constructor + * @param {google.cloud.securitycenter.v2.IGcpMetadata=} [properties] Properties to set + */ + function GcpMetadata(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]]; + } + + /** + * GcpMetadata project. + * @member {string} project + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @instance + */ + GcpMetadata.prototype.project = ""; + + /** + * GcpMetadata projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @instance + */ + GcpMetadata.prototype.projectDisplayName = ""; + + /** + * GcpMetadata parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @instance + */ + GcpMetadata.prototype.parent = ""; + + /** + * GcpMetadata parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @instance + */ + GcpMetadata.prototype.parentDisplayName = ""; + + /** + * GcpMetadata folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @instance + */ + GcpMetadata.prototype.folders = $util.emptyArray; + + /** + * GcpMetadata organization. + * @member {string} organization + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @instance + */ + GcpMetadata.prototype.organization = ""; + + /** + * Creates a new GcpMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {google.cloud.securitycenter.v2.IGcpMetadata=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GcpMetadata} GcpMetadata instance + */ + GcpMetadata.create = function create(properties) { + return new GcpMetadata(properties); + }; + + /** + * Encodes the specified GcpMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.GcpMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {google.cloud.securitycenter.v2.IGcpMetadata} message GcpMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectDisplayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v2.Folder.encode(message.folders[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.organization); + return writer; + }; + + /** + * Encodes the specified GcpMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GcpMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {google.cloud.securitycenter.v2.IGcpMetadata} message GcpMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcpMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.GcpMetadata} GcpMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GcpMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.projectDisplayName = reader.string(); + break; + } + case 3: { + message.parent = reader.string(); + break; + } + case 4: { + message.parentDisplayName = reader.string(); + break; + } + case 5: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v2.Folder.decode(reader, reader.uint32())); + break; + } + case 6: { + message.organization = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcpMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.GcpMetadata} GcpMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcpMetadata message. + * @function verify + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcpMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.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.v2.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + return null; + }; + + /** + * Creates a GcpMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GcpMetadata} GcpMetadata + */ + GcpMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GcpMetadata) + return object; + var message = new $root.google.cloud.securitycenter.v2.GcpMetadata(); + 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.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v2.GcpMetadata.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.v2.GcpMetadata.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v2.Folder.fromObject(object.folders[i]); + } + } + if (object.organization != null) + message.organization = String(object.organization); + return message; + }; + + /** + * Creates a plain object from a GcpMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {google.cloud.securitycenter.v2.GcpMetadata} message GcpMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcpMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.project = ""; + object.projectDisplayName = ""; + object.parent = ""; + object.parentDisplayName = ""; + object.organization = ""; + } + 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.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v2.Folder.toObject(message.folders[j], options); + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + return object; + }; + + /** + * Converts this GcpMetadata to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @instance + * @returns {Object.} JSON object + */ + GcpMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcpMetadata + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.GcpMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcpMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.GcpMetadata"; + }; + + return GcpMetadata; + })(); + + v2.AwsMetadata = (function() { + + /** + * Properties of an AwsMetadata. + * @memberof google.cloud.securitycenter.v2 + * @interface IAwsMetadata + * @property {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization|null} [organization] AwsMetadata organization + * @property {Array.|null} [organizationalUnits] AwsMetadata organizationalUnits + * @property {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount|null} [account] AwsMetadata account + */ + + /** + * Constructs a new AwsMetadata. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an AwsMetadata. + * @implements IAwsMetadata + * @constructor + * @param {google.cloud.securitycenter.v2.IAwsMetadata=} [properties] Properties to set + */ + function AwsMetadata(properties) { + this.organizationalUnits = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsMetadata organization. + * @member {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization|null|undefined} organization + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @instance + */ + AwsMetadata.prototype.organization = null; + + /** + * AwsMetadata organizationalUnits. + * @member {Array.} organizationalUnits + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @instance + */ + AwsMetadata.prototype.organizationalUnits = $util.emptyArray; + + /** + * AwsMetadata account. + * @member {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount|null|undefined} account + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @instance + */ + AwsMetadata.prototype.account = null; + + /** + * Creates a new AwsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {google.cloud.securitycenter.v2.IAwsMetadata=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AwsMetadata} AwsMetadata instance + */ + AwsMetadata.create = function create(properties) { + return new AwsMetadata(properties); + }; + + /** + * Encodes the specified AwsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {google.cloud.securitycenter.v2.IAwsMetadata} message AwsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.encode(message.organization, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.organizationalUnits != null && message.organizationalUnits.length) + for (var i = 0; i < message.organizationalUnits.length; ++i) + $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.encode(message.organizationalUnits[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.encode(message.account, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AwsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {google.cloud.securitycenter.v2.IAwsMetadata} message AwsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AwsMetadata} AwsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AwsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.organization = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.organizationalUnits && message.organizationalUnits.length)) + message.organizationalUnits = []; + message.organizationalUnits.push($root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.decode(reader, reader.uint32())); + break; + } + case 3: { + message.account = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AwsMetadata} AwsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsMetadata message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organization != null && message.hasOwnProperty("organization")) { + var error = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify(message.organization); + if (error) + return "organization." + error; + } + if (message.organizationalUnits != null && message.hasOwnProperty("organizationalUnits")) { + if (!Array.isArray(message.organizationalUnits)) + return "organizationalUnits: array expected"; + for (var i = 0; i < message.organizationalUnits.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify(message.organizationalUnits[i]); + if (error) + return "organizationalUnits." + error; + } + } + if (message.account != null && message.hasOwnProperty("account")) { + var error = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify(message.account); + if (error) + return "account." + error; + } + return null; + }; + + /** + * Creates an AwsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AwsMetadata} AwsMetadata + */ + AwsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AwsMetadata) + return object; + var message = new $root.google.cloud.securitycenter.v2.AwsMetadata(); + if (object.organization != null) { + if (typeof object.organization !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AwsMetadata.organization: object expected"); + message.organization = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.fromObject(object.organization); + } + if (object.organizationalUnits) { + if (!Array.isArray(object.organizationalUnits)) + throw TypeError(".google.cloud.securitycenter.v2.AwsMetadata.organizationalUnits: array expected"); + message.organizationalUnits = []; + for (var i = 0; i < object.organizationalUnits.length; ++i) { + if (typeof object.organizationalUnits[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AwsMetadata.organizationalUnits: object expected"); + message.organizationalUnits[i] = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.fromObject(object.organizationalUnits[i]); + } + } + if (object.account != null) { + if (typeof object.account !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AwsMetadata.account: object expected"); + message.account = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.fromObject(object.account); + } + return message; + }; + + /** + * Creates a plain object from an AwsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata} message AwsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.organizationalUnits = []; + if (options.defaults) { + object.organization = null; + object.account = null; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.toObject(message.organization, options); + if (message.organizationalUnits && message.organizationalUnits.length) { + object.organizationalUnits = []; + for (var j = 0; j < message.organizationalUnits.length; ++j) + object.organizationalUnits[j] = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.toObject(message.organizationalUnits[j], options); + } + if (message.account != null && message.hasOwnProperty("account")) + object.account = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.toObject(message.account, options); + return object; + }; + + /** + * Converts this AwsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @instance + * @returns {Object.} JSON object + */ + AwsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsMetadata + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AwsMetadata"; + }; + + AwsMetadata.AwsOrganization = (function() { + + /** + * Properties of an AwsOrganization. + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @interface IAwsOrganization + * @property {string|null} [id] AwsOrganization id + */ + + /** + * Constructs a new AwsOrganization. + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @classdesc Represents an AwsOrganization. + * @implements IAwsOrganization + * @constructor + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization=} [properties] Properties to set + */ + function AwsOrganization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsOrganization id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @instance + */ + AwsOrganization.prototype.id = ""; + + /** + * Creates a new AwsOrganization instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} AwsOrganization instance + */ + AwsOrganization.create = function create(properties) { + return new AwsOrganization(properties); + }; + + /** + * Encodes the specified AwsOrganization message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization} message AwsOrganization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsOrganization.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); + return writer; + }; + + /** + * Encodes the specified AwsOrganization message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization} message AwsOrganization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsOrganization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsOrganization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} AwsOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsOrganization.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsOrganization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} AwsOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsOrganization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsOrganization message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsOrganization.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"; + return null; + }; + + /** + * Creates an AwsOrganization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} AwsOrganization + */ + AwsOrganization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization) + return object; + var message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization(); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from an AwsOrganization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} message AwsOrganization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsOrganization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this AwsOrganization to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @instance + * @returns {Object.} JSON object + */ + AwsOrganization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsOrganization + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsOrganization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization"; + }; + + return AwsOrganization; + })(); + + AwsMetadata.AwsOrganizationalUnit = (function() { + + /** + * Properties of an AwsOrganizationalUnit. + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @interface IAwsOrganizationalUnit + * @property {string|null} [id] AwsOrganizationalUnit id + * @property {string|null} [name] AwsOrganizationalUnit name + */ + + /** + * Constructs a new AwsOrganizationalUnit. + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @classdesc Represents an AwsOrganizationalUnit. + * @implements IAwsOrganizationalUnit + * @constructor + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit=} [properties] Properties to set + */ + function AwsOrganizationalUnit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsOrganizationalUnit id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @instance + */ + AwsOrganizationalUnit.prototype.id = ""; + + /** + * AwsOrganizationalUnit name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @instance + */ + AwsOrganizationalUnit.prototype.name = ""; + + /** + * Creates a new AwsOrganizationalUnit instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit instance + */ + AwsOrganizationalUnit.create = function create(properties) { + return new AwsOrganizationalUnit(properties); + }; + + /** + * Encodes the specified AwsOrganizationalUnit message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit} message AwsOrganizationalUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsOrganizationalUnit.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified AwsOrganizationalUnit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit} message AwsOrganizationalUnit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsOrganizationalUnit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsOrganizationalUnit message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsOrganizationalUnit.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsOrganizationalUnit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsOrganizationalUnit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsOrganizationalUnit message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsOrganizationalUnit.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an AwsOrganizationalUnit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit + */ + AwsOrganizationalUnit.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) + return object; + var message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AwsOrganizationalUnit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} message AwsOrganizationalUnit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsOrganizationalUnit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this AwsOrganizationalUnit to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @instance + * @returns {Object.} JSON object + */ + AwsOrganizationalUnit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsOrganizationalUnit + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsOrganizationalUnit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit"; + }; + + return AwsOrganizationalUnit; + })(); + + AwsMetadata.AwsAccount = (function() { + + /** + * Properties of an AwsAccount. + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @interface IAwsAccount + * @property {string|null} [id] AwsAccount id + * @property {string|null} [name] AwsAccount name + */ + + /** + * Constructs a new AwsAccount. + * @memberof google.cloud.securitycenter.v2.AwsMetadata + * @classdesc Represents an AwsAccount. + * @implements IAwsAccount + * @constructor + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount=} [properties] Properties to set + */ + function AwsAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsAccount id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @instance + */ + AwsAccount.prototype.id = ""; + + /** + * AwsAccount name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @instance + */ + AwsAccount.prototype.name = ""; + + /** + * Creates a new AwsAccount instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} AwsAccount instance + */ + AwsAccount.create = function create(properties) { + return new AwsAccount(properties); + }; + + /** + * Encodes the specified AwsAccount message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount} message AwsAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsAccount.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified AwsAccount message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount} message AwsAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} AwsAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsAccount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} AwsAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsAccount message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsAccount.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an AwsAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} AwsAccount + */ + AwsAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount) + return object; + var message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AwsAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} message AwsAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this AwsAccount to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @instance + * @returns {Object.} JSON object + */ + AwsAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsAccount + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AwsMetadata.AwsAccount"; + }; + + return AwsAccount; + })(); + + return AwsMetadata; + })(); + + v2.AzureMetadata = (function() { + + /** + * Properties of an AzureMetadata. + * @memberof google.cloud.securitycenter.v2 + * @interface IAzureMetadata + * @property {Array.|null} [managementGroups] AzureMetadata managementGroups + * @property {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription|null} [subscription] AzureMetadata subscription + * @property {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup|null} [resourceGroup] AzureMetadata resourceGroup + * @property {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant|null} [tenant] AzureMetadata tenant + */ + + /** + * Constructs a new AzureMetadata. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an AzureMetadata. + * @implements IAzureMetadata + * @constructor + * @param {google.cloud.securitycenter.v2.IAzureMetadata=} [properties] Properties to set + */ + function AzureMetadata(properties) { + this.managementGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureMetadata managementGroups. + * @member {Array.} managementGroups + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @instance + */ + AzureMetadata.prototype.managementGroups = $util.emptyArray; + + /** + * AzureMetadata subscription. + * @member {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription|null|undefined} subscription + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @instance + */ + AzureMetadata.prototype.subscription = null; + + /** + * AzureMetadata resourceGroup. + * @member {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup|null|undefined} resourceGroup + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @instance + */ + AzureMetadata.prototype.resourceGroup = null; + + /** + * AzureMetadata tenant. + * @member {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant|null|undefined} tenant + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @instance + */ + AzureMetadata.prototype.tenant = null; + + /** + * Creates a new AzureMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {google.cloud.securitycenter.v2.IAzureMetadata=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AzureMetadata} AzureMetadata instance + */ + AzureMetadata.create = function create(properties) { + return new AzureMetadata(properties); + }; + + /** + * Encodes the specified AzureMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {google.cloud.securitycenter.v2.IAzureMetadata} message AzureMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.managementGroups != null && message.managementGroups.length) + for (var i = 0; i < message.managementGroups.length; ++i) + $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.encode(message.managementGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.encode(message.subscription, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceGroup != null && Object.hasOwnProperty.call(message, "resourceGroup")) + $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.encode(message.resourceGroup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tenant != null && Object.hasOwnProperty.call(message, "tenant")) + $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.encode(message.tenant, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AzureMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {google.cloud.securitycenter.v2.IAzureMetadata} message AzureMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AzureMetadata} AzureMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.managementGroups && message.managementGroups.length)) + message.managementGroups = []; + message.managementGroups.push($root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.subscription = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resourceGroup = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.decode(reader, reader.uint32()); + break; + } + case 7: { + message.tenant = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AzureMetadata} AzureMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureMetadata message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.managementGroups != null && message.hasOwnProperty("managementGroups")) { + if (!Array.isArray(message.managementGroups)) + return "managementGroups: array expected"; + for (var i = 0; i < message.managementGroups.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify(message.managementGroups[i]); + if (error) + return "managementGroups." + error; + } + } + if (message.subscription != null && message.hasOwnProperty("subscription")) { + var error = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify(message.subscription); + if (error) + return "subscription." + error; + } + if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) { + var error = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify(message.resourceGroup); + if (error) + return "resourceGroup." + error; + } + if (message.tenant != null && message.hasOwnProperty("tenant")) { + var error = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify(message.tenant); + if (error) + return "tenant." + error; + } + return null; + }; + + /** + * Creates an AzureMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AzureMetadata} AzureMetadata + */ + AzureMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata) + return object; + var message = new $root.google.cloud.securitycenter.v2.AzureMetadata(); + if (object.managementGroups) { + if (!Array.isArray(object.managementGroups)) + throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.managementGroups: array expected"); + message.managementGroups = []; + for (var i = 0; i < object.managementGroups.length; ++i) { + if (typeof object.managementGroups[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.managementGroups: object expected"); + message.managementGroups[i] = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.fromObject(object.managementGroups[i]); + } + } + if (object.subscription != null) { + if (typeof object.subscription !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.subscription: object expected"); + message.subscription = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.fromObject(object.subscription); + } + if (object.resourceGroup != null) { + if (typeof object.resourceGroup !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.resourceGroup: object expected"); + message.resourceGroup = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.fromObject(object.resourceGroup); + } + if (object.tenant != null) { + if (typeof object.tenant !== "object") + throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.tenant: object expected"); + message.tenant = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.fromObject(object.tenant); + } + return message; + }; + + /** + * Creates a plain object from an AzureMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata} message AzureMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.managementGroups = []; + if (options.defaults) { + object.subscription = null; + object.resourceGroup = null; + object.tenant = null; + } + if (message.managementGroups && message.managementGroups.length) { + object.managementGroups = []; + for (var j = 0; j < message.managementGroups.length; ++j) + object.managementGroups[j] = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.toObject(message.managementGroups[j], options); + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.toObject(message.subscription, options); + if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) + object.resourceGroup = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.toObject(message.resourceGroup, options); + if (message.tenant != null && message.hasOwnProperty("tenant")) + object.tenant = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.toObject(message.tenant, options); + return object; + }; + + /** + * Converts this AzureMetadata to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @instance + * @returns {Object.} JSON object + */ + AzureMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureMetadata + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata"; + }; + + AzureMetadata.AzureManagementGroup = (function() { + + /** + * Properties of an AzureManagementGroup. + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @interface IAzureManagementGroup + * @property {string|null} [id] AzureManagementGroup id + * @property {string|null} [displayName] AzureManagementGroup displayName + */ + + /** + * Constructs a new AzureManagementGroup. + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @classdesc Represents an AzureManagementGroup. + * @implements IAzureManagementGroup + * @constructor + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup=} [properties] Properties to set + */ + function AzureManagementGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureManagementGroup id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @instance + */ + AzureManagementGroup.prototype.id = ""; + + /** + * AzureManagementGroup displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @instance + */ + AzureManagementGroup.prototype.displayName = ""; + + /** + * Creates a new AzureManagementGroup instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} AzureManagementGroup instance + */ + AzureManagementGroup.create = function create(properties) { + return new AzureManagementGroup(properties); + }; + + /** + * Encodes the specified AzureManagementGroup message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup} message AzureManagementGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureManagementGroup.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AzureManagementGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup} message AzureManagementGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureManagementGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureManagementGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} AzureManagementGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureManagementGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureManagementGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} AzureManagementGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureManagementGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureManagementGroup message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureManagementGroup.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AzureManagementGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} AzureManagementGroup + */ + AzureManagementGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup) + return object; + var message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AzureManagementGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} message AzureManagementGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureManagementGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AzureManagementGroup to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @instance + * @returns {Object.} JSON object + */ + AzureManagementGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureManagementGroup + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureManagementGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup"; + }; + + return AzureManagementGroup; + })(); + + AzureMetadata.AzureSubscription = (function() { + + /** + * Properties of an AzureSubscription. + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @interface IAzureSubscription + * @property {string|null} [id] AzureSubscription id + * @property {string|null} [displayName] AzureSubscription displayName + */ + + /** + * Constructs a new AzureSubscription. + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @classdesc Represents an AzureSubscription. + * @implements IAzureSubscription + * @constructor + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription=} [properties] Properties to set + */ + function AzureSubscription(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureSubscription id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @instance + */ + AzureSubscription.prototype.id = ""; + + /** + * AzureSubscription displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @instance + */ + AzureSubscription.prototype.displayName = ""; + + /** + * Creates a new AzureSubscription instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} AzureSubscription instance + */ + AzureSubscription.create = function create(properties) { + return new AzureSubscription(properties); + }; + + /** + * Encodes the specified AzureSubscription message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription} message AzureSubscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureSubscription.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AzureSubscription message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription} message AzureSubscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureSubscription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureSubscription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} AzureSubscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureSubscription.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureSubscription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} AzureSubscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureSubscription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureSubscription message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureSubscription.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AzureSubscription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} AzureSubscription + */ + AzureSubscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription) + return object; + var message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AzureSubscription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} message AzureSubscription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureSubscription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AzureSubscription to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @instance + * @returns {Object.} JSON object + */ + AzureSubscription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureSubscription + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureSubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription"; + }; + + return AzureSubscription; + })(); + + AzureMetadata.AzureResourceGroup = (function() { + + /** + * Properties of an AzureResourceGroup. + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @interface IAzureResourceGroup + * @property {string|null} [id] AzureResourceGroup id + * @property {string|null} [name] AzureResourceGroup name + */ + + /** + * Constructs a new AzureResourceGroup. + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @classdesc Represents an AzureResourceGroup. + * @implements IAzureResourceGroup + * @constructor + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup=} [properties] Properties to set + */ + function AzureResourceGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureResourceGroup id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @instance + */ + AzureResourceGroup.prototype.id = ""; + + /** + * AzureResourceGroup name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @instance + */ + AzureResourceGroup.prototype.name = ""; + + /** + * Creates a new AzureResourceGroup instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} AzureResourceGroup instance + */ + AzureResourceGroup.create = function create(properties) { + return new AzureResourceGroup(properties); + }; + + /** + * Encodes the specified AzureResourceGroup message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup} message AzureResourceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureResourceGroup.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + return writer; + }; + + /** + * Encodes the specified AzureResourceGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup} message AzureResourceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureResourceGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureResourceGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} AzureResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureResourceGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.id = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureResourceGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} AzureResourceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureResourceGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureResourceGroup message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureResourceGroup.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an AzureResourceGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} AzureResourceGroup + */ + AzureResourceGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup) + return object; + var message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AzureResourceGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} message AzureResourceGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureResourceGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this AzureResourceGroup to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @instance + * @returns {Object.} JSON object + */ + AzureResourceGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureResourceGroup + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureResourceGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup"; + }; + + return AzureResourceGroup; + })(); + + AzureMetadata.AzureTenant = (function() { + + /** + * Properties of an AzureTenant. + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @interface IAzureTenant + * @property {string|null} [id] AzureTenant id + * @property {string|null} [displayName] AzureTenant displayName + */ + + /** + * Constructs a new AzureTenant. + * @memberof google.cloud.securitycenter.v2.AzureMetadata + * @classdesc Represents an AzureTenant. + * @implements IAzureTenant + * @constructor + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant=} [properties] Properties to set + */ + function AzureTenant(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureTenant id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @instance + */ + AzureTenant.prototype.id = ""; + + /** + * AzureTenant displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @instance + */ + AzureTenant.prototype.displayName = ""; + + /** + * Creates a new AzureTenant instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} AzureTenant instance + */ + AzureTenant.create = function create(properties) { + return new AzureTenant(properties); + }; + + /** + * Encodes the specified AzureTenant message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant} message AzureTenant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureTenant.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AzureTenant message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant} message AzureTenant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureTenant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureTenant message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} AzureTenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureTenant.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureTenant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} AzureTenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureTenant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureTenant message. + * @function verify + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureTenant.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AzureTenant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} AzureTenant + */ + AzureTenant.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant) + return object; + var message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AzureTenant message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} message AzureTenant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureTenant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AzureTenant to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @instance + * @returns {Object.} JSON object + */ + AzureTenant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureTenant + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureTenant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata.AzureTenant"; + }; + + return AzureTenant; + })(); + + return AzureMetadata; + })(); + + v2.ResourcePath = (function() { + + /** + * Properties of a ResourcePath. + * @memberof google.cloud.securitycenter.v2 + * @interface IResourcePath + * @property {Array.|null} [nodes] ResourcePath nodes + */ + + /** + * Constructs a new ResourcePath. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ResourcePath. + * @implements IResourcePath + * @constructor + * @param {google.cloud.securitycenter.v2.IResourcePath=} [properties] Properties to set + */ + function ResourcePath(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]]; + } + + /** + * ResourcePath nodes. + * @member {Array.} nodes + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @instance + */ + ResourcePath.prototype.nodes = $util.emptyArray; + + /** + * Creates a new ResourcePath instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {google.cloud.securitycenter.v2.IResourcePath=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ResourcePath} ResourcePath instance + */ + ResourcePath.create = function create(properties) { + return new ResourcePath(properties); + }; + + /** + * Encodes the specified ResourcePath message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {google.cloud.securitycenter.v2.IResourcePath} message ResourcePath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePath.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourcePath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {google.cloud.securitycenter.v2.IResourcePath} message ResourcePath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePath message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ResourcePath} ResourcePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePath.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourcePath(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ResourcePath} ResourcePath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePath message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePath.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.v2.ResourcePath.ResourcePathNode.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ResourcePath} ResourcePath + */ + ResourcePath.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ResourcePath) + return object; + var message = new $root.google.cloud.securitycenter.v2.ResourcePath(); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.securitycenter.v2.ResourcePath.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.v2.ResourcePath.nodes: object expected"); + message.nodes[i] = $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.fromObject(object.nodes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResourcePath message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {google.cloud.securitycenter.v2.ResourcePath} message ResourcePath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePath.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this ResourcePath to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @instance + * @returns {Object.} JSON object + */ + ResourcePath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourcePath + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourcePath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourcePath"; + }; + + /** + * ResourcePathNodeType enum. + * @name google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType + * @enum {number} + * @property {number} RESOURCE_PATH_NODE_TYPE_UNSPECIFIED=0 RESOURCE_PATH_NODE_TYPE_UNSPECIFIED value + * @property {number} GCP_ORGANIZATION=1 GCP_ORGANIZATION value + * @property {number} GCP_FOLDER=2 GCP_FOLDER value + * @property {number} GCP_PROJECT=3 GCP_PROJECT value + * @property {number} AWS_ORGANIZATION=4 AWS_ORGANIZATION value + * @property {number} AWS_ORGANIZATIONAL_UNIT=5 AWS_ORGANIZATIONAL_UNIT value + * @property {number} AWS_ACCOUNT=6 AWS_ACCOUNT value + * @property {number} AZURE_MANAGEMENT_GROUP=7 AZURE_MANAGEMENT_GROUP value + * @property {number} AZURE_SUBSCRIPTION=8 AZURE_SUBSCRIPTION value + * @property {number} AZURE_RESOURCE_GROUP=9 AZURE_RESOURCE_GROUP value + */ + ResourcePath.ResourcePathNodeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GCP_ORGANIZATION"] = 1; + values[valuesById[2] = "GCP_FOLDER"] = 2; + values[valuesById[3] = "GCP_PROJECT"] = 3; + values[valuesById[4] = "AWS_ORGANIZATION"] = 4; + values[valuesById[5] = "AWS_ORGANIZATIONAL_UNIT"] = 5; + values[valuesById[6] = "AWS_ACCOUNT"] = 6; + values[valuesById[7] = "AZURE_MANAGEMENT_GROUP"] = 7; + values[valuesById[8] = "AZURE_SUBSCRIPTION"] = 8; + values[valuesById[9] = "AZURE_RESOURCE_GROUP"] = 9; + return values; + })(); + + ResourcePath.ResourcePathNode = (function() { + + /** + * Properties of a ResourcePathNode. + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @interface IResourcePathNode + * @property {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType|null} [nodeType] ResourcePathNode nodeType + * @property {string|null} [id] ResourcePathNode id + * @property {string|null} [displayName] ResourcePathNode displayName + */ + + /** + * Constructs a new ResourcePathNode. + * @memberof google.cloud.securitycenter.v2.ResourcePath + * @classdesc Represents a ResourcePathNode. + * @implements IResourcePathNode + * @constructor + * @param {google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode=} [properties] Properties to set + */ + function ResourcePathNode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePathNode nodeType. + * @member {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType} nodeType + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @instance + */ + ResourcePathNode.prototype.nodeType = 0; + + /** + * ResourcePathNode id. + * @member {string} id + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @instance + */ + ResourcePathNode.prototype.id = ""; + + /** + * ResourcePathNode displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @instance + */ + ResourcePathNode.prototype.displayName = ""; + + /** + * Creates a new ResourcePathNode instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} ResourcePathNode instance + */ + ResourcePathNode.create = function create(properties) { + return new ResourcePathNode(properties); + }; + + /** + * Encodes the specified ResourcePathNode message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode} message ResourcePathNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePathNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeType); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ResourcePathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode} message ResourcePathNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePathNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePathNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} ResourcePathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePathNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodeType = reader.int32(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePathNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} ResourcePathNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePathNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePathNode message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePathNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeType != null && message.hasOwnProperty("nodeType")) + switch (message.nodeType) { + default: + return "nodeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a ResourcePathNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} ResourcePathNode + */ + ResourcePathNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode) + return object; + var message = new $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode(); + switch (object.nodeType) { + default: + if (typeof object.nodeType === "number") { + message.nodeType = object.nodeType; + break; + } + break; + case "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED": + case 0: + message.nodeType = 0; + break; + case "GCP_ORGANIZATION": + case 1: + message.nodeType = 1; + break; + case "GCP_FOLDER": + case 2: + message.nodeType = 2; + break; + case "GCP_PROJECT": + case 3: + message.nodeType = 3; + break; + case "AWS_ORGANIZATION": + case 4: + message.nodeType = 4; + break; + case "AWS_ORGANIZATIONAL_UNIT": + case 5: + message.nodeType = 5; + break; + case "AWS_ACCOUNT": + case 6: + message.nodeType = 6; + break; + case "AZURE_MANAGEMENT_GROUP": + case 7: + message.nodeType = 7; + break; + case "AZURE_SUBSCRIPTION": + case 8: + message.nodeType = 8; + break; + case "AZURE_RESOURCE_GROUP": + case 9: + message.nodeType = 9; + break; + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a ResourcePathNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} message ResourcePathNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePathNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeType = options.enums === String ? "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" : 0; + object.id = ""; + object.displayName = ""; + } + if (message.nodeType != null && message.hasOwnProperty("nodeType")) + object.nodeType = options.enums === String ? $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType[message.nodeType] === undefined ? message.nodeType : $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType[message.nodeType] : message.nodeType; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ResourcePathNode to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @instance + * @returns {Object.} JSON object + */ + ResourcePathNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourcePathNode + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourcePathNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode"; + }; + + return ResourcePathNode; + })(); + + return ResourcePath; + })(); + + v2.ResourceValueConfig = (function() { + + /** + * Properties of a ResourceValueConfig. + * @memberof google.cloud.securitycenter.v2 + * @interface IResourceValueConfig + * @property {string|null} [name] ResourceValueConfig name + * @property {google.cloud.securitycenter.v2.ResourceValue|null} [resourceValue] ResourceValueConfig resourceValue + * @property {Array.|null} [tagValues] ResourceValueConfig tagValues + * @property {string|null} [resourceType] ResourceValueConfig resourceType + * @property {string|null} [scope] ResourceValueConfig scope + * @property {Object.|null} [resourceLabelsSelector] ResourceValueConfig resourceLabelsSelector + * @property {string|null} [description] ResourceValueConfig description + * @property {google.protobuf.ITimestamp|null} [createTime] ResourceValueConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ResourceValueConfig updateTime + * @property {google.cloud.securitycenter.v2.CloudProvider|null} [cloudProvider] ResourceValueConfig cloudProvider + * @property {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping|null} [sensitiveDataProtectionMapping] ResourceValueConfig sensitiveDataProtectionMapping + */ + + /** + * Constructs a new ResourceValueConfig. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ResourceValueConfig. + * @implements IResourceValueConfig + * @constructor + * @param {google.cloud.securitycenter.v2.IResourceValueConfig=} [properties] Properties to set + */ + function ResourceValueConfig(properties) { + this.tagValues = []; + this.resourceLabelsSelector = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceValueConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.name = ""; + + /** + * ResourceValueConfig resourceValue. + * @member {google.cloud.securitycenter.v2.ResourceValue} resourceValue + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.resourceValue = 0; + + /** + * ResourceValueConfig tagValues. + * @member {Array.} tagValues + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.tagValues = $util.emptyArray; + + /** + * ResourceValueConfig resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.resourceType = ""; + + /** + * ResourceValueConfig scope. + * @member {string} scope + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.scope = ""; + + /** + * ResourceValueConfig resourceLabelsSelector. + * @member {Object.} resourceLabelsSelector + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.resourceLabelsSelector = $util.emptyObject; + + /** + * ResourceValueConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.description = ""; + + /** + * ResourceValueConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.createTime = null; + + /** + * ResourceValueConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.updateTime = null; + + /** + * ResourceValueConfig cloudProvider. + * @member {google.cloud.securitycenter.v2.CloudProvider} cloudProvider + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.cloudProvider = 0; + + /** + * ResourceValueConfig sensitiveDataProtectionMapping. + * @member {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping|null|undefined} sensitiveDataProtectionMapping + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + */ + ResourceValueConfig.prototype.sensitiveDataProtectionMapping = null; + + /** + * Creates a new ResourceValueConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {google.cloud.securitycenter.v2.IResourceValueConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ResourceValueConfig} ResourceValueConfig instance + */ + ResourceValueConfig.create = function create(properties) { + return new ResourceValueConfig(properties); + }; + + /** + * Encodes the specified ResourceValueConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {google.cloud.securitycenter.v2.IResourceValueConfig} message ResourceValueConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceValueConfig.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.resourceValue != null && Object.hasOwnProperty.call(message, "resourceValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceValue); + if (message.tagValues != null && message.tagValues.length) + for (var i = 0; i < message.tagValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tagValues[i]); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceType); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.scope); + if (message.resourceLabelsSelector != null && Object.hasOwnProperty.call(message, "resourceLabelsSelector")) + for (var keys = Object.keys(message.resourceLabelsSelector), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourceLabelsSelector[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.cloudProvider); + if (message.sensitiveDataProtectionMapping != null && Object.hasOwnProperty.call(message, "sensitiveDataProtectionMapping")) + $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.encode(message.sensitiveDataProtectionMapping, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceValueConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {google.cloud.securitycenter.v2.IResourceValueConfig} message ResourceValueConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceValueConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceValueConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ResourceValueConfig} ResourceValueConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceValueConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourceValueConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resourceValue = reader.int32(); + break; + } + case 3: { + if (!(message.tagValues && message.tagValues.length)) + message.tagValues = []; + message.tagValues.push(reader.string()); + break; + } + case 4: { + message.resourceType = reader.string(); + break; + } + case 5: { + message.scope = reader.string(); + break; + } + case 6: { + if (message.resourceLabelsSelector === $util.emptyObject) + message.resourceLabelsSelector = {}; + 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.resourceLabelsSelector[key] = value; + break; + } + case 7: { + message.description = reader.string(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.cloudProvider = reader.int32(); + break; + } + case 11: { + message.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceValueConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ResourceValueConfig} ResourceValueConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceValueConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceValueConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceValueConfig.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.resourceValue != null && message.hasOwnProperty("resourceValue")) + switch (message.resourceValue) { + default: + return "resourceValue: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.tagValues != null && message.hasOwnProperty("tagValues")) { + if (!Array.isArray(message.tagValues)) + return "tagValues: array expected"; + for (var i = 0; i < message.tagValues.length; ++i) + if (!$util.isString(message.tagValues[i])) + return "tagValues: string[] expected"; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.resourceLabelsSelector != null && message.hasOwnProperty("resourceLabelsSelector")) { + if (!$util.isObject(message.resourceLabelsSelector)) + return "resourceLabelsSelector: object expected"; + var key = Object.keys(message.resourceLabelsSelector); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourceLabelsSelector[key[i]])) + return "resourceLabelsSelector: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + switch (message.cloudProvider) { + default: + return "cloudProvider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sensitiveDataProtectionMapping != null && message.hasOwnProperty("sensitiveDataProtectionMapping")) { + var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify(message.sensitiveDataProtectionMapping); + if (error) + return "sensitiveDataProtectionMapping." + error; + } + return null; + }; + + /** + * Creates a ResourceValueConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ResourceValueConfig} ResourceValueConfig + */ + ResourceValueConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ResourceValueConfig) + return object; + var message = new $root.google.cloud.securitycenter.v2.ResourceValueConfig(); + if (object.name != null) + message.name = String(object.name); + switch (object.resourceValue) { + default: + if (typeof object.resourceValue === "number") { + message.resourceValue = object.resourceValue; + break; + } + break; + case "RESOURCE_VALUE_UNSPECIFIED": + case 0: + message.resourceValue = 0; + break; + case "HIGH": + case 1: + message.resourceValue = 1; + break; + case "MEDIUM": + case 2: + message.resourceValue = 2; + break; + case "LOW": + case 3: + message.resourceValue = 3; + break; + case "NONE": + case 4: + message.resourceValue = 4; + break; + } + if (object.tagValues) { + if (!Array.isArray(object.tagValues)) + throw TypeError(".google.cloud.securitycenter.v2.ResourceValueConfig.tagValues: array expected"); + message.tagValues = []; + for (var i = 0; i < object.tagValues.length; ++i) + message.tagValues[i] = String(object.tagValues[i]); + } + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.scope != null) + message.scope = String(object.scope); + if (object.resourceLabelsSelector) { + if (typeof object.resourceLabelsSelector !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ResourceValueConfig.resourceLabelsSelector: object expected"); + message.resourceLabelsSelector = {}; + for (var keys = Object.keys(object.resourceLabelsSelector), i = 0; i < keys.length; ++i) + message.resourceLabelsSelector[keys[i]] = String(object.resourceLabelsSelector[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ResourceValueConfig.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.v2.ResourceValueConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.cloudProvider) { + default: + if (typeof object.cloudProvider === "number") { + message.cloudProvider = object.cloudProvider; + break; + } + break; + case "CLOUD_PROVIDER_UNSPECIFIED": + case 0: + message.cloudProvider = 0; + break; + case "GOOGLE_CLOUD_PLATFORM": + case 1: + message.cloudProvider = 1; + break; + case "AMAZON_WEB_SERVICES": + case 2: + message.cloudProvider = 2; + break; + case "MICROSOFT_AZURE": + case 3: + message.cloudProvider = 3; + break; + } + if (object.sensitiveDataProtectionMapping != null) { + if (typeof object.sensitiveDataProtectionMapping !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ResourceValueConfig.sensitiveDataProtectionMapping: object expected"); + message.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.fromObject(object.sensitiveDataProtectionMapping); + } + return message; + }; + + /** + * Creates a plain object from a ResourceValueConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {google.cloud.securitycenter.v2.ResourceValueConfig} message ResourceValueConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceValueConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tagValues = []; + if (options.objects || options.defaults) + object.resourceLabelsSelector = {}; + if (options.defaults) { + object.name = ""; + object.resourceValue = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; + object.resourceType = ""; + object.scope = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; + object.sensitiveDataProtectionMapping = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) + object.resourceValue = options.enums === String ? $root.google.cloud.securitycenter.v2.ResourceValue[message.resourceValue] === undefined ? message.resourceValue : $root.google.cloud.securitycenter.v2.ResourceValue[message.resourceValue] : message.resourceValue; + if (message.tagValues && message.tagValues.length) { + object.tagValues = []; + for (var j = 0; j < message.tagValues.length; ++j) + object.tagValues[j] = message.tagValues[j]; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + var keys2; + if (message.resourceLabelsSelector && (keys2 = Object.keys(message.resourceLabelsSelector)).length) { + object.resourceLabelsSelector = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceLabelsSelector[keys2[j]] = message.resourceLabelsSelector[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] : message.cloudProvider; + if (message.sensitiveDataProtectionMapping != null && message.hasOwnProperty("sensitiveDataProtectionMapping")) + object.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.toObject(message.sensitiveDataProtectionMapping, options); + return object; + }; + + /** + * Converts this ResourceValueConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @instance + * @returns {Object.} JSON object + */ + ResourceValueConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceValueConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceValueConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourceValueConfig"; + }; + + ResourceValueConfig.SensitiveDataProtectionMapping = (function() { + + /** + * Properties of a SensitiveDataProtectionMapping. + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @interface ISensitiveDataProtectionMapping + * @property {google.cloud.securitycenter.v2.ResourceValue|null} [highSensitivityMapping] SensitiveDataProtectionMapping highSensitivityMapping + * @property {google.cloud.securitycenter.v2.ResourceValue|null} [mediumSensitivityMapping] SensitiveDataProtectionMapping mediumSensitivityMapping + */ + + /** + * Constructs a new SensitiveDataProtectionMapping. + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig + * @classdesc Represents a SensitiveDataProtectionMapping. + * @implements ISensitiveDataProtectionMapping + * @constructor + * @param {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping=} [properties] Properties to set + */ + function SensitiveDataProtectionMapping(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SensitiveDataProtectionMapping highSensitivityMapping. + * @member {google.cloud.securitycenter.v2.ResourceValue} highSensitivityMapping + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @instance + */ + SensitiveDataProtectionMapping.prototype.highSensitivityMapping = 0; + + /** + * SensitiveDataProtectionMapping mediumSensitivityMapping. + * @member {google.cloud.securitycenter.v2.ResourceValue} mediumSensitivityMapping + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @instance + */ + SensitiveDataProtectionMapping.prototype.mediumSensitivityMapping = 0; + + /** + * Creates a new SensitiveDataProtectionMapping instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping instance + */ + SensitiveDataProtectionMapping.create = function create(properties) { + return new SensitiveDataProtectionMapping(properties); + }; + + /** + * Encodes the specified SensitiveDataProtectionMapping message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping} message SensitiveDataProtectionMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SensitiveDataProtectionMapping.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.highSensitivityMapping != null && Object.hasOwnProperty.call(message, "highSensitivityMapping")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highSensitivityMapping); + if (message.mediumSensitivityMapping != null && Object.hasOwnProperty.call(message, "mediumSensitivityMapping")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediumSensitivityMapping); + return writer; + }; + + /** + * Encodes the specified SensitiveDataProtectionMapping message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping} message SensitiveDataProtectionMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SensitiveDataProtectionMapping.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SensitiveDataProtectionMapping.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.highSensitivityMapping = reader.int32(); + break; + } + case 2: { + message.mediumSensitivityMapping = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SensitiveDataProtectionMapping.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SensitiveDataProtectionMapping message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SensitiveDataProtectionMapping.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.highSensitivityMapping != null && message.hasOwnProperty("highSensitivityMapping")) + switch (message.highSensitivityMapping) { + default: + return "highSensitivityMapping: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.mediumSensitivityMapping != null && message.hasOwnProperty("mediumSensitivityMapping")) + switch (message.mediumSensitivityMapping) { + default: + return "mediumSensitivityMapping: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a SensitiveDataProtectionMapping message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping + */ + SensitiveDataProtectionMapping.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping) + return object; + var message = new $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping(); + switch (object.highSensitivityMapping) { + default: + if (typeof object.highSensitivityMapping === "number") { + message.highSensitivityMapping = object.highSensitivityMapping; + break; + } + break; + case "RESOURCE_VALUE_UNSPECIFIED": + case 0: + message.highSensitivityMapping = 0; + break; + case "HIGH": + case 1: + message.highSensitivityMapping = 1; + break; + case "MEDIUM": + case 2: + message.highSensitivityMapping = 2; + break; + case "LOW": + case 3: + message.highSensitivityMapping = 3; + break; + case "NONE": + case 4: + message.highSensitivityMapping = 4; + break; + } + switch (object.mediumSensitivityMapping) { + default: + if (typeof object.mediumSensitivityMapping === "number") { + message.mediumSensitivityMapping = object.mediumSensitivityMapping; + break; + } + break; + case "RESOURCE_VALUE_UNSPECIFIED": + case 0: + message.mediumSensitivityMapping = 0; + break; + case "HIGH": + case 1: + message.mediumSensitivityMapping = 1; + break; + case "MEDIUM": + case 2: + message.mediumSensitivityMapping = 2; + break; + case "LOW": + case 3: + message.mediumSensitivityMapping = 3; + break; + case "NONE": + case 4: + message.mediumSensitivityMapping = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a SensitiveDataProtectionMapping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} message SensitiveDataProtectionMapping + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SensitiveDataProtectionMapping.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.highSensitivityMapping = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; + object.mediumSensitivityMapping = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; + } + if (message.highSensitivityMapping != null && message.hasOwnProperty("highSensitivityMapping")) + object.highSensitivityMapping = options.enums === String ? $root.google.cloud.securitycenter.v2.ResourceValue[message.highSensitivityMapping] === undefined ? message.highSensitivityMapping : $root.google.cloud.securitycenter.v2.ResourceValue[message.highSensitivityMapping] : message.highSensitivityMapping; + if (message.mediumSensitivityMapping != null && message.hasOwnProperty("mediumSensitivityMapping")) + object.mediumSensitivityMapping = options.enums === String ? $root.google.cloud.securitycenter.v2.ResourceValue[message.mediumSensitivityMapping] === undefined ? message.mediumSensitivityMapping : $root.google.cloud.securitycenter.v2.ResourceValue[message.mediumSensitivityMapping] : message.mediumSensitivityMapping; + return object; + }; + + /** + * Converts this SensitiveDataProtectionMapping to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @instance + * @returns {Object.} JSON object + */ + SensitiveDataProtectionMapping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SensitiveDataProtectionMapping + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SensitiveDataProtectionMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping"; + }; + + return SensitiveDataProtectionMapping; + })(); + + return ResourceValueConfig; + })(); + + /** + * ResourceValue enum. + * @name google.cloud.securitycenter.v2.ResourceValue + * @enum {number} + * @property {number} RESOURCE_VALUE_UNSPECIFIED=0 RESOURCE_VALUE_UNSPECIFIED value + * @property {number} HIGH=1 HIGH value + * @property {number} MEDIUM=2 MEDIUM value + * @property {number} LOW=3 LOW value + * @property {number} NONE=4 NONE value + */ + v2.ResourceValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_VALUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGH"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + values[valuesById[3] = "LOW"] = 3; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + v2.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v2 + * @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.v2.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.v2.SecurityCenter|batchCreateResourceValueConfigs}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef BatchCreateResourceValueConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} [response] BatchCreateResourceValueConfigsResponse + */ + + /** + * Calls BatchCreateResourceValueConfigs. + * @function batchCreateResourceValueConfigs + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest} request BatchCreateResourceValueConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigsCallback} callback Node-style callback called with the error, if any, and BatchCreateResourceValueConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.batchCreateResourceValueConfigs = function batchCreateResourceValueConfigs(request, callback) { + return this.rpcCall(batchCreateResourceValueConfigs, $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest, $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse, request, callback); + }, "name", { value: "BatchCreateResourceValueConfigs" }); + + /** + * Calls BatchCreateResourceValueConfigs. + * @function batchCreateResourceValueConfigs + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest} request BatchCreateResourceValueConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|bulkMuteFindings}. + * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BulkMuteFindings" }); + + /** + * Calls BulkMuteFindings. + * @function bulkMuteFindings + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createBigQueryExport}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef CreateBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls CreateBigQueryExport. + * @function createBigQueryExport + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest} request CreateBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.CreateBigQueryExportRequest, $root.google.cloud.securitycenter.v2.BigQueryExport, request, callback); + }, "name", { value: "CreateBigQueryExport" }); + + /** + * Calls CreateBigQueryExport. + * @function createBigQueryExport + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest} request CreateBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createFinding}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.CreateFindingRequest, $root.google.cloud.securitycenter.v2.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createMuteConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef CreateMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.MuteConfig} [response] MuteConfig + */ + + /** + * Calls CreateMuteConfig. + * @function createMuteConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.CreateMuteConfigRequest, $root.google.cloud.securitycenter.v2.MuteConfig, request, callback); + }, "name", { value: "CreateMuteConfig" }); + + /** + * Calls CreateMuteConfig. + * @function createMuteConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createNotificationConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef CreateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v2.NotificationConfig, request, callback); + }, "name", { value: "CreateNotificationConfig" }); + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createSource}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.CreateSourceRequest, $root.google.cloud.securitycenter.v2.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|deleteBigQueryExport}. + * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest} request DeleteBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBigQueryExport" }); + + /** + * Calls DeleteBigQueryExport. + * @function deleteBigQueryExport + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest} request DeleteBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|deleteMuteConfig}. + * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.DeleteMuteConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMuteConfig" }); + + /** + * Calls DeleteMuteConfig. + * @function deleteMuteConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|deleteNotificationConfig}. + * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteNotificationConfig" }); + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|deleteResourceValueConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef DeleteResourceValueConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteResourceValueConfig. + * @function deleteResourceValueConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest} request DeleteResourceValueConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteResourceValueConfig = function deleteResourceValueConfig(request, callback) { + return this.rpcCall(deleteResourceValueConfig, $root.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteResourceValueConfig" }); + + /** + * Calls DeleteResourceValueConfig. + * @function deleteResourceValueConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest} request DeleteResourceValueConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getBigQueryExport}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef GetBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls GetBigQueryExport. + * @function getBigQueryExport + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetBigQueryExportRequest} request GetBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest, $root.google.cloud.securitycenter.v2.BigQueryExport, request, callback); + }, "name", { value: "GetBigQueryExport" }); + + /** + * Calls GetBigQueryExport. + * @function getBigQueryExport + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetBigQueryExportRequest} request GetBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getSimulation}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef GetSimulationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.Simulation} [response] Simulation + */ + + /** + * Calls GetSimulation. + * @function getSimulation + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetSimulationRequest} request GetSimulationRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.GetSimulationCallback} callback Node-style callback called with the error, if any, and Simulation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSimulation = function getSimulation(request, callback) { + return this.rpcCall(getSimulation, $root.google.cloud.securitycenter.v2.GetSimulationRequest, $root.google.cloud.securitycenter.v2.Simulation, request, callback); + }, "name", { value: "GetSimulation" }); + + /** + * Calls GetSimulation. + * @function getSimulation + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetSimulationRequest} request GetSimulationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getValuedResource}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef GetValuedResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ValuedResource} [response] ValuedResource + */ + + /** + * Calls GetValuedResource. + * @function getValuedResource + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest} request GetValuedResourceRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.GetValuedResourceCallback} callback Node-style callback called with the error, if any, and ValuedResource + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getValuedResource = function getValuedResource(request, callback) { + return this.rpcCall(getValuedResource, $root.google.cloud.securitycenter.v2.GetValuedResourceRequest, $root.google.cloud.securitycenter.v2.ValuedResource, request, callback); + }, "name", { value: "GetValuedResource" }); + + /** + * Calls GetValuedResource. + * @function getValuedResource + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest} request GetValuedResourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getIamPolicy}. + * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.SecurityCenter|getMuteConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef GetMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.MuteConfig} [response] MuteConfig + */ + + /** + * Calls GetMuteConfig. + * @function getMuteConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.GetMuteConfigRequest, $root.google.cloud.securitycenter.v2.MuteConfig, request, callback); + }, "name", { value: "GetMuteConfig" }); + + /** + * Calls GetMuteConfig. + * @function getMuteConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getNotificationConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef GetNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v2.NotificationConfig, request, callback); + }, "name", { value: "GetNotificationConfig" }); + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getResourceValueConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef GetResourceValueConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ResourceValueConfig} [response] ResourceValueConfig + */ + + /** + * Calls GetResourceValueConfig. + * @function getResourceValueConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest} request GetResourceValueConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfigCallback} callback Node-style callback called with the error, if any, and ResourceValueConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getResourceValueConfig = function getResourceValueConfig(request, callback) { + return this.rpcCall(getResourceValueConfig, $root.google.cloud.securitycenter.v2.GetResourceValueConfigRequest, $root.google.cloud.securitycenter.v2.ResourceValueConfig, request, callback); + }, "name", { value: "GetResourceValueConfig" }); + + /** + * Calls GetResourceValueConfig. + * @function getResourceValueConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest} request GetResourceValueConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getSource}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.GetSourceRequest, $root.google.cloud.securitycenter.v2.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|groupFindings}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.GroupFindingsRequest, $root.google.cloud.securitycenter.v2.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listAttackPaths}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef ListAttackPathsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ListAttackPathsResponse} [response] ListAttackPathsResponse + */ + + /** + * Calls ListAttackPaths. + * @function listAttackPaths + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest} request ListAttackPathsRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.ListAttackPathsCallback} callback Node-style callback called with the error, if any, and ListAttackPathsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAttackPaths = function listAttackPaths(request, callback) { + return this.rpcCall(listAttackPaths, $root.google.cloud.securitycenter.v2.ListAttackPathsRequest, $root.google.cloud.securitycenter.v2.ListAttackPathsResponse, request, callback); + }, "name", { value: "ListAttackPaths" }); + + /** + * Calls ListAttackPaths. + * @function listAttackPaths + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest} request ListAttackPathsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listBigQueryExports}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef ListBigQueryExportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ListBigQueryExportsResponse} [response] ListBigQueryExportsResponse + */ + + /** + * Calls ListBigQueryExports. + * @function listBigQueryExports + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListBigQueryExportsRequest} request ListBigQueryExportsRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest, $root.google.cloud.securitycenter.v2.ListBigQueryExportsResponse, request, callback); + }, "name", { value: "ListBigQueryExports" }); + + /** + * Calls ListBigQueryExports. + * @function listBigQueryExports + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListBigQueryExportsRequest} request ListBigQueryExportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listFindings}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsRequest, $root.google.cloud.securitycenter.v2.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listMuteConfigs}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef ListMuteConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ListMuteConfigsResponse} [response] ListMuteConfigsResponse + */ + + /** + * Calls ListMuteConfigs. + * @function listMuteConfigs + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.ListMuteConfigsRequest, $root.google.cloud.securitycenter.v2.ListMuteConfigsResponse, request, callback); + }, "name", { value: "ListMuteConfigs" }); + + /** + * Calls ListMuteConfigs. + * @function listMuteConfigs + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listNotificationConfigs}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef ListNotificationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + */ + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v2.ListNotificationConfigsResponse, request, callback); + }, "name", { value: "ListNotificationConfigs" }); + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listResourceValueConfigs}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef ListResourceValueConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} [response] ListResourceValueConfigsResponse + */ + + /** + * Calls ListResourceValueConfigs. + * @function listResourceValueConfigs + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest} request ListResourceValueConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigsCallback} callback Node-style callback called with the error, if any, and ListResourceValueConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listResourceValueConfigs = function listResourceValueConfigs(request, callback) { + return this.rpcCall(listResourceValueConfigs, $root.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest, $root.google.cloud.securitycenter.v2.ListResourceValueConfigsResponse, request, callback); + }, "name", { value: "ListResourceValueConfigs" }); + + /** + * Calls ListResourceValueConfigs. + * @function listResourceValueConfigs + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest} request ListResourceValueConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listSources}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.ListSourcesRequest, $root.google.cloud.securitycenter.v2.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listValuedResources}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef ListValuedResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ListValuedResourcesResponse} [response] ListValuedResourcesResponse + */ + + /** + * Calls ListValuedResources. + * @function listValuedResources + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest} request ListValuedResourcesRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.ListValuedResourcesCallback} callback Node-style callback called with the error, if any, and ListValuedResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listValuedResources = function listValuedResources(request, callback) { + return this.rpcCall(listValuedResources, $root.google.cloud.securitycenter.v2.ListValuedResourcesRequest, $root.google.cloud.securitycenter.v2.ListValuedResourcesResponse, request, callback); + }, "name", { value: "ListValuedResources" }); + + /** + * Calls ListValuedResources. + * @function listValuedResources + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest} request ListValuedResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|setFindingState}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.SetFindingStateRequest, $root.google.cloud.securitycenter.v2.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|setIamPolicy}. + * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.SecurityCenter|setMute}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef SetMuteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.Finding} [response] Finding + */ + + /** + * Calls SetMute. + * @function setMute + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ISetMuteRequest} request SetMuteRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.SetMuteRequest, $root.google.cloud.securitycenter.v2.Finding, request, callback); + }, "name", { value: "SetMute" }); + + /** + * Calls SetMute. + * @function setMute + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.ISetMuteRequest} request SetMuteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|testIamPermissions}. + * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.SecurityCenter|updateBigQueryExport}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef UpdateBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls UpdateBigQueryExport. + * @function updateBigQueryExport + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest} request UpdateBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.UpdateBigQueryExportRequest, $root.google.cloud.securitycenter.v2.BigQueryExport, request, callback); + }, "name", { value: "UpdateBigQueryExport" }); + + /** + * Calls UpdateBigQueryExport. + * @function updateBigQueryExport + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest} request UpdateBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateExternalSystem}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef UpdateExternalSystemCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ExternalSystem} [response] ExternalSystem + */ + + /** + * Calls UpdateExternalSystem. + * @function updateExternalSystem + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateExternalSystemRequest} request UpdateExternalSystemRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.UpdateExternalSystemRequest, $root.google.cloud.securitycenter.v2.ExternalSystem, request, callback); + }, "name", { value: "UpdateExternalSystem" }); + + /** + * Calls UpdateExternalSystem. + * @function updateExternalSystem + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateExternalSystemRequest} request UpdateExternalSystemRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateFinding}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.UpdateFindingRequest, $root.google.cloud.securitycenter.v2.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateMuteConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef UpdateMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.MuteConfig} [response] MuteConfig + */ + + /** + * Calls UpdateMuteConfig. + * @function updateMuteConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.UpdateMuteConfigRequest, $root.google.cloud.securitycenter.v2.MuteConfig, request, callback); + }, "name", { value: "UpdateMuteConfig" }); + + /** + * Calls UpdateMuteConfig. + * @function updateMuteConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateNotificationConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef UpdateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v2.NotificationConfig, request, callback); + }, "name", { value: "UpdateNotificationConfig" }); + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateResourceValueConfig}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef UpdateResourceValueConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.ResourceValueConfig} [response] ResourceValueConfig + */ + + /** + * Calls UpdateResourceValueConfig. + * @function updateResourceValueConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest} request UpdateResourceValueConfigRequest message or plain object + * @param {google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfigCallback} callback Node-style callback called with the error, if any, and ResourceValueConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateResourceValueConfig = function updateResourceValueConfig(request, callback) { + return this.rpcCall(updateResourceValueConfig, $root.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest, $root.google.cloud.securitycenter.v2.ResourceValueConfig, request, callback); + }, "name", { value: "UpdateResourceValueConfig" }); + + /** + * Calls UpdateResourceValueConfig. + * @function updateResourceValueConfig + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest} request UpdateResourceValueConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v2.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateSource}. + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v2.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v2.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.v2.UpdateSourceRequest, $root.google.cloud.securitycenter.v2.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v2.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v2.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v2.BatchCreateResourceValueConfigsRequest = (function() { + + /** + * Properties of a BatchCreateResourceValueConfigsRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IBatchCreateResourceValueConfigsRequest + * @property {string|null} [parent] BatchCreateResourceValueConfigsRequest parent + * @property {Array.|null} [requests] BatchCreateResourceValueConfigsRequest requests + */ + + /** + * Constructs a new BatchCreateResourceValueConfigsRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a BatchCreateResourceValueConfigsRequest. + * @implements IBatchCreateResourceValueConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest=} [properties] Properties to set + */ + function BatchCreateResourceValueConfigsRequest(properties) { + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateResourceValueConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @instance + */ + BatchCreateResourceValueConfigsRequest.prototype.parent = ""; + + /** + * BatchCreateResourceValueConfigsRequest requests. + * @member {Array.} requests + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @instance + */ + BatchCreateResourceValueConfigsRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchCreateResourceValueConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest instance + */ + BatchCreateResourceValueConfigsRequest.create = function create(properties) { + return new BatchCreateResourceValueConfigsRequest(properties); + }; + + /** + * Encodes the specified BatchCreateResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateResourceValueConfigsRequest.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.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateResourceValueConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateResourceValueConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateResourceValueConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateResourceValueConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateResourceValueConfigsRequest.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.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest + */ + BatchCreateResourceValueConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateResourceValueConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateResourceValueConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateResourceValueConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateResourceValueConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateResourceValueConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateResourceValueConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest"; + }; + + return BatchCreateResourceValueConfigsRequest; + })(); + + v2.BatchCreateResourceValueConfigsResponse = (function() { + + /** + * Properties of a BatchCreateResourceValueConfigsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IBatchCreateResourceValueConfigsResponse + * @property {Array.|null} [resourceValueConfigs] BatchCreateResourceValueConfigsResponse resourceValueConfigs + */ + + /** + * Constructs a new BatchCreateResourceValueConfigsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a BatchCreateResourceValueConfigsResponse. + * @implements IBatchCreateResourceValueConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse=} [properties] Properties to set + */ + function BatchCreateResourceValueConfigsResponse(properties) { + this.resourceValueConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateResourceValueConfigsResponse resourceValueConfigs. + * @member {Array.} resourceValueConfigs + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @instance + */ + BatchCreateResourceValueConfigsResponse.prototype.resourceValueConfigs = $util.emptyArray; + + /** + * Creates a new BatchCreateResourceValueConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse instance + */ + BatchCreateResourceValueConfigsResponse.create = function create(properties) { + return new BatchCreateResourceValueConfigsResponse(properties); + }; + + /** + * Encodes the specified BatchCreateResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateResourceValueConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceValueConfigs != null && message.resourceValueConfigs.length) + for (var i = 0; i < message.resourceValueConfigs.length; ++i) + $root.google.cloud.securitycenter.v2.ResourceValueConfig.encode(message.resourceValueConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateResourceValueConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateResourceValueConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceValueConfigs && message.resourceValueConfigs.length)) + message.resourceValueConfigs = []; + message.resourceValueConfigs.push($root.google.cloud.securitycenter.v2.ResourceValueConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateResourceValueConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateResourceValueConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateResourceValueConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceValueConfigs != null && message.hasOwnProperty("resourceValueConfigs")) { + if (!Array.isArray(message.resourceValueConfigs)) + return "resourceValueConfigs: array expected"; + for (var i = 0; i < message.resourceValueConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.verify(message.resourceValueConfigs[i]); + if (error) + return "resourceValueConfigs." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse + */ + BatchCreateResourceValueConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse(); + if (object.resourceValueConfigs) { + if (!Array.isArray(object.resourceValueConfigs)) + throw TypeError(".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.resourceValueConfigs: array expected"); + message.resourceValueConfigs = []; + for (var i = 0; i < object.resourceValueConfigs.length; ++i) { + if (typeof object.resourceValueConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.resourceValueConfigs: object expected"); + message.resourceValueConfigs[i] = $root.google.cloud.securitycenter.v2.ResourceValueConfig.fromObject(object.resourceValueConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateResourceValueConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateResourceValueConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceValueConfigs = []; + if (message.resourceValueConfigs && message.resourceValueConfigs.length) { + object.resourceValueConfigs = []; + for (var j = 0; j < message.resourceValueConfigs.length; ++j) + object.resourceValueConfigs[j] = $root.google.cloud.securitycenter.v2.ResourceValueConfig.toObject(message.resourceValueConfigs[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateResourceValueConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateResourceValueConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateResourceValueConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateResourceValueConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse"; + }; + + return BatchCreateResourceValueConfigsResponse; + })(); + + v2.BulkMuteFindingsRequest = (function() { + + /** + * Properties of a BulkMuteFindingsRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IBulkMuteFindingsRequest + * @property {string|null} [parent] BulkMuteFindingsRequest parent + * @property {string|null} [filter] BulkMuteFindingsRequest filter + * @property {google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState|null} [muteState] BulkMuteFindingsRequest muteState + */ + + /** + * Constructs a new BulkMuteFindingsRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a BulkMuteFindingsRequest. + * @implements IBulkMuteFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest=} [properties] Properties to set + */ + function BulkMuteFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BulkMuteFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.parent = ""; + + /** + * BulkMuteFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.filter = ""; + + /** + * BulkMuteFindingsRequest muteState. + * @member {google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState} muteState + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.muteState = 0; + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsRequest} BulkMuteFindingsRequest instance + */ + BulkMuteFindingsRequest.create = function create(properties) { + return new BulkMuteFindingsRequest(properties); + }; + + /** + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.BulkMuteFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest} message BulkMuteFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsRequest.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.muteState != null && Object.hasOwnProperty.call(message, "muteState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.muteState); + return writer; + }; + + /** + * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BulkMuteFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.muteState = reader.int32(); + 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.v2.BulkMuteFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.muteState != null && message.hasOwnProperty("muteState")) + switch (message.muteState) { + default: + return "muteState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a BulkMuteFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsRequest} BulkMuteFindingsRequest + */ + BulkMuteFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + switch (object.muteState) { + default: + if (typeof object.muteState === "number") { + message.muteState = object.muteState; + break; + } + break; + case "MUTE_STATE_UNSPECIFIED": + case 0: + message.muteState = 0; + break; + case "MUTED": + case 1: + message.muteState = 1; + break; + case "UNDEFINED": + case 2: + message.muteState = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a BulkMuteFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.muteState = options.enums === String ? "MUTE_STATE_UNSPECIFIED" : 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.muteState != null && message.hasOwnProperty("muteState")) + object.muteState = options.enums === String ? $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState[message.muteState] === undefined ? message.muteState : $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState[message.muteState] : message.muteState; + return object; + }; + + /** + * Converts this BulkMuteFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + BulkMuteFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BulkMuteFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsRequest"; + }; + + /** + * MuteState enum. + * @name google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState + * @enum {number} + * @property {number} MUTE_STATE_UNSPECIFIED=0 MUTE_STATE_UNSPECIFIED value + * @property {number} MUTED=1 MUTED value + * @property {number} UNDEFINED=2 UNDEFINED value + */ + BulkMuteFindingsRequest.MuteState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MUTED"] = 1; + values[valuesById[2] = "UNDEFINED"] = 2; + return values; + })(); + + return BulkMuteFindingsRequest; + })(); + + v2.BulkMuteFindingsResponse = (function() { + + /** + * Properties of a BulkMuteFindingsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IBulkMuteFindingsResponse + */ + + /** + * Constructs a new BulkMuteFindingsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a BulkMuteFindingsResponse. + * @implements IBulkMuteFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsResponse} BulkMuteFindingsResponse instance + */ + BulkMuteFindingsResponse.create = function create(properties) { + return new BulkMuteFindingsResponse(properties); + }; + + /** + * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.BulkMuteFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsResponse} message BulkMuteFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsResponse} BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BulkMuteFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsResponse} BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkMuteFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkMuteFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsResponse} BulkMuteFindingsResponse + */ + BulkMuteFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.BulkMuteFindingsResponse) + return object; + return new $root.google.cloud.securitycenter.v2.BulkMuteFindingsResponse(); + }; + + /** + * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.BulkMuteFindingsResponse} message BulkMuteFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkMuteFindingsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BulkMuteFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + BulkMuteFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BulkMuteFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsResponse"; + }; + + return BulkMuteFindingsResponse; + })(); + + v2.CreateBigQueryExportRequest = (function() { + + /** + * Properties of a CreateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface ICreateBigQueryExportRequest + * @property {string|null} [parent] CreateBigQueryExportRequest parent + * @property {google.cloud.securitycenter.v2.IBigQueryExport|null} [bigQueryExport] CreateBigQueryExportRequest bigQueryExport + * @property {string|null} [bigQueryExportId] CreateBigQueryExportRequest bigQueryExportId + */ + + /** + * Constructs a new CreateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CreateBigQueryExportRequest. + * @implements ICreateBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest=} [properties] Properties to set + */ + function CreateBigQueryExportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBigQueryExportRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.parent = ""; + + /** + * CreateBigQueryExportRequest bigQueryExport. + * @member {google.cloud.securitycenter.v2.IBigQueryExport|null|undefined} bigQueryExport + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.bigQueryExport = null; + + /** + * CreateBigQueryExportRequest bigQueryExportId. + * @member {string} bigQueryExportId + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.bigQueryExportId = ""; + + /** + * Creates a new CreateBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CreateBigQueryExportRequest} CreateBigQueryExportRequest instance + */ + CreateBigQueryExportRequest.create = function create(properties) { + return new CreateBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest} message CreateBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBigQueryExportRequest.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.bigQueryExport != null && Object.hasOwnProperty.call(message, "bigQueryExport")) + $root.google.cloud.securitycenter.v2.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 CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest} message CreateBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.CreateBigQueryExportRequest} CreateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBigQueryExportRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateBigQueryExportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.bigQueryExport = $root.google.cloud.securitycenter.v2.BigQueryExport.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigQueryExportId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.CreateBigQueryExportRequest} CreateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBigQueryExportRequest.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.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) { + var error = $root.google.cloud.securitycenter.v2.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 CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CreateBigQueryExportRequest} CreateBigQueryExportRequest + */ + CreateBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CreateBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.CreateBigQueryExportRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.bigQueryExport != null) { + if (typeof object.bigQueryExport !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CreateBigQueryExportRequest.bigQueryExport: object expected"); + message.bigQueryExport = $root.google.cloud.securitycenter.v2.BigQueryExport.fromObject(object.bigQueryExport); + } + if (object.bigQueryExportId != null) + message.bigQueryExportId = String(object.bigQueryExportId); + return message; + }; + + /** + * Creates a plain object from a CreateBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.CreateBigQueryExportRequest} message CreateBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBigQueryExportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.bigQueryExport = null; + object.bigQueryExportId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) + object.bigQueryExport = $root.google.cloud.securitycenter.v2.BigQueryExport.toObject(message.bigQueryExport, options); + if (message.bigQueryExportId != null && message.hasOwnProperty("bigQueryExportId")) + object.bigQueryExportId = message.bigQueryExportId; + return object; + }; + + /** + * Converts this CreateBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.CreateBigQueryExportRequest"; + }; + + return CreateBigQueryExportRequest; + })(); + + v2.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v2.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v2.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v2.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v2.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && 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.v2.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.v2.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.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.v2.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v2.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.v2.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.CreateFindingRequest"; + }; + + return CreateFindingRequest; + })(); + + v2.CreateMuteConfigRequest = (function() { + + /** + * Properties of a CreateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface ICreateMuteConfigRequest + * @property {string|null} [parent] CreateMuteConfigRequest parent + * @property {google.cloud.securitycenter.v2.IMuteConfig|null} [muteConfig] CreateMuteConfigRequest muteConfig + * @property {string|null} [muteConfigId] CreateMuteConfigRequest muteConfigId + */ + + /** + * Constructs a new CreateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CreateMuteConfigRequest. + * @implements ICreateMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest=} [properties] Properties to set + */ + 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]]; + } + + /** + * CreateMuteConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.parent = ""; + + /** + * CreateMuteConfigRequest muteConfig. + * @member {google.cloud.securitycenter.v2.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.muteConfig = null; + + /** + * CreateMuteConfigRequest muteConfigId. + * @member {string} muteConfigId + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.muteConfigId = ""; + + /** + * Creates a new CreateMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CreateMuteConfigRequest} CreateMuteConfigRequest instance + */ + CreateMuteConfigRequest.create = function create(properties) { + return new CreateMuteConfigRequest(properties); + }; + + /** + * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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; + }; + + /** + * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest} message CreateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.muteConfig = $root.google.cloud.securitycenter.v2.MuteConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.muteConfigId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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()); + }; + + /** + * Verifies a CreateMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + 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.v2.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; + }; + + /** + * Creates a CreateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CreateMuteConfigRequest} CreateMuteConfigRequest + */ + CreateMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CreateMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.CreateMuteConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.muteConfig != null) { + if (typeof object.muteConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CreateMuteConfigRequest.muteConfig: object expected"); + message.muteConfig = $root.google.cloud.securitycenter.v2.MuteConfig.fromObject(object.muteConfig); + } + if (object.muteConfigId != null) + message.muteConfigId = String(object.muteConfigId); + return message; + }; + + /** + * Creates a plain object from a CreateMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.MuteConfig.toObject(message.muteConfig, options); + if (message.muteConfigId != null && message.hasOwnProperty("muteConfigId")) + object.muteConfigId = message.muteConfigId; + return object; + }; + + /** + * Converts this CreateMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.CreateMuteConfigRequest"; + }; + + return CreateMuteConfigRequest; + })(); + + v2.CreateNotificationConfigRequest = (function() { + + /** + * Properties of a CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface ICreateNotificationConfigRequest + * @property {string|null} [parent] CreateNotificationConfigRequest parent + * @property {string|null} [configId] CreateNotificationConfigRequest configId + * @property {google.cloud.securitycenter.v2.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig + */ + + /** + * Constructs a new CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CreateNotificationConfigRequest. + * @implements ICreateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.parent = ""; + + /** + * CreateNotificationConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.configId = ""; + + /** + * CreateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v2.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance + */ + CreateNotificationConfigRequest.create = function create(properties) { + return new CreateNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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(); + }; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.NotificationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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()); + }; + + /** + * Verifies a CreateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + return null; + }; + + /** + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CreateNotificationConfigRequest} CreateNotificationConfigRequest + */ + CreateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CreateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest"; + }; + + return CreateNotificationConfigRequest; + })(); + + v2.CreateResourceValueConfigRequest = (function() { + + /** + * Properties of a CreateResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface ICreateResourceValueConfigRequest + * @property {string|null} [parent] CreateResourceValueConfigRequest parent + * @property {google.cloud.securitycenter.v2.IResourceValueConfig|null} [resourceValueConfig] CreateResourceValueConfigRequest resourceValueConfig + */ + + /** + * Constructs a new CreateResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CreateResourceValueConfigRequest. + * @implements ICreateResourceValueConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest=} [properties] Properties to set + */ + function CreateResourceValueConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateResourceValueConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @instance + */ + CreateResourceValueConfigRequest.prototype.parent = ""; + + /** + * CreateResourceValueConfigRequest resourceValueConfig. + * @member {google.cloud.securitycenter.v2.IResourceValueConfig|null|undefined} resourceValueConfig + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @instance + */ + CreateResourceValueConfigRequest.prototype.resourceValueConfig = null; + + /** + * Creates a new CreateResourceValueConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest instance + */ + CreateResourceValueConfigRequest.create = function create(properties) { + return new CreateResourceValueConfigRequest(properties); + }; + + /** + * Encodes the specified CreateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest} message CreateResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateResourceValueConfigRequest.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.resourceValueConfig != null && Object.hasOwnProperty.call(message, "resourceValueConfig")) + $root.google.cloud.securitycenter.v2.ResourceValueConfig.encode(message.resourceValueConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest} message CreateResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateResourceValueConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateResourceValueConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateResourceValueConfigRequest.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.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) { + var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.verify(message.resourceValueConfig); + if (error) + return "resourceValueConfig." + error; + } + return null; + }; + + /** + * Creates a CreateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest + */ + CreateResourceValueConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceValueConfig != null) { + if (typeof object.resourceValueConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.resourceValueConfig: object expected"); + message.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.fromObject(object.resourceValueConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateResourceValueConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} message CreateResourceValueConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateResourceValueConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceValueConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) + object.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.toObject(message.resourceValueConfig, options); + return object; + }; + + /** + * Converts this CreateResourceValueConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateResourceValueConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateResourceValueConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.CreateResourceValueConfigRequest"; + }; + + return CreateResourceValueConfigRequest; + })(); + + v2.CreateSourceRequest = (function() { + + /** + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v2.ISource|null} [source] CreateSourceRequest source + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v2.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v2.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && 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.v2.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.v2.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.source = $root.google.cloud.securitycenter.v2.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.v2.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.CreateSourceRequest} CreateSourceRequest + */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v2.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v2.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.v2.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Source.toObject(message.source, options); + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.CreateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.CreateSourceRequest"; + }; + + return CreateSourceRequest; + })(); + + v2.DeleteBigQueryExportRequest = (function() { + + /** + * Properties of a DeleteBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IDeleteBigQueryExportRequest + * @property {string|null} [name] DeleteBigQueryExportRequest name + */ + + /** + * Constructs a new DeleteBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a DeleteBigQueryExportRequest. + * @implements IDeleteBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest + * @instance + */ + DeleteBigQueryExportRequest.prototype.name = ""; + + /** + * Creates a new DeleteBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest instance + */ + DeleteBigQueryExportRequest.create = function create(properties) { + return new DeleteBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified DeleteBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.DeleteBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.DeleteBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest + */ + DeleteBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest"; + }; + + return DeleteBigQueryExportRequest; + })(); + + v2.DeleteMuteConfigRequest = (function() { + + /** + * Properties of a DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IDeleteMuteConfigRequest + * @property {string|null} [name] DeleteMuteConfigRequest name + */ + + /** + * Constructs a new DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a DeleteMuteConfigRequest. + * @implements IDeleteMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest=} [properties] Properties to set + */ + 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]]; + } + + /** + * DeleteMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest + * @instance + */ + DeleteMuteConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.DeleteMuteConfigRequest} DeleteMuteConfigRequest instance + */ + DeleteMuteConfigRequest.create = function create(properties) { + return new DeleteMuteConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest} message DeleteMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + 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; + }; + + /** + * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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(); + }; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DeleteMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.DeleteMuteConfigRequest} DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.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; + }; + + /** + * Creates a DeleteMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.DeleteMuteConfigRequest} DeleteMuteConfigRequest + */ + DeleteMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.DeleteMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.DeleteMuteConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.DeleteMuteConfigRequest} message DeleteMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + 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; + }; + + /** + * Converts this DeleteMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.DeleteMuteConfigRequest"; + }; + + return DeleteMuteConfigRequest; + })(); + + v2.DeleteNotificationConfigRequest = (function() { + + /** + * Properties of a DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name + */ + + /** + * Constructs a new DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a DeleteNotificationConfigRequest. + * @implements IDeleteNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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]]; + } + + /** + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest + * @instance + */ + DeleteNotificationConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance + */ + DeleteNotificationConfigRequest.create = function create(properties) { + return new DeleteNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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(); + }; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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()); + }; + + /** + * Verifies a DeleteNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.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; + }; + + /** + * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + */ + DeleteNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest(); + 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. + * @function toObject + * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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; + }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.DeleteNotificationConfigRequest"; + }; + + return DeleteNotificationConfigRequest; + })(); + + v2.DeleteResourceValueConfigRequest = (function() { + + /** + * Properties of a DeleteResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IDeleteResourceValueConfigRequest + * @property {string|null} [name] DeleteResourceValueConfigRequest name + */ + + /** + * Constructs a new DeleteResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a DeleteResourceValueConfigRequest. + * @implements IDeleteResourceValueConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest=} [properties] Properties to set + */ + function DeleteResourceValueConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteResourceValueConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @instance + */ + DeleteResourceValueConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteResourceValueConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest instance + */ + DeleteResourceValueConfigRequest.create = function create(properties) { + return new DeleteResourceValueConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourceValueConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteResourceValueConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest + */ + DeleteResourceValueConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteResourceValueConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteResourceValueConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteResourceValueConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest"; + }; + + return DeleteResourceValueConfigRequest; + })(); + + v2.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.securitycenter.v2 + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.securitycenter.v2.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {google.cloud.securitycenter.v2.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {google.cloud.securitycenter.v2.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {google.cloud.securitycenter.v2.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.BigQueryDestination) + return object; + var message = new $root.google.cloud.securitycenter.v2.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {google.cloud.securitycenter.v2.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataset = ""; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.BigQueryDestination"; + }; + + return BigQueryDestination; + })(); + + v2.ExportFindingsMetadata = (function() { + + /** + * Properties of an ExportFindingsMetadata. + * @memberof google.cloud.securitycenter.v2 + * @interface IExportFindingsMetadata + * @property {google.protobuf.ITimestamp|null} [exportStartTime] ExportFindingsMetadata exportStartTime + * @property {google.cloud.securitycenter.v2.IBigQueryDestination|null} [bigQueryDestination] ExportFindingsMetadata bigQueryDestination + */ + + /** + * Constructs a new ExportFindingsMetadata. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an ExportFindingsMetadata. + * @implements IExportFindingsMetadata + * @constructor + * @param {google.cloud.securitycenter.v2.IExportFindingsMetadata=} [properties] Properties to set + */ + function ExportFindingsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportFindingsMetadata exportStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} exportStartTime + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @instance + */ + ExportFindingsMetadata.prototype.exportStartTime = null; + + /** + * ExportFindingsMetadata bigQueryDestination. + * @member {google.cloud.securitycenter.v2.IBigQueryDestination|null|undefined} bigQueryDestination + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @instance + */ + ExportFindingsMetadata.prototype.bigQueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportFindingsMetadata destination. + * @member {"bigQueryDestination"|undefined} destination + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @instance + */ + Object.defineProperty(ExportFindingsMetadata.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["bigQueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportFindingsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {google.cloud.securitycenter.v2.IExportFindingsMetadata=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ExportFindingsMetadata} ExportFindingsMetadata instance + */ + ExportFindingsMetadata.create = function create(properties) { + return new ExportFindingsMetadata(properties); + }; + + /** + * Encodes the specified ExportFindingsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {google.cloud.securitycenter.v2.IExportFindingsMetadata} message ExportFindingsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFindingsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exportStartTime != null && Object.hasOwnProperty.call(message, "exportStartTime")) + $root.google.protobuf.Timestamp.encode(message.exportStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigQueryDestination != null && Object.hasOwnProperty.call(message, "bigQueryDestination")) + $root.google.cloud.securitycenter.v2.BigQueryDestination.encode(message.bigQueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportFindingsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {google.cloud.securitycenter.v2.IExportFindingsMetadata} message ExportFindingsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFindingsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportFindingsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ExportFindingsMetadata} ExportFindingsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFindingsMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExportFindingsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.exportStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigQueryDestination = $root.google.cloud.securitycenter.v2.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportFindingsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ExportFindingsMetadata} ExportFindingsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFindingsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportFindingsMetadata message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportFindingsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exportStartTime != null && message.hasOwnProperty("exportStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.exportStartTime); + if (error) + return "exportStartTime." + error; + } + if (message.bigQueryDestination != null && message.hasOwnProperty("bigQueryDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.securitycenter.v2.BigQueryDestination.verify(message.bigQueryDestination); + if (error) + return "bigQueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an ExportFindingsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ExportFindingsMetadata} ExportFindingsMetadata + */ + ExportFindingsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ExportFindingsMetadata) + return object; + var message = new $root.google.cloud.securitycenter.v2.ExportFindingsMetadata(); + if (object.exportStartTime != null) { + if (typeof object.exportStartTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ExportFindingsMetadata.exportStartTime: object expected"); + message.exportStartTime = $root.google.protobuf.Timestamp.fromObject(object.exportStartTime); + } + if (object.bigQueryDestination != null) { + if (typeof object.bigQueryDestination !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ExportFindingsMetadata.bigQueryDestination: object expected"); + message.bigQueryDestination = $root.google.cloud.securitycenter.v2.BigQueryDestination.fromObject(object.bigQueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an ExportFindingsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {google.cloud.securitycenter.v2.ExportFindingsMetadata} message ExportFindingsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportFindingsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.exportStartTime = null; + if (message.exportStartTime != null && message.hasOwnProperty("exportStartTime")) + object.exportStartTime = $root.google.protobuf.Timestamp.toObject(message.exportStartTime, options); + if (message.bigQueryDestination != null && message.hasOwnProperty("bigQueryDestination")) { + object.bigQueryDestination = $root.google.cloud.securitycenter.v2.BigQueryDestination.toObject(message.bigQueryDestination, options); + if (options.oneofs) + object.destination = "bigQueryDestination"; + } + return object; + }; + + /** + * Converts this ExportFindingsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportFindingsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportFindingsMetadata + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportFindingsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ExportFindingsMetadata"; + }; + + return ExportFindingsMetadata; + })(); + + v2.ExportFindingsResponse = (function() { + + /** + * Properties of an ExportFindingsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IExportFindingsResponse + */ + + /** + * Constructs a new ExportFindingsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an ExportFindingsResponse. + * @implements IExportFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.IExportFindingsResponse=} [properties] Properties to set + */ + function ExportFindingsResponse(properties) { + if (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 ExportFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.IExportFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ExportFindingsResponse} ExportFindingsResponse instance + */ + ExportFindingsResponse.create = function create(properties) { + return new ExportFindingsResponse(properties); + }; + + /** + * Encodes the specified ExportFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.IExportFindingsResponse} message ExportFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.IExportFindingsResponse} message ExportFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ExportFindingsResponse} ExportFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFindingsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExportFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ExportFindingsResponse} ExportFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ExportFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ExportFindingsResponse} ExportFindingsResponse + */ + ExportFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ExportFindingsResponse) + return object; + return new $root.google.cloud.securitycenter.v2.ExportFindingsResponse(); + }; + + /** + * Creates a plain object from an ExportFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.ExportFindingsResponse} message ExportFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportFindingsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ExportFindingsResponse"; + }; + + return ExportFindingsResponse; + })(); + + v2.GetBigQueryExportRequest = (function() { + + /** + * Properties of a GetBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IGetBigQueryExportRequest + * @property {string|null} [name] GetBigQueryExportRequest name + */ + + /** + * Constructs a new GetBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GetBigQueryExportRequest. + * @implements IGetBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest + * @instance + */ + GetBigQueryExportRequest.prototype.name = ""; + + /** + * Creates a new GetBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GetBigQueryExportRequest} GetBigQueryExportRequest instance + */ + GetBigQueryExportRequest.create = function create(properties) { + return new GetBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified GetBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetBigQueryExportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.GetBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.GetBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GetBigQueryExportRequest} GetBigQueryExportRequest + */ + GetBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GetBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + GetBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest"; + }; + + return GetBigQueryExportRequest; + })(); + + v2.GetMuteConfigRequest = (function() { + + /** + * Properties of a GetMuteConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IGetMuteConfigRequest + * @property {string|null} [name] GetMuteConfigRequest name + */ + + /** + * Constructs a new GetMuteConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GetMuteConfigRequest. + * @implements IGetMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest=} [properties] Properties to set + */ + function GetMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @instance + */ + GetMuteConfigRequest.prototype.name = ""; + + /** + * Creates a new GetMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GetMuteConfigRequest} GetMuteConfigRequest instance + */ + GetMuteConfigRequest.create = function create(properties) { + return new GetMuteConfigRequest(properties); + }; + + /** + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMuteConfigRequest.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 GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.GetMuteConfigRequest} GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMuteConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.GetMuteConfigRequest} GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMuteConfigRequest.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 GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GetMuteConfigRequest} GetMuteConfigRequest + */ + GetMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GetMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.GetMuteConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.GetMuteConfigRequest} message GetMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMuteConfigRequest.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 GetMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.GetMuteConfigRequest"; + }; + + return GetMuteConfigRequest; + })(); + + v2.GetNotificationConfigRequest = (function() { + + /** + * Properties of a GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name + */ + + /** + * Constructs a new GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GetNotificationConfigRequest. + * @implements IGetNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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]]; + } + + /** + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest + * @instance + */ + GetNotificationConfigRequest.prototype.name = ""; + + /** + * Creates a new GetNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GetNotificationConfigRequest} GetNotificationConfigRequest instance + */ + GetNotificationConfigRequest.create = function create(properties) { + return new GetNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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(); + }; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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()); + }; + + /** + * Verifies a GetNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.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; + }; + + /** + * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GetNotificationConfigRequest} GetNotificationConfigRequest + */ + GetNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GetNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.GetNotificationConfigRequest(); + 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. + * @function toObject + * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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; + }; + + /** + * Converts this GetNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.GetNotificationConfigRequest"; + }; + + return GetNotificationConfigRequest; + })(); + + v2.GetResourceValueConfigRequest = (function() { + + /** + * Properties of a GetResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IGetResourceValueConfigRequest + * @property {string|null} [name] GetResourceValueConfigRequest name + */ + + /** + * Constructs a new GetResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GetResourceValueConfigRequest. + * @implements IGetResourceValueConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest=} [properties] Properties to set + */ + function GetResourceValueConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetResourceValueConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @instance + */ + GetResourceValueConfigRequest.prototype.name = ""; + + /** + * Creates a new GetResourceValueConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} GetResourceValueConfigRequest instance + */ + GetResourceValueConfigRequest.create = function create(properties) { + return new GetResourceValueConfigRequest(properties); + }; + + /** + * Encodes the specified GetResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetResourceValueConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest} message GetResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourceValueConfigRequest.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 GetResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetResourceValueConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest} message GetResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} GetResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourceValueConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetResourceValueConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} GetResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetResourceValueConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetResourceValueConfigRequest.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 GetResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} GetResourceValueConfigRequest + */ + GetResourceValueConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GetResourceValueConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.GetResourceValueConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetResourceValueConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} message GetResourceValueConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetResourceValueConfigRequest.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 GetResourceValueConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetResourceValueConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetResourceValueConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.GetResourceValueConfigRequest"; + }; + + return GetResourceValueConfigRequest; + })(); + + v2.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GetSourceRequest} GetSourceRequest instance + */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "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.v2.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GetSourceRequest} GetSourceRequest + */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GetSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.GetSourceRequest"; + }; + + return GetSourceRequest; + })(); + + v2.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; + + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; + + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GroupFindingsRequest} GroupFindingsRequest instance + */ + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); + }; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && 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.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 GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 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.v2.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.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.v2.GroupFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GroupFindingsRequest} GroupFindingsRequest + */ + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GroupFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.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.v2.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.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.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.v2.GroupFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.GroupFindingsRequest"; + }; + + return GroupFindingsRequest; + })(); + + v2.GroupFindingsResponse = (function() { + + /** + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize + */ + + /** + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * GroupFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GroupFindingsResponse} GroupFindingsResponse instance + */ + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); + }; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).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 GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v2.GroupResult.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.v2.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + 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.v2.GroupFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GroupFindingsResponse} GroupFindingsResponse + */ + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GroupFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v2.GroupResult.fromObject(object.groupByResults[i]); + } + } + 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.v2.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.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.v2.GroupResult.toObject(message.groupByResults[j], 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.v2.GroupFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.GroupFindingsResponse"; + }; + + return GroupFindingsResponse; + })(); + + v2.GroupResult = (function() { + + /** + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v2 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count + */ + + /** + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GroupResult. + * @implements IGroupResult + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.GroupResult + * @instance + */ + GroupResult.prototype.properties = $util.emptyObject; + + /** + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v2.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.v2.GroupResult + * @static + * @param {google.cloud.securitycenter.v2.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GroupResult} GroupResult instance + */ + GroupResult.create = function create(properties) { + return new GroupResult(properties); + }; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GroupResult + * @static + * @param {google.cloud.securitycenter.v2.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 && 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 GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GroupResult + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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; + 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.v2.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.GroupResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GroupResult} GroupResult + */ + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GroupResult) + return object; + var message = new $root.google.cloud.securitycenter.v2.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.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.v2.GroupResult + * @static + * @param {google.cloud.securitycenter.v2.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.v2.GroupResult + * @instance + * @returns {Object.} JSON object + */ + GroupResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.GroupResult"; + }; + + return GroupResult; + })(); + + v2.ListAttackPathsRequest = (function() { + + /** + * Properties of a ListAttackPathsRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IListAttackPathsRequest + * @property {string|null} [parent] ListAttackPathsRequest parent + * @property {string|null} [filter] ListAttackPathsRequest filter + * @property {string|null} [pageToken] ListAttackPathsRequest pageToken + * @property {number|null} [pageSize] ListAttackPathsRequest pageSize + */ + + /** + * Constructs a new ListAttackPathsRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListAttackPathsRequest. + * @implements IListAttackPathsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest=} [properties] Properties to set + */ + function ListAttackPathsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttackPathsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @instance + */ + ListAttackPathsRequest.prototype.parent = ""; + + /** + * ListAttackPathsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @instance + */ + ListAttackPathsRequest.prototype.filter = ""; + + /** + * ListAttackPathsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @instance + */ + ListAttackPathsRequest.prototype.pageToken = ""; + + /** + * ListAttackPathsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @instance + */ + ListAttackPathsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAttackPathsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListAttackPathsRequest} ListAttackPathsRequest instance + */ + ListAttackPathsRequest.create = function create(properties) { + return new ListAttackPathsRequest(properties); + }; + + /** + * Encodes the specified ListAttackPathsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest} message ListAttackPathsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttackPathsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAttackPathsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest} message ListAttackPathsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttackPathsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttackPathsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ListAttackPathsRequest} ListAttackPathsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttackPathsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListAttackPathsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttackPathsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListAttackPathsRequest} ListAttackPathsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttackPathsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttackPathsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttackPathsRequest.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.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 ListAttackPathsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListAttackPathsRequest} ListAttackPathsRequest + */ + ListAttackPathsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListAttackPathsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListAttackPathsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + 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 ListAttackPathsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {google.cloud.securitycenter.v2.ListAttackPathsRequest} message ListAttackPathsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttackPathsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + 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.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListAttackPathsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAttackPathsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttackPathsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttackPathsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListAttackPathsRequest"; + }; + + return ListAttackPathsRequest; + })(); + + v2.ListAttackPathsResponse = (function() { + + /** + * Properties of a ListAttackPathsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IListAttackPathsResponse + * @property {Array.|null} [attackPaths] ListAttackPathsResponse attackPaths + * @property {string|null} [nextPageToken] ListAttackPathsResponse nextPageToken + */ + + /** + * Constructs a new ListAttackPathsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListAttackPathsResponse. + * @implements IListAttackPathsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.IListAttackPathsResponse=} [properties] Properties to set + */ + function ListAttackPathsResponse(properties) { + this.attackPaths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttackPathsResponse attackPaths. + * @member {Array.} attackPaths + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @instance + */ + ListAttackPathsResponse.prototype.attackPaths = $util.emptyArray; + + /** + * ListAttackPathsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @instance + */ + ListAttackPathsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAttackPathsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListAttackPathsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListAttackPathsResponse} ListAttackPathsResponse instance + */ + ListAttackPathsResponse.create = function create(properties) { + return new ListAttackPathsResponse(properties); + }; + + /** + * Encodes the specified ListAttackPathsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListAttackPathsResponse} message ListAttackPathsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttackPathsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attackPaths != null && message.attackPaths.length) + for (var i = 0; i < message.attackPaths.length; ++i) + $root.google.cloud.securitycenter.v2.AttackPath.encode(message.attackPaths[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 ListAttackPathsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListAttackPathsResponse} message ListAttackPathsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttackPathsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttackPathsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ListAttackPathsResponse} ListAttackPathsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttackPathsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListAttackPathsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.attackPaths && message.attackPaths.length)) + message.attackPaths = []; + message.attackPaths.push($root.google.cloud.securitycenter.v2.AttackPath.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttackPathsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListAttackPathsResponse} ListAttackPathsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttackPathsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttackPathsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttackPathsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attackPaths != null && message.hasOwnProperty("attackPaths")) { + if (!Array.isArray(message.attackPaths)) + return "attackPaths: array expected"; + for (var i = 0; i < message.attackPaths.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.AttackPath.verify(message.attackPaths[i]); + if (error) + return "attackPaths." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttackPathsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListAttackPathsResponse} ListAttackPathsResponse + */ + ListAttackPathsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListAttackPathsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListAttackPathsResponse(); + if (object.attackPaths) { + if (!Array.isArray(object.attackPaths)) + throw TypeError(".google.cloud.securitycenter.v2.ListAttackPathsResponse.attackPaths: array expected"); + message.attackPaths = []; + for (var i = 0; i < object.attackPaths.length; ++i) { + if (typeof object.attackPaths[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListAttackPathsResponse.attackPaths: object expected"); + message.attackPaths[i] = $root.google.cloud.securitycenter.v2.AttackPath.fromObject(object.attackPaths[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttackPathsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {google.cloud.securitycenter.v2.ListAttackPathsResponse} message ListAttackPathsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttackPathsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attackPaths = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.attackPaths && message.attackPaths.length) { + object.attackPaths = []; + for (var j = 0; j < message.attackPaths.length; ++j) + object.attackPaths[j] = $root.google.cloud.securitycenter.v2.AttackPath.toObject(message.attackPaths[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAttackPathsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAttackPathsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttackPathsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttackPathsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListAttackPathsResponse"; + }; + + return ListAttackPathsResponse; + })(); + + v2.GetSimulationRequest = (function() { + + /** + * Properties of a GetSimulationRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IGetSimulationRequest + * @property {string|null} [name] GetSimulationRequest name + */ + + /** + * Constructs a new GetSimulationRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GetSimulationRequest. + * @implements IGetSimulationRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IGetSimulationRequest=} [properties] Properties to set + */ + function GetSimulationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSimulationRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @instance + */ + GetSimulationRequest.prototype.name = ""; + + /** + * Creates a new GetSimulationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetSimulationRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GetSimulationRequest} GetSimulationRequest instance + */ + GetSimulationRequest.create = function create(properties) { + return new GetSimulationRequest(properties); + }; + + /** + * Encodes the specified GetSimulationRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetSimulationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetSimulationRequest} message GetSimulationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSimulationRequest.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 GetSimulationRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetSimulationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetSimulationRequest} message GetSimulationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSimulationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSimulationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.GetSimulationRequest} GetSimulationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSimulationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetSimulationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSimulationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.GetSimulationRequest} GetSimulationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSimulationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSimulationRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSimulationRequest.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 GetSimulationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GetSimulationRequest} GetSimulationRequest + */ + GetSimulationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GetSimulationRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.GetSimulationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSimulationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {google.cloud.securitycenter.v2.GetSimulationRequest} message GetSimulationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSimulationRequest.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 GetSimulationRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @instance + * @returns {Object.} JSON object + */ + GetSimulationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSimulationRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.GetSimulationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSimulationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.GetSimulationRequest"; + }; + + return GetSimulationRequest; + })(); + + v2.GetValuedResourceRequest = (function() { + + /** + * Properties of a GetValuedResourceRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IGetValuedResourceRequest + * @property {string|null} [name] GetValuedResourceRequest name + */ + + /** + * Constructs a new GetValuedResourceRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GetValuedResourceRequest. + * @implements IGetValuedResourceRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest=} [properties] Properties to set + */ + function GetValuedResourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetValuedResourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @instance + */ + GetValuedResourceRequest.prototype.name = ""; + + /** + * Creates a new GetValuedResourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GetValuedResourceRequest} GetValuedResourceRequest instance + */ + GetValuedResourceRequest.create = function create(properties) { + return new GetValuedResourceRequest(properties); + }; + + /** + * Encodes the specified GetValuedResourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetValuedResourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest} message GetValuedResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValuedResourceRequest.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 GetValuedResourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetValuedResourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest} message GetValuedResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValuedResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetValuedResourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.GetValuedResourceRequest} GetValuedResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValuedResourceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetValuedResourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetValuedResourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.GetValuedResourceRequest} GetValuedResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValuedResourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetValuedResourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetValuedResourceRequest.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 GetValuedResourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GetValuedResourceRequest} GetValuedResourceRequest + */ + GetValuedResourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GetValuedResourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.GetValuedResourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetValuedResourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {google.cloud.securitycenter.v2.GetValuedResourceRequest} message GetValuedResourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetValuedResourceRequest.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 GetValuedResourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetValuedResourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetValuedResourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetValuedResourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.GetValuedResourceRequest"; + }; + + return GetValuedResourceRequest; + })(); + + v2.ListBigQueryExportsRequest = (function() { + + /** + * Properties of a ListBigQueryExportsRequest. + * @memberof google.cloud.securitycenter.v2 + * @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.v2 + * @classdesc Represents a ListBigQueryExportsRequest. + * @implements IListBigQueryExportsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.parent = ""; + + /** + * ListBigQueryExportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.pageSize = 0; + + /** + * ListBigQueryExportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBigQueryExportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListBigQueryExportsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListBigQueryExportsRequest} ListBigQueryExportsRequest instance + */ + ListBigQueryExportsRequest.create = function create(properties) { + return new ListBigQueryExportsRequest(properties); + }; + + /** + * Encodes the specified ListBigQueryExportsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListBigQueryExportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListBigQueryExportsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.ListBigQueryExportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.ListBigQueryExportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListBigQueryExportsRequest} ListBigQueryExportsRequest + */ + ListBigQueryExportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListBigQueryExportsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBigQueryExportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBigQueryExportsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest"; + }; + + return ListBigQueryExportsRequest; + })(); + + v2.ListBigQueryExportsResponse = (function() { + + /** + * Properties of a ListBigQueryExportsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IListBigQueryExportsResponse + * @property {Array.|null} [bigQueryExports] ListBigQueryExportsResponse bigQueryExports + * @property {string|null} [nextPageToken] ListBigQueryExportsResponse nextPageToken + */ + + /** + * Constructs a new ListBigQueryExportsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListBigQueryExportsResponse. + * @implements IListBigQueryExportsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse + * @instance + */ + ListBigQueryExportsResponse.prototype.bigQueryExports = $util.emptyArray; + + /** + * ListBigQueryExportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsResponse + * @instance + */ + ListBigQueryExportsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBigQueryExportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListBigQueryExportsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListBigQueryExportsResponse} ListBigQueryExportsResponse instance + */ + ListBigQueryExportsResponse.create = function create(properties) { + return new ListBigQueryExportsResponse(properties); + }; + + /** + * Encodes the specified ListBigQueryExportsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListBigQueryExportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.ListBigQueryExportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListBigQueryExportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bigQueryExports && message.bigQueryExports.length)) + message.bigQueryExports = []; + message.bigQueryExports.push($root.google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.ListBigQueryExportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListBigQueryExportsResponse} ListBigQueryExportsResponse + */ + ListBigQueryExportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListBigQueryExportsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListBigQueryExportsResponse(); + if (object.bigQueryExports) { + if (!Array.isArray(object.bigQueryExports)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse.bigQueryExports: object expected"); + message.bigQueryExports[i] = $root.google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.ListBigQueryExportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBigQueryExportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBigQueryExportsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse"; + }; + + return ListBigQueryExportsResponse; + })(); + + v2.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @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.v2 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v2.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v2.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; + + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v2.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + 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")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v2.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 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.v2.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.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.v2.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v2.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.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.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.v2.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListFindingsRequest"; + }; + + return ListFindingsRequest; + })(); + + v2.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IListFindingsResponse + * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).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 ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.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.v2.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); + if (error) + return "listFindingsResults." + 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.v2.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse(); + if (object.listFindingsResults) { + if (!Array.isArray(object.listFindingsResults)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.listFindingsResults: object expected"); + message.listFindingsResults[i] = $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); + } + } + 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.v2.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v2.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.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.v2.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], 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.v2.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListFindingsResponse"; + }; + + ListFindingsResponse.ListFindingsResult = (function() { + + /** + * Properties of a ListFindingsResult. + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse + * @interface IListFindingsResult + * @property {google.cloud.securitycenter.v2.IFinding|null} [finding] ListFindingsResult finding + * @property {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource|null} [resource] ListFindingsResult resource + */ + + /** + * Constructs a new ListFindingsResult. + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse + * @classdesc Represents a ListFindingsResult. + * @implements IListFindingsResult + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.finding = null; + + /** + * ListFindingsResult resource. + * @member {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.resource = null; + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v2.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.finding = $root.google.cloud.securitycenter.v2.Finding.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult} ListFindingsResult + */ + ListFindingsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v2.Finding.fromObject(object.finding); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v2.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.resource = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v2.Finding.toObject(message.finding, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this ListFindingsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult"; + }; + + ListFindingsResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [displayName] Resource displayName + * @property {string|null} [type] Resource type + * @property {google.cloud.securitycenter.v2.CloudProvider|null} [cloudProvider] Resource cloudProvider + * @property {string|null} [service] Resource service + * @property {string|null} [location] Resource location + * @property {google.cloud.securitycenter.v2.IGcpMetadata|null} [gcpMetadata] Resource gcpMetadata + * @property {google.cloud.securitycenter.v2.IAwsMetadata|null} [awsMetadata] Resource awsMetadata + * @property {google.cloud.securitycenter.v2.IAzureMetadata|null} [azureMetadata] Resource azureMetadata + * @property {google.cloud.securitycenter.v2.IResourcePath|null} [resourcePath] Resource resourcePath + * @property {string|null} [resourcePathString] Resource resourcePathString + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.displayName = ""; + + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.type = ""; + + /** + * Resource cloudProvider. + * @member {google.cloud.securitycenter.v2.CloudProvider} cloudProvider + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.cloudProvider = 0; + + /** + * Resource service. + * @member {string} service + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.service = ""; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Resource gcpMetadata. + * @member {google.cloud.securitycenter.v2.IGcpMetadata|null|undefined} gcpMetadata + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.gcpMetadata = null; + + /** + * Resource awsMetadata. + * @member {google.cloud.securitycenter.v2.IAwsMetadata|null|undefined} awsMetadata + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.awsMetadata = null; + + /** + * Resource azureMetadata. + * @member {google.cloud.securitycenter.v2.IAzureMetadata|null|undefined} azureMetadata + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.azureMetadata = null; + + /** + * Resource resourcePath. + * @member {google.cloud.securitycenter.v2.IResourcePath|null|undefined} resourcePath + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.resourcePath = null; + + /** + * Resource resourcePathString. + * @member {string} resourcePathString + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.resourcePathString = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Resource cloudProviderMetadata. + * @member {"gcpMetadata"|"awsMetadata"|"azureMetadata"|undefined} cloudProviderMetadata + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Object.defineProperty(Resource.prototype, "cloudProviderMetadata", { + get: $util.oneOfGetter($oneOfFields = ["gcpMetadata", "awsMetadata", "azureMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v2.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 && 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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cloudProvider); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.service); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + if (message.gcpMetadata != null && Object.hasOwnProperty.call(message, "gcpMetadata")) + $root.google.cloud.securitycenter.v2.GcpMetadata.encode(message.gcpMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.awsMetadata != null && Object.hasOwnProperty.call(message, "awsMetadata")) + $root.google.cloud.securitycenter.v2.AwsMetadata.encode(message.awsMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.azureMetadata != null && Object.hasOwnProperty.call(message, "azureMetadata")) + $root.google.cloud.securitycenter.v2.AzureMetadata.encode(message.azureMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.resourcePath != null && Object.hasOwnProperty.call(message, "resourcePath")) + $root.google.cloud.securitycenter.v2.ResourcePath.encode(message.resourcePath, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.resourcePathString != null && Object.hasOwnProperty.call(message, "resourcePathString")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.resourcePathString); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 4: { + message.cloudProvider = reader.int32(); + break; + } + case 5: { + message.service = reader.string(); + break; + } + case 6: { + message.location = reader.string(); + break; + } + case 7: { + message.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.decode(reader, reader.uint32()); + break; + } + case 8: { + message.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.decode(reader, reader.uint32()); + break; + } + case 9: { + message.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.decode(reader, reader.uint32()); + break; + } + case 10: { + message.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.decode(reader, reader.uint32()); + break; + } + case 11: { + message.resourcePathString = 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.v2.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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"; + 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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + switch (message.cloudProvider) { + default: + return "cloudProvider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.gcpMetadata != null && message.hasOwnProperty("gcpMetadata")) { + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v2.GcpMetadata.verify(message.gcpMetadata); + if (error) + return "gcpMetadata." + error; + } + } + if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { + if (properties.cloudProviderMetadata === 1) + return "cloudProviderMetadata: multiple values"; + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v2.AwsMetadata.verify(message.awsMetadata); + if (error) + return "awsMetadata." + error; + } + } + if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { + if (properties.cloudProviderMetadata === 1) + return "cloudProviderMetadata: multiple values"; + properties.cloudProviderMetadata = 1; + { + var error = $root.google.cloud.securitycenter.v2.AzureMetadata.verify(message.azureMetadata); + if (error) + return "azureMetadata." + error; + } + } + if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) { + var error = $root.google.cloud.securitycenter.v2.ResourcePath.verify(message.resourcePath); + if (error) + return "resourcePath." + error; + } + if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) + if (!$util.isString(message.resourcePathString)) + return "resourcePathString: 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.v2.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v2.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); + switch (object.cloudProvider) { + default: + if (typeof object.cloudProvider === "number") { + message.cloudProvider = object.cloudProvider; + break; + } + break; + case "CLOUD_PROVIDER_UNSPECIFIED": + case 0: + message.cloudProvider = 0; + break; + case "GOOGLE_CLOUD_PLATFORM": + case 1: + message.cloudProvider = 1; + break; + case "AMAZON_WEB_SERVICES": + case 2: + message.cloudProvider = 2; + break; + case "MICROSOFT_AZURE": + case 3: + message.cloudProvider = 3; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.location != null) + message.location = String(object.location); + if (object.gcpMetadata != null) { + if (typeof object.gcpMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.gcpMetadata: object expected"); + message.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.fromObject(object.gcpMetadata); + } + if (object.awsMetadata != null) { + if (typeof object.awsMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.awsMetadata: object expected"); + message.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.fromObject(object.awsMetadata); + } + if (object.azureMetadata != null) { + if (typeof object.azureMetadata !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.azureMetadata: object expected"); + message.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.fromObject(object.azureMetadata); + } + if (object.resourcePath != null) { + if (typeof object.resourcePath !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.resourcePath: object expected"); + message.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.fromObject(object.resourcePath); + } + if (object.resourcePathString != null) + message.resourcePathString = String(object.resourcePathString); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v2.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.displayName = ""; + object.type = ""; + object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; + object.service = ""; + object.location = ""; + object.resourcePath = null; + object.resourcePathString = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] : message.cloudProvider; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.gcpMetadata != null && message.hasOwnProperty("gcpMetadata")) { + object.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.toObject(message.gcpMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "gcpMetadata"; + } + if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { + object.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.toObject(message.awsMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "awsMetadata"; + } + if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { + object.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.toObject(message.azureMetadata, options); + if (options.oneofs) + object.cloudProviderMetadata = "azureMetadata"; + } + if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) + object.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.toObject(message.resourcePath, options); + if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) + object.resourcePathString = message.resourcePathString; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.Resource"; + }; + + return Resource; + })(); + + return ListFindingsResult; + })(); + + return ListFindingsResponse; + })(); + + v2.ListMuteConfigsRequest = (function() { + + /** + * Properties of a ListMuteConfigsRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IListMuteConfigsRequest + * @property {string|null} [parent] ListMuteConfigsRequest parent + * @property {number|null} [pageSize] ListMuteConfigsRequest pageSize + * @property {string|null} [pageToken] ListMuteConfigsRequest pageToken + */ + + /** + * Constructs a new ListMuteConfigsRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListMuteConfigsRequest. + * @implements IListMuteConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest=} [properties] Properties to set + */ + function ListMuteConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMuteConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.parent = ""; + + /** + * ListMuteConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.pageSize = 0; + + /** + * ListMuteConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMuteConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListMuteConfigsRequest} ListMuteConfigsRequest instance + */ + ListMuteConfigsRequest.create = function create(properties) { + return new ListMuteConfigsRequest(properties); + }; + + /** + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListMuteConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMuteConfigsRequest.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 ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListMuteConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMuteConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.ListMuteConfigsRequest} ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListMuteConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListMuteConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListMuteConfigsRequest} ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMuteConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMuteConfigsRequest.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 ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListMuteConfigsRequest} ListMuteConfigsRequest + */ + ListMuteConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListMuteConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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 ListMuteConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.ListMuteConfigsRequest} message ListMuteConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMuteConfigsRequest.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 ListMuteConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMuteConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMuteConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListMuteConfigsRequest"; + }; + + return ListMuteConfigsRequest; + })(); + + v2.ListMuteConfigsResponse = (function() { + + /** + * Properties of a ListMuteConfigsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IListMuteConfigsResponse + * @property {Array.|null} [muteConfigs] ListMuteConfigsResponse muteConfigs + * @property {string|null} [nextPageToken] ListMuteConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListMuteConfigsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListMuteConfigsResponse. + * @implements IListMuteConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.IListMuteConfigsResponse=} [properties] Properties to set + */ + function ListMuteConfigsResponse(properties) { + this.muteConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMuteConfigsResponse muteConfigs. + * @member {Array.} muteConfigs + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @instance + */ + ListMuteConfigsResponse.prototype.muteConfigs = $util.emptyArray; + + /** + * ListMuteConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @instance + */ + ListMuteConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMuteConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListMuteConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListMuteConfigsResponse} ListMuteConfigsResponse instance + */ + ListMuteConfigsResponse.create = function create(properties) { + return new ListMuteConfigsResponse(properties); + }; + + /** + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListMuteConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMuteConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.muteConfigs != null && message.muteConfigs.length) + for (var i = 0; i < message.muteConfigs.length; ++i) + $root.google.cloud.securitycenter.v2.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 ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListMuteConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMuteConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.ListMuteConfigsResponse} ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListMuteConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.muteConfigs && message.muteConfigs.length)) + message.muteConfigs = []; + message.muteConfigs.push($root.google.cloud.securitycenter.v2.MuteConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListMuteConfigsResponse} ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMuteConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMuteConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.v2.MuteConfig.verify(message.muteConfigs[i]); + if (error) + return "muteConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListMuteConfigsResponse} ListMuteConfigsResponse + */ + ListMuteConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListMuteConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListMuteConfigsResponse(); + if (object.muteConfigs) { + if (!Array.isArray(object.muteConfigs)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListMuteConfigsResponse.muteConfigs: object expected"); + message.muteConfigs[i] = $root.google.cloud.securitycenter.v2.MuteConfig.fromObject(object.muteConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.ListMuteConfigsResponse} message ListMuteConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMuteConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.muteConfigs = []; + if (options.defaults) + 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.v2.MuteConfig.toObject(message.muteConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMuteConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMuteConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMuteConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListMuteConfigsResponse"; + }; + + return ListMuteConfigsResponse; + })(); + + v2.ListNotificationConfigsRequest = (function() { + + /** + * Properties of a ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IListNotificationConfigsRequest + * @property {string|null} [parent] ListNotificationConfigsRequest parent + * @property {string|null} [pageToken] ListNotificationConfigsRequest pageToken + * @property {number|null} [pageSize] ListNotificationConfigsRequest pageSize + */ + + /** + * Constructs a new ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListNotificationConfigsRequest. + * @implements IListNotificationConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest=} [properties] Properties to set + */ + function ListNotificationConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.parent = ""; + + /** + * ListNotificationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageToken = ""; + + /** + * ListNotificationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListNotificationConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance + */ + ListNotificationConfigsRequest.create = function create(properties) { + return new ListNotificationConfigsRequest(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListNotificationConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListNotificationConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsRequest} ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListNotificationConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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; + } + } + return message; + }; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsRequest} ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.v2.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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsRequest} ListNotificationConfigsRequest + */ + ListNotificationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListNotificationConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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 ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.ListNotificationConfigsRequest} message ListNotificationConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNotificationConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsRequest"; + }; + + return ListNotificationConfigsRequest; + })(); + + v2.ListNotificationConfigsResponse = (function() { + + /** + * Properties of a ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IListNotificationConfigsResponse + * @property {Array.|null} [notificationConfigs] ListNotificationConfigsResponse notificationConfigs + * @property {string|null} [nextPageToken] ListNotificationConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListNotificationConfigsResponse. + * @implements IListNotificationConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsResponse=} [properties] Properties to set + */ + function ListNotificationConfigsResponse(properties) { + this.notificationConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsResponse notificationConfigs. + * @member {Array.} notificationConfigs + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; + + /** + * ListNotificationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListNotificationConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance + */ + ListNotificationConfigsResponse.create = function create(properties) { + return new ListNotificationConfigsResponse(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListNotificationConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notificationConfigs != null && message.notificationConfigs.length) + for (var i = 0; i < message.notificationConfigs.length; ++i) + $root.google.cloud.securitycenter.v2.NotificationConfig.encode(message.notificationConfigs[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 ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListNotificationConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsResponse} ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListNotificationConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.notificationConfigs && message.notificationConfigs.length)) + message.notificationConfigs = []; + message.notificationConfigs.push($root.google.cloud.securitycenter.v2.NotificationConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNotificationConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNotificationConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.v2.NotificationConfig.verify(message.notificationConfigs[i]); + if (error) + return "notificationConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} ListNotificationConfigsResponse + */ + ListNotificationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListNotificationConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListNotificationConfigsResponse(); + if (object.notificationConfigs) { + if (!Array.isArray(object.notificationConfigs)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsResponse.notificationConfigs: object expected"); + message.notificationConfigs[i] = $root.google.cloud.securitycenter.v2.NotificationConfig.fromObject(object.notificationConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} message ListNotificationConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + 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.v2.NotificationConfig.toObject(message.notificationConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNotificationConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsResponse"; + }; + + return ListNotificationConfigsResponse; + })(); + + v2.ListResourceValueConfigsRequest = (function() { + + /** + * Properties of a ListResourceValueConfigsRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IListResourceValueConfigsRequest + * @property {string|null} [parent] ListResourceValueConfigsRequest parent + * @property {number|null} [pageSize] ListResourceValueConfigsRequest pageSize + * @property {string|null} [pageToken] ListResourceValueConfigsRequest pageToken + */ + + /** + * Constructs a new ListResourceValueConfigsRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListResourceValueConfigsRequest. + * @implements IListResourceValueConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest=} [properties] Properties to set + */ + function ListResourceValueConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceValueConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @instance + */ + ListResourceValueConfigsRequest.prototype.parent = ""; + + /** + * ListResourceValueConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @instance + */ + ListResourceValueConfigsRequest.prototype.pageSize = 0; + + /** + * ListResourceValueConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @instance + */ + ListResourceValueConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListResourceValueConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest instance + */ + ListResourceValueConfigsRequest.create = function create(properties) { + return new ListResourceValueConfigsRequest(properties); + }; + + /** + * Encodes the specified ListResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest} message ListResourceValueConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest} message ListResourceValueConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceValueConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceValueConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListResourceValueConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceValueConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceValueConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest + */ + ListResourceValueConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest(); + 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 ListResourceValueConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} message ListResourceValueConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListResourceValueConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceValueConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceValueConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListResourceValueConfigsRequest"; + }; + + return ListResourceValueConfigsRequest; + })(); + + v2.ListResourceValueConfigsResponse = (function() { + + /** + * Properties of a ListResourceValueConfigsResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IListResourceValueConfigsResponse + * @property {Array.|null} [resourceValueConfigs] ListResourceValueConfigsResponse resourceValueConfigs + * @property {string|null} [nextPageToken] ListResourceValueConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListResourceValueConfigsResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListResourceValueConfigsResponse. + * @implements IListResourceValueConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsResponse=} [properties] Properties to set + */ + function ListResourceValueConfigsResponse(properties) { + this.resourceValueConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceValueConfigsResponse resourceValueConfigs. + * @member {Array.} resourceValueConfigs + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @instance + */ + ListResourceValueConfigsResponse.prototype.resourceValueConfigs = $util.emptyArray; + + /** + * ListResourceValueConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @instance + */ + ListResourceValueConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListResourceValueConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse instance + */ + ListResourceValueConfigsResponse.create = function create(properties) { + return new ListResourceValueConfigsResponse(properties); + }; + + /** + * Encodes the specified ListResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsResponse} message ListResourceValueConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceValueConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceValueConfigs != null && message.resourceValueConfigs.length) + for (var i = 0; i < message.resourceValueConfigs.length; ++i) + $root.google.cloud.securitycenter.v2.ResourceValueConfig.encode(message.resourceValueConfigs[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 ListResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsResponse} message ListResourceValueConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceValueConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceValueConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListResourceValueConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceValueConfigs && message.resourceValueConfigs.length)) + message.resourceValueConfigs = []; + message.resourceValueConfigs.push($root.google.cloud.securitycenter.v2.ResourceValueConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceValueConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceValueConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceValueConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceValueConfigs != null && message.hasOwnProperty("resourceValueConfigs")) { + if (!Array.isArray(message.resourceValueConfigs)) + return "resourceValueConfigs: array expected"; + for (var i = 0; i < message.resourceValueConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.verify(message.resourceValueConfigs[i]); + if (error) + return "resourceValueConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse + */ + ListResourceValueConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListResourceValueConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListResourceValueConfigsResponse(); + if (object.resourceValueConfigs) { + if (!Array.isArray(object.resourceValueConfigs)) + throw TypeError(".google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.resourceValueConfigs: array expected"); + message.resourceValueConfigs = []; + for (var i = 0; i < object.resourceValueConfigs.length; ++i) { + if (typeof object.resourceValueConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.resourceValueConfigs: object expected"); + message.resourceValueConfigs[i] = $root.google.cloud.securitycenter.v2.ResourceValueConfig.fromObject(object.resourceValueConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListResourceValueConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} message ListResourceValueConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceValueConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceValueConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.resourceValueConfigs && message.resourceValueConfigs.length) { + object.resourceValueConfigs = []; + for (var j = 0; j < message.resourceValueConfigs.length; ++j) + object.resourceValueConfigs[j] = $root.google.cloud.securitycenter.v2.ResourceValueConfig.toObject(message.resourceValueConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListResourceValueConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListResourceValueConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceValueConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceValueConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListResourceValueConfigsResponse"; + }; + + return ListResourceValueConfigsResponse; + })(); + + v2.ListSourcesRequest = (function() { + + /** + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v2 + * @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.v2 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v2.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v2.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.v2.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListSourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListSourcesRequest"; + }; + + return ListSourcesRequest; + })(); + + v2.ListSourcesResponse = (function() { + + /** + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v2.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Source.encode(message.sources[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 ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v2.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.v2.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListSourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v2.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.v2.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.ListSourcesResponse"; + }; + + return ListSourcesResponse; + })(); + + v2.ListValuedResourcesRequest = (function() { + + /** + * Properties of a ListValuedResourcesRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IListValuedResourcesRequest + * @property {string|null} [parent] ListValuedResourcesRequest parent + * @property {string|null} [filter] ListValuedResourcesRequest filter + * @property {string|null} [pageToken] ListValuedResourcesRequest pageToken + * @property {number|null} [pageSize] ListValuedResourcesRequest pageSize + * @property {string|null} [orderBy] ListValuedResourcesRequest orderBy + */ + + /** + * Constructs a new ListValuedResourcesRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListValuedResourcesRequest. + * @implements IListValuedResourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest=} [properties] Properties to set + */ + function ListValuedResourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValuedResourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.parent = ""; + + /** + * ListValuedResourcesRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.filter = ""; + + /** + * ListValuedResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.pageToken = ""; + + /** + * ListValuedResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.pageSize = 0; + + /** + * ListValuedResourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @instance + */ + ListValuedResourcesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListValuedResourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListValuedResourcesRequest} ListValuedResourcesRequest instance + */ + ListValuedResourcesRequest.create = function create(properties) { + return new ListValuedResourcesRequest(properties); + }; + + /** + * Encodes the specified ListValuedResourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest} message ListValuedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValuedResourcesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListValuedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest} message ListValuedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValuedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValuedResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ListValuedResourcesRequest} ListValuedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValuedResourcesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListValuedResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValuedResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListValuedResourcesRequest} ListValuedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValuedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValuedResourcesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValuedResourcesRequest.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.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListValuedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListValuedResourcesRequest} ListValuedResourcesRequest + */ + ListValuedResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListValuedResourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListValuedResourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListValuedResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {google.cloud.securitycenter.v2.ListValuedResourcesRequest} message ListValuedResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValuedResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageToken = ""; + object.pageSize = 0; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListValuedResourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListValuedResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValuedResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValuedResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListValuedResourcesRequest"; + }; + + return ListValuedResourcesRequest; + })(); + + v2.ListValuedResourcesResponse = (function() { + + /** + * Properties of a ListValuedResourcesResponse. + * @memberof google.cloud.securitycenter.v2 + * @interface IListValuedResourcesResponse + * @property {Array.|null} [valuedResources] ListValuedResourcesResponse valuedResources + * @property {string|null} [nextPageToken] ListValuedResourcesResponse nextPageToken + * @property {number|null} [totalSize] ListValuedResourcesResponse totalSize + */ + + /** + * Constructs a new ListValuedResourcesResponse. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ListValuedResourcesResponse. + * @implements IListValuedResourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v2.IListValuedResourcesResponse=} [properties] Properties to set + */ + function ListValuedResourcesResponse(properties) { + this.valuedResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValuedResourcesResponse valuedResources. + * @member {Array.} valuedResources + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @instance + */ + ListValuedResourcesResponse.prototype.valuedResources = $util.emptyArray; + + /** + * ListValuedResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @instance + */ + ListValuedResourcesResponse.prototype.nextPageToken = ""; + + /** + * ListValuedResourcesResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @instance + */ + ListValuedResourcesResponse.prototype.totalSize = 0; + + /** + * Creates a new ListValuedResourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {google.cloud.securitycenter.v2.IListValuedResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ListValuedResourcesResponse} ListValuedResourcesResponse instance + */ + ListValuedResourcesResponse.create = function create(properties) { + return new ListValuedResourcesResponse(properties); + }; + + /** + * Encodes the specified ListValuedResourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {google.cloud.securitycenter.v2.IListValuedResourcesResponse} message ListValuedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValuedResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.valuedResources != null && message.valuedResources.length) + for (var i = 0; i < message.valuedResources.length; ++i) + $root.google.cloud.securitycenter.v2.ValuedResource.encode(message.valuedResources[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); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListValuedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {google.cloud.securitycenter.v2.IListValuedResourcesResponse} message ListValuedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValuedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValuedResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ListValuedResourcesResponse} ListValuedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValuedResourcesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListValuedResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.valuedResources && message.valuedResources.length)) + message.valuedResources = []; + message.valuedResources.push($root.google.cloud.securitycenter.v2.ValuedResource.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValuedResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ListValuedResourcesResponse} ListValuedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValuedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValuedResourcesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValuedResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.valuedResources != null && message.hasOwnProperty("valuedResources")) { + if (!Array.isArray(message.valuedResources)) + return "valuedResources: array expected"; + for (var i = 0; i < message.valuedResources.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.ValuedResource.verify(message.valuedResources[i]); + if (error) + return "valuedResources." + 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 ListValuedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ListValuedResourcesResponse} ListValuedResourcesResponse + */ + ListValuedResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ListValuedResourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v2.ListValuedResourcesResponse(); + if (object.valuedResources) { + if (!Array.isArray(object.valuedResources)) + throw TypeError(".google.cloud.securitycenter.v2.ListValuedResourcesResponse.valuedResources: array expected"); + message.valuedResources = []; + for (var i = 0; i < object.valuedResources.length; ++i) { + if (typeof object.valuedResources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ListValuedResourcesResponse.valuedResources: object expected"); + message.valuedResources[i] = $root.google.cloud.securitycenter.v2.ValuedResource.fromObject(object.valuedResources[i]); + } + } + 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 ListValuedResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {google.cloud.securitycenter.v2.ListValuedResourcesResponse} message ListValuedResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValuedResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.valuedResources = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.valuedResources && message.valuedResources.length) { + object.valuedResources = []; + for (var j = 0; j < message.valuedResources.length; ++j) + object.valuedResources[j] = $root.google.cloud.securitycenter.v2.ValuedResource.toObject(message.valuedResources[j], 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 ListValuedResourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListValuedResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValuedResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValuedResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListValuedResourcesResponse"; + }; + + return ListValuedResourcesResponse; + })(); + + v2.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v2.Finding.State|null} [state] SetFindingStateRequest state + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v2.Finding.State} state + * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v2.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v2.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); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + 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.v2.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.SetFindingStateRequest(); + 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; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v2.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; + } + 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.v2.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.Finding.State[message.state] : message.state; + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetFindingStateRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.SetFindingStateRequest"; + }; + + return SetFindingStateRequest; + })(); + + v2.SetMuteRequest = (function() { + + /** + * Properties of a SetMuteRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface ISetMuteRequest + * @property {string|null} [name] SetMuteRequest name + * @property {google.cloud.securitycenter.v2.Finding.Mute|null} [mute] SetMuteRequest mute + */ + + /** + * Constructs a new SetMuteRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a SetMuteRequest. + * @implements ISetMuteRequest + * @constructor + * @param {google.cloud.securitycenter.v2.ISetMuteRequest=} [properties] Properties to set + */ + function SetMuteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetMuteRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @instance + */ + SetMuteRequest.prototype.name = ""; + + /** + * SetMuteRequest mute. + * @member {google.cloud.securitycenter.v2.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @instance + */ + SetMuteRequest.prototype.mute = 0; + + /** + * Creates a new SetMuteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v2.ISetMuteRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.SetMuteRequest} SetMuteRequest instance + */ + SetMuteRequest.create = function create(properties) { + return new SetMuteRequest(properties); + }; + + /** + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.SetMuteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v2.ISetMuteRequest} message SetMuteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} 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.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mute); + return writer; + }; + + /** + * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SetMuteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v2.ISetMuteRequest} message SetMuteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMuteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.SetMuteRequest} SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMuteRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SetMuteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.mute = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.SetMuteRequest} SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMuteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetMuteRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + 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.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.SetMuteRequest} SetMuteRequest + */ + SetMuteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.SetMuteRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.SetMuteRequest(); + 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; + break; + case "MUTED": + case 1: + message.mute = 1; + break; + case "UNMUTED": + case 2: + message.mute = 2; + break; + case "UNDEFINED": + case 3: + message.mute = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v2.SetMuteRequest} message SetMuteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetMuteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; + } + 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.v2.Finding.Mute[message.mute] === undefined ? message.mute : $root.google.cloud.securitycenter.v2.Finding.Mute[message.mute] : message.mute; + return object; + }; + + /** + * Converts this SetMuteRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.SetMuteRequest + * @instance + * @returns {Object.} JSON object + */ + SetMuteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetMuteRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.SetMuteRequest"; + }; + + return SetMuteRequest; + })(); + + v2.UpdateBigQueryExportRequest = (function() { + + /** + * Properties of an UpdateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IUpdateBigQueryExportRequest + * @property {google.cloud.securitycenter.v2.IBigQueryExport|null} [bigQueryExport] UpdateBigQueryExportRequest bigQueryExport + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBigQueryExportRequest updateMask + */ + + /** + * Constructs a new UpdateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an UpdateBigQueryExportRequest. + * @implements IUpdateBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest=} [properties] Properties to set + */ + function UpdateBigQueryExportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBigQueryExportRequest bigQueryExport. + * @member {google.cloud.securitycenter.v2.IBigQueryExport|null|undefined} bigQueryExport + * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest + * @instance + */ + UpdateBigQueryExportRequest.prototype.bigQueryExport = null; + + /** + * UpdateBigQueryExportRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest + * @instance + */ + UpdateBigQueryExportRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest instance + */ + UpdateBigQueryExportRequest.create = function create(properties) { + return new UpdateBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest} message UpdateBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBigQueryExportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigQueryExport != null && Object.hasOwnProperty.call(message, "bigQueryExport")) + $root.google.cloud.securitycenter.v2.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 UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest} message UpdateBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.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.v2.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBigQueryExportRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bigQueryExport = $root.google.cloud.securitycenter.v2.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; + } + } + return message; + }; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.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.v2.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.v2.UpdateBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest + */ + UpdateBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest(); + if (object.bigQueryExport != null) { + if (typeof object.bigQueryExport !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateBigQueryExportRequest.bigQueryExport: object expected"); + message.bigQueryExport = $root.google.cloud.securitycenter.v2.BigQueryExport.fromObject(object.bigQueryExport); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.UpdateBigQueryExportRequest"; + }; + + return UpdateBigQueryExportRequest; + })(); + + v2.UpdateExternalSystemRequest = (function() { + + /** + * Properties of an UpdateExternalSystemRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IUpdateExternalSystemRequest + * @property {google.cloud.securitycenter.v2.IExternalSystem|null} [externalSystem] UpdateExternalSystemRequest externalSystem + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExternalSystemRequest updateMask + */ + + /** + * Constructs a new UpdateExternalSystemRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an UpdateExternalSystemRequest. + * @implements IUpdateExternalSystemRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.IExternalSystem|null|undefined} externalSystem + * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest + * @instance + */ + UpdateExternalSystemRequest.prototype.externalSystem = null; + + /** + * UpdateExternalSystemRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest + * @instance + */ + UpdateExternalSystemRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExternalSystemRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateExternalSystemRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.UpdateExternalSystemRequest} UpdateExternalSystemRequest instance + */ + UpdateExternalSystemRequest.create = function create(properties) { + return new UpdateExternalSystemRequest(properties); + }; + + /** + * Encodes the specified UpdateExternalSystemRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateExternalSystemRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateExternalSystemRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateExternalSystemRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.externalSystem = $root.google.cloud.securitycenter.v2.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.v2.UpdateExternalSystemRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateExternalSystemRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.UpdateExternalSystemRequest} UpdateExternalSystemRequest + */ + UpdateExternalSystemRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.UpdateExternalSystemRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.UpdateExternalSystemRequest(); + if (object.externalSystem != null) { + if (typeof object.externalSystem !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateExternalSystemRequest.externalSystem: object expected"); + message.externalSystem = $root.google.cloud.securitycenter.v2.ExternalSystem.fromObject(object.externalSystem); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateExternalSystemRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExternalSystemRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExternalSystemRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.UpdateExternalSystemRequest"; + }; + + return UpdateExternalSystemRequest; + })(); + + v2.UpdateFindingRequest = (function() { + + /** + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v2.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + */ + + /** + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v2.Finding.encode(message.finding, 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 UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.finding = $root.google.cloud.securitycenter.v2.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.v2.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v2.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.UpdateFindingRequest"; + }; + + return UpdateFindingRequest; + })(); + + v2.UpdateMuteConfigRequest = (function() { + + /** + * Properties of an UpdateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IUpdateMuteConfigRequest + * @property {google.cloud.securitycenter.v2.IMuteConfig|null} [muteConfig] UpdateMuteConfigRequest muteConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMuteConfigRequest updateMask + */ + + /** + * Constructs a new UpdateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an UpdateMuteConfigRequest. + * @implements IUpdateMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest + * @instance + */ + UpdateMuteConfigRequest.prototype.muteConfig = null; + + /** + * UpdateMuteConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest + * @instance + */ + UpdateMuteConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.UpdateMuteConfigRequest} UpdateMuteConfigRequest instance + */ + UpdateMuteConfigRequest.create = function create(properties) { + return new UpdateMuteConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.muteConfig = $root.google.cloud.securitycenter.v2.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.v2.UpdateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.UpdateMuteConfigRequest} UpdateMuteConfigRequest + */ + UpdateMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.UpdateMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.UpdateMuteConfigRequest(); + if (object.muteConfig != null) { + if (typeof object.muteConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateMuteConfigRequest.muteConfig: object expected"); + message.muteConfig = $root.google.cloud.securitycenter.v2.MuteConfig.fromObject(object.muteConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.UpdateMuteConfigRequest"; + }; + + return UpdateMuteConfigRequest; + })(); + + v2.UpdateNotificationConfigRequest = (function() { + + /** + * Properties of an UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IUpdateNotificationConfigRequest + * @property {google.cloud.securitycenter.v2.INotificationConfig|null} [notificationConfig] UpdateNotificationConfigRequest notificationConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNotificationConfigRequest updateMask + */ + + /** + * Constructs a new UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an UpdateNotificationConfigRequest. + * @implements IUpdateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * UpdateNotificationConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest instance + */ + UpdateNotificationConfigRequest.create = function create(properties) { + return new UpdateNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.securitycenter.v2.NotificationConfig.encode(message.notificationConfig, 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 UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.notificationConfig = $root.google.cloud.securitycenter.v2.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.v2.UpdateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + */ + UpdateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest(); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v2.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.UpdateNotificationConfigRequest"; + }; + + return UpdateNotificationConfigRequest; + })(); + + v2.UpdateResourceValueConfigRequest = (function() { + + /** + * Properties of an UpdateResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IUpdateResourceValueConfigRequest + * @property {google.cloud.securitycenter.v2.IResourceValueConfig|null} [resourceValueConfig] UpdateResourceValueConfigRequest resourceValueConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateResourceValueConfigRequest updateMask + */ + + /** + * Constructs a new UpdateResourceValueConfigRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an UpdateResourceValueConfigRequest. + * @implements IUpdateResourceValueConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest=} [properties] Properties to set + */ + function UpdateResourceValueConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateResourceValueConfigRequest resourceValueConfig. + * @member {google.cloud.securitycenter.v2.IResourceValueConfig|null|undefined} resourceValueConfig + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @instance + */ + UpdateResourceValueConfigRequest.prototype.resourceValueConfig = null; + + /** + * UpdateResourceValueConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @instance + */ + UpdateResourceValueConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateResourceValueConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest instance + */ + UpdateResourceValueConfigRequest.create = function create(properties) { + return new UpdateResourceValueConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateResourceValueConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceValueConfig != null && Object.hasOwnProperty.call(message, "resourceValueConfig")) + $root.google.cloud.securitycenter.v2.ResourceValueConfig.encode(message.resourceValueConfig, 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 UpdateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateResourceValueConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.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 UpdateResourceValueConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateResourceValueConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateResourceValueConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) { + var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.verify(message.resourceValueConfig); + if (error) + return "resourceValueConfig." + 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 UpdateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest + */ + UpdateResourceValueConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest(); + if (object.resourceValueConfig != null) { + if (typeof object.resourceValueConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.resourceValueConfig: object expected"); + message.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.fromObject(object.resourceValueConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateResourceValueConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateResourceValueConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceValueConfig = null; + object.updateMask = null; + } + if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) + object.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.toObject(message.resourceValueConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateResourceValueConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateResourceValueConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateResourceValueConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest"; + }; + + return UpdateResourceValueConfigRequest; + })(); + + v2.UpdateSecurityMarksRequest = (function() { + + /** + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v2.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + */ + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; + + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v2.SecurityMarks.encode(message.securityMarks, 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 UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.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 UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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; + } + return null; + }; + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v2.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; + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.UpdateSecurityMarksRequest"; + }; + + return UpdateSecurityMarksRequest; + })(); + + v2.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v2 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v2.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v2.Source.encode(message.source, 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 UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.securitycenter.v2.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.v2.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v2.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v2.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v2.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.UpdateSourceRequest"; + }; + + return UpdateSourceRequest; + })(); + + v2.Simulation = (function() { + + /** + * Properties of a Simulation. + * @memberof google.cloud.securitycenter.v2 + * @interface ISimulation + * @property {string|null} [name] Simulation name + * @property {google.protobuf.ITimestamp|null} [createTime] Simulation createTime + * @property {Array.|null} [resourceValueConfigsMetadata] Simulation resourceValueConfigsMetadata + * @property {google.cloud.securitycenter.v2.CloudProvider|null} [cloudProvider] Simulation cloudProvider + */ + + /** + * Constructs a new Simulation. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a Simulation. + * @implements ISimulation + * @constructor + * @param {google.cloud.securitycenter.v2.ISimulation=} [properties] Properties to set + */ + function Simulation(properties) { + this.resourceValueConfigsMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Simulation name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.Simulation + * @instance + */ + Simulation.prototype.name = ""; + + /** + * Simulation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v2.Simulation + * @instance + */ + Simulation.prototype.createTime = null; + + /** + * Simulation resourceValueConfigsMetadata. + * @member {Array.} resourceValueConfigsMetadata + * @memberof google.cloud.securitycenter.v2.Simulation + * @instance + */ + Simulation.prototype.resourceValueConfigsMetadata = $util.emptyArray; + + /** + * Simulation cloudProvider. + * @member {google.cloud.securitycenter.v2.CloudProvider} cloudProvider + * @memberof google.cloud.securitycenter.v2.Simulation + * @instance + */ + Simulation.prototype.cloudProvider = 0; + + /** + * Creates a new Simulation instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {google.cloud.securitycenter.v2.ISimulation=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Simulation} Simulation instance + */ + Simulation.create = function create(properties) { + return new Simulation(properties); + }; + + /** + * Encodes the specified Simulation message. Does not implicitly {@link google.cloud.securitycenter.v2.Simulation.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {google.cloud.securitycenter.v2.ISimulation} message Simulation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Simulation.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceValueConfigsMetadata != null && message.resourceValueConfigsMetadata.length) + for (var i = 0; i < message.resourceValueConfigsMetadata.length; ++i) + $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.encode(message.resourceValueConfigsMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cloudProvider); + return writer; + }; + + /** + * Encodes the specified Simulation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Simulation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {google.cloud.securitycenter.v2.ISimulation} message Simulation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Simulation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Simulation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.Simulation} Simulation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Simulation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Simulation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.resourceValueConfigsMetadata && message.resourceValueConfigsMetadata.length)) + message.resourceValueConfigsMetadata = []; + message.resourceValueConfigsMetadata.push($root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.decode(reader, reader.uint32())); + break; + } + case 4: { + message.cloudProvider = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Simulation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.Simulation} Simulation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Simulation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Simulation message. + * @function verify + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Simulation.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.resourceValueConfigsMetadata != null && message.hasOwnProperty("resourceValueConfigsMetadata")) { + if (!Array.isArray(message.resourceValueConfigsMetadata)) + return "resourceValueConfigsMetadata: array expected"; + for (var i = 0; i < message.resourceValueConfigsMetadata.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify(message.resourceValueConfigsMetadata[i]); + if (error) + return "resourceValueConfigsMetadata." + error; + } + } + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + switch (message.cloudProvider) { + default: + return "cloudProvider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Simulation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Simulation} Simulation + */ + Simulation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Simulation) + return object; + var message = new $root.google.cloud.securitycenter.v2.Simulation(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Simulation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.resourceValueConfigsMetadata) { + if (!Array.isArray(object.resourceValueConfigsMetadata)) + throw TypeError(".google.cloud.securitycenter.v2.Simulation.resourceValueConfigsMetadata: array expected"); + message.resourceValueConfigsMetadata = []; + for (var i = 0; i < object.resourceValueConfigsMetadata.length; ++i) { + if (typeof object.resourceValueConfigsMetadata[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Simulation.resourceValueConfigsMetadata: object expected"); + message.resourceValueConfigsMetadata[i] = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.fromObject(object.resourceValueConfigsMetadata[i]); + } + } + switch (object.cloudProvider) { + default: + if (typeof object.cloudProvider === "number") { + message.cloudProvider = object.cloudProvider; + break; + } + break; + case "CLOUD_PROVIDER_UNSPECIFIED": + case 0: + message.cloudProvider = 0; + break; + case "GOOGLE_CLOUD_PLATFORM": + case 1: + message.cloudProvider = 1; + break; + case "AMAZON_WEB_SERVICES": + case 2: + message.cloudProvider = 2; + break; + case "MICROSOFT_AZURE": + case 3: + message.cloudProvider = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Simulation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {google.cloud.securitycenter.v2.Simulation} message Simulation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Simulation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceValueConfigsMetadata = []; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.resourceValueConfigsMetadata && message.resourceValueConfigsMetadata.length) { + object.resourceValueConfigsMetadata = []; + for (var j = 0; j < message.resourceValueConfigsMetadata.length; ++j) + object.resourceValueConfigsMetadata[j] = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.toObject(message.resourceValueConfigsMetadata[j], options); + } + if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) + object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] : message.cloudProvider; + return object; + }; + + /** + * Converts this Simulation to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.Simulation + * @instance + * @returns {Object.} JSON object + */ + Simulation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Simulation + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.Simulation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Simulation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.Simulation"; + }; + + return Simulation; + })(); + + v2.ValuedResource = (function() { + + /** + * Properties of a ValuedResource. + * @memberof google.cloud.securitycenter.v2 + * @interface IValuedResource + * @property {string|null} [name] ValuedResource name + * @property {string|null} [resource] ValuedResource resource + * @property {string|null} [resourceType] ValuedResource resourceType + * @property {string|null} [displayName] ValuedResource displayName + * @property {google.cloud.securitycenter.v2.ValuedResource.ResourceValue|null} [resourceValue] ValuedResource resourceValue + * @property {number|null} [exposedScore] ValuedResource exposedScore + * @property {Array.|null} [resourceValueConfigsUsed] ValuedResource resourceValueConfigsUsed + */ + + /** + * Constructs a new ValuedResource. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ValuedResource. + * @implements IValuedResource + * @constructor + * @param {google.cloud.securitycenter.v2.IValuedResource=} [properties] Properties to set + */ + function ValuedResource(properties) { + this.resourceValueConfigsUsed = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValuedResource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @instance + */ + ValuedResource.prototype.name = ""; + + /** + * ValuedResource resource. + * @member {string} resource + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @instance + */ + ValuedResource.prototype.resource = ""; + + /** + * ValuedResource resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @instance + */ + ValuedResource.prototype.resourceType = ""; + + /** + * ValuedResource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @instance + */ + ValuedResource.prototype.displayName = ""; + + /** + * ValuedResource resourceValue. + * @member {google.cloud.securitycenter.v2.ValuedResource.ResourceValue} resourceValue + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @instance + */ + ValuedResource.prototype.resourceValue = 0; + + /** + * ValuedResource exposedScore. + * @member {number} exposedScore + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @instance + */ + ValuedResource.prototype.exposedScore = 0; + + /** + * ValuedResource resourceValueConfigsUsed. + * @member {Array.} resourceValueConfigsUsed + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @instance + */ + ValuedResource.prototype.resourceValueConfigsUsed = $util.emptyArray; + + /** + * Creates a new ValuedResource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {google.cloud.securitycenter.v2.IValuedResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ValuedResource} ValuedResource instance + */ + ValuedResource.create = function create(properties) { + return new ValuedResource(properties); + }; + + /** + * Encodes the specified ValuedResource message. Does not implicitly {@link google.cloud.securitycenter.v2.ValuedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {google.cloud.securitycenter.v2.IValuedResource} message ValuedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValuedResource.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.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.resourceValue != null && Object.hasOwnProperty.call(message, "resourceValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resourceValue); + if (message.exposedScore != null && Object.hasOwnProperty.call(message, "exposedScore")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.exposedScore); + if (message.resourceValueConfigsUsed != null && message.resourceValueConfigsUsed.length) + for (var i = 0; i < message.resourceValueConfigsUsed.length; ++i) + $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.encode(message.resourceValueConfigsUsed[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValuedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ValuedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {google.cloud.securitycenter.v2.IValuedResource} message ValuedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValuedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValuedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ValuedResource} ValuedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValuedResource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ValuedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resource = reader.string(); + break; + } + case 3: { + message.resourceType = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.resourceValue = reader.int32(); + break; + } + case 6: { + message.exposedScore = reader.double(); + break; + } + case 7: { + if (!(message.resourceValueConfigsUsed && message.resourceValueConfigsUsed.length)) + message.resourceValueConfigsUsed = []; + message.resourceValueConfigsUsed.push($root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValuedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ValuedResource} ValuedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValuedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValuedResource message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValuedResource.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.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) + switch (message.resourceValue) { + default: + return "resourceValue: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exposedScore != null && message.hasOwnProperty("exposedScore")) + if (typeof message.exposedScore !== "number") + return "exposedScore: number expected"; + if (message.resourceValueConfigsUsed != null && message.hasOwnProperty("resourceValueConfigsUsed")) { + if (!Array.isArray(message.resourceValueConfigsUsed)) + return "resourceValueConfigsUsed: array expected"; + for (var i = 0; i < message.resourceValueConfigsUsed.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify(message.resourceValueConfigsUsed[i]); + if (error) + return "resourceValueConfigsUsed." + error; + } + } + return null; + }; + + /** + * Creates a ValuedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ValuedResource} ValuedResource + */ + ValuedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ValuedResource) + return object; + var message = new $root.google.cloud.securitycenter.v2.ValuedResource(); + if (object.name != null) + message.name = String(object.name); + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.resourceValue) { + default: + if (typeof object.resourceValue === "number") { + message.resourceValue = object.resourceValue; + break; + } + break; + case "RESOURCE_VALUE_UNSPECIFIED": + case 0: + message.resourceValue = 0; + break; + case "RESOURCE_VALUE_LOW": + case 1: + message.resourceValue = 1; + break; + case "RESOURCE_VALUE_MEDIUM": + case 2: + message.resourceValue = 2; + break; + case "RESOURCE_VALUE_HIGH": + case 3: + message.resourceValue = 3; + break; + } + if (object.exposedScore != null) + message.exposedScore = Number(object.exposedScore); + if (object.resourceValueConfigsUsed) { + if (!Array.isArray(object.resourceValueConfigsUsed)) + throw TypeError(".google.cloud.securitycenter.v2.ValuedResource.resourceValueConfigsUsed: array expected"); + message.resourceValueConfigsUsed = []; + for (var i = 0; i < object.resourceValueConfigsUsed.length; ++i) { + if (typeof object.resourceValueConfigsUsed[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.ValuedResource.resourceValueConfigsUsed: object expected"); + message.resourceValueConfigsUsed[i] = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.fromObject(object.resourceValueConfigsUsed[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValuedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {google.cloud.securitycenter.v2.ValuedResource} message ValuedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValuedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceValueConfigsUsed = []; + if (options.defaults) { + object.name = ""; + object.resource = ""; + object.resourceType = ""; + object.displayName = ""; + object.resourceValue = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; + object.exposedScore = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) + object.resourceValue = options.enums === String ? $root.google.cloud.securitycenter.v2.ValuedResource.ResourceValue[message.resourceValue] === undefined ? message.resourceValue : $root.google.cloud.securitycenter.v2.ValuedResource.ResourceValue[message.resourceValue] : message.resourceValue; + if (message.exposedScore != null && message.hasOwnProperty("exposedScore")) + object.exposedScore = options.json && !isFinite(message.exposedScore) ? String(message.exposedScore) : message.exposedScore; + if (message.resourceValueConfigsUsed && message.resourceValueConfigsUsed.length) { + object.resourceValueConfigsUsed = []; + for (var j = 0; j < message.resourceValueConfigsUsed.length; ++j) + object.resourceValueConfigsUsed[j] = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.toObject(message.resourceValueConfigsUsed[j], options); + } + return object; + }; + + /** + * Converts this ValuedResource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @instance + * @returns {Object.} JSON object + */ + ValuedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValuedResource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ValuedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValuedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ValuedResource"; + }; + + /** + * ResourceValue enum. + * @name google.cloud.securitycenter.v2.ValuedResource.ResourceValue + * @enum {number} + * @property {number} RESOURCE_VALUE_UNSPECIFIED=0 RESOURCE_VALUE_UNSPECIFIED value + * @property {number} RESOURCE_VALUE_LOW=1 RESOURCE_VALUE_LOW value + * @property {number} RESOURCE_VALUE_MEDIUM=2 RESOURCE_VALUE_MEDIUM value + * @property {number} RESOURCE_VALUE_HIGH=3 RESOURCE_VALUE_HIGH value + */ + ValuedResource.ResourceValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_VALUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_VALUE_LOW"] = 1; + values[valuesById[2] = "RESOURCE_VALUE_MEDIUM"] = 2; + values[valuesById[3] = "RESOURCE_VALUE_HIGH"] = 3; + return values; + })(); + + return ValuedResource; + })(); + + v2.ResourceValueConfigMetadata = (function() { + + /** + * Properties of a ResourceValueConfigMetadata. + * @memberof google.cloud.securitycenter.v2 + * @interface IResourceValueConfigMetadata + * @property {string|null} [name] ResourceValueConfigMetadata name + */ + + /** + * Constructs a new ResourceValueConfigMetadata. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ResourceValueConfigMetadata. + * @implements IResourceValueConfigMetadata + * @constructor + * @param {google.cloud.securitycenter.v2.IResourceValueConfigMetadata=} [properties] Properties to set + */ + function ResourceValueConfigMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceValueConfigMetadata name. + * @member {string} name + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @instance + */ + ResourceValueConfigMetadata.prototype.name = ""; + + /** + * Creates a new ResourceValueConfigMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {google.cloud.securitycenter.v2.IResourceValueConfigMetadata=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} ResourceValueConfigMetadata instance + */ + ResourceValueConfigMetadata.create = function create(properties) { + return new ResourceValueConfigMetadata(properties); + }; + + /** + * Encodes the specified ResourceValueConfigMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {google.cloud.securitycenter.v2.IResourceValueConfigMetadata} message ResourceValueConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceValueConfigMetadata.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 ResourceValueConfigMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {google.cloud.securitycenter.v2.IResourceValueConfigMetadata} message ResourceValueConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceValueConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} ResourceValueConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceValueConfigMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} ResourceValueConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceValueConfigMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceValueConfigMetadata message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceValueConfigMetadata.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 ResourceValueConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} ResourceValueConfigMetadata + */ + ResourceValueConfigMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata) + return object; + var message = new $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ResourceValueConfigMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} message ResourceValueConfigMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceValueConfigMetadata.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 ResourceValueConfigMetadata to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @instance + * @returns {Object.} JSON object + */ + ResourceValueConfigMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceValueConfigMetadata + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceValueConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourceValueConfigMetadata"; + }; + + return ResourceValueConfigMetadata; + })(); + + v2.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.securitycenter.v2 + * @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.v2 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v2.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.v2.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v2.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v2.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Source canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v2.Source + * @instance + */ + Source.prototype.canonicalName = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.Source + * @static + * @param {google.cloud.securitycenter.v2.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v2.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.Source + * @static + * @param {google.cloud.securitycenter.v2.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 4, wireType 2 =*/34).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.Source + * @static + * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.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.v2.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.Source) + return object; + var message = new $root.google.cloud.securitycenter.v2.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.v2.Source + * @static + * @param {google.cloud.securitycenter.v2.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.v2.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.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.v2.Source"; + }; + + return Source; + })(); + + return v2; + })(); + + return securitycenter; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + 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 + * @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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + /** + * 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 + * @property {number} IDENTIFIER=8 IDENTIFIER 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; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), 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.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + 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.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), 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.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + 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.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + 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.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.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.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + api.RoutingRule = (function() { + + /** + * Properties of a RoutingRule. + * @memberof google.api + * @interface IRoutingRule + * @property {Array.|null} [routingParameters] RoutingRule routingParameters + */ + + /** + * Constructs a new RoutingRule. + * @memberof google.api + * @classdesc Represents a RoutingRule. + * @implements IRoutingRule + * @constructor + * @param {google.api.IRoutingRule=} [properties] Properties to set + */ + function RoutingRule(properties) { + this.routingParameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingRule routingParameters. + * @member {Array.} routingParameters + * @memberof google.api.RoutingRule + * @instance + */ + RoutingRule.prototype.routingParameters = $util.emptyArray; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @function create + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule=} [properties] Properties to set + * @returns {google.api.RoutingRule} RoutingRule instance + */ + RoutingRule.create = function create(properties) { + return new RoutingRule(properties); + }; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingParameters != null && message.routingParameters.length) + for (var i = 0; i < message.routingParameters.length; ++i) + $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.routingParameters && message.routingParameters.length)) + message.routingParameters = []; + message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingRule message. + * @function verify + * @memberof google.api.RoutingRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { + if (!Array.isArray(message.routingParameters)) + return "routingParameters: array expected"; + for (var i = 0; i < message.routingParameters.length; ++i) { + var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i]); + if (error) + return "routingParameters." + error; + } + } + return null; + }; + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingRule} RoutingRule + */ + RoutingRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingRule) + return object; + var message = new $root.google.api.RoutingRule(); + if (object.routingParameters) { + if (!Array.isArray(object.routingParameters)) + throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); + message.routingParameters = []; + for (var i = 0; i < object.routingParameters.length; ++i) { + if (typeof object.routingParameters[i] !== "object") + throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); + message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingRule + * @static + * @param {google.api.RoutingRule} message RoutingRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routingParameters = []; + if (message.routingParameters && message.routingParameters.length) { + object.routingParameters = []; + for (var j = 0; j < message.routingParameters.length; ++j) + object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); + } + return object; + }; + + /** + * Converts this RoutingRule to JSON. + * @function toJSON + * @memberof google.api.RoutingRule + * @instance + * @returns {Object.} JSON object + */ + RoutingRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingRule + * @function getTypeUrl + * @memberof google.api.RoutingRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingRule"; + }; + + return RoutingRule; + })(); + + api.RoutingParameter = (function() { + + /** + * Properties of a RoutingParameter. + * @memberof google.api + * @interface IRoutingParameter + * @property {string|null} [field] RoutingParameter field + * @property {string|null} [pathTemplate] RoutingParameter pathTemplate + */ + + /** + * Constructs a new RoutingParameter. + * @memberof google.api + * @classdesc Represents a RoutingParameter. + * @implements IRoutingParameter + * @constructor + * @param {google.api.IRoutingParameter=} [properties] Properties to set + */ + function RoutingParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingParameter field. + * @member {string} field + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.field = ""; + + /** + * RoutingParameter pathTemplate. + * @member {string} pathTemplate + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.pathTemplate = ""; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @function create + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter=} [properties] Properties to set + * @returns {google.api.RoutingParameter} RoutingParameter instance + */ + RoutingParameter.create = function create(properties) { + return new RoutingParameter(properties); + }; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); + return writer; + }; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.pathTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingParameter message. + * @function verify + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + if (!$util.isString(message.pathTemplate)) + return "pathTemplate: string expected"; + return null; + }; + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingParameter} RoutingParameter + */ + RoutingParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingParameter) + return object; + var message = new $root.google.api.RoutingParameter(); + if (object.field != null) + message.field = String(object.field); + if (object.pathTemplate != null) + message.pathTemplate = String(object.pathTemplate); + return message; + }; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.RoutingParameter} message RoutingParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.pathTemplate = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + object.pathTemplate = message.pathTemplate; + return object; + }; + + /** + * Converts this RoutingParameter to JSON. + * @function toJSON + * @memberof google.api.RoutingParameter + * @instance + * @returns {Object.} JSON object + */ + RoutingParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingParameter + * @function getTypeUrl + * @memberof google.api.RoutingParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingParameter"; + }; + + return RoutingParameter; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + 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); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * 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 = []; + this.declaration = []; + if (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; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * 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.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + 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 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + 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; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + 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]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + 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.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 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 50: { + message.features = $root.google.protobuf.FeatureSet.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; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.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; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + */ + + /** + * 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.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $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; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + 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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + 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(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.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; + } + 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()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.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"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.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"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + 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.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.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; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.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; + } + } + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + 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; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @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 + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * 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"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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; + } + case 525000001: { + message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + 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.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @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 + * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing + */ + + /** + * 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * 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; + + /** + * MethodOptions .google.api.routing. + * @member {google.api.IRoutingRule|null|undefined} .google.api.routing + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.routing"] = 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 && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + 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 && 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 && 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(); + if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) + $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.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; + } + 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 72295729: { + message[".google.api.routing"] = $root.google.api.RoutingRule.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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; + } + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { + var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); + if (error) + return ".google.api.routing." + 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) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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"]); + } + if (object[".google.api.routing"] != null) { + if (typeof object[".google.api.routing"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); + message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); + } + 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.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + object[".google.api.routing"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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); + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) + object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + 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 && 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(); + } + 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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + 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(); + if (tag === error) + break; + 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; + } + } + message.fields[key] = value; + 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); + }; + + /** + * 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; + })(); + + 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|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * 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 && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + 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] === undefined ? message.nullValue : $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); + }; + + /** + * 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; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.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, error) { + 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(); + if (tag === error) + break; + 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() { + + /** + * 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 && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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 >= 0) + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + return protobuf; + })(); + + 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 && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + return type; + })(); + + 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 + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * 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; + + /** + * 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 + * @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 && Object.hasOwnProperty.call(message, "resource")) + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 3: { + message.updateMask = $root.google.protobuf.FieldMask.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; + } + 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 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); + } + 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; + }; + + /** + * 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; + 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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) + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 {Array.|null} [auditConfigs] Policy auditConfigs + * @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 = []; + this.auditConfigs = []; + if (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 auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $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 && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + 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) + $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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 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; + } + } + 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.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"; + 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.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 >= 0) + 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 = []; + object.auditConfigs = []; + } + 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); + } + 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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + 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 && 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + 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] === 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) + 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() { + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && 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.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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + 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] === 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")) + 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); + }; + + /** + * 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 + * @enum {number} + * @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 && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + 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] === 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")) + 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); + }; + + /** + * 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 + * @enum {number} + * @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.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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + 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 && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + 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); + if (message.name != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + 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; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + 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 && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + 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) + $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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * 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; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/protos.json b/owl-bot-staging/google-cloud-securitycenter/protos/protos.json new file mode 100644 index 00000000000..b5bf0b8d7b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/protos/protos.json @@ -0,0 +1,17570 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "securitycenter": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.SecurityCenter.V1", + "go_package": "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb", + "java_multiple_files": true, + "java_outer_classname": "ValuedResourceProto", + "java_package": "com.google.cloud.securitycenter.v1", + "php_namespace": "Google\\Cloud\\SecurityCenter\\V1", + "ruby_package": "Google::Cloud::SecurityCenter::V1", + "(google.api.resource_definition).type": "securitycenter.googleapis.com/EventThreatDetectionSettings", + "(google.api.resource_definition).pattern": "projects/{project}/eventThreatDetectionSettings" + }, + "nested": { + "Access": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "callerIp": { + "type": "string", + "id": 2 + }, + "callerIpGeo": { + "type": "Geolocation", + "id": 3 + }, + "userAgentFamily": { + "type": "string", + "id": 4 + }, + "userAgent": { + "type": "string", + "id": 12 + }, + "serviceName": { + "type": "string", + "id": 5 + }, + "methodName": { + "type": "string", + "id": 6 + }, + "principalSubject": { + "type": "string", + "id": 7 + }, + "serviceAccountKeyName": { + "type": "string", + "id": 8 + }, + "serviceAccountDelegationInfo": { + "rule": "repeated", + "type": "ServiceAccountDelegationInfo", + "id": 9 + }, + "userName": { + "type": "string", + "id": 11 + } + } + }, + "ServiceAccountDelegationInfo": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "principalSubject": { + "type": "string", + "id": 2 + } + } + }, + "Geolocation": { + "fields": { + "regionCode": { + "type": "string", + "id": 1 + } + } + }, + "Application": { + "fields": { + "baseUri": { + "type": "string", + "id": 1 + }, + "fullUri": { + "type": "string", + "id": 2 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "projects/{project}/assets/{asset}", + "(google.api.resource).plural": "assets", + "(google.api.resource).singular": "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 + }, + "canonicalName": { + "type": "string", + "id": 13 + } + }, + "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 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 + } + } + }, + "IamPolicy": { + "fields": { + "policyBlob": { + "type": "string", + "id": 1 + } + } + } + } + }, + "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": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "canonicalName": { + "type": "string", + "id": 3 + } + } + }, + "AttackExposure": { + "fields": { + "score": { + "type": "double", + "id": 1 + }, + "latestCalculationTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "attackExposureResult": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "exposedHighValueResourcesCount": { + "type": "int32", + "id": 5 + }, + "exposedMediumValueResourcesCount": { + "type": "int32", + "id": 6 + }, + "exposedLowValueResourcesCount": { + "type": "int32", + "id": 7 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CALCULATED": 1, + "NOT_CALCULATED": 2 + } + } + } + }, + "AttackPath": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/AttackPath", + "(google.api.resource).pattern": "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}", + "(google.api.resource).plural": "attackPaths", + "(google.api.resource).singular": "attackPath" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "pathNodes": { + "rule": "repeated", + "type": "AttackPathNode", + "id": 2 + }, + "edges": { + "rule": "repeated", + "type": "AttackPathEdge", + "id": 3 + } + }, + "nested": { + "AttackPathNode": { + "fields": { + "resource": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "associatedFindings": { + "rule": "repeated", + "type": "PathNodeAssociatedFinding", + "id": 4 + }, + "uuid": { + "type": "string", + "id": 5 + }, + "attackSteps": { + "rule": "repeated", + "type": "AttackStepNode", + "id": 6 + } + }, + "nested": { + "PathNodeAssociatedFinding": { + "fields": { + "canonicalFinding": { + "type": "string", + "id": 1 + }, + "findingCategory": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + } + }, + "NodeType": { + "values": { + "NODE_TYPE_UNSPECIFIED": 0, + "NODE_TYPE_AND": 1, + "NODE_TYPE_OR": 2, + "NODE_TYPE_DEFENSE": 3, + "NODE_TYPE_ATTACKER": 4 + } + }, + "AttackStepNode": { + "fields": { + "uuid": { + "type": "string", + "id": 1 + }, + "type": { + "type": "NodeType", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + } + } + } + } + }, + "AttackPathEdge": { + "fields": { + "source": { + "type": "string", + "id": 1 + }, + "destination": { + "type": "string", + "id": 2 + } + } + } + } + }, + "BackupDisasterRecovery": { + "fields": { + "backupTemplate": { + "type": "string", + "id": 1 + }, + "policies": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "host": { + "type": "string", + "id": 3 + }, + "applications": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "storagePool": { + "type": "string", + "id": 5 + }, + "policyOptions": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "profile": { + "type": "string", + "id": 7 + }, + "appliance": { + "type": "string", + "id": 8 + }, + "backupType": { + "type": "string", + "id": 9 + }, + "backupCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + } + }, + "BigQueryExport": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/BigQueryExport", + "(google.api.resource).pattern": "projects/{project}/bigQueryExports/{export}", + "(google.api.resource).plural": "bigQueryExports", + "(google.api.resource).singular": "bigQueryExport" + }, + "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" + } + } + } + }, + "Chokepoint": { + "fields": { + "relatedFindings": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "CloudArmor": { + "fields": { + "securityPolicy": { + "type": "SecurityPolicy", + "id": 1 + }, + "requests": { + "type": "Requests", + "id": 2 + }, + "adaptiveProtection": { + "type": "AdaptiveProtection", + "id": 3 + }, + "attack": { + "type": "Attack", + "id": 4 + }, + "threatVector": { + "type": "string", + "id": 5 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 6 + } + } + }, + "SecurityPolicy": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "preview": { + "type": "bool", + "id": 3 + } + } + }, + "Requests": { + "fields": { + "ratio": { + "type": "double", + "id": 1 + }, + "shortTermAllowed": { + "type": "int32", + "id": 2 + }, + "longTermAllowed": { + "type": "int32", + "id": 3 + }, + "longTermDenied": { + "type": "int32", + "id": 4 + } + } + }, + "AdaptiveProtection": { + "fields": { + "confidence": { + "type": "double", + "id": 1 + } + } + }, + "Attack": { + "fields": { + "volumePps": { + "type": "int32", + "id": 1 + }, + "volumeBps": { + "type": "int32", + "id": 2 + }, + "classification": { + "type": "string", + "id": 3 + } + } + }, + "CloudDlpDataProfile": { + "fields": { + "dataProfile": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/TableDataProfile" + } + }, + "parentType": { + "type": "ParentType", + "id": 2 + }, + "infoTypes": { + "rule": "repeated", + "type": "InfoType", + "id": 3 + } + }, + "nested": { + "ParentType": { + "values": { + "PARENT_TYPE_UNSPECIFIED": 0, + "ORGANIZATION": 1, + "PROJECT": 2 + } + } + } + }, + "InfoType": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "sensitivityScore": { + "type": "SensitivityScore", + "id": 3 + } + } + }, + "SensitivityScore": { + "fields": { + "score": { + "type": "SensitivityScoreLevel", + "id": 1 + } + }, + "nested": { + "SensitivityScoreLevel": { + "values": { + "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED": 0, + "SENSITIVITY_LOW": 10, + "SENSITIVITY_UNKNOWN": 12, + "SENSITIVITY_MODERATE": 20, + "SENSITIVITY_HIGH": 30 + } + } + } + }, + "CloudDlpInspection": { + "fields": { + "inspectJob": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + }, + "infoType": { + "type": "string", + "id": 2 + }, + "infoTypeCount": { + "type": "int64", + "id": 3 + }, + "fullScan": { + "type": "bool", + "id": 4 + } + } + }, + "Compliance": { + "fields": { + "standard": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "ids": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "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 + } + } + } + }, + "ContactDetails": { + "fields": { + "contacts": { + "rule": "repeated", + "type": "Contact", + "id": 1 + } + } + }, + "Contact": { + "fields": { + "email": { + "type": "string", + "id": 1 + } + } + }, + "Container": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "imageId": { + "type": "string", + "id": 3 + }, + "labels": { + "rule": "repeated", + "type": "Label", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "Label": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "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 + }, + "version": { + "type": "string", + "id": 6 + } + } + }, + "EffectiveEventThreatDetectionCustomModule": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule", + "(google.api.resource).pattern": "projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enablementState": { + "type": "EnablementState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "EnablementState": { + "values": { + "ENABLEMENT_STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2 + } + } + } + }, + "EffectiveSecurityHealthAnalyticsCustomModule": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule", + "(google.api.resource).pattern": "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "customConfig": { + "type": "CustomConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enablementState": { + "type": "EnablementState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "EnablementState": { + "values": { + "ENABLEMENT_STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2 + } + } + } + }, + "CustomConfig": { + "fields": { + "predicate": { + "type": "google.type.Expr", + "id": 1 + }, + "customOutput": { + "type": "CustomOutputSpec", + "id": 2 + }, + "resourceSelector": { + "type": "ResourceSelector", + "id": 3 + }, + "severity": { + "type": "Severity", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "recommendation": { + "type": "string", + "id": 6 + } + }, + "nested": { + "CustomOutputSpec": { + "fields": { + "properties": { + "rule": "repeated", + "type": "Property", + "id": 1 + } + }, + "nested": { + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "valueExpression": { + "type": "google.type.Expr", + "id": 2 + } + } + } + } + }, + "ResourceSelector": { + "fields": { + "resourceTypes": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } + } + } + }, + "EventThreatDetectionCustomModule": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule", + "(google.api.resource).pattern": "projects/{project}/eventThreatDetectionSettings/customModules/{module}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "config": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "ancestorModule": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + }, + "enablementState": { + "type": "EnablementState", + "id": 4 + }, + "type": { + "type": "string", + "id": 5 + }, + "displayName": { + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastEditor": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "EnablementState": { + "values": { + "ENABLEMENT_STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "INHERITED": 3 + } + } + } + }, + "CustomModuleValidationErrors": { + "fields": { + "errors": { + "rule": "repeated", + "type": "CustomModuleValidationError", + "id": 1 + } + } + }, + "CustomModuleValidationError": { + "oneofs": { + "_start": { + "oneof": [ + "start" + ] + }, + "_end": { + "oneof": [ + "end" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "fieldPath": { + "type": "string", + "id": 2 + }, + "start": { + "type": "Position", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "end": { + "type": "Position", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, + "Position": { + "fields": { + "lineNumber": { + "type": "int32", + "id": 1 + }, + "columnNumber": { + "type": "int32", + "id": 2 + } + } + }, + "Exfiltration": { + "fields": { + "sources": { + "rule": "repeated", + "type": "ExfilResource", + "id": 1 + }, + "targets": { + "rule": "repeated", + "type": "ExfilResource", + "id": 2 + }, + "totalExfiltratedBytes": { + "type": "int64", + "id": 3 + } + } + }, + "ExfilResource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "components": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ExternalExposure": { + "fields": { + "privateIpAddress": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4_OR_IPV6" + } + }, + "privatePort": { + "type": "string", + "id": 2 + }, + "exposedService": { + "type": "string", + "id": 3 + }, + "publicIpAddress": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "IPV4_OR_IPV6" + } + }, + "publicPort": { + "type": "string", + "id": 5 + }, + "exposedEndpoint": { + "type": "string", + "id": 6 + }, + "loadBalancerFirewallPolicy": { + "type": "string", + "id": 7 + }, + "serviceFirewallPolicy": { + "type": "string", + "id": 8 + }, + "forwardingRule": { + "type": "string", + "id": 9 + }, + "backendService": { + "type": "string", + "id": 10 + }, + "instanceGroup": { + "type": "string", + "id": 11 + }, + "networkEndpointGroup": { + "type": "string", + "id": 12 + } + } + }, + "ExternalSystem": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}", + "(google.api.resource).plural": "externalSystems", + "(google.api.resource).singular": "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 + }, + "caseUri": { + "type": "string", + "id": 6 + }, + "casePriority": { + "type": "string", + "id": 7 + }, + "caseSla": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "caseCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "caseCloseTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "ticketInfo": { + "type": "TicketInfo", + "id": 8 + } + }, + "nested": { + "TicketInfo": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "assignee": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "uri": { + "type": "string", + "id": 4 + }, + "status": { + "type": "string", + "id": 5 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + } + } + } + }, + "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 + }, + "diskPath": { + "type": "DiskPath", + "id": 7 + } + }, + "nested": { + "DiskPath": { + "fields": { + "partitionUuid": { + "type": "string", + "id": 1 + }, + "relativePath": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}", + "(google.api.resource).plural": "findings", + "(google.api.resource).singular": "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 + }, + "severity": { + "type": "Severity", + "id": 12 + }, + "canonicalName": { + "type": "string", + "id": 14 + }, + "mute": { + "type": "Mute", + "id": 15 + }, + "findingClass": { + "type": "FindingClass", + "id": 17 + }, + "indicator": { + "type": "Indicator", + "id": 18 + }, + "vulnerability": { + "type": "Vulnerability", + "id": 20 + }, + "muteUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalSystems": { + "keyType": "string", + "type": "ExternalSystem", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mitreAttack": { + "type": "MitreAttack", + "id": 25 + }, + "access": { + "type": "Access", + "id": 26 + }, + "connections": { + "rule": "repeated", + "type": "Connection", + "id": 31 + }, + "muteInitiator": { + "type": "string", + "id": 28 + }, + "muteInfo": { + "type": "MuteInfo", + "id": 61, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "processes": { + "rule": "repeated", + "type": "Process", + "id": 30 + }, + "contacts": { + "keyType": "string", + "type": "ContactDetails", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "compliances": { + "rule": "repeated", + "type": "Compliance", + "id": 34 + }, + "parentDisplayName": { + "type": "string", + "id": 36, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 37 + }, + "exfiltration": { + "type": "Exfiltration", + "id": 38 + }, + "iamBindings": { + "rule": "repeated", + "type": "IamBinding", + "id": 39 + }, + "nextSteps": { + "type": "string", + "id": 40 + }, + "moduleName": { + "type": "string", + "id": 41 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 42 + }, + "kubernetes": { + "type": "Kubernetes", + "id": 43 + }, + "database": { + "type": "Database", + "id": 44 + }, + "attackExposure": { + "type": "AttackExposure", + "id": 45 + }, + "files": { + "rule": "repeated", + "type": "File", + "id": 46 + }, + "cloudDlpInspection": { + "type": "CloudDlpInspection", + "id": 48 + }, + "cloudDlpDataProfile": { + "type": "CloudDlpDataProfile", + "id": 49 + }, + "kernelRootkit": { + "type": "KernelRootkit", + "id": 50 + }, + "orgPolicies": { + "rule": "repeated", + "type": "OrgPolicy", + "id": 51 + }, + "application": { + "type": "Application", + "id": 53 + }, + "backupDisasterRecovery": { + "type": "BackupDisasterRecovery", + "id": 55 + }, + "securityPosture": { + "type": "SecurityPosture", + "id": 56 + }, + "logEntries": { + "rule": "repeated", + "type": "LogEntry", + "id": 57 + }, + "loadBalancers": { + "rule": "repeated", + "type": "LoadBalancer", + "id": 58 + }, + "cloudArmor": { + "type": "CloudArmor", + "id": 59 + }, + "notebook": { + "type": "Notebook", + "id": 63 + }, + "toxicCombination": { + "type": "ToxicCombination", + "id": 64 + }, + "groupMemberships": { + "rule": "repeated", + "type": "GroupMembership", + "id": 65 + }, + "chokepoint": { + "type": "Chokepoint", + "id": 77 + }, + "externalExposure": { + "type": "ExternalExposure", + "id": 84 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } + }, + "Mute": { + "values": { + "MUTE_UNSPECIFIED": 0, + "MUTED": 1, + "UNMUTED": 2, + "UNDEFINED": 4 + } + }, + "FindingClass": { + "values": { + "FINDING_CLASS_UNSPECIFIED": 0, + "THREAT": 1, + "VULNERABILITY": 2, + "MISCONFIGURATION": 3, + "OBSERVATION": 4, + "SCC_ERROR": 5, + "POSTURE_VIOLATION": 6, + "TOXIC_COMBINATION": 7, + "SENSITIVE_DATA_RISK": 8, + "CHOKEPOINT": 9, + "EXTERNAL_EXPOSURE": 10 + } + }, + "MuteInfo": { + "fields": { + "staticMute": { + "type": "StaticMute", + "id": 1 + }, + "dynamicMuteRecords": { + "rule": "repeated", + "type": "DynamicMuteRecord", + "id": 2 + } + }, + "nested": { + "StaticMute": { + "fields": { + "state": { + "type": "Mute", + "id": 1 + }, + "applyTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "DynamicMuteRecord": { + "fields": { + "muteConfig": { + "type": "string", + "id": 1 + }, + "matchTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + } + } + }, + "GroupMembership": { + "fields": { + "groupType": { + "type": "GroupType", + "id": 1 + }, + "groupId": { + "type": "string", + "id": 2 + } + }, + "nested": { + "GroupType": { + "values": { + "GROUP_TYPE_UNSPECIFIED": 0, + "GROUP_TYPE_TOXIC_COMBINATION": 1, + "GROUP_TYPE_CHOKEPOINT": 3 + } + } + } + }, + "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": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "domains": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "signatures": { + "rule": "repeated", + "type": "ProcessSignature", + "id": 3 + }, + "uris": { + "rule": "repeated", + "type": "string", + "id": 4 + } + }, + "nested": { + "ProcessSignature": { + "oneofs": { + "signature": { + "oneof": [ + "memoryHashSignature", + "yaraRuleSignature" + ] + } + }, + "fields": { + "memoryHashSignature": { + "type": "MemoryHashSignature", + "id": 6 + }, + "yaraRuleSignature": { + "type": "YaraRuleSignature", + "id": 7 + }, + "signatureType": { + "type": "SignatureType", + "id": 8 + } + }, + "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 + } + } + }, + "SignatureType": { + "values": { + "SIGNATURE_TYPE_UNSPECIFIED": 0, + "SIGNATURE_TYPE_PROCESS": 1, + "SIGNATURE_TYPE_FILE": 2 + } + } + } + } + } + }, + "KernelRootkit": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "unexpectedCodeModification": { + "type": "bool", + "id": 2 + }, + "unexpectedReadOnlyDataModification": { + "type": "bool", + "id": 3 + }, + "unexpectedFtraceHandler": { + "type": "bool", + "id": 4 + }, + "unexpectedKprobeHandler": { + "type": "bool", + "id": 5 + }, + "unexpectedKernelCodePages": { + "type": "bool", + "id": 6 + }, + "unexpectedSystemCallHandler": { + "type": "bool", + "id": 7 + }, + "unexpectedInterruptHandler": { + "type": "bool", + "id": 8 + }, + "unexpectedProcessesInRunqueue": { + "type": "bool", + "id": 9 + } + } + }, + "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 + }, + "objects": { + "rule": "repeated", + "type": "Object", + "id": 7 + } + }, + "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 + } + } + }, + "Object": { + "fields": { + "group": { + "type": "string", + "id": 1 + }, + "kind": { + "type": "string", + "id": 2 + }, + "ns": { + "type": "string", + "id": 3 + }, + "name": { + "type": "string", + "id": 4 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 5 + } + } + } + } + }, + "LoadBalancer": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "LogEntry": { + "oneofs": { + "logEntry": { + "oneof": [ + "cloudLoggingEntry" + ] + } + }, + "fields": { + "cloudLoggingEntry": { + "type": "CloudLoggingEntry", + "id": 1 + } + } + }, + "CloudLoggingEntry": { + "fields": { + "insertId": { + "type": "string", + "id": 1 + }, + "logId": { + "type": "string", + "id": 2 + }, + "resourceContainer": { + "type": "string", + "id": 3 + }, + "timestamp": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "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, + "MASQUERADING": 49, + "MATCH_LEGITIMATE_NAME_OR_LOCATION": 50, + "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": 37, + "STARTUP_ITEMS": 38, + "NETWORK_SERVICE_DISCOVERY": 32, + "PROCESS_DISCOVERY": 56, + "COMMAND_AND_SCRIPTING_INTERPRETER": 6, + "UNIX_SHELL": 7, + "PYTHON": 59, + "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": 63, + "PERMISSION_GROUPS_DISCOVERY": 18, + "CLOUD_GROUPS": 19, + "INDICATOR_REMOVAL_FILE_DELETION": 64, + "APPLICATION_LAYER_PROTOCOL": 45, + "DNS": 46, + "SOFTWARE_DEPLOYMENT_TOOLS": 47, + "VALID_ACCOUNTS": 14, + "DEFAULT_ACCOUNTS": 35, + "LOCAL_ACCOUNTS": 15, + "CLOUD_ACCOUNTS": 16, + "PROXY": 9, + "EXTERNAL_PROXY": 10, + "MULTI_HOP_PROXY": 11, + "ACCOUNT_MANIPULATION": 22, + "ADDITIONAL_CLOUD_CREDENTIALS": 40, + "SSH_AUTHORIZED_KEYS": 23, + "ADDITIONAL_CONTAINER_CLUSTER_ROLES": 58, + "INGRESS_TOOL_TRANSFER": 3, + "NATIVE_API": 4, + "BRUTE_FORCE": 44, + "SHARED_MODULES": 5, + "ACCESS_TOKEN_MANIPULATION": 33, + "TOKEN_IMPERSONATION_OR_THEFT": 39, + "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, + "DOMAIN_POLICY_MODIFICATION": 30, + "DATA_DESTRUCTION": 29, + "SERVICE_STOP": 52, + "INHIBIT_SYSTEM_RECOVERY": 36, + "RESOURCE_HIJACKING": 8, + "NETWORK_DENIAL_OF_SERVICE": 17, + "CLOUD_SERVICE_DISCOVERY": 48, + "STEAL_APPLICATION_ACCESS_TOKEN": 42, + "ACCOUNT_ACCESS_REMOVAL": 51, + "STEAL_WEB_SESSION_COOKIE": 25, + "CREATE_OR_MODIFY_SYSTEM_PROCESS": 24, + "ABUSE_ELEVATION_CONTROL_MECHANISM": 34, + "UNSECURED_CREDENTIALS": 13, + "MODIFY_AUTHENTICATION_PROCESS": 28, + "IMPAIR_DEFENSES": 31, + "DISABLE_OR_MODIFY_TOOLS": 55, + "EXFILTRATION_OVER_WEB_SERVICE": 20, + "EXFILTRATION_TO_CLOUD_STORAGE": 21, + "DYNAMIC_RESOLUTION": 12, + "LATERAL_TOOL_TRANSFER": 41, + "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": 26, + "CREATE_SNAPSHOT": 54, + "CLOUD_INFRASTRUCTURE_DISCOVERY": 53, + "OBTAIN_CAPABILITIES": 43, + "ACTIVE_SCANNING": 1, + "SCANNING_IP_BLOCKS": 2, + "CONTAINER_ADMINISTRATION_COMMAND": 60, + "ESCAPE_TO_HOST": 61, + "CONTAINER_AND_RESOURCE_DISCOVERY": 57, + "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": 62 + } + } + } + }, + "Notebook": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "lastAuthor": { + "type": "string", + "id": 3 + }, + "notebookUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "OrgPolicy": { + "options": { + "(google.api.resource).type": "orgpolicy.googleapis.com/Policy", + "(google.api.resource).pattern": "projects/{project}/policies/{constraint_name}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Process": { + "fields": { + "name": { + "type": "string", + "id": 12 + }, + "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 + } + } + }, + "SecurityPosture": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "revisionId": { + "type": "string", + "id": 2 + }, + "postureDeploymentResource": { + "type": "string", + "id": 3 + }, + "postureDeployment": { + "type": "string", + "id": 4 + }, + "changedPolicy": { + "type": "string", + "id": 5 + }, + "policySet": { + "type": "string", + "id": 6 + }, + "policy": { + "type": "string", + "id": 7 + }, + "policyDriftDetails": { + "rule": "repeated", + "type": "PolicyDriftDetails", + "id": 8 + } + }, + "nested": { + "PolicyDriftDetails": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "expectedValue": { + "type": "string", + "id": 2 + }, + "detectedValue": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ToxicCombination": { + "fields": { + "attackExposureScore": { + "type": "double", + "id": 1 + }, + "relatedFindings": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "Vulnerability": { + "fields": { + "cve": { + "type": "Cve", + "id": 1 + }, + "offendingPackage": { + "type": "Package", + "id": 2 + }, + "fixedPackage": { + "type": "Package", + "id": 3 + }, + "securityBulletin": { + "type": "SecurityBulletin", + "id": 4 + } + } + }, + "Cve": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "references": { + "rule": "repeated", + "type": "Reference", + "id": 2 + }, + "cvssv3": { + "type": "Cvssv3", + "id": 3 + }, + "upstreamFixAvailable": { + "type": "bool", + "id": 4 + }, + "impact": { + "type": "RiskRating", + "id": 5 + }, + "exploitationActivity": { + "type": "ExploitationActivity", + "id": 6 + }, + "observedInTheWild": { + "type": "bool", + "id": 7 + }, + "zeroDay": { + "type": "bool", + "id": 8 + }, + "exploitReleaseDate": { + "type": "google.protobuf.Timestamp", + "id": 9 + } + }, + "nested": { + "RiskRating": { + "values": { + "RISK_RATING_UNSPECIFIED": 0, + "LOW": 1, + "MEDIUM": 2, + "HIGH": 3, + "CRITICAL": 4 + } + }, + "ExploitationActivity": { + "values": { + "EXPLOITATION_ACTIVITY_UNSPECIFIED": 0, + "WIDE": 1, + "CONFIRMED": 2, + "AVAILABLE": 3, + "ANTICIPATED": 4, + "NO_KNOWN": 5 + } + } + } + }, + "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 + } + } + } + }, + "Package": { + "fields": { + "packageName": { + "type": "string", + "id": 1 + }, + "cpeUri": { + "type": "string", + "id": 2 + }, + "packageType": { + "type": "string", + "id": 3 + }, + "packageVersion": { + "type": "string", + "id": 4 + } + } + }, + "SecurityBulletin": { + "fields": { + "bulletinId": { + "type": "string", + "id": 1 + }, + "submissionTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "suggestedUpgradeVersion": { + "type": "string", + "id": 3 + } + } + }, + "MuteConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/MuteConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/muteConfigs/{mute_config}", + "(google.api.resource).plural": "muteConfigs", + "(google.api.resource).singular": "muteConfig" + }, + "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" + } + }, + "type": { + "type": "MuteConfigType", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expiryTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MuteConfigType": { + "values": { + "MUTE_CONFIG_TYPE_UNSPECIFIED": 0, + "STATIC": 1, + "DYNAMIC": 2 + } + } + } + }, + "NotificationConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", + "(google.api.resource).pattern": "projects/{project}/notificationConfigs/{notification_config}", + "(google.api.resource).plural": "notificationConfigs", + "(google.api.resource).singular": "notificationConfig" + }, + "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 + }, + "resource": { + "type": "Resource", + "id": 3 + } + } + }, + "Resource": { + "oneofs": { + "cloudProviderMetadata": { + "oneof": [ + "awsMetadata", + "azureMetadata" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 8 + }, + "type": { + "type": "string", + "id": 6 + }, + "project": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parent": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudProvider": { + "type": "CloudProvider", + "id": 9 + }, + "organization": { + "type": "string", + "id": 10 + }, + "service": { + "type": "string", + "id": 11 + }, + "location": { + "type": "string", + "id": 12 + }, + "awsMetadata": { + "type": "AwsMetadata", + "id": 16 + }, + "azureMetadata": { + "type": "AzureMetadata", + "id": 17 + }, + "resourcePath": { + "type": "ResourcePath", + "id": 18 + }, + "resourcePathString": { + "type": "string", + "id": 19 + } + } + }, + "CloudProvider": { + "values": { + "CLOUD_PROVIDER_UNSPECIFIED": 0, + "GOOGLE_CLOUD_PLATFORM": 1, + "AMAZON_WEB_SERVICES": 2, + "MICROSOFT_AZURE": 3 + } + }, + "AwsMetadata": { + "fields": { + "organization": { + "type": "AwsOrganization", + "id": 2 + }, + "organizationalUnits": { + "rule": "repeated", + "type": "AwsOrganizationalUnit", + "id": 3 + }, + "account": { + "type": "AwsAccount", + "id": 4 + } + }, + "nested": { + "AwsOrganization": { + "fields": { + "id": { + "type": "string", + "id": 1 + } + } + }, + "AwsOrganizationalUnit": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "AwsAccount": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + } + } + }, + "AzureMetadata": { + "fields": { + "managementGroups": { + "rule": "repeated", + "type": "AzureManagementGroup", + "id": 4 + }, + "subscription": { + "type": "AzureSubscription", + "id": 5 + }, + "resourceGroup": { + "type": "AzureResourceGroup", + "id": 6 + } + }, + "nested": { + "AzureManagementGroup": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "AzureSubscription": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "AzureResourceGroup": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ResourcePath": { + "fields": { + "nodes": { + "rule": "repeated", + "type": "ResourcePathNode", + "id": 1 + } + }, + "nested": { + "ResourcePathNodeType": { + "values": { + "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED": 0, + "GCP_ORGANIZATION": 1, + "GCP_FOLDER": 2, + "GCP_PROJECT": 3, + "AWS_ORGANIZATION": 4, + "AWS_ORGANIZATIONAL_UNIT": 5, + "AWS_ACCOUNT": 6, + "AZURE_MANAGEMENT_GROUP": 7, + "AZURE_SUBSCRIPTION": 8, + "AZURE_RESOURCE_GROUP": 9 + } + }, + "ResourcePathNode": { + "fields": { + "nodeType": { + "type": "ResourcePathNodeType", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + } + } + } + } + }, + "OrganizationSettings": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", + "(google.api.resource).pattern": "organizations/{organization}/organizationSettings", + "(google.api.resource).plural": "organizationSettings", + "(google.api.resource).singular": "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 + }, + "folderIds": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "InclusionMode": { + "values": { + "INCLUSION_MODE_UNSPECIFIED": 0, + "INCLUDE_ONLY": 1, + "EXCLUDE": 2 + } + } + } + } + } + }, + "ResourceValueConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/ResourceValueConfig", + "(google.api.resource).pattern": "organizations/{organization}/resourceValueConfigs/{resource_value_config}", + "(google.api.resource).plural": "resourceValueConfigs", + "(google.api.resource).singular": "resourceValueConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "resourceValue": { + "type": "ResourceValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tagValues": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceType": { + "type": "string", + "id": 4 + }, + "scope": { + "type": "string", + "id": 5 + }, + "resourceLabelsSelector": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudProvider": { + "type": "CloudProvider", + "id": 10 + }, + "sensitiveDataProtectionMapping": { + "type": "SensitiveDataProtectionMapping", + "id": 11 + } + }, + "nested": { + "SensitiveDataProtectionMapping": { + "fields": { + "highSensitivityMapping": { + "type": "ResourceValue", + "id": 1 + }, + "mediumSensitivityMapping": { + "type": "ResourceValue", + "id": 2 + } + } + } + } + }, + "ResourceValue": { + "values": { + "RESOURCE_VALUE_UNSPECIFIED": 0, + "HIGH": 1, + "MEDIUM": 2, + "LOW": 3, + "NONE": 4 + } + }, + "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 + } + } + } + }, + "SecurityHealthAnalyticsCustomModule": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule", + "(google.api.resource).pattern": "projects/{project}/securityHealthAnalyticsSettings/customModules/{custom_module}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "enablementState": { + "type": "EnablementState", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastEditor": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ancestorModule": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + }, + "customConfig": { + "type": "CustomConfig", + "id": 8 + } + }, + "nested": { + "EnablementState": { + "values": { + "ENABLEMENT_STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "INHERITED": 3 + } + } + } + }, + "SecurityCenter": { + "options": { + "(google.api.default_host)": "securitycenter.googleapis.com", + "(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" + } + } + ] + }, + "CreateSecurityHealthAnalyticsCustomModule": { + "requestType": "CreateSecurityHealthAnalyticsCustomModuleRequest", + "responseType": "SecurityHealthAnalyticsCustomModule", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules", + "(google.api.http).body": "security_health_analytics_custom_module", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules", + "(google.api.http).additional_bindings.body": "security_health_analytics_custom_module", + "(google.api.method_signature)": "parent,security_health_analytics_custom_module" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules", + "body": "security_health_analytics_custom_module", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules", + "body": "security_health_analytics_custom_module" + }, + { + "post": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules", + "body": "security_health_analytics_custom_module" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,security_health_analytics_custom_module" + } + ] + }, + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "Source", + "options": { + "(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", + "responseType": "Finding", + "options": { + "(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" + } + ] + }, + "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/*/locations/*}/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=organizations/*/locations/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v1/{parent=folders/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v1/{parent=folders/*/locations/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v1/{parent=projects/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v1/{parent=projects/*/locations/*}/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", + "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", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/notificationConfigs", + "body": "notification_config" + }, + { + "post": "/v1/{parent=projects/*}/notificationConfigs", + "body": "notification_config" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,config_id,notification_config" + }, + { + "(google.api.method_signature)": "parent,notification_config" + } + ] + }, + "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/*/locations/*/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/*}" + }, + { + "delete": "/v1/{name=organizations/*/locations/*/muteConfigs/*}" + }, + { + "delete": "/v1/{name=folders/*/locations/*/muteConfigs/*}" + }, + { + "delete": "/v1/{name=projects/*/locations/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteNotificationConfig": { + "requestType": "DeleteNotificationConfigRequest", + "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/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/notificationConfigs/*}" + }, + { + "delete": "/v1/{name=projects/*/notificationConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteSecurityHealthAnalyticsCustomModule": { + "requestType": "DeleteSecurityHealthAnalyticsCustomModuleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}" + }, + { + "delete": "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSimulation": { + "requestType": "GetSimulationRequest", + "responseType": "Simulation", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/simulations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/simulations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetValuedResource": { + "requestType": "GetValuedResourceRequest", + "responseType": "ValuedResource", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/simulations/*/valuedResources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/simulations/*/valuedResources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "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", + "options": { + "(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" + } + ] + }, + "GetMuteConfig": { + "requestType": "GetMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/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/*}" + }, + { + "get": "/v1/{name=organizations/*/locations/*/muteConfigs/*}" + }, + { + "get": "/v1/{name=folders/*/locations/*/muteConfigs/*}" + }, + { + "get": "/v1/{name=projects/*/locations/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetNotificationConfig": { + "requestType": "GetNotificationConfigRequest", + "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/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/notificationConfigs/*}" + }, + { + "get": "/v1/{name=projects/*/notificationConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetOrganizationSettings": { + "requestType": "GetOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "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" + } + ] + }, + "GetEffectiveSecurityHealthAnalyticsCustomModule": { + "requestType": "GetEffectiveSecurityHealthAnalyticsCustomModuleRequest", + "responseType": "EffectiveSecurityHealthAnalyticsCustomModule", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" + }, + { + "get": "/v1/{name=projects/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSecurityHealthAnalyticsCustomModule": { + "requestType": "GetSecurityHealthAnalyticsCustomModuleRequest", + "responseType": "SecurityHealthAnalyticsCustomModule", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}" + }, + { + "get": "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "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", + "responseType": "GroupAssetsResponse", + "options": { + "deprecated": true, + "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/assets:group", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/assets:group", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/assets:group", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*}/assets:group", + "body": "*" + } + ] + } + } + ] + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "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": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*/sources/*}/findings:group", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "deprecated": true, + "(google.api.http).get": "/v1/{parent=organizations/*}/assets", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/assets" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/assets", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/assets" + }, + { + "get": "/v1/{parent=projects/*}/assets" + } + ] + } + } + ] + }, + "ListDescendantSecurityHealthAnalyticsCustomModules": { + "requestType": "ListDescendantSecurityHealthAnalyticsCustomModulesRequest", + "responseType": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:listDescendant", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:listDescendant", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:listDescendant", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:listDescendant" + }, + { + "get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:listDescendant" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(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", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/sources/*}/findings" + }, + { + "get": "/v1/{parent=projects/*/sources/*}/findings" + } + ] + } + } + ] + }, + "ListMuteConfigs": { + "requestType": "ListMuteConfigsRequest", + "responseType": "ListMuteConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/muteConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*/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" + }, + { + "get": "/v1/{parent=organizations/*/locations/*/muteConfigs}" + }, + { + "get": "/v1/{parent=folders/*/locations/*/muteConfigs}" + }, + { + "get": "/v1/{parent=projects/*/locations/*/muteConfigs}" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListNotificationConfigs": { + "requestType": "ListNotificationConfigsRequest", + "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", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/notificationConfigs" + }, + { + "get": "/v1/{parent=projects/*}/notificationConfigs" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEffectiveSecurityHealthAnalyticsCustomModules": { + "requestType": "ListEffectiveSecurityHealthAnalyticsCustomModulesRequest", + "responseType": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/effectiveCustomModules", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/effectiveCustomModules", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/effectiveCustomModules", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/effectiveCustomModules" + }, + { + "get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/effectiveCustomModules" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListSecurityHealthAnalyticsCustomModules": { + "requestType": "ListSecurityHealthAnalyticsCustomModulesRequest", + "responseType": "ListSecurityHealthAnalyticsCustomModulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules" + }, + { + "get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListSources": { + "requestType": "ListSourcesRequest", + "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", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/sources" + }, + { + "get": "/v1/{parent=projects/*}/sources" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RunAssetDiscovery": { + "requestType": "RunAssetDiscoveryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "deprecated": true, + "(google.api.http).post": "/v1/{parent=organizations/*}/assets:runDiscovery", + "(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" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(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", + "responseType": "Finding", + "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": "*", + "additional_bindings": [ + { + "post": "/v1/{name=folders/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v1/{name=projects/*/sources/*/findings/*}:setState", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,state,start_time" + } + ] + }, + "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", + "options": { + "(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", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(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" + } + ] + }, + "SimulateSecurityHealthAnalyticsCustomModule": { + "requestType": "SimulateSecurityHealthAnalyticsCustomModuleRequest", + "responseType": "SimulateSecurityHealthAnalyticsCustomModuleResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:simulate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:simulate", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,custom_config,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:simulate", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:simulate", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:simulate", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,custom_config,resource" + } + ] + }, + "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", + "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", + "additional_bindings": [ + { + "patch": "/v1/{finding.name=folders/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v1/{finding.name=projects/*/sources/*/findings/*}", + "body": "finding" + } + ] + } + }, + { + "(google.api.method_signature)": "finding" + } + ] + }, + "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/*/locations/*/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" + }, + { + "patch": "/v1/{mute_config.name=organizations/*/locations/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v1/{mute_config.name=folders/*/locations/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v1/{mute_config.name=projects/*/locations/*/muteConfigs/*}", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.method_signature)": "mute_config,update_mask" + } + ] + }, + "UpdateNotificationConfig": { + "requestType": "UpdateNotificationConfigRequest", + "responseType": "NotificationConfig", + "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", + "additional_bindings": [ + { + "patch": "/v1/{notification_config.name=folders/*/notificationConfigs/*}", + "body": "notification_config" + }, + { + "patch": "/v1/{notification_config.name=projects/*/notificationConfigs/*}", + "body": "notification_config" + } + ] + } + }, + { + "(google.api.method_signature)": "notification_config" + }, + { + "(google.api.method_signature)": "notification_config,update_mask" + } + ] + }, + "UpdateOrganizationSettings": { + "requestType": "UpdateOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(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" + } + ] + }, + "UpdateSecurityHealthAnalyticsCustomModule": { + "requestType": "UpdateSecurityHealthAnalyticsCustomModuleRequest", + "responseType": "SecurityHealthAnalyticsCustomModule", + "options": { + "(google.api.http).patch": "/v1/{security_health_analytics_custom_module.name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", + "(google.api.http).body": "security_health_analytics_custom_module", + "(google.api.http).additional_bindings.patch": "/v1/{security_health_analytics_custom_module.name=projects/*/securityHealthAnalyticsSettings/customModules/*}", + "(google.api.http).additional_bindings.body": "security_health_analytics_custom_module", + "(google.api.method_signature)": "security_health_analytics_custom_module,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{security_health_analytics_custom_module.name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", + "body": "security_health_analytics_custom_module", + "additional_bindings": [ + { + "patch": "/v1/{security_health_analytics_custom_module.name=folders/*/securityHealthAnalyticsSettings/customModules/*}", + "body": "security_health_analytics_custom_module" + }, + { + "patch": "/v1/{security_health_analytics_custom_module.name=projects/*/securityHealthAnalyticsSettings/customModules/*}", + "body": "security_health_analytics_custom_module" + } + ] + } + }, + { + "(google.api.method_signature)": "security_health_analytics_custom_module,update_mask" + } + ] + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "Source", + "options": { + "(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", + "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=projects/*/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=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" + } + ] + } + }, + { + "(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" + } + ] + }, + "CreateEventThreatDetectionCustomModule": { + "requestType": "CreateEventThreatDetectionCustomModuleRequest", + "responseType": "EventThreatDetectionCustomModule", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules", + "(google.api.http).body": "event_threat_detection_custom_module", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules", + "(google.api.http).additional_bindings.body": "event_threat_detection_custom_module", + "(google.api.method_signature)": "parent,event_threat_detection_custom_module" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules", + "body": "event_threat_detection_custom_module", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules", + "body": "event_threat_detection_custom_module" + }, + { + "post": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules", + "body": "event_threat_detection_custom_module" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,event_threat_detection_custom_module" + } + ] + }, + "DeleteEventThreatDetectionCustomModule": { + "requestType": "DeleteEventThreatDetectionCustomModuleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}" + }, + { + "delete": "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEventThreatDetectionCustomModule": { + "requestType": "GetEventThreatDetectionCustomModuleRequest", + "responseType": "EventThreatDetectionCustomModule", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}" + }, + { + "get": "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDescendantEventThreatDetectionCustomModules": { + "requestType": "ListDescendantEventThreatDetectionCustomModulesRequest", + "responseType": "ListDescendantEventThreatDetectionCustomModulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:listDescendant", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:listDescendant", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:listDescendant", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules:listDescendant" + }, + { + "get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:listDescendant" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEventThreatDetectionCustomModules": { + "requestType": "ListEventThreatDetectionCustomModulesRequest", + "responseType": "ListEventThreatDetectionCustomModulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules" + }, + { + "get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateEventThreatDetectionCustomModule": { + "requestType": "UpdateEventThreatDetectionCustomModuleRequest", + "responseType": "EventThreatDetectionCustomModule", + "options": { + "(google.api.http).patch": "/v1/{event_threat_detection_custom_module.name=organizations/*/eventThreatDetectionSettings/customModules/*}", + "(google.api.http).body": "event_threat_detection_custom_module", + "(google.api.http).additional_bindings.patch": "/v1/{event_threat_detection_custom_module.name=projects/*/eventThreatDetectionSettings/customModules/*}", + "(google.api.http).additional_bindings.body": "event_threat_detection_custom_module", + "(google.api.method_signature)": "event_threat_detection_custom_module,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{event_threat_detection_custom_module.name=organizations/*/eventThreatDetectionSettings/customModules/*}", + "body": "event_threat_detection_custom_module", + "additional_bindings": [ + { + "patch": "/v1/{event_threat_detection_custom_module.name=folders/*/eventThreatDetectionSettings/customModules/*}", + "body": "event_threat_detection_custom_module" + }, + { + "patch": "/v1/{event_threat_detection_custom_module.name=projects/*/eventThreatDetectionSettings/customModules/*}", + "body": "event_threat_detection_custom_module" + } + ] + } + }, + { + "(google.api.method_signature)": "event_threat_detection_custom_module,update_mask" + } + ] + }, + "ValidateEventThreatDetectionCustomModule": { + "requestType": "ValidateEventThreatDetectionCustomModuleRequest", + "responseType": "ValidateEventThreatDetectionCustomModuleResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/eventThreatDetectionSettings}:validateCustomModule", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/eventThreatDetectionSettings}:validateCustomModule", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/eventThreatDetectionSettings}:validateCustomModule", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/eventThreatDetectionSettings}:validateCustomModule", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*/eventThreatDetectionSettings}:validateCustomModule", + "body": "*" + } + ] + } + } + ] + }, + "GetEffectiveEventThreatDetectionCustomModule": { + "requestType": "GetEffectiveEventThreatDetectionCustomModuleRequest", + "responseType": "EffectiveEventThreatDetectionCustomModule", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/eventThreatDetectionSettings/effectiveCustomModules/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/eventThreatDetectionSettings/effectiveCustomModules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/eventThreatDetectionSettings/effectiveCustomModules/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/eventThreatDetectionSettings/effectiveCustomModules/*}" + }, + { + "get": "/v1/{name=projects/*/eventThreatDetectionSettings/effectiveCustomModules/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEffectiveEventThreatDetectionCustomModules": { + "requestType": "ListEffectiveEventThreatDetectionCustomModulesRequest", + "responseType": "ListEffectiveEventThreatDetectionCustomModulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/effectiveCustomModules", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/effectiveCustomModules", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/effectiveCustomModules", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/eventThreatDetectionSettings}/effectiveCustomModules" + }, + { + "get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/effectiveCustomModules" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "BatchCreateResourceValueConfigs": { + "requestType": "BatchCreateResourceValueConfigsRequest", + "responseType": "BatchCreateResourceValueConfigsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/resourceValueConfigs:batchCreate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,requests" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/resourceValueConfigs:batchCreate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,requests" + } + ] + }, + "DeleteResourceValueConfig": { + "requestType": "DeleteResourceValueConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/resourceValueConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/resourceValueConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetResourceValueConfig": { + "requestType": "GetResourceValueConfigRequest", + "responseType": "ResourceValueConfig", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/resourceValueConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/resourceValueConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListResourceValueConfigs": { + "requestType": "ListResourceValueConfigsRequest", + "responseType": "ListResourceValueConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/resourceValueConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/resourceValueConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateResourceValueConfig": { + "requestType": "UpdateResourceValueConfigRequest", + "responseType": "ResourceValueConfig", + "options": { + "(google.api.http).patch": "/v1/{resource_value_config.name=organizations/*/resourceValueConfigs/*}", + "(google.api.http).body": "resource_value_config", + "(google.api.method_signature)": "resource_value_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{resource_value_config.name=organizations/*/resourceValueConfigs/*}", + "body": "resource_value_config" + } + }, + { + "(google.api.method_signature)": "resource_value_config,update_mask" + } + ] + }, + "ListValuedResources": { + "requestType": "ListValuedResourcesRequest", + "responseType": "ListValuedResourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/simulations/*}/valuedResources", + "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/simulations/*}/valuedResources", + "additional_bindings": { + "get": "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListAttackPaths": { + "requestType": "ListAttackPathsRequest", + "responseType": "ListAttackPathsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/simulations/*}/attackPaths", + "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/simulations/*}/attackPaths", + "additional_bindings": [ + { + "get": "/v1/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" + }, + { + "get": "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "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 + } + }, + "muteState": { + "type": "MuteState", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MuteState": { + "values": { + "MUTE_STATE_UNSPECIFIED": 0, + "MUTED": 1, + "UNDEFINED": 2 + } + } + } + }, + "BulkMuteFindingsResponse": { + "fields": {} + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "CreateResourceValueConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" + } + }, + "resourceValueConfig": { + "type": "ResourceValueConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateResourceValueConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" + } + }, + "requests": { + "rule": "repeated", + "type": "CreateResourceValueConfigRequest", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateResourceValueConfigsResponse": { + "fields": { + "resourceValueConfigs": { + "rule": "repeated", + "type": "ResourceValueConfig", + "id": 1 + } + } + }, + "DeleteResourceValueConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/ResourceValueConfig" + } + } + } + }, + "GetResourceValueConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/ResourceValueConfig" + } + } + } + }, + "ListResourceValueConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListResourceValueConfigsResponse": { + "fields": { + "resourceValueConfigs": { + "rule": "repeated", + "type": "ResourceValueConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateResourceValueConfigRequest": { + "fields": { + "resourceValueConfig": { + "type": "ResourceValueConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CreateNotificationConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateSecurityHealthAnalyticsCustomModuleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + }, + "securityHealthAnalyticsCustomModule": { + "type": "SecurityHealthAnalyticsCustomModule", + "id": 2, + "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" + } + } + } + }, + "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": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "DeleteSecurityHealthAnalyticsCustomModuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + } + } + }, + "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": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" + } + } + } + }, + "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" + } + } + } + }, + "GetEffectiveSecurityHealthAnalyticsCustomModuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule" + } + } + } + }, + "GetSecurityHealthAnalyticsCustomModuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + } + } + }, + "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).child_type": "securitycenter.googleapis.com/Asset" + } + }, + "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 + }, + "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 + }, + "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 + } + } + }, + "ListDescendantSecurityHealthAnalyticsCustomModulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDescendantSecurityHealthAnalyticsCustomModulesResponse": { + "fields": { + "securityHealthAnalyticsCustomModules": { + "rule": "repeated", + "type": "SecurityHealthAnalyticsCustomModule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListValuedResourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ValuedResource" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListValuedResourcesResponse": { + "fields": { + "valuedResources": { + "rule": "repeated", + "type": "ValuedResource", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListAttackPathsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/AttackPath" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListAttackPathsResponse": { + "fields": { + "attackPaths": { + "rule": "repeated", + "type": "AttackPath", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSimulationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Simulation" + } + } + } + }, + "GetValuedResourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/ValuedResource" + } + } + } + }, + "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": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListNotificationConfigsResponse": { + "fields": { + "notificationConfigs": { + "rule": "repeated", + "type": "NotificationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListEffectiveSecurityHealthAnalyticsCustomModulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse": { + "fields": { + "effectiveSecurityHealthAnalyticsCustomModules": { + "rule": "repeated", + "type": "EffectiveSecurityHealthAnalyticsCustomModule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSecurityHealthAnalyticsCustomModulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSecurityHealthAnalyticsCustomModulesResponse": { + "fields": { + "securityHealthAnalyticsCustomModules": { + "rule": "repeated", + "type": "SecurityHealthAnalyticsCustomModule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" + } + }, + "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).child_type": "securitycenter.googleapis.com/Asset" + } + }, + "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 + } + } + }, + "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 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "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, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "CHANGED": 1, + "UNCHANGED": 2, + "ADDED": 3, + "REMOVED": 4 + } + }, + "Resource": { + "oneofs": { + "cloudProviderMetadata": { + "oneof": [ + "awsMetadata", + "azureMetadata" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 8 + }, + "type": { + "type": "string", + "id": 6 + }, + "projectName": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parentName": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7 + }, + "cloudProvider": { + "type": "CloudProvider", + "id": 9 + }, + "organization": { + "type": "string", + "id": 10 + }, + "service": { + "type": "string", + "id": 11 + }, + "location": { + "type": "string", + "id": 12 + }, + "awsMetadata": { + "type": "AwsMetadata", + "id": 16 + }, + "azureMetadata": { + "type": "AzureMetadata", + "id": 17 + }, + "resourcePath": { + "type": "ResourcePath", + "id": 18 + }, + "resourcePathString": { + "type": "string", + "id": 19 + } + } + } + } + } + } + }, + "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" + } + } + } + }, + "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": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + } + } + }, + "SimulateSecurityHealthAnalyticsCustomModuleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "customConfig": { + "type": "CustomConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "SimulatedResource", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SimulatedResource": { + "fields": { + "resourceType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceData": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "iamPolicyData": { + "type": "google.iam.v1.Policy", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "SimulateSecurityHealthAnalyticsCustomModuleResponse": { + "fields": { + "result": { + "type": "SimulatedResult", + "id": 1 + } + }, + "nested": { + "SimulatedResult": { + "oneofs": { + "result": { + "oneof": [ + "finding", + "noViolation", + "error" + ] + } + }, + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "noViolation": { + "type": "google.protobuf.Empty", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 3 + } + } + } + } + }, + "UpdateExternalSystemRequest": { + "fields": { + "externalSystem": { + "type": "ExternalSystem", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateFindingRequest": { + "fields": { + "finding": { + "type": "Finding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateMuteConfigRequest": { + "fields": { + "muteConfig": { + "type": "MuteConfig", + "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 + } + } + }, + "UpdateSecurityHealthAnalyticsCustomModuleRequest": { + "fields": { + "securityHealthAnalyticsCustomModule": { + "type": "SecurityHealthAnalyticsCustomModule", + "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 + } + } + }, + "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" + } + } + } + }, + "CreateEventThreatDetectionCustomModuleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + }, + "eventThreatDetectionCustomModule": { + "type": "EventThreatDetectionCustomModule", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ValidateEventThreatDetectionCustomModuleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + }, + "rawText": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ValidateEventThreatDetectionCustomModuleResponse": { + "fields": { + "errors": { + "type": "CustomModuleValidationErrors", + "id": 2 + } + } + }, + "DeleteEventThreatDetectionCustomModuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + } + } + }, + "GetEventThreatDetectionCustomModuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + } + } + }, + "ListDescendantEventThreatDetectionCustomModulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListDescendantEventThreatDetectionCustomModulesResponse": { + "fields": { + "eventThreatDetectionCustomModules": { + "rule": "repeated", + "type": "EventThreatDetectionCustomModule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListEventThreatDetectionCustomModulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListEventThreatDetectionCustomModulesResponse": { + "fields": { + "eventThreatDetectionCustomModules": { + "rule": "repeated", + "type": "EventThreatDetectionCustomModule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateEventThreatDetectionCustomModuleRequest": { + "fields": { + "eventThreatDetectionCustomModule": { + "type": "EventThreatDetectionCustomModule", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetEffectiveEventThreatDetectionCustomModuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" + } + } + } + }, + "ListEffectiveEventThreatDetectionCustomModulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListEffectiveEventThreatDetectionCustomModulesResponse": { + "fields": { + "effectiveEventThreatDetectionCustomModules": { + "rule": "repeated", + "type": "EffectiveEventThreatDetectionCustomModule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Simulation": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Simulation", + "(google.api.resource).pattern": "organizations/{organization}/simulations/{simulation}", + "(google.api.resource).plural": "simulations", + "(google.api.resource).singular": "simulation" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceValueConfigsMetadata": { + "rule": "repeated", + "type": "ResourceValueConfigMetadata", + "id": 3 + }, + "cloudProvider": { + "type": "CloudProvider", + "id": 4 + } + } + }, + "ValuedResource": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/ValuedResource", + "(google.api.resource).pattern": "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}", + "(google.api.resource).plural": "valuedResources", + "(google.api.resource).singular": "valuedResource" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "resource": { + "type": "string", + "id": 2 + }, + "resourceType": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4 + }, + "resourceValue": { + "type": "ResourceValue", + "id": 5 + }, + "exposedScore": { + "type": "double", + "id": 6 + }, + "resourceValueConfigsUsed": { + "rule": "repeated", + "type": "ResourceValueConfigMetadata", + "id": 7 + } + }, + "nested": { + "ResourceValue": { + "values": { + "RESOURCE_VALUE_UNSPECIFIED": 0, + "RESOURCE_VALUE_LOW": 1, + "RESOURCE_VALUE_MEDIUM": 2, + "RESOURCE_VALUE_HIGH": 3 + } + } + } + }, + "ResourceValueConfigMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "projects/{project}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "canonicalName": { + "type": "string", + "id": 14 + } + } + } + } + }, + "v1beta1": { + "options": { + "go_package": "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb", + "java_multiple_files": true, + "java_package": "com.google.cloud.securitycenter.v1beta1" + }, + "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 + } + }, + "nested": { + "SecurityCenterProperties": { + "fields": { + "resourceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resourceParent": { + "type": "string", + "id": 3 + }, + "resourceProject": { + "type": "string", + "id": 4 + }, + "resourceOwners": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + } + } + }, + "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, + "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 + } + } + } + }, + "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": "/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", + "responseType": "Finding", + "options": { + "(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", + "responseType": "google.iam.v1.Policy", + "options": { + "(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", + "responseType": "OrganizationSettings", + "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", + "responseType": "Source", + "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", + "responseType": "GroupAssetsResponse", + "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", + "responseType": "GroupFindingsResponse", + "options": { + "(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", + "responseType": "ListSourcesResponse", + "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", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=organizations/*}/assets:runDiscovery", + "(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" + }, + "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", + "responseType": "Finding", + "options": { + "(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", + "responseType": "google.iam.v1.Policy", + "options": { + "(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", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(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", + "responseType": "Finding", + "options": { + "(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", + "responseType": "OrganizationSettings", + "options": { + "(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", + "responseType": "Source", + "options": { + "(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", + "responseType": "SecurityMarks", + "options": { + "(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.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" + } + ] + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "pageToken": { + "type": "string", + "id": 5 + }, + "pageSize": { + "type": "int32", + "id": 6 + } + } + }, + "GroupFindingsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "GroupResult": { + "fields": { + "properties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1 + }, + "count": { + "type": "int64", + "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 + }, + "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 + }, + "state": { + "type": "State", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "UNUSED": 1, + "ADDED": 2, + "REMOVED": 3, + "ACTIVE": 4 + } + } + } + } + } + }, + "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 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 6 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListFindingsResponse": { + "fields": { + "findings": { + "rule": "repeated", + "type": "Finding", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 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 + } + } + }, + "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 + } + } + } + } + }, + "v1p1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.SecurityCenter.V1P1Beta1", + "go_package": "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb", + "java_multiple_files": true, + "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}" + }, + "nested": { + "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "projects/{project}/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 + }, + "canonicalName": { + "type": "string", + "id": 13 + } + }, + "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 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 + } + } + }, + "IamPolicy": { + "fields": { + "policyBlob": { + "type": "string", + "id": 1 + } + } + } + } + }, + "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": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "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": "projects/{project}/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 + }, + "severity": { + "type": "Severity", + "id": 13 + }, + "canonicalName": { + "type": "string", + "id": 14 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } + } + } + }, + "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 + }, + "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 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "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 + }, + "folderIds": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "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" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/sources", + "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" + }, + "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", + "responseType": "NotificationConfig", + "options": { + "(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", + "responseType": "google.protobuf.Empty", + "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", + "responseType": "google.iam.v1.Policy", + "options": { + "(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", + "responseType": "NotificationConfig", + "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", + "responseType": "OrganizationSettings", + "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", + "responseType": "Source", + "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", + "responseType": "GroupAssetsResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/assets:group", + "(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": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{parent=folders/*}/assets:group", + "body": "*" + }, + { + "post": "/v1p1beta1/{parent=projects/*}/assets:group", + "body": "*" + } + ] + } + } + ] + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "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": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{parent=folders/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v1p1beta1/{parent=projects/*/sources/*}/findings:group", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "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", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*}/assets" + }, + { + "get": "/v1p1beta1/{parent=projects/*}/assets" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "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", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*/sources/*}/findings" + }, + { + "get": "/v1p1beta1/{parent=projects/*/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" + }, + "parsedOptions": [ + { + "(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.http).additional_bindings.get": "/v1p1beta1/{parent=projects/*}/sources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*}/sources", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*}/sources" + }, + { + "get": "/v1p1beta1/{parent=projects/*}/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" + }, + "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", + "responseType": "Finding", + "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": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{name=folders/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState", + "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" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy", + "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" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions", + "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.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", + "additional_bindings": [ + { + "patch": "/v1p1beta1/{finding.name=folders/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}", + "body": "finding" + } + ] + } + }, + { + "(google.api.method_signature)": "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" + }, + "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", + "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" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}", + "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" + }, + "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", + "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=projects/*/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=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" + } + ] + } + }, + { + "(google.api.method_signature)": "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).child_type": "securitycenter.googleapis.com/Asset" + } + }, + "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 + }, + "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 + }, + "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).child_type": "securitycenter.googleapis.com/Source" + } + }, + "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).child_type": "securitycenter.googleapis.com/Asset" + } + }, + "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 + } + } + }, + "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 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "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, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "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 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 + } + } + }, + "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": "projects/{project}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "canonicalName": { + "type": "string", + "id": 14 + } + } + } + } + }, + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.SecurityCenter.V2", + "go_package": "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb", + "java_multiple_files": true, + "java_outer_classname": "SourceProto", + "java_package": "com.google.cloud.securitycenter.v2", + "php_namespace": "Google\\Cloud\\SecurityCenter\\V2", + "ruby_package": "Google::Cloud::SecurityCenter::V2", + "(google.api.resource_definition).type": "securitycenter.googleapis.com/OrganizationValuedResource", + "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}" + }, + "nested": { + "Access": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "callerIp": { + "type": "string", + "id": 2 + }, + "callerIpGeo": { + "type": "Geolocation", + "id": 3 + }, + "userAgentFamily": { + "type": "string", + "id": 4 + }, + "userAgent": { + "type": "string", + "id": 5 + }, + "serviceName": { + "type": "string", + "id": 6 + }, + "methodName": { + "type": "string", + "id": 7 + }, + "principalSubject": { + "type": "string", + "id": 8 + }, + "serviceAccountKeyName": { + "type": "string", + "id": 9 + }, + "serviceAccountDelegationInfo": { + "rule": "repeated", + "type": "ServiceAccountDelegationInfo", + "id": 10 + }, + "userName": { + "type": "string", + "id": 11 + } + } + }, + "ServiceAccountDelegationInfo": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "principalSubject": { + "type": "string", + "id": 2 + } + } + }, + "Geolocation": { + "fields": { + "regionCode": { + "type": "string", + "id": 1 + } + } + }, + "AffectedResources": { + "fields": { + "count": { + "type": "int64", + "id": 1 + } + } + }, + "AiModel": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "domain": { + "type": "string", + "id": 2 + }, + "library": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + }, + "publisher": { + "type": "string", + "id": 5 + }, + "deploymentPlatform": { + "type": "DeploymentPlatform", + "id": 6 + }, + "displayName": { + "type": "string", + "id": 7 + } + }, + "nested": { + "DeploymentPlatform": { + "values": { + "DEPLOYMENT_PLATFORM_UNSPECIFIED": 0, + "VERTEX_AI": 1, + "GKE": 2, + "GCE": 3, + "FINE_TUNED_MODEL": 4 + } + } + } + }, + "Application": { + "fields": { + "baseUri": { + "type": "string", + "id": 1 + }, + "fullUri": { + "type": "string", + "id": 2 + } + } + }, + "AttackExposure": { + "fields": { + "score": { + "type": "double", + "id": 1 + }, + "latestCalculationTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "attackExposureResult": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "exposedHighValueResourcesCount": { + "type": "int32", + "id": 5 + }, + "exposedMediumValueResourcesCount": { + "type": "int32", + "id": 6 + }, + "exposedLowValueResourcesCount": { + "type": "int32", + "id": 7 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CALCULATED": 1, + "NOT_CALCULATED": 2 + } + } + } + }, + "AttackPath": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/AttackPath", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}", + "(google.api.resource).plural": "attackPaths", + "(google.api.resource).singular": "attackPath" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "pathNodes": { + "rule": "repeated", + "type": "AttackPathNode", + "id": 2 + }, + "edges": { + "rule": "repeated", + "type": "AttackPathEdge", + "id": 3 + } + }, + "nested": { + "AttackPathNode": { + "fields": { + "resource": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "associatedFindings": { + "rule": "repeated", + "type": "PathNodeAssociatedFinding", + "id": 4 + }, + "uuid": { + "type": "string", + "id": 5 + }, + "attackSteps": { + "rule": "repeated", + "type": "AttackStepNode", + "id": 6 + } + }, + "nested": { + "PathNodeAssociatedFinding": { + "fields": { + "canonicalFinding": { + "type": "string", + "id": 1 + }, + "findingCategory": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + } + }, + "NodeType": { + "values": { + "NODE_TYPE_UNSPECIFIED": 0, + "NODE_TYPE_AND": 1, + "NODE_TYPE_OR": 2, + "NODE_TYPE_DEFENSE": 3, + "NODE_TYPE_ATTACKER": 4 + } + }, + "AttackStepNode": { + "fields": { + "uuid": { + "type": "string", + "id": 1 + }, + "type": { + "type": "NodeType", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + } + } + } + } + }, + "AttackPathEdge": { + "fields": { + "source": { + "type": "string", + "id": 1 + }, + "destination": { + "type": "string", + "id": 2 + } + } + } + } + }, + "BackupDisasterRecovery": { + "fields": { + "backupTemplate": { + "type": "string", + "id": 1 + }, + "policies": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "host": { + "type": "string", + "id": 3 + }, + "applications": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "storagePool": { + "type": "string", + "id": 5 + }, + "policyOptions": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "profile": { + "type": "string", + "id": 7 + }, + "appliance": { + "type": "string", + "id": 8 + }, + "backupType": { + "type": "string", + "id": 9 + }, + "backupCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + } + }, + "BigQueryExport": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/BigQueryExport", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/bigQueryExports/{export}", + "(google.api.resource).plural": "bigQueryExports", + "(google.api.resource).singular": "bigQueryExport" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "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" + } + } + } + }, + "Chokepoint": { + "fields": { + "relatedFindings": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "CloudArmor": { + "fields": { + "securityPolicy": { + "type": "SecurityPolicy", + "id": 1 + }, + "requests": { + "type": "Requests", + "id": 2 + }, + "adaptiveProtection": { + "type": "AdaptiveProtection", + "id": 3 + }, + "attack": { + "type": "Attack", + "id": 4 + }, + "threatVector": { + "type": "string", + "id": 5 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 6 + } + } + }, + "SecurityPolicy": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "preview": { + "type": "bool", + "id": 3 + } + } + }, + "Requests": { + "fields": { + "ratio": { + "type": "double", + "id": 1 + }, + "shortTermAllowed": { + "type": "int32", + "id": 2 + }, + "longTermAllowed": { + "type": "int32", + "id": 3 + }, + "longTermDenied": { + "type": "int32", + "id": 4 + } + } + }, + "AdaptiveProtection": { + "fields": { + "confidence": { + "type": "double", + "id": 1 + } + } + }, + "Attack": { + "fields": { + "volumePpsLong": { + "type": "int64", + "id": 4 + }, + "volumeBpsLong": { + "type": "int64", + "id": 5 + }, + "classification": { + "type": "string", + "id": 3 + }, + "volumePps": { + "type": "int32", + "id": 1, + "options": { + "deprecated": true + } + }, + "volumeBps": { + "type": "int32", + "id": 2, + "options": { + "deprecated": true + } + } + } + }, + "CloudDlpDataProfile": { + "fields": { + "dataProfile": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/TableDataProfile" + } + }, + "parentType": { + "type": "ParentType", + "id": 2 + } + }, + "nested": { + "ParentType": { + "values": { + "PARENT_TYPE_UNSPECIFIED": 0, + "ORGANIZATION": 1, + "PROJECT": 2 + } + } + } + }, + "CloudDlpInspection": { + "fields": { + "inspectJob": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" + } + }, + "infoType": { + "type": "string", + "id": 2 + }, + "infoTypeCount": { + "type": "int64", + "id": 3 + }, + "fullScan": { + "type": "bool", + "id": 4 + } + } + }, + "Compliance": { + "fields": { + "standard": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "ids": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "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 + } + } + } + }, + "ContactDetails": { + "fields": { + "contacts": { + "rule": "repeated", + "type": "Contact", + "id": 1 + } + } + }, + "Contact": { + "fields": { + "email": { + "type": "string", + "id": 1 + } + } + }, + "Container": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "imageId": { + "type": "string", + "id": 3 + }, + "labels": { + "rule": "repeated", + "type": "Label", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "Label": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "DataAccessEvent": { + "fields": { + "eventId": { + "type": "string", + "id": 1 + }, + "principalEmail": { + "type": "string", + "id": 2 + }, + "operation": { + "type": "Operation", + "id": 3 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "Operation": { + "values": { + "OPERATION_UNSPECIFIED": 0, + "READ": 1, + "MOVE": 2, + "COPY": 3 + } + } + } + }, + "DataFlowEvent": { + "fields": { + "eventId": { + "type": "string", + "id": 1 + }, + "principalEmail": { + "type": "string", + "id": 2 + }, + "operation": { + "type": "Operation", + "id": 3 + }, + "violatedLocation": { + "type": "string", + "id": 4 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + }, + "nested": { + "Operation": { + "values": { + "OPERATION_UNSPECIFIED": 0, + "READ": 1, + "MOVE": 2, + "COPY": 3 + } + } + } + }, + "DataRetentionDeletionEvent": { + "fields": { + "eventDetectionTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "dataObjectCount": { + "type": "int64", + "id": 3 + }, + "maxRetentionAllowed": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "eventType": { + "type": "EventType", + "id": 5 + } + }, + "nested": { + "EventType": { + "values": { + "EVENT_TYPE_UNSPECIFIED": 0, + "EVENT_TYPE_MAX_TTL_EXCEEDED": 1 + } + } + } + }, + "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 + }, + "version": { + "type": "string", + "id": 6 + } + } + }, + "Disk": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Exfiltration": { + "fields": { + "sources": { + "rule": "repeated", + "type": "ExfilResource", + "id": 1 + }, + "targets": { + "rule": "repeated", + "type": "ExfilResource", + "id": 2 + }, + "totalExfiltratedBytes": { + "type": "int64", + "id": 3 + } + } + }, + "ExfilResource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "components": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ExternalSystem": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/locations/{location}/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 + }, + "caseUri": { + "type": "string", + "id": 6 + }, + "casePriority": { + "type": "string", + "id": 7 + }, + "caseSla": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "caseCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "caseCloseTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "ticketInfo": { + "type": "TicketInfo", + "id": 8 + } + }, + "nested": { + "TicketInfo": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "assignee": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "uri": { + "type": "string", + "id": 4 + }, + "status": { + "type": "string", + "id": 5 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + } + } + } + }, + "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 + }, + "diskPath": { + "type": "DiskPath", + "id": 7 + }, + "operations": { + "rule": "repeated", + "type": "FileOperation", + "id": 8 + } + }, + "nested": { + "DiskPath": { + "fields": { + "partitionUuid": { + "type": "string", + "id": 1 + }, + "relativePath": { + "type": "string", + "id": 2 + } + } + }, + "FileOperation": { + "fields": { + "type": { + "type": "OperationType", + "id": 1 + } + }, + "nested": { + "OperationType": { + "values": { + "OPERATION_TYPE_UNSPECIFIED": 0, + "OPEN": 1, + "READ": 2, + "RENAME": 3, + "WRITE": 4, + "EXECUTE": 5 + } + } + } + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/locations/{location}/findings/{finding}", + "(google.api.resource).plural": "findings", + "(google.api.resource).singular": "finding" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "canonicalName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parent": { + "type": "string", + "id": 3 + }, + "resourceName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "category": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "externalUri": { + "type": "string", + "id": 8 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 9 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "severity": { + "type": "Severity", + "id": 14 + }, + "mute": { + "type": "Mute", + "id": 15 + }, + "muteInfo": { + "type": "MuteInfo", + "id": 53, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "findingClass": { + "type": "FindingClass", + "id": 16 + }, + "indicator": { + "type": "Indicator", + "id": 17 + }, + "vulnerability": { + "type": "Vulnerability", + "id": 18 + }, + "muteUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalSystems": { + "keyType": "string", + "type": "ExternalSystem", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mitreAttack": { + "type": "MitreAttack", + "id": 21 + }, + "access": { + "type": "Access", + "id": 22 + }, + "connections": { + "rule": "repeated", + "type": "Connection", + "id": 23 + }, + "muteInitiator": { + "type": "string", + "id": 24 + }, + "processes": { + "rule": "repeated", + "type": "Process", + "id": 25 + }, + "contacts": { + "keyType": "string", + "type": "ContactDetails", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "compliances": { + "rule": "repeated", + "type": "Compliance", + "id": 27 + }, + "parentDisplayName": { + "type": "string", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 30 + }, + "exfiltration": { + "type": "Exfiltration", + "id": 31 + }, + "iamBindings": { + "rule": "repeated", + "type": "IamBinding", + "id": 32 + }, + "nextSteps": { + "type": "string", + "id": 33 + }, + "moduleName": { + "type": "string", + "id": 34 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 35 + }, + "kubernetes": { + "type": "Kubernetes", + "id": 36 + }, + "database": { + "type": "Database", + "id": 37 + }, + "attackExposure": { + "type": "AttackExposure", + "id": 38 + }, + "files": { + "rule": "repeated", + "type": "File", + "id": 39 + }, + "cloudDlpInspection": { + "type": "CloudDlpInspection", + "id": 40 + }, + "cloudDlpDataProfile": { + "type": "CloudDlpDataProfile", + "id": 41 + }, + "kernelRootkit": { + "type": "KernelRootkit", + "id": 42 + }, + "orgPolicies": { + "rule": "repeated", + "type": "OrgPolicy", + "id": 43 + }, + "job": { + "type": "Job", + "id": 44 + }, + "application": { + "type": "Application", + "id": 45 + }, + "ipRules": { + "type": "IpRules", + "id": 46 + }, + "backupDisasterRecovery": { + "type": "BackupDisasterRecovery", + "id": 47 + }, + "securityPosture": { + "type": "SecurityPosture", + "id": 48 + }, + "logEntries": { + "rule": "repeated", + "type": "LogEntry", + "id": 49 + }, + "loadBalancers": { + "rule": "repeated", + "type": "LoadBalancer", + "id": 50 + }, + "cloudArmor": { + "type": "CloudArmor", + "id": 51 + }, + "notebook": { + "type": "Notebook", + "id": 55 + }, + "toxicCombination": { + "type": "ToxicCombination", + "id": 56 + }, + "groupMemberships": { + "rule": "repeated", + "type": "GroupMembership", + "id": 57 + }, + "disk": { + "type": "Disk", + "id": 58 + }, + "dataAccessEvents": { + "rule": "repeated", + "type": "DataAccessEvent", + "id": 61 + }, + "dataFlowEvents": { + "rule": "repeated", + "type": "DataFlowEvent", + "id": 62 + }, + "networks": { + "rule": "repeated", + "type": "Network", + "id": 63 + }, + "dataRetentionDeletionEvents": { + "rule": "repeated", + "type": "DataRetentionDeletionEvent", + "id": 64 + }, + "affectedResources": { + "type": "AffectedResources", + "id": 65 + }, + "aiModel": { + "type": "AiModel", + "id": 66 + }, + "chokepoint": { + "type": "Chokepoint", + "id": 69 + }, + "vertexAi": { + "type": "VertexAi", + "id": 72 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } + }, + "Mute": { + "values": { + "MUTE_UNSPECIFIED": 0, + "MUTED": 1, + "UNMUTED": 2, + "UNDEFINED": 3 + } + }, + "MuteInfo": { + "fields": { + "staticMute": { + "type": "StaticMute", + "id": 1 + }, + "dynamicMuteRecords": { + "rule": "repeated", + "type": "DynamicMuteRecord", + "id": 2 + } + }, + "nested": { + "StaticMute": { + "fields": { + "state": { + "type": "Mute", + "id": 1 + }, + "applyTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "DynamicMuteRecord": { + "fields": { + "muteConfig": { + "type": "string", + "id": 1 + }, + "matchTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "FindingClass": { + "values": { + "FINDING_CLASS_UNSPECIFIED": 0, + "THREAT": 1, + "VULNERABILITY": 2, + "MISCONFIGURATION": 3, + "OBSERVATION": 4, + "SCC_ERROR": 5, + "POSTURE_VIOLATION": 6, + "TOXIC_COMBINATION": 7, + "SENSITIVE_DATA_RISK": 8, + "CHOKEPOINT": 9 + } + } + } + }, + "GroupMembership": { + "fields": { + "groupType": { + "type": "GroupType", + "id": 1 + }, + "groupId": { + "type": "string", + "id": 2 + } + }, + "nested": { + "GroupType": { + "values": { + "GROUP_TYPE_UNSPECIFIED": 0, + "GROUP_TYPE_TOXIC_COMBINATION": 1, + "GROUP_TYPE_CHOKEPOINT": 3 + } + } + } + }, + "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": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "domains": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "signatures": { + "rule": "repeated", + "type": "ProcessSignature", + "id": 3 + }, + "uris": { + "rule": "repeated", + "type": "string", + "id": 4 + } + }, + "nested": { + "ProcessSignature": { + "oneofs": { + "signature": { + "oneof": [ + "memoryHashSignature", + "yaraRuleSignature" + ] + } + }, + "fields": { + "memoryHashSignature": { + "type": "MemoryHashSignature", + "id": 6 + }, + "yaraRuleSignature": { + "type": "YaraRuleSignature", + "id": 7 + }, + "signatureType": { + "type": "SignatureType", + "id": 8 + } + }, + "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 + } + } + }, + "SignatureType": { + "values": { + "SIGNATURE_TYPE_UNSPECIFIED": 0, + "SIGNATURE_TYPE_PROCESS": 1, + "SIGNATURE_TYPE_FILE": 2 + } + } + } + } + } + }, + "IpRules": { + "oneofs": { + "rules": { + "oneof": [ + "allowed", + "denied" + ] + } + }, + "fields": { + "direction": { + "type": "Direction", + "id": 1 + }, + "allowed": { + "type": "Allowed", + "id": 2 + }, + "denied": { + "type": "Denied", + "id": 3 + }, + "sourceIpRanges": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "destinationIpRanges": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "exposedServices": { + "rule": "repeated", + "type": "string", + "id": 6 + } + }, + "nested": { + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "INGRESS": 1, + "EGRESS": 2 + } + } + } + }, + "IpRule": { + "fields": { + "protocol": { + "type": "string", + "id": 1 + }, + "portRanges": { + "rule": "repeated", + "type": "PortRange", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PortRange": { + "fields": { + "min": { + "type": "int64", + "id": 1 + }, + "max": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "Allowed": { + "fields": { + "ipRules": { + "rule": "repeated", + "type": "IpRule", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Denied": { + "fields": { + "ipRules": { + "rule": "repeated", + "type": "IpRule", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Job": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "JobState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorCode": { + "type": "int32", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + }, + "JobState": { + "values": { + "JOB_STATE_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "SUCCEEDED": 3, + "FAILED": 4 + } + }, + "KernelRootkit": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "unexpectedCodeModification": { + "type": "bool", + "id": 2 + }, + "unexpectedReadOnlyDataModification": { + "type": "bool", + "id": 3 + }, + "unexpectedFtraceHandler": { + "type": "bool", + "id": 4 + }, + "unexpectedKprobeHandler": { + "type": "bool", + "id": 5 + }, + "unexpectedKernelCodePages": { + "type": "bool", + "id": 6 + }, + "unexpectedSystemCallHandler": { + "type": "bool", + "id": 7 + }, + "unexpectedInterruptHandler": { + "type": "bool", + "id": 8 + }, + "unexpectedProcessesInRunqueue": { + "type": "bool", + "id": 9 + } + } + }, + "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 + }, + "objects": { + "rule": "repeated", + "type": "Object", + "id": 7 + } + }, + "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 + } + } + }, + "Object": { + "fields": { + "group": { + "type": "string", + "id": 1 + }, + "kind": { + "type": "string", + "id": 2 + }, + "ns": { + "type": "string", + "id": 3 + }, + "name": { + "type": "string", + "id": 4 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 5 + } + } + } + } + }, + "LoadBalancer": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "LogEntry": { + "oneofs": { + "logEntry": { + "oneof": [ + "cloudLoggingEntry" + ] + } + }, + "fields": { + "cloudLoggingEntry": { + "type": "CloudLoggingEntry", + "id": 1 + } + } + }, + "CloudLoggingEntry": { + "fields": { + "insertId": { + "type": "string", + "id": 1 + }, + "logId": { + "type": "string", + "id": 2 + }, + "resourceContainer": { + "type": "string", + "id": 3 + }, + "timestamp": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "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, + "DATA_OBFUSCATION": 70, + "DATA_OBFUSCATION_STEGANOGRAPHY": 71, + "OS_CREDENTIAL_DUMPING": 114, + "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM": 115, + "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW": 122, + "DATA_FROM_LOCAL_SYSTEM": 117, + "AUTOMATED_EXFILTRATION": 68, + "OBFUSCATED_FILES_OR_INFO": 72, + "STEGANOGRAPHY": 73, + "COMPILE_AFTER_DELIVERY": 74, + "COMMAND_OBFUSCATION": 75, + "SCHEDULED_TRANSFER": 120, + "SYSTEM_OWNER_USER_DISCOVERY": 118, + "MASQUERADING": 49, + "MATCH_LEGITIMATE_NAME_OR_LOCATION": 50, + "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": 37, + "STARTUP_ITEMS": 38, + "NETWORK_SERVICE_DISCOVERY": 32, + "SCHEDULED_TASK_JOB": 89, + "SCHEDULED_TASK_JOB_CRON": 119, + "CONTAINER_ORCHESTRATION_JOB": 90, + "PROCESS_INJECTION": 93, + "INPUT_CAPTURE": 103, + "INPUT_CAPTURE_KEYLOGGING": 104, + "PROCESS_DISCOVERY": 56, + "COMMAND_AND_SCRIPTING_INTERPRETER": 6, + "UNIX_SHELL": 7, + "PYTHON": 59, + "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": 63, + "PERMISSION_GROUPS_DISCOVERY": 18, + "CLOUD_GROUPS": 19, + "INDICATOR_REMOVAL": 123, + "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS": 124, + "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY": 125, + "INDICATOR_REMOVAL_FILE_DELETION": 64, + "INDICATOR_REMOVAL_TIMESTOMP": 128, + "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA": 126, + "APPLICATION_LAYER_PROTOCOL": 45, + "DNS": 46, + "SOFTWARE_DEPLOYMENT_TOOLS": 47, + "VALID_ACCOUNTS": 14, + "DEFAULT_ACCOUNTS": 35, + "LOCAL_ACCOUNTS": 15, + "CLOUD_ACCOUNTS": 16, + "FILE_AND_DIRECTORY_DISCOVERY": 121, + "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT": 116, + "PROXY": 9, + "EXTERNAL_PROXY": 10, + "MULTI_HOP_PROXY": 11, + "ACCOUNT_MANIPULATION": 22, + "ADDITIONAL_CLOUD_CREDENTIALS": 40, + "ADDITIONAL_CLOUD_ROLES": 67, + "SSH_AUTHORIZED_KEYS": 23, + "ADDITIONAL_CONTAINER_CLUSTER_ROLES": 58, + "MULTI_STAGE_CHANNELS": 76, + "INGRESS_TOOL_TRANSFER": 3, + "NATIVE_API": 4, + "BRUTE_FORCE": 44, + "AUTOMATED_COLLECTION": 94, + "SHARED_MODULES": 5, + "DATA_ENCODING": 77, + "STANDARD_ENCODING": 78, + "ACCESS_TOKEN_MANIPULATION": 33, + "TOKEN_IMPERSONATION_OR_THEFT": 39, + "CREATE_ACCOUNT": 79, + "LOCAL_ACCOUNT": 80, + "DEOBFUSCATE_DECODE_FILES_OR_INFO": 95, + "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, + "SUPPLY_CHAIN_COMPROMISE": 129, + "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS": 130, + "EXPLOITATION_FOR_CLIENT_EXECUTION": 134, + "USER_EXECUTION": 69, + "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION": 135, + "DOMAIN_POLICY_MODIFICATION": 30, + "DATA_DESTRUCTION": 29, + "DATA_ENCRYPTED_FOR_IMPACT": 132, + "SERVICE_STOP": 52, + "INHIBIT_SYSTEM_RECOVERY": 36, + "FIRMWARE_CORRUPTION": 81, + "RESOURCE_HIJACKING": 8, + "NETWORK_DENIAL_OF_SERVICE": 17, + "CLOUD_SERVICE_DISCOVERY": 48, + "STEAL_APPLICATION_ACCESS_TOKEN": 42, + "ACCOUNT_ACCESS_REMOVAL": 51, + "TRANSFER_DATA_TO_CLOUD_ACCOUNT": 91, + "STEAL_WEB_SESSION_COOKIE": 25, + "CREATE_OR_MODIFY_SYSTEM_PROCESS": 24, + "EVENT_TRIGGERED_EXECUTION": 65, + "BOOT_OR_LOGON_AUTOSTART_EXECUTION": 82, + "KERNEL_MODULES_AND_EXTENSIONS": 83, + "SHORTCUT_MODIFICATION": 127, + "ABUSE_ELEVATION_CONTROL_MECHANISM": 34, + "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID": 136, + "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING": 109, + "UNSECURED_CREDENTIALS": 13, + "CREDENTIALS_IN_FILES": 105, + "BASH_HISTORY": 96, + "PRIVATE_KEYS": 97, + "SUBVERT_TRUST_CONTROL": 106, + "INSTALL_ROOT_CERTIFICATE": 107, + "COMPROMISE_HOST_SOFTWARE_BINARY": 84, + "CREDENTIALS_FROM_PASSWORD_STORES": 98, + "MODIFY_AUTHENTICATION_PROCESS": 28, + "PLUGGABLE_AUTHENTICATION_MODULES": 108, + "MULTI_FACTOR_AUTHENTICATION": 137, + "IMPAIR_DEFENSES": 31, + "DISABLE_OR_MODIFY_TOOLS": 55, + "INDICATOR_BLOCKING": 110, + "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM": 111, + "HIDE_ARTIFACTS": 85, + "HIDDEN_FILES_AND_DIRECTORIES": 86, + "HIDDEN_USERS": 87, + "EXFILTRATION_OVER_WEB_SERVICE": 20, + "EXFILTRATION_TO_CLOUD_STORAGE": 21, + "DYNAMIC_RESOLUTION": 12, + "LATERAL_TOOL_TRANSFER": 41, + "HIJACK_EXECUTION_FLOW": 112, + "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING": 113, + "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": 26, + "CREATE_SNAPSHOT": 54, + "CLOUD_INFRASTRUCTURE_DISCOVERY": 53, + "DEVELOP_CAPABILITIES": 99, + "DEVELOP_CAPABILITIES_MALWARE": 100, + "OBTAIN_CAPABILITIES": 43, + "OBTAIN_CAPABILITIES_MALWARE": 101, + "OBTAIN_CAPABILITIES_VULNERABILITIES": 133, + "ACTIVE_SCANNING": 1, + "SCANNING_IP_BLOCKS": 2, + "STAGE_CAPABILITIES": 88, + "UPLOAD_MALWARE": 102, + "CONTAINER_ADMINISTRATION_COMMAND": 60, + "DEPLOY_CONTAINER": 66, + "ESCAPE_TO_HOST": 61, + "CONTAINER_AND_RESOURCE_DISCOVERY": 57, + "REFLECTIVE_CODE_LOADING": 92, + "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": 62, + "FINANCIAL_THEFT": 131 + } + } + } + }, + "Network": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Notebook": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "lastAuthor": { + "type": "string", + "id": 3 + }, + "notebookUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "OrgPolicy": { + "options": { + "(google.api.resource).type": "orgpolicy.googleapis.com/Policy", + "(google.api.resource).pattern": "projects/{project}/policies/{constraint_name}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + } + } + }, + "Process": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "binary": { + "type": "File", + "id": 2 + }, + "libraries": { + "rule": "repeated", + "type": "File", + "id": 3 + }, + "script": { + "type": "File", + "id": 4 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "argumentsTruncated": { + "type": "bool", + "id": 6 + }, + "envVariables": { + "rule": "repeated", + "type": "EnvironmentVariable", + "id": 7 + }, + "envVariablesTruncated": { + "type": "bool", + "id": 8 + }, + "pid": { + "type": "int64", + "id": 9 + }, + "parentPid": { + "type": "int64", + "id": 10 + }, + "userId": { + "type": "int64", + "id": 11 + } + } + }, + "EnvironmentVariable": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "val": { + "type": "string", + "id": 2 + } + } + }, + "SecurityMarks": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "canonicalName": { + "type": "string", + "id": 3 + } + } + }, + "SecurityPosture": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "revisionId": { + "type": "string", + "id": 2 + }, + "postureDeploymentResource": { + "type": "string", + "id": 3 + }, + "postureDeployment": { + "type": "string", + "id": 4 + }, + "changedPolicy": { + "type": "string", + "id": 5 + }, + "policySet": { + "type": "string", + "id": 6 + }, + "policy": { + "type": "string", + "id": 7 + }, + "policyDriftDetails": { + "rule": "repeated", + "type": "PolicyDriftDetails", + "id": 8 + } + }, + "nested": { + "PolicyDriftDetails": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "expectedValue": { + "type": "string", + "id": 2 + }, + "detectedValue": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ToxicCombination": { + "fields": { + "attackExposureScore": { + "type": "double", + "id": 1 + }, + "relatedFindings": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "VertexAi": { + "fields": { + "datasets": { + "rule": "repeated", + "type": "Dataset", + "id": 1 + }, + "pipelines": { + "rule": "repeated", + "type": "Pipeline", + "id": 2 + } + }, + "nested": { + "Dataset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "source": { + "type": "string", + "id": 3 + } + } + }, + "Pipeline": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Vulnerability": { + "fields": { + "cve": { + "type": "Cve", + "id": 1 + }, + "offendingPackage": { + "type": "Package", + "id": 2 + }, + "fixedPackage": { + "type": "Package", + "id": 3 + }, + "securityBulletin": { + "type": "SecurityBulletin", + "id": 4 + }, + "providerRiskScore": { + "type": "int64", + "id": 5 + }, + "reachable": { + "type": "bool", + "id": 6 + }, + "cwes": { + "rule": "repeated", + "type": "Cwe", + "id": 7 + } + } + }, + "Cve": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "references": { + "rule": "repeated", + "type": "Reference", + "id": 2 + }, + "cvssv3": { + "type": "Cvssv3", + "id": 3 + }, + "upstreamFixAvailable": { + "type": "bool", + "id": 4 + }, + "impact": { + "type": "RiskRating", + "id": 5 + }, + "exploitationActivity": { + "type": "ExploitationActivity", + "id": 6 + }, + "observedInTheWild": { + "type": "bool", + "id": 7 + }, + "zeroDay": { + "type": "bool", + "id": 8 + }, + "exploitReleaseDate": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "firstExploitationDate": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "RiskRating": { + "values": { + "RISK_RATING_UNSPECIFIED": 0, + "LOW": 1, + "MEDIUM": 2, + "HIGH": 3, + "CRITICAL": 4 + } + }, + "ExploitationActivity": { + "values": { + "EXPLOITATION_ACTIVITY_UNSPECIFIED": 0, + "WIDE": 1, + "CONFIRMED": 2, + "AVAILABLE": 3, + "ANTICIPATED": 4, + "NO_KNOWN": 5 + } + } + } + }, + "Reference": { + "fields": { + "source": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "Cvssv3": { + "fields": { + "baseScore": { + "type": "double", + "id": 1 + }, + "attackVector": { + "type": "AttackVector", + "id": 2 + }, + "attackComplexity": { + "type": "AttackComplexity", + "id": 3 + }, + "privilegesRequired": { + "type": "PrivilegesRequired", + "id": 4 + }, + "userInteraction": { + "type": "UserInteraction", + "id": 5 + }, + "scope": { + "type": "Scope", + "id": 6 + }, + "confidentialityImpact": { + "type": "Impact", + "id": 7 + }, + "integrityImpact": { + "type": "Impact", + "id": 8 + }, + "availabilityImpact": { + "type": "Impact", + "id": 9 + } + }, + "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 + } + } + } + }, + "Package": { + "fields": { + "packageName": { + "type": "string", + "id": 1 + }, + "cpeUri": { + "type": "string", + "id": 2 + }, + "packageType": { + "type": "string", + "id": 3 + }, + "packageVersion": { + "type": "string", + "id": 4 + } + } + }, + "SecurityBulletin": { + "fields": { + "bulletinId": { + "type": "string", + "id": 1 + }, + "submissionTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "suggestedUpgradeVersion": { + "type": "string", + "id": 3 + } + } + }, + "Cwe": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "references": { + "rule": "repeated", + "type": "Reference", + "id": 2 + } + } + }, + "Folder": { + "fields": { + "resourceFolder": { + "type": "string", + "id": 1 + }, + "resourceFolderDisplayName": { + "type": "string", + "id": 2 + } + } + }, + "MuteConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/MuteConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/muteConfigs/{mute_config}", + "(google.api.resource).plural": "muteConfigs", + "(google.api.resource).singular": "muteConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mostRecentEditor": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "MuteConfigType", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "expiryTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MuteConfigType": { + "values": { + "MUTE_CONFIG_TYPE_UNSPECIFIED": 0, + "STATIC": 1, + "DYNAMIC": 2 + } + } + } + }, + "NotificationConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/notificationConfigs/{notification_config}", + "(google.api.resource).plural": "notificationConfigs", + "(google.api.resource).singular": "notificationConfig" + }, + "oneofs": { + "notifyConfig": { + "oneof": [ + "streamingConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "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 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "StreamingConfig": { + "fields": { + "filter": { + "type": "string", + "id": 1 + } + } + } + } + }, + "NotificationMessage": { + "oneofs": { + "event": { + "oneof": [ + "finding" + ] + } + }, + "fields": { + "notificationConfigName": { + "type": "string", + "id": 1 + }, + "finding": { + "type": "Finding", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + } + } + }, + "Resource": { + "oneofs": { + "cloudProviderMetadata": { + "oneof": [ + "gcpMetadata", + "awsMetadata", + "azureMetadata" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "cloudProvider": { + "type": "CloudProvider", + "id": 4 + }, + "service": { + "type": "string", + "id": 5 + }, + "location": { + "type": "string", + "id": 6 + }, + "gcpMetadata": { + "type": "GcpMetadata", + "id": 7 + }, + "awsMetadata": { + "type": "AwsMetadata", + "id": 8 + }, + "azureMetadata": { + "type": "AzureMetadata", + "id": 9 + }, + "resourcePath": { + "type": "ResourcePath", + "id": 10 + }, + "resourcePathString": { + "type": "string", + "id": 11 + } + } + }, + "CloudProvider": { + "values": { + "CLOUD_PROVIDER_UNSPECIFIED": 0, + "GOOGLE_CLOUD_PLATFORM": 1, + "AMAZON_WEB_SERVICES": 2, + "MICROSOFT_AZURE": 3 + } + }, + "GcpMetadata": { + "fields": { + "project": { + "type": "string", + "id": 1 + }, + "projectDisplayName": { + "type": "string", + "id": 2 + }, + "parent": { + "type": "string", + "id": 3 + }, + "parentDisplayName": { + "type": "string", + "id": 4 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "organization": { + "type": "string", + "id": 6 + } + } + }, + "AwsMetadata": { + "fields": { + "organization": { + "type": "AwsOrganization", + "id": 1 + }, + "organizationalUnits": { + "rule": "repeated", + "type": "AwsOrganizationalUnit", + "id": 2 + }, + "account": { + "type": "AwsAccount", + "id": 3 + } + }, + "nested": { + "AwsOrganization": { + "fields": { + "id": { + "type": "string", + "id": 1 + } + } + }, + "AwsOrganizationalUnit": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "AwsAccount": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + } + } + }, + "AzureMetadata": { + "fields": { + "managementGroups": { + "rule": "repeated", + "type": "AzureManagementGroup", + "id": 1 + }, + "subscription": { + "type": "AzureSubscription", + "id": 2 + }, + "resourceGroup": { + "type": "AzureResourceGroup", + "id": 3 + }, + "tenant": { + "type": "AzureTenant", + "id": 7 + } + }, + "nested": { + "AzureManagementGroup": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "AzureSubscription": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "AzureResourceGroup": { + "fields": { + "id": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 1 + } + } + }, + "AzureTenant": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ResourcePath": { + "fields": { + "nodes": { + "rule": "repeated", + "type": "ResourcePathNode", + "id": 1 + } + }, + "nested": { + "ResourcePathNodeType": { + "values": { + "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED": 0, + "GCP_ORGANIZATION": 1, + "GCP_FOLDER": 2, + "GCP_PROJECT": 3, + "AWS_ORGANIZATION": 4, + "AWS_ORGANIZATIONAL_UNIT": 5, + "AWS_ACCOUNT": 6, + "AZURE_MANAGEMENT_GROUP": 7, + "AZURE_SUBSCRIPTION": 8, + "AZURE_RESOURCE_GROUP": 9 + } + }, + "ResourcePathNode": { + "fields": { + "nodeType": { + "type": "ResourcePathNodeType", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ResourceValueConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/ResourceValueConfig", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}", + "(google.api.resource).plural": "resourceValueConfigs", + "(google.api.resource).singular": "resourceValueConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "resourceValue": { + "type": "ResourceValue", + "id": 2 + }, + "tagValues": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "resourceType": { + "type": "string", + "id": 4 + }, + "scope": { + "type": "string", + "id": 5 + }, + "resourceLabelsSelector": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudProvider": { + "type": "CloudProvider", + "id": 10 + }, + "sensitiveDataProtectionMapping": { + "type": "SensitiveDataProtectionMapping", + "id": 11 + } + }, + "nested": { + "SensitiveDataProtectionMapping": { + "fields": { + "highSensitivityMapping": { + "type": "ResourceValue", + "id": 1 + }, + "mediumSensitivityMapping": { + "type": "ResourceValue", + "id": 2 + } + } + } + } + }, + "ResourceValue": { + "values": { + "RESOURCE_VALUE_UNSPECIFIED": 0, + "HIGH": 1, + "MEDIUM": 2, + "LOW": 3, + "NONE": 4 + } + }, + "SecurityCenter": { + "options": { + "(google.api.default_host)": "securitycenter.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "BatchCreateResourceValueConfigs": { + "requestType": "BatchCreateResourceValueConfigsRequest", + "responseType": "BatchCreateResourceValueConfigsResponse", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,requests" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate", + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,requests" + } + ] + }, + "BulkMuteFindings": { + "requestType": "BulkMuteFindingsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*}/findings:bulkMute", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/findings:bulkMute", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v2.BulkMuteFindingsResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*}/findings:bulkMute", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{parent=organizations/*/locations/*}/findings:bulkMute", + "body": "*" + }, + { + "post": "/v2/{parent=folders/*}/findings:bulkMute", + "body": "*" + }, + { + "post": "/v2/{parent=folders/*/locations/*}/findings:bulkMute", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*}/findings:bulkMute", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*/locations/*}/findings:bulkMute", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.securitycenter.v2.BulkMuteFindingsResponse", + "metadata_type": "google.protobuf.Empty" + } + } + ] + }, + "CreateBigQueryExport": { + "requestType": "CreateBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*/locations/*}/bigQueryExports", + "(google.api.http).body": "big_query_export", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/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": "/v2/{parent=organizations/*/locations/*}/bigQueryExports", + "body": "big_query_export", + "additional_bindings": [ + { + "post": "/v2/{parent=folders/*/locations/*}/bigQueryExports", + "body": "big_query_export" + }, + { + "post": "/v2/{parent=projects/*/locations/*}/bigQueryExports", + "body": "big_query_export" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,big_query_export,big_query_export_id" + } + ] + }, + "CreateFinding": { + "requestType": "CreateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*/sources/*/locations/*}/findings", + "(google.api.http).body": "finding", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/sources/*}/findings", + "(google.api.http).additional_bindings.body": "finding", + "(google.api.method_signature)": "parent,finding,finding_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*/sources/*/locations/*}/findings", + "body": "finding", + "additional_bindings": { + "post": "/v2/{parent=organizations/*/sources/*}/findings", + "body": "finding" + } + } + }, + { + "(google.api.method_signature)": "parent,finding,finding_id" + } + ] + }, + "CreateMuteConfig": { + "requestType": "CreateMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*/locations/*}/muteConfigs", + "(google.api.http).body": "mute_config", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*}/muteConfigs", + "(google.api.http).additional_bindings.body": "mute_config", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}", + "(google.api.method_signature)": "parent,mute_config,mute_config_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*/locations/*}/muteConfigs", + "body": "mute_config", + "additional_bindings": [ + { + "post": "/v2/{parent=folders/*/locations/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v2/{parent=projects/*/locations/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v2/{parent=organizations/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v2/{parent=folders/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v2/{parent=projects/*}/muteConfigs", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + }, + { + "field": "parent", + "path_template": "organizations/*/locations/{location=*}" + }, + { + "field": "parent", + "path_template": "folders/*/locations/{location=*}" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,mute_config,mute_config_id" + } + ] + }, + "CreateNotificationConfig": { + "requestType": "CreateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*/locations/*}/notificationConfigs", + "(google.api.http).body": "notification_config", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/notificationConfigs", + "(google.api.http).additional_bindings.body": "notification_config", + "(google.api.method_signature)": "parent,notification_config,config_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*/locations/*}/notificationConfigs", + "body": "notification_config", + "additional_bindings": [ + { + "post": "/v2/{parent=folders/*/locations/*}/notificationConfigs", + "body": "notification_config" + }, + { + "post": "/v2/{parent=projects/*/locations/*}/notificationConfigs", + "body": "notification_config" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,notification_config,config_id" + } + ] + }, + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*}/sources", + "(google.api.http).body": "source", + "(google.api.method_signature)": "parent,source" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*}/sources", + "body": "source" + } + }, + { + "(google.api.method_signature)": "parent,source" + } + ] + }, + "DeleteBigQueryExport": { + "requestType": "DeleteBigQueryExportRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=organizations/*/locations/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/bigQueryExports/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=organizations/*/locations/*/bigQueryExports/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=folders/*/locations/*/bigQueryExports/*}" + }, + { + "delete": "/v2/{name=projects/*/locations/*/bigQueryExports/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteMuteConfig": { + "requestType": "DeleteMuteConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/muteConfigs/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}/muteConfigs/*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=organizations/*/muteConfigs/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=organizations/*/locations/*/muteConfigs/*}" + }, + { + "delete": "/v2/{name=folders/*/muteConfigs/*}" + }, + { + "delete": "/v2/{name=folders/*/locations/*/muteConfigs/*}" + }, + { + "delete": "/v2/{name=projects/*/muteConfigs/*}" + }, + { + "delete": "/v2/{name=projects/*/locations/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "name", + "path_template": "projects/*/locations/{location=*}/muteConfigs/*" + }, + { + "field": "name", + "path_template": "organizations/*/locations/{location=*}/muteConfigs/*" + }, + { + "field": "name", + "path_template": "folders/*/locations/{location=*}/muteConfigs/*" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteNotificationConfig": { + "requestType": "DeleteNotificationConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=organizations/*/locations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=organizations/*/locations/*/notificationConfigs/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=folders/*/locations/*/notificationConfigs/*}" + }, + { + "delete": "/v2/{name=projects/*/locations/*/notificationConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteResourceValueConfig": { + "requestType": "DeleteResourceValueConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=organizations/*/resourceValueConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=organizations/*/resourceValueConfigs/*}", + "additional_bindings": { + "delete": "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetBigQueryExport": { + "requestType": "GetBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/locations/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/bigQueryExports/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/locations/*/bigQueryExports/*}", + "additional_bindings": [ + { + "get": "/v2/{name=folders/*/locations/*/bigQueryExports/*}" + }, + { + "get": "/v2/{name=projects/*/locations/*/bigQueryExports/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSimulation": { + "requestType": "GetSimulationRequest", + "responseType": "Simulation", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/simulations/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/locations/*/simulations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/simulations/*}", + "additional_bindings": { + "get": "/v2/{name=organizations/*/locations/*/simulations/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetValuedResource": { + "requestType": "GetValuedResourceRequest", + "responseType": "ValuedResource", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/simulations/*/valuedResources/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/locations/*/simulations/*/valuedResources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/simulations/*/valuedResources/*}", + "additional_bindings": { + "get": "/v2/{name=organizations/*/locations/*/simulations/*/valuedResources/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=organizations/*/sources/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=organizations/*/sources/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "GetMuteConfig": { + "requestType": "GetMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/muteConfigs/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}/muteConfigs/*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/muteConfigs/*}", + "additional_bindings": [ + { + "get": "/v2/{name=organizations/*/locations/*/muteConfigs/*}" + }, + { + "get": "/v2/{name=folders/*/muteConfigs/*}" + }, + { + "get": "/v2/{name=folders/*/locations/*/muteConfigs/*}" + }, + { + "get": "/v2/{name=projects/*/muteConfigs/*}" + }, + { + "get": "/v2/{name=projects/*/locations/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "name", + "path_template": "projects/*/locations/{location=*}/muteConfigs/*" + }, + { + "field": "name", + "path_template": "organizations/*/locations/{location=*}/muteConfigs/*" + }, + { + "field": "name", + "path_template": "folders/*/locations/{location=*}/muteConfigs/*" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetNotificationConfig": { + "requestType": "GetNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/locations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/locations/*/notificationConfigs/*}", + "additional_bindings": [ + { + "get": "/v2/{name=folders/*/locations/*/notificationConfigs/*}" + }, + { + "get": "/v2/{name=projects/*/locations/*/notificationConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetResourceValueConfig": { + "requestType": "GetResourceValueConfigRequest", + "responseType": "ResourceValueConfig", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/resourceValueConfigs/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/resourceValueConfigs/*}", + "additional_bindings": { + "get": "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/sources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "options": { + "(google.api.http).post": "/v2/{parent=organizations/*/sources/*}/findings:group", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/sources/*/locations/*}/findings:group", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,group_by" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=organizations/*/sources/*}/findings:group", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{parent=organizations/*/sources/*/locations/*}/findings:group", + "body": "*" + }, + { + "post": "/v2/{parent=folders/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v2/{parent=folders/*/sources/*/locations/*}/findings:group", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v2/{parent=projects/*/sources/*/locations/*}/findings:group", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] + }, + "ListAttackPaths": { + "requestType": "ListAttackPathsRequest", + "responseType": "ListAttackPathsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*/simulations/*}/attackPaths", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/locations/*/simulations/*/attackExposureResults/*}/attackPaths", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*/simulations/*}/attackPaths", + "additional_bindings": [ + { + "get": "/v2/{parent=organizations/*}/attackPaths" + }, + { + "get": "/v2/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" + }, + { + "get": "/v2/{parent=organizations/*/locations/*/simulations/*/valuedResources/*}/attackPaths" + }, + { + "get": "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" + }, + { + "get": "/v2/{parent=organizations/*/locations/*/simulations/*/attackExposureResults/*}/attackPaths" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListBigQueryExports": { + "requestType": "ListBigQueryExportsRequest", + "responseType": "ListBigQueryExportsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*/locations/*}/bigQueryExports", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/bigQueryExports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*/locations/*}/bigQueryExports", + "additional_bindings": [ + { + "get": "/v2/{parent=folders/*/locations/*}/bigQueryExports" + }, + { + "get": "/v2/{parent=projects/*/locations/*}/bigQueryExports" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*/sources/*}/findings", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/sources/*/locations/*}/findings", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*/sources/*}/findings", + "additional_bindings": [ + { + "get": "/v2/{parent=organizations/*/sources/*/locations/*}/findings" + }, + { + "get": "/v2/{parent=folders/*/sources/*}/findings" + }, + { + "get": "/v2/{parent=folders/*/sources/*/locations/*}/findings" + }, + { + "get": "/v2/{parent=projects/*/sources/*}/findings" + }, + { + "get": "/v2/{parent=projects/*/sources/*/locations/*}/findings" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListMuteConfigs": { + "requestType": "ListMuteConfigsRequest", + "responseType": "ListMuteConfigsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*}/muteConfigs", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/muteConfigs", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}/muteConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*}/muteConfigs", + "additional_bindings": [ + { + "get": "/v2/{parent=organizations/*/locations/*}/muteConfigs" + }, + { + "get": "/v2/{parent=folders/*}/muteConfigs" + }, + { + "get": "/v2/{parent=folders/*/locations/*}/muteConfigs" + }, + { + "get": "/v2/{parent=projects/*}/muteConfigs" + }, + { + "get": "/v2/{parent=projects/*/locations/*}/muteConfigs" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "parent", + "path_template": "projects/*/locations/{location=*}/muteConfigs" + }, + { + "field": "parent", + "path_template": "organizations/*/locations/{location=*}/muteConfigs" + }, + { + "field": "parent", + "path_template": "folders/*/locations/{location=*}/muteConfigs" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListNotificationConfigs": { + "requestType": "ListNotificationConfigsRequest", + "responseType": "ListNotificationConfigsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*/locations/*}/notificationConfigs", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/notificationConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*/locations/*}/notificationConfigs", + "additional_bindings": [ + { + "get": "/v2/{parent=folders/*/locations/*}/notificationConfigs" + }, + { + "get": "/v2/{parent=projects/*/locations/*}/notificationConfigs" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListResourceValueConfigs": { + "requestType": "ListResourceValueConfigsRequest", + "responseType": "ListResourceValueConfigsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*}/resourceValueConfigs", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*}/resourceValueConfigs", + "additional_bindings": { + "get": "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListSources": { + "requestType": "ListSourcesRequest", + "responseType": "ListSourcesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*}/sources", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*}/sources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*}/sources", + "additional_bindings": [ + { + "get": "/v2/{parent=folders/*}/sources" + }, + { + "get": "/v2/{parent=projects/*}/sources" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListValuedResources": { + "requestType": "ListValuedResourcesRequest", + "responseType": "ListValuedResourcesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=organizations/*/simulations/*}/valuedResources", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/valuedResources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=organizations/*/simulations/*}/valuedResources", + "additional_bindings": [ + { + "get": "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources" + }, + { + "get": "/v2/{parent=organizations/*}/valuedResources" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SetFindingState": { + "requestType": "SetFindingStateRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v2/{name=organizations/*/sources/*/findings/*}:setState", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setState", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,state" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=organizations/*/sources/*/findings/*}:setState", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v2/{name=folders/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v2/{name=folders/*/sources/*/locations/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v2/{name=projects/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setState", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,state" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=organizations/*/sources/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=organizations/*/sources/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "SetMute": { + "requestType": "SetMuteRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v2/{name=organizations/*/sources/*/findings/*}:setMute", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setMute", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,mute" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=organizations/*/sources/*/findings/*}:setMute", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setMute", + "body": "*" + }, + { + "post": "/v2/{name=folders/*/sources/*/findings/*}:setMute", + "body": "*" + }, + { + "post": "/v2/{name=folders/*/sources/*/locations/*/findings/*}:setMute", + "body": "*" + }, + { + "post": "/v2/{name=projects/*/sources/*/findings/*}:setMute", + "body": "*" + }, + { + "post": "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setMute", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,mute" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v2/{resource=organizations/*/sources/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=organizations/*/sources/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "UpdateBigQueryExport": { + "requestType": "UpdateBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).patch": "/v2/{big_query_export.name=organizations/*/locations/*/bigQueryExports/*}", + "(google.api.http).body": "big_query_export", + "(google.api.http).additional_bindings.patch": "/v2/{big_query_export.name=projects/*/locations/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.body": "big_query_export", + "(google.api.method_signature)": "big_query_export,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{big_query_export.name=organizations/*/locations/*/bigQueryExports/*}", + "body": "big_query_export", + "additional_bindings": [ + { + "patch": "/v2/{big_query_export.name=folders/*/locations/*/bigQueryExports/*}", + "body": "big_query_export" + }, + { + "patch": "/v2/{big_query_export.name=projects/*/locations/*/bigQueryExports/*}", + "body": "big_query_export" + } + ] + } + }, + { + "(google.api.method_signature)": "big_query_export,update_mask" + } + ] + }, + "UpdateExternalSystem": { + "requestType": "UpdateExternalSystemRequest", + "responseType": "ExternalSystem", + "options": { + "(google.api.http).patch": "/v2/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}", + "(google.api.http).body": "external_system", + "(google.api.http).additional_bindings.patch": "/v2/{external_system.name=projects/*/sources/*/locations/*/findings/*/externalSystems/*}", + "(google.api.http).additional_bindings.body": "external_system", + "(google.api.method_signature)": "external_system,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system", + "additional_bindings": [ + { + "patch": "/v2/{external_system.name=organizations/*/sources/*/locations/*/findings/*/externalSystems/*}", + "body": "external_system" + }, + { + "patch": "/v2/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system" + }, + { + "patch": "/v2/{external_system.name=folders/*/sources/*/locations/*/findings/*/externalSystems/*}", + "body": "external_system" + }, + { + "patch": "/v2/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system" + }, + { + "patch": "/v2/{external_system.name=projects/*/sources/*/locations/*/findings/*/externalSystems/*}", + "body": "external_system" + } + ] + } + }, + { + "(google.api.method_signature)": "external_system,update_mask" + } + ] + }, + "UpdateFinding": { + "requestType": "UpdateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).patch": "/v2/{finding.name=organizations/*/sources/*/findings/*}", + "(google.api.http).body": "finding", + "(google.api.http).additional_bindings.patch": "/v2/{finding.name=projects/*/sources/*/locations/*/findings/*}", + "(google.api.http).additional_bindings.body": "finding", + "(google.api.method_signature)": "finding,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{finding.name=organizations/*/sources/*/findings/*}", + "body": "finding", + "additional_bindings": [ + { + "patch": "/v2/{finding.name=organizations/*/sources/*/locations/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v2/{finding.name=folders/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v2/{finding.name=folders/*/sources/*/locations/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v2/{finding.name=projects/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v2/{finding.name=projects/*/sources/*/locations/*/findings/*}", + "body": "finding" + } + ] + } + }, + { + "(google.api.method_signature)": "finding,update_mask" + } + ] + }, + "UpdateMuteConfig": { + "requestType": "UpdateMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).patch": "/v2/{mute_config.name=organizations/*/muteConfigs/*}", + "(google.api.http).body": "mute_config", + "(google.api.http).additional_bindings.patch": "/v2/{mute_config.name=projects/*/locations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.body": "mute_config", + "(google.api.routing).routing_parameters.field": "mute_config.name", + "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}/muteConfigs/*", + "(google.api.method_signature)": "mute_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{mute_config.name=organizations/*/muteConfigs/*}", + "body": "mute_config", + "additional_bindings": [ + { + "patch": "/v2/{mute_config.name=organizations/*/locations/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v2/{mute_config.name=folders/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v2/{mute_config.name=folders/*/locations/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v2/{mute_config.name=projects/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v2/{mute_config.name=projects/*/locations/*/muteConfigs/*}", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "mute_config.name", + "path_template": "projects/*/locations/{location=*}/muteConfigs/*" + }, + { + "field": "mute_config.name", + "path_template": "organizations/*/locations/{location=*}/muteConfigs/*" + }, + { + "field": "mute_config.name", + "path_template": "folders/*/locations/{location=*}/muteConfigs/*" + } + ] + } + }, + { + "(google.api.method_signature)": "mute_config,update_mask" + } + ] + }, + "UpdateNotificationConfig": { + "requestType": "UpdateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).patch": "/v2/{notification_config.name=organizations/*/locations/*/notificationConfigs/*}", + "(google.api.http).body": "notification_config", + "(google.api.http).additional_bindings.patch": "/v2/{notification_config.name=projects/*/locations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.body": "notification_config", + "(google.api.method_signature)": "notification_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{notification_config.name=organizations/*/locations/*/notificationConfigs/*}", + "body": "notification_config", + "additional_bindings": [ + { + "patch": "/v2/{notification_config.name=folders/*/locations/*/notificationConfigs/*}", + "body": "notification_config" + }, + { + "patch": "/v2/{notification_config.name=projects/*/locations/*/notificationConfigs/*}", + "body": "notification_config" + } + ] + } + }, + { + "(google.api.method_signature)": "notification_config,update_mask" + } + ] + }, + "UpdateResourceValueConfig": { + "requestType": "UpdateResourceValueConfigRequest", + "responseType": "ResourceValueConfig", + "options": { + "(google.api.http).patch": "/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}", + "(google.api.http).body": "resource_value_config", + "(google.api.http).additional_bindings.patch": "/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}", + "(google.api.http).additional_bindings.body": "resource_value_config", + "(google.api.method_signature)": "resource_value_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}", + "body": "resource_value_config", + "additional_bindings": { + "patch": "/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}", + "body": "resource_value_config" + } + } + }, + { + "(google.api.method_signature)": "resource_value_config,update_mask" + } + ] + }, + "UpdateSecurityMarks": { + "requestType": "UpdateSecurityMarksRequest", + "responseType": "SecurityMarks", + "options": { + "(google.api.http).patch": "/v2/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).body": "security_marks", + "(google.api.http).additional_bindings.patch": "/v2/{security_marks.name=projects/*/sources/*/locations/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.body": "security_marks", + "(google.api.method_signature)": "security_marks,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks", + "additional_bindings": [ + { + "patch": "/v2/{security_marks.name=organizations/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v2/{security_marks.name=organizations/*/sources/*/locations/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v2/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v2/{security_marks.name=folders/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v2/{security_marks.name=folders/*/sources/*/locations/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v2/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v2/{security_marks.name=projects/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v2/{security_marks.name=projects/*/sources/*/locations/*/findings/*/securityMarks}", + "body": "security_marks" + } + ] + } + }, + { + "(google.api.method_signature)": "security_marks,update_mask" + } + ] + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).patch": "/v2/{source.name=organizations/*/sources/*}", + "(google.api.http).body": "source", + "(google.api.method_signature)": "source,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{source.name=organizations/*/sources/*}", + "body": "source" + } + }, + { + "(google.api.method_signature)": "source,update_mask" + } + ] + } + } + }, + "BatchCreateResourceValueConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" + } + }, + "requests": { + "rule": "repeated", + "type": "CreateResourceValueConfigRequest", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateResourceValueConfigsResponse": { + "fields": { + "resourceValueConfigs": { + "rule": "repeated", + "type": "ResourceValueConfig", + "id": 1 + } + } + }, + "BulkMuteFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "muteState": { + "type": "MuteState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MuteState": { + "values": { + "MUTE_STATE_UNSPECIFIED": 0, + "MUTED": 1, + "UNDEFINED": 2 + } + } + } + }, + "BulkMuteFindingsResponse": { + "fields": {} + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateResourceValueConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" + } + }, + "resourceValueConfig": { + "type": "ResourceValueConfig", + "id": 2, + "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" + } + } + } + }, + "DeleteBigQueryExportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/BigQueryExport" + } + } + } + }, + "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": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "DeleteResourceValueConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/ResourceValueConfig" + } + } + } + }, + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportFindingsMetadata": { + "oneofs": { + "destination": { + "oneof": [ + "bigQueryDestination" + ] + } + }, + "fields": { + "exportStartTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bigQueryDestination": { + "type": "BigQueryDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportFindingsResponse": { + "fields": {} + }, + "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": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" + } + } + } + }, + "GetNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "GetResourceValueConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/ResourceValueConfig" + } + } + } + }, + "GetSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + } + } + }, + "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" + } + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + } + }, + "GroupFindingsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "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 + } + } + }, + "ListAttackPathsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/AttackPath" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListAttackPathsResponse": { + "fields": { + "attackPaths": { + "rule": "repeated", + "type": "AttackPath", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSimulationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Simulation" + } + } + } + }, + "GetValuedResourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/ValuedResource" + } + } + } + }, + "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 + } + } + }, + "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 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + } + }, + "ListFindingsResponse": { + "fields": { + "listFindingsResults": { + "rule": "repeated", + "type": "ListFindingsResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListFindingsResult": { + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "resource": { + "type": "Resource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Resource": { + "oneofs": { + "cloudProviderMetadata": { + "oneof": [ + "gcpMetadata", + "awsMetadata", + "azureMetadata" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "cloudProvider": { + "type": "CloudProvider", + "id": 4 + }, + "service": { + "type": "string", + "id": 5 + }, + "location": { + "type": "string", + "id": 6 + }, + "gcpMetadata": { + "type": "GcpMetadata", + "id": 7 + }, + "awsMetadata": { + "type": "AwsMetadata", + "id": 8 + }, + "azureMetadata": { + "type": "AzureMetadata", + "id": 9 + }, + "resourcePath": { + "type": "ResourcePath", + "id": 10 + }, + "resourcePathString": { + "type": "string", + "id": 11 + } + } + } + } + } + } + }, + "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": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListNotificationConfigsResponse": { + "fields": { + "notificationConfigs": { + "rule": "repeated", + "type": "NotificationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListResourceValueConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListResourceValueConfigsResponse": { + "fields": { + "resourceValueConfigs": { + "rule": "repeated", + "type": "ResourceValueConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListSourcesResponse": { + "fields": { + "sources": { + "rule": "repeated", + "type": "Source", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListValuedResourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ValuedResource" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListValuedResourcesResponse": { + "fields": { + "valuedResources": { + "rule": "repeated", + "type": "ValuedResource", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "UpdateBigQueryExportRequest": { + "fields": { + "bigQueryExport": { + "type": "BigQueryExport", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateExternalSystemRequest": { + "fields": { + "externalSystem": { + "type": "ExternalSystem", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateFindingRequest": { + "fields": { + "finding": { + "type": "Finding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateMuteConfigRequest": { + "fields": { + "muteConfig": { + "type": "MuteConfig", + "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 + } + } + }, + "UpdateResourceValueConfigRequest": { + "fields": { + "resourceValueConfig": { + "type": "ResourceValueConfig", + "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 + } + } + }, + "UpdateSourceRequest": { + "fields": { + "source": { + "type": "Source", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "Simulation": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Simulation", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/simulations/{simluation}", + "(google.api.resource).plural": "simulations", + "(google.api.resource).singular": "simulation" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceValueConfigsMetadata": { + "rule": "repeated", + "type": "ResourceValueConfigMetadata", + "id": 3 + }, + "cloudProvider": { + "type": "CloudProvider", + "id": 4 + } + } + }, + "ValuedResource": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/ValuedResource", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}", + "(google.api.resource).plural": "valuedResources", + "(google.api.resource).singular": "valuedResource" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "resource": { + "type": "string", + "id": 2 + }, + "resourceType": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4 + }, + "resourceValue": { + "type": "ResourceValue", + "id": 5 + }, + "exposedScore": { + "type": "double", + "id": 6 + }, + "resourceValueConfigsUsed": { + "rule": "repeated", + "type": "ResourceValueConfigMetadata", + "id": 7 + } + }, + "nested": { + "ResourceValue": { + "values": { + "RESOURCE_VALUE_UNSPECIFIED": 0, + "RESOURCE_VALUE_LOW": 1, + "RESOURCE_VALUE_MEDIUM": 2, + "RESOURCE_VALUE_HIGH": 3 + } + } + } + }, + "ResourceValueConfigMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "projects/{project}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "canonicalName": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "RoutingProto", + "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 + }, + "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", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "routing": { + "type": "google.api.RoutingRule", + "id": 72295729, + "extend": "google.protobuf.MethodOptions" + }, + "RoutingRule": { + "fields": { + "routingParameters": { + "rule": "repeated", + "type": "RoutingParameter", + "id": 2 + } + } + }, + "RoutingParameter": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "pathTemplate": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "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 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "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 + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "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 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "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 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "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 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "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 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "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 + } + } + }, + "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": { + "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 + } + } + } + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "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": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "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", + "responseType": "Operation", + "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", + "responseType": "google.protobuf.Empty", + "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", + "responseType": "google.protobuf.Empty", + "options": { + "(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", + "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": { + "cc_enable_arenas": true, + "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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js new file mode 100644 index 00000000000..06a231a2f15 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requests) { + // [START securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new ResourceValueConfig's parent. + * The parent field in the CreateResourceValueConfigRequest + * messages must either be empty or match this field. + */ + // const parent = 'abc123' + /** + * Required. The resource value configs to be created. + */ + // const requests = [1,2,3,4] + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callBatchCreateResourceValueConfigs() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const response = await securitycenterClient.batchCreateResourceValueConfigs(request); + console.log(response); + } + + callBatchCreateResourceValueConfigs(); + // [END securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js new file mode 100644 index 00000000000..0400b80d9e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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' + /** + * Optional. All findings matching the given filter will have their mute state + * set to this value. The default value is `MUTED`. Setting this to + * `UNDEFINED` will clear the mute state on all matching findings. + */ + // const muteState = {} + + // 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js new file mode 100644 index 00000000000..56d7f9ae426 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource of the new BigQuery export. Its + * format is `organizations/[organization_id]`, `folders/[folder_id]`, or + * `projects/[project_id]`. + */ + // const parent = 'abc123' + /** + * Required. The BigQuery export being created. + */ + // const bigQueryExport = {} + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. + */ + // 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js new file mode 100644 index 00000000000..a8683573ab4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, eventThreatDetectionCustomModule) { + // [START securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new custom module's parent. + * Its format is: + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + */ + // const parent = 'abc123' + /** + * Required. The module to create. The + * event_threat_detection_custom_module.name will be ignored and server + * generated. + */ + // const eventThreatDetectionCustomModule = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateEventThreatDetectionCustomModule() { + // Construct request + const request = { + parent, + eventThreatDetectionCustomModule, + }; + + // Run request + const response = await securitycenterClient.createEventThreatDetectionCustomModule(request); + console.log(response); + } + + callCreateEventThreatDetectionCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js new file mode 100644 index 00000000000..9305355c90e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callCreateFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + callCreateFinding(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js new file mode 100644 index 00000000000..9c2ab116ef7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. + */ + // 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js new file mode 100644 index 00000000000..66b6a01eede --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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' + /** + * Required. + * Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters and contain 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 callCreateNotificationConfig() { + // Construct request + const request = { + parent, + configId, + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.createNotificationConfig(request); + console.log(response); + } + + callCreateNotificationConfig(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js new file mode 100644 index 00000000000..f46ecd8ca06 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, securityHealthAnalyticsCustomModule) { + // [START securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new custom module's parent. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + */ + // const parent = 'abc123' + /** + * Required. SecurityHealthAnalytics custom module to create. The provided + * name is ignored and reset with provided parent information and + * server-generated ID. + */ + // const securityHealthAnalyticsCustomModule = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateSecurityHealthAnalyticsCustomModule() { + // Construct request + const request = { + parent, + securityHealthAnalyticsCustomModule, + }; + + // Run request + const response = await securitycenterClient.createSecurityHealthAnalyticsCustomModule(request); + console.log(response); + } + + callCreateSecurityHealthAnalyticsCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js new file mode 100644 index 00000000000..7a02f2d7226 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callCreateSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + callCreateSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js new file mode 100644 index 00000000000..cd35a8fc98d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the BigQuery 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js new file mode 100644 index 00000000000..e650f60daf7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_DeleteEventThreatDetectionCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the custom module to delete. + * Its format is: + * * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + * * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + * * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteEventThreatDetectionCustomModule() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteEventThreatDetectionCustomModule(request); + console.log(response); + } + + callDeleteEventThreatDetectionCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js new file mode 100644 index 00000000000..78b10cb40f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * Required. Name of the mute config to delete. Its format is + * `organizations/{organization}/muteConfigs/{config_id}`, + * `folders/{folder}/muteConfigs/{config_id}`, + * `projects/{project}/muteConfigs/{config_id}`, + * `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + * `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + * `projects/{project}/locations/global/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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js new file mode 100644 index 00000000000..c74f24446b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * Required. Name of the notification config to delete. Its format is + * `organizations/[organization_id]/notificationConfigs/[config_id]`, + * `folders/[folder_id]/notificationConfigs/[config_id]`, + * or `projects/[project_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 callDeleteNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteNotificationConfig(request); + console.log(response); + } + + callDeleteNotificationConfig(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js new file mode 100644 index 00000000000..dc702af70cb --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_DeleteResourceValueConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the ResourceValueConfig to delete + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteResourceValueConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteResourceValueConfig(request); + console.log(response); + } + + callDeleteResourceValueConfig(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js new file mode 100644 index 00000000000..af762489928 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_DeleteSecurityHealthAnalyticsCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the custom module to delete. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + * `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + * or + * `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteSecurityHealthAnalyticsCustomModule() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteSecurityHealthAnalyticsCustomModule(request); + console.log(response); + } + + callDeleteSecurityHealthAnalyticsCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js new file mode 100644 index 00000000000..03dd812a700 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the BigQuery 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js new file mode 100644 index 00000000000..9bf9dc06979 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_GetEffectiveEventThreatDetectionCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the effective Event Threat Detection custom + * module. + * Its format is: + * * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + * * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + * * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetEffectiveEventThreatDetectionCustomModule() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getEffectiveEventThreatDetectionCustomModule(request); + console.log(response); + } + + callGetEffectiveEventThreatDetectionCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js new file mode 100644 index 00000000000..496318a1c18 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_GetEffectiveSecurityHealthAnalyticsCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the effective custom module to get. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + * `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + * or + * `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetEffectiveSecurityHealthAnalyticsCustomModule() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getEffectiveSecurityHealthAnalyticsCustomModule(request); + console.log(response); + } + + callGetEffectiveSecurityHealthAnalyticsCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js new file mode 100644 index 00000000000..71edf4f4e5b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_GetEventThreatDetectionCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the custom module to get. + * Its format is: + * * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + * * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + * * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetEventThreatDetectionCustomModule() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getEventThreatDetectionCustomModule(request); + console.log(response); + } + + callGetEventThreatDetectionCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..5b8dbed8756 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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`. + */ + // const options = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js new file mode 100644 index 00000000000..b0d8f7c980b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * Required. Name of the mute config to retrieve. Its format is + * `organizations/{organization}/muteConfigs/{config_id}`, + * `folders/{folder}/muteConfigs/{config_id}`, + * `projects/{project}/muteConfigs/{config_id}`, + * `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + * `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + * `projects/{project}/locations/global/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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js new file mode 100644 index 00000000000..5bef0250fbe --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * Required. Name of the notification config to get. Its format is + * `organizations/[organization_id]/notificationConfigs/[config_id]`, + * `folders/[folder_id]/notificationConfigs/[config_id]`, + * or `projects/[project_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 callGetNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getNotificationConfig(request); + console.log(response); + } + + callGetNotificationConfig(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..700b089c742 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callGetOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings(request); + console.log(response); + } + + callGetOrganizationSettings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js new file mode 100644 index 00000000000..bb016f906a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_GetResourceValueConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource value config to retrieve. Its format is + * `organizations/{organization}/resourceValueConfigs/{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 callGetResourceValueConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getResourceValueConfig(request); + console.log(response); + } + + callGetResourceValueConfig(); + // [END securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js new file mode 100644 index 00000000000..aa97b45f74d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_GetSecurityHealthAnalyticsCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the custom module to get. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + * `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + * or + * `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetSecurityHealthAnalyticsCustomModule() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSecurityHealthAnalyticsCustomModule(request); + console.log(response); + } + + callGetSecurityHealthAnalyticsCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js new file mode 100644 index 00000000000..71c77686e1e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_GetSimulation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization name or simulation name of this simulation + * Valid format: + * `organizations/{organization}/simulations/latest` + * `organizations/{organization}/simulations/{simulation}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetSimulation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSimulation(request); + console.log(response); + } + + callGetSimulation(); + // [END securitycenter_v1_generated_SecurityCenter_GetSimulation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js new file mode 100644 index 00000000000..08903fee4c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callGetSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + callGetSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js new file mode 100644 index 00000000000..1941c52a2d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_GetValuedResource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of this valued resource + * Valid format: + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetValuedResource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getValuedResource(request); + console.log(response); + } + + callGetValuedResource(); + // [END securitycenter_v1_generated_SecurityCenter_GetValuedResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js new file mode 100644 index 00000000000..007a3c85b29 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -0,0 +1,176 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * Required. The name of the parent to group the assets by. 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 callGroupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupAssets(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js new file mode 100644 index 00000000000..b7f4e2b4fa3 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -0,0 +1,174 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 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 callGroupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupFindings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js new file mode 100644 index 00000000000..6ab4b8cb6c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js @@ -0,0 +1,187 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * Required. The name of the parent resource that contains the assets. The + * value that you can specify on parent depends on the method in which you + * specify parent. You can specify one of the following values: + * `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 callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js new file mode 100644 index 00000000000..382492e7094 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListAttackPaths_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of parent to list attack paths. + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + */ + // const parent = 'abc123' + /** + * The filter expression that filters the attack path in the response. + * Supported fields: + * * `valued_resources` supports = + */ + // const filter = 'abc123' + /** + * The value returned by the last `ListAttackPathsResponse`; indicates + * that this is a continuation of a prior `ListAttackPaths` 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 callListAttackPaths() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listAttackPathsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAttackPaths(); + // [END securitycenter_v1_generated_SecurityCenter_ListAttackPaths_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js new file mode 100644 index 00000000000..7a5312cf641 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, 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 = 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js new file mode 100644 index 00000000000..1364d1650a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListDescendantEventThreatDetectionCustomModules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the parent to list custom modules under. + * Its format is: + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + */ + // const parent = 'abc123' + /** + * A page token, received from a previous + * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to + * retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListDescendantEventThreatDetectionCustomModules` must match the call that + * provided the page token. + */ + // const pageToken = 'abc123' + /** + * The maximum number of modules 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 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListDescendantEventThreatDetectionCustomModules() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listDescendantEventThreatDetectionCustomModulesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDescendantEventThreatDetectionCustomModules(); + // [END securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js new file mode 100644 index 00000000000..c6d003b6963 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListDescendantSecurityHealthAnalyticsCustomModules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of parent to list descendant custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + */ + // const parent = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + /** + * The value returned by the last call indicating a continuation + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListDescendantSecurityHealthAnalyticsCustomModules() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listDescendantSecurityHealthAnalyticsCustomModulesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDescendantSecurityHealthAnalyticsCustomModules(); + // [END securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js new file mode 100644 index 00000000000..92688688bdd --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListEffectiveEventThreatDetectionCustomModules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the parent to list custom modules for. + * Its format is: + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + */ + // const parent = 'abc123' + /** + * A page token, received from a previous + * `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to + * retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListEffectiveEventThreatDetectionCustomModules` must match the call that + * provided the page token. + */ + // const pageToken = 'abc123' + /** + * The maximum number of modules 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 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListEffectiveEventThreatDetectionCustomModules() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listEffectiveEventThreatDetectionCustomModulesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEffectiveEventThreatDetectionCustomModules(); + // [END securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js new file mode 100644 index 00000000000..85716da998d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListEffectiveSecurityHealthAnalyticsCustomModules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of parent to list effective custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + */ + // const parent = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + /** + * The value returned by the last call indicating a continuation + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListEffectiveSecurityHealthAnalyticsCustomModules() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listEffectiveSecurityHealthAnalyticsCustomModulesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEffectiveSecurityHealthAnalyticsCustomModules(); + // [END securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js new file mode 100644 index 00000000000..c58fa6d1824 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListEventThreatDetectionCustomModules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the parent to list custom modules under. + * Its format is: + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + */ + // const parent = 'abc123' + /** + * A page token, received from a previous + * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters provided to + * `ListEventThreatDetectionCustomModules` must match the call that provided + * the page token. + */ + // const pageToken = 'abc123' + /** + * The maximum number of modules 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 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListEventThreatDetectionCustomModules() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listEventThreatDetectionCustomModulesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEventThreatDetectionCustomModules(); + // [END securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js new file mode 100644 index 00000000000..37bf56b92f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js @@ -0,0 +1,191 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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: `=`, `:` + * * resource.display_name: `=`, `:` + */ + // 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 callListFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js new file mode 100644 index 00000000000..4b585435bb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 = 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js new file mode 100644 index 00000000000..5e8d74e6cc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * Required. The name of the parent in which to list the notification + * configurations. Its format is "organizations/[organization_id]", + * "folders/[folder_id]", or "projects/[project_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 callListNotificationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listNotificationConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListNotificationConfigs(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js new file mode 100644 index 00000000000..5e66edcbb1c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListResourceValueConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns the collection of resource value configs. + * Its format is + * `organizations/[organization_id]` + */ + // const parent = 'abc123' + /** + * The number of results 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 `ListResourceValueConfigs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListResourceValueConfigs` must match the call that provided the + * page token. + * page_size can be specified, and the new page_size will be used. + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListResourceValueConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listResourceValueConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListResourceValueConfigs(); + // [END securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js new file mode 100644 index 00000000000..beb9d8b0b34 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListSecurityHealthAnalyticsCustomModules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of parent to list custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + */ + // const parent = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + /** + * The value returned by the last call indicating a continuation + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListSecurityHealthAnalyticsCustomModules() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listSecurityHealthAnalyticsCustomModulesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecurityHealthAnalyticsCustomModules(); + // [END securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js new file mode 100644 index 00000000000..f9c0b7b73ce --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callListSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSources(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js new file mode 100644 index 00000000000..83d3c39a4f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js @@ -0,0 +1,100 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_ListValuedResources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of parent to list valued resources. + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + */ + // const parent = 'abc123' + /** + * The filter expression that filters the valued resources in the response. + * Supported fields: + * * `resource_value` supports = + * * `resource_type` supports = + */ + // const filter = 'abc123' + /** + * The value returned by the last `ListValuedResourcesResponse`; indicates + * that this is a continuation of a prior `ListValuedResources` 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 + /** + * Optional. The fields by which to order the valued resources response. + * Supported fields: + * * `exposed_score` + * * `resource_value` + * * `resource_type` + * * `resource` + * * `display_name` + * Values should be a comma separated list of fields. For example: + * `exposed_score,resource_value`. + * The default sorting order is descending. To specify ascending or descending + * order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for + * example: `exposed_score DESC`. + */ + // const orderBy = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListValuedResources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listValuedResourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListValuedResources(); + // [END securitycenter_v1_generated_SecurityCenter_ListValuedResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..98e0fc29ccc --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callRunAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunAssetDiscovery(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js new file mode 100644 index 00000000000..a4116d648fd --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * Required. The relative resource + * name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * of the finding. Example: + * `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' + /** + * 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 callSetFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + callSetFindingState(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..911aea07b23 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 = {} + /** + * 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; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js new file mode 100644 index 00000000000..e18ebbe96ef --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * Required. The relative resource + * name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * of the finding. Example: + * `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' + /** + * 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js new file mode 100644 index 00000000000..83feb2dfb03 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, customConfig, resource) { + // [START securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the organization, project, or + * folder. For more information about relative resource names, see Relative + * Resource + * Name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * Example: `organizations/{organization_id}` + */ + // const parent = 'abc123' + /** + * Required. The custom configuration that you need to test. + */ + // const customConfig = {} + /** + * Required. Resource data to simulate custom module against. + */ + // const resource = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSimulateSecurityHealthAnalyticsCustomModule() { + // Construct request + const request = { + parent, + customConfig, + resource, + }; + + // Run request + const response = await securitycenterClient.simulateSecurityHealthAnalyticsCustomModule(request); + console.log(response); + } + + callSimulateSecurityHealthAnalyticsCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..3d7813598f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 = ['abc','def'] + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js new file mode 100644 index 00000000000..fe0995786d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js new file mode 100644 index 00000000000..f4093f8d97a --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(eventThreatDetectionCustomModule) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The module being updated. + */ + // const eventThreatDetectionCustomModule = {} + /** + * 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 callUpdateEventThreatDetectionCustomModule() { + // Construct request + const request = { + eventThreatDetectionCustomModule, + }; + + // Run request + const response = await securitycenterClient.updateEventThreatDetectionCustomModule(request); + console.log(response); + } + + callUpdateEventThreatDetectionCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js new file mode 100644 index 00000000000..5b699615e78 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js new file mode 100644 index 00000000000..5cf4f892b62 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + callUpdateFinding(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js new file mode 100644 index 00000000000..e9907f5228d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js new file mode 100644 index 00000000000..4eb3622cfee --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateNotificationConfig() { + // Construct request + const request = { + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.updateNotificationConfig(request); + console.log(response); + } + + callUpdateNotificationConfig(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..09351d96c89 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings(request); + console.log(response); + } + + callUpdateOrganizationSettings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js new file mode 100644 index 00000000000..138ff41f9a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resourceValueConfig) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource value config being updated. + */ + // const resourceValueConfig = {} + /** + * 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 callUpdateResourceValueConfig() { + // Construct request + const request = { + resourceValueConfig, + }; + + // Run request + const response = await securitycenterClient.updateResourceValueConfig(request); + console.log(response); + } + + callUpdateResourceValueConfig(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js new file mode 100644 index 00000000000..d230134932e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(securityHealthAnalyticsCustomModule) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The SecurityHealthAnalytics custom module to update. + */ + // const securityHealthAnalyticsCustomModule = {} + /** + * The list of fields to be updated. The only fields that can be updated are + * `enablement_state` and `custom_config`. If empty or set to the wildcard + * value `*`, both `enablement_state` and `custom_config` are updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSecurityHealthAnalyticsCustomModule() { + // Construct request + const request = { + securityHealthAnalyticsCustomModule, + }; + + // Run request + const response = await securitycenterClient.updateSecurityHealthAnalyticsCustomModule(request); + console.log(response); + } + + callUpdateSecurityHealthAnalyticsCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js new file mode 100644 index 00000000000..2493a54c831 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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. Must be + * earlier or equal to the server time. + */ + // const startTime = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + callUpdateSecurityMarks(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js new file mode 100644 index 00000000000..a9fe907a312 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + callUpdateSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js new file mode 100644 index 00000000000..4764401ddae --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, rawText, type) { + // [START securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent to validate the Custom Module under. + * Its format is: + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + */ + // const parent = 'abc123' + /** + * Required. The raw text of the module's contents. Used to generate error + * messages. + */ + // const rawText = 'abc123' + /** + * Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + */ + // const type = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callValidateEventThreatDetectionCustomModule() { + // Construct request + const request = { + parent, + rawText, + type, + }; + + // Run request + const response = await securitycenterClient.validateEventThreatDetectionCustomModule(request); + console.log(response); + } + + callValidateEventThreatDetectionCustomModule(); + // [END securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json new file mode 100644 index 00000000000..96f2d664554 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json @@ -0,0 +1,2907 @@ +{ + "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": 85, + "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" + }, + { + "name": "mute_state", + "type": ".google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState" + } + ], + "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_CreateSecurityHealthAnalyticsCustomModule_async", + "title": "SecurityCenter createSecurityHealthAnalyticsCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", + "canonical": true, + "file": "security_center.create_security_health_analytics_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModule", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "security_health_analytics_custom_module", + "type": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule" + } + ], + "resultType": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModule", + "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": 60, + "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": 67, + "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": 68, + "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": 70, + "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": 59, + "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": 56, + "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_DeleteSecurityHealthAnalyticsCustomModule_async", + "title": "SecurityCenter deleteSecurityHealthAnalyticsCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", + "canonical": true, + "file": "security_center.delete_security_health_analytics_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModule", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetSimulation_async", + "title": "SecurityCenter getSimulation Sample", + "origin": "API_DEFINITION", + "description": " Get the simulation by name or the latest simulation for the given organization.", + "canonical": true, + "file": "security_center.get_simulation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSimulation", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSimulation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Simulation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSimulation", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSimulation", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetValuedResource_async", + "title": "SecurityCenter getValuedResource Sample", + "origin": "API_DEFINITION", + "description": " Get the valued resource by name", + "canonical": true, + "file": "security_center.get_valued_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetValuedResource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetValuedResource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ValuedResource", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetValuedResource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetValuedResource", + "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 BigQuery export.", + "canonical": true, + "file": "security_center.get_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "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", + "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": 59, + "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": 59, + "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": 56, + "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": 54, + "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_GetEffectiveSecurityHealthAnalyticsCustomModule_async", + "title": "SecurityCenter getEffectiveSecurityHealthAnalyticsCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", + "canonical": true, + "file": "security_center.get_effective_security_health_analytics_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEffectiveSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetEffectiveSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModule", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_async", + "title": "SecurityCenter getSecurityHealthAnalyticsCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a SecurityHealthAnalyticsCustomModule.", + "canonical": true, + "file": "security_center.get_security_health_analytics_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModule", + "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": 54, + "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": 168, + "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": 166, + "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": 179, + "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_ListDescendantSecurityHealthAnalyticsCustomModules_async", + "title": "SecurityCenter listDescendantSecurityHealthAnalyticsCustomModules Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", + "canonical": true, + "file": "security_center.list_descendant_security_health_analytics_custom_modules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDescendantSecurityHealthAnalyticsCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModules", + "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.ListDescendantSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListDescendantSecurityHealthAnalyticsCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModules", + "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": 183, + "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": 71, + "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": 68, + "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_ListEffectiveSecurityHealthAnalyticsCustomModules_async", + "title": "SecurityCenter listEffectiveSecurityHealthAnalyticsCustomModules Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + "canonical": true, + "file": "security_center.list_effective_security_health_analytics_custom_modules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEffectiveSecurityHealthAnalyticsCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModules", + "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.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListEffectiveSecurityHealthAnalyticsCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModules", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_async", + "title": "SecurityCenter listSecurityHealthAnalyticsCustomModules Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + "canonical": true, + "file": "security_center.list_security_health_analytics_custom_modules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSecurityHealthAnalyticsCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModules", + "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.ListSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSecurityHealthAnalyticsCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModules", + "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": 68, + "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": 55, + "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": 68, + "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": 63, + "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": 69, + "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" + } + } + } + }, + { + "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": 62, + "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_SimulateSecurityHealthAnalyticsCustomModule_async", + "title": "SecurityCenter simulateSecurityHealthAnalyticsCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + "canonical": true, + "file": "security_center.simulate_security_health_analytics_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SimulateSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModule", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_config", + "type": ".google.cloud.securitycenter.v1.CustomConfig" + }, + { + "name": "resource", + "type": ".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource" + } + ], + "resultType": ".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SimulateSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModule", + "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": 58, + "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": 66, + "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": 58, + "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": 58, + "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": 58, + "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_UpdateSecurityHealthAnalyticsCustomModule_async", + "title": "SecurityCenter updateSecurityHealthAnalyticsCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", + "canonical": true, + "file": "security_center.update_security_health_analytics_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModule", + "async": true, + "parameters": [ + { + "name": "security_health_analytics_custom_module", + "type": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityHealthAnalyticsCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModule", + "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": 58, + "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": 67, + "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" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async", + "title": "SecurityCenter createBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Creates a BigQuery export.", + "canonical": true, + "file": "security_center.create_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "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 BigQuery export.", + "canonical": true, + "file": "security_center.delete_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "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": 58, + "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": 71, + "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" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_async", + "title": "SecurityCenter createEventThreatDetectionCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", + "canonical": true, + "file": "security_center.create_event_threat_detection_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModule", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "event_threat_detection_custom_module", + "type": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule" + } + ], + "resultType": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModule", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_async", + "title": "SecurityCenter deleteEventThreatDetectionCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", + "canonical": true, + "file": "security_center.delete_event_threat_detection_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModule", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_async", + "title": "SecurityCenter getEventThreatDetectionCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Gets an Event Threat Detection custom module.", + "canonical": true, + "file": "security_center.get_event_threat_detection_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModule", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_async", + "title": "SecurityCenter listDescendantEventThreatDetectionCustomModules Sample", + "origin": "API_DEFINITION", + "description": " Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", + "canonical": true, + "file": "security_center.list_descendant_event_threat_detection_custom_modules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDescendantEventThreatDetectionCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModules", + "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.ListDescendantEventThreatDetectionCustomModulesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListDescendantEventThreatDetectionCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModules", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_async", + "title": "SecurityCenter listEventThreatDetectionCustomModules Sample", + "origin": "API_DEFINITION", + "description": " Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", + "canonical": true, + "file": "security_center.list_event_threat_detection_custom_modules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEventThreatDetectionCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModules", + "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.ListEventThreatDetectionCustomModulesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListEventThreatDetectionCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModules", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_async", + "title": "SecurityCenter updateEventThreatDetectionCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.", + "canonical": true, + "file": "security_center.update_event_threat_detection_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModule", + "async": true, + "parameters": [ + { + "name": "event_threat_detection_custom_module", + "type": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModule", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_async", + "title": "SecurityCenter validateEventThreatDetectionCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Validates the given Event Threat Detection custom module.", + "canonical": true, + "file": "security_center.validate_event_threat_detection_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ValidateEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModule", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "raw_text", + "type": "TYPE_STRING" + }, + { + "name": "type", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ValidateEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModule", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_async", + "title": "SecurityCenter getEffectiveEventThreatDetectionCustomModule Sample", + "origin": "API_DEFINITION", + "description": " Gets an effective Event Threat Detection custom module at the given level.", + "canonical": true, + "file": "security_center.get_effective_event_threat_detection_custom_module.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEffectiveEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetEffectiveEventThreatDetectionCustomModule", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModule", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_async", + "title": "SecurityCenter listEffectiveEventThreatDetectionCustomModules Sample", + "origin": "API_DEFINITION", + "description": " Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.", + "canonical": true, + "file": "security_center.list_effective_event_threat_detection_custom_modules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEffectiveEventThreatDetectionCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModules", + "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.ListEffectiveEventThreatDetectionCustomModulesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListEffectiveEventThreatDetectionCustomModules", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModules", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_async", + "title": "SecurityCenter batchCreateResourceValueConfigs Sample", + "origin": "API_DEFINITION", + "description": " Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.", + "canonical": true, + "file": "security_center.batch_create_resource_value_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateResourceValueConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "BatchCreateResourceValueConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_async", + "title": "SecurityCenter deleteResourceValueConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a ResourceValueConfig.", + "canonical": true, + "file": "security_center.delete_resource_value_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteResourceValueConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteResourceValueConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_async", + "title": "SecurityCenter getResourceValueConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a ResourceValueConfig.", + "canonical": true, + "file": "security_center.get_resource_value_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetResourceValueConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ResourceValueConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetResourceValueConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_async", + "title": "SecurityCenter listResourceValueConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists all ResourceValueConfigs.", + "canonical": true, + "file": "security_center.list_resource_value_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListResourceValueConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigs", + "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.ListResourceValueConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListResourceValueConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_async", + "title": "SecurityCenter updateResourceValueConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing ResourceValueConfigs with new rules.", + "canonical": true, + "file": "security_center.update_resource_value_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateResourceValueConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfig", + "async": true, + "parameters": [ + { + "name": "resource_value_config", + "type": ".google.cloud.securitycenter.v1.ResourceValueConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ResourceValueConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateResourceValueConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListValuedResources_async", + "title": "SecurityCenter listValuedResources Sample", + "origin": "API_DEFINITION", + "description": " Lists the valued resources for a set of simulation results and filter.", + "canonical": true, + "file": "security_center.list_valued_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListValuedResources", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListValuedResources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListValuedResourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListValuedResources", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListValuedResources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListAttackPaths_async", + "title": "SecurityCenter listAttackPaths Sample", + "origin": "API_DEFINITION", + "description": " Lists the attack paths for a set of simulation results or valued resources and filter.", + "canonical": true, + "file": "security_center.list_attack_paths.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAttackPaths", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAttackPaths", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListAttackPathsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAttackPaths", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAttackPaths", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js new file mode 100644 index 00000000000..bfb25900b23 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callCreateFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + callCreateFinding(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js new file mode 100644 index 00000000000..7c886bd0783 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callCreateSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + callCreateSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..0d291a776ba --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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`. + */ + // const options = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..fe5cff18804 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callGetOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings(request); + console.log(response); + } + + callGetOrganizationSettings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js new file mode 100644 index 00000000000..3e2feb62385 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callGetSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + callGetSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js new file mode 100644 index 00000000000..74aa4670b37 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js @@ -0,0 +1,139 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callGroupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupAssets(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js new file mode 100644 index 00000000000..9f68d14b7f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js @@ -0,0 +1,118 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callGroupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupFindings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js new file mode 100644 index 00000000000..f7a78250c53 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js @@ -0,0 +1,144 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js new file mode 100644 index 00000000000..4c9da681eff --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js @@ -0,0 +1,121 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callListFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js new file mode 100644 index 00000000000..b371c9da77c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callListSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSources(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..136a5390702 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callRunAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunAssetDiscovery(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js new file mode 100644 index 00000000000..1d71876924d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callSetFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + callSetFindingState(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..ce159b9a0ac --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 = {} + /** + * 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; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..adb7a14d19f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 = ['abc','def'] + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js new file mode 100644 index 00000000000..c98245c8be0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + callUpdateFinding(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..e2ef636e325 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings(request); + console.log(response); + } + + callUpdateOrganizationSettings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js new file mode 100644 index 00000000000..bfe3b0385a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + callUpdateSecurityMarks(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js new file mode 100644 index 00000000000..3f3f3a9c564 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + callUpdateSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json new file mode 100644 index 00000000000..e41fe5b440c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json @@ -0,0 +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": 60, + "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": 67, + "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": 59, + "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": 54, + "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": 54, + "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": 131, + "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": 110, + "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": 136, + "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": 113, + "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": 67, + "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": 55, + "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": 66, + "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": 69, + "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" + } + } + } + }, + { + "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": 62, + "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": 62, + "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": 57, + "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": 57, + "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": 61, + "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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js new file mode 100644 index 00000000000..076d4024764 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callCreateFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + callCreateFinding(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js new file mode 100644 index 00000000000..640abc85120 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callCreateNotificationConfig() { + // Construct request + const request = { + parent, + configId, + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.createNotificationConfig(request); + console.log(response); + } + + callCreateNotificationConfig(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js new file mode 100644 index 00000000000..823ddc36aec --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callCreateSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + callCreateSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js new file mode 100644 index 00000000000..8d98467bd3a --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callDeleteNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteNotificationConfig(request); + console.log(response); + } + + callDeleteNotificationConfig(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..df279ca8777 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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`. + */ + // const options = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js new file mode 100644 index 00000000000..c75edfc98f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callGetNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getNotificationConfig(request); + console.log(response); + } + + callGetNotificationConfig(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..8311292782e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callGetOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings(request); + console.log(response); + } + + callGetOrganizationSettings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js new file mode 100644 index 00000000000..b2cc9ac8361 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callGetSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + callGetSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js new file mode 100644 index 00000000000..3b187f63469 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js @@ -0,0 +1,176 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callGroupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupAssets(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js new file mode 100644 index 00000000000..9143e0a95e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js @@ -0,0 +1,172 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callGroupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupFindings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js new file mode 100644 index 00000000000..6351f41a531 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js @@ -0,0 +1,185 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js new file mode 100644 index 00000000000..85deac67bed --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js @@ -0,0 +1,181 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callListFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js new file mode 100644 index 00000000000..b2fa4fbc780 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callListNotificationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listNotificationConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListNotificationConfigs(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js new file mode 100644 index 00000000000..444040d32b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callListSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSources(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..341171e330f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_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. + */ + /** + * 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 callRunAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunAssetDiscovery(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js new file mode 100644 index 00000000000..c45f132d97c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, 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. + */ + /** + * 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 callSetFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + callSetFindingState(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..ad06a6ada6d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 = {} + /** + * 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; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..be4756d9f27 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 = ['abc','def'] + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js new file mode 100644 index 00000000000..541476a06a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + callUpdateFinding(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js new file mode 100644 index 00000000000..358882fe53d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateNotificationConfig() { + // Construct request + const request = { + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.updateNotificationConfig(request); + console.log(response); + } + + callUpdateNotificationConfig(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..2124db502a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings(request); + console.log(response); + } + + callUpdateOrganizationSettings(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js new file mode 100644 index 00000000000..d8655bcd440 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + callUpdateSecurityMarks(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js new file mode 100644 index 00000000000..3d4a7dddfef --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +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. + */ + /** + * 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 callUpdateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + callUpdateSource(); + // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json new file mode 100644 index 00000000000..73ceda373e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json @@ -0,0 +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": 60, + "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": 65, + "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": 67, + "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": 54, + "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": 59, + "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": 54, + "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": 54, + "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": 54, + "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": 168, + "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": 164, + "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": 177, + "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": 173, + "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": 67, + "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": 68, + "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": 55, + "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": 66, + "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": 69, + "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" + } + } + } + }, + { + "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": 62, + "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": 66, + "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": 58, + "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": 58, + "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": 58, + "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": 66, + "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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js new file mode 100644 index 00000000000..6cf6f770cf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requests) { + // [START securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new ResourceValueConfig's parent. + * The parent field in the CreateResourceValueConfigRequest + * messages must either be empty or match this field. + */ + // const parent = 'abc123' + /** + * Required. The resource value configs to be created. + */ + // const requests = [1,2,3,4] + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callBatchCreateResourceValueConfigs() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const response = await securitycenterClient.batchCreateResourceValueConfigs(request); + console.log(response); + } + + callBatchCreateResourceValueConfigs(); + // [END securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js new file mode 100644 index 00000000000..d0d95d3b9f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js @@ -0,0 +1,94 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. The parent, at which bulk action needs to be applied. If no + * location is specified, findings are updated in global. The following list + * shows some examples: + * + `organizations/[organization_id]` + * + `organizations/[organization_id]/locations/[location_id]` + * + `folders/[folder_id]` + * + `folders/[folder_id]/locations/[location_id]` + * + `projects/[project_id]` + * + `projects/[project_id]/locations/[location_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' + /** + * Optional. All findings matching the given filter will have their mute state + * set to this value. The default value is `MUTED`. Setting this to + * `UNDEFINED` will clear the mute state on all matching findings. + */ + // const muteState = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_BulkMuteFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js new file mode 100644 index 00000000000..3ec09a4c9ca --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. The name of the parent resource of the new BigQuery export. Its + * format is `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_id]`. + */ + // const parent = 'abc123' + /** + * Required. The BigQuery export being created. + */ + // const bigQueryExport = {} + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. + */ + // const bigQueryExportId = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_CreateBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js new file mode 100644 index 00000000000..3af8374d077 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, findingId, finding) { + // [START securitycenter_v2_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. + */ + /** + * Required. Resource name of the new finding's parent. The following list + * shows some examples of the format: + * + + * `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + callCreateFinding(); + // [END securitycenter_v2_generated_SecurityCenter_CreateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js new file mode 100644 index 00000000000..5e0fccbadeb --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, muteConfig, muteConfigId) { + // [START securitycenter_v2_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. + */ + /** + * Required. Resource name of the new mute configs's parent. Its format is + * `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_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 only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. + */ + // const muteConfigId = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_CreateMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js new file mode 100644 index 00000000000..31b796f4b33 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, configId, notificationConfig) { + // [START securitycenter_v2_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. + */ + /** + * Required. Resource name of the new notification config's parent. Its format + * is `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_id]`. + */ + // const parent = 'abc123' + /** + * Required. + * Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters and contain 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateNotificationConfig() { + // Construct request + const request = { + parent, + configId, + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.createNotificationConfig(request); + console.log(response); + } + + callCreateNotificationConfig(); + // [END securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js new file mode 100644 index 00000000000..7c60ffa8db5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, source) { + // [START securitycenter_v2_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. + */ + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + callCreateSource(); + // [END securitycenter_v2_generated_SecurityCenter_CreateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js new file mode 100644 index 00000000000..b9bccdda6c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. The name of the BigQuery export to delete. The following list + * shows some examples of the format: + * + + * `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + * + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + * + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_DeleteBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js new file mode 100644 index 00000000000..97f11c9ee2c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. Name of the mute config to delete. The following list shows some + * examples of the format: + * + `organizations/{organization}/muteConfigs/{config_id}` + * + + * `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + * + `folders/{folder}/muteConfigs/{config_id}` + * + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + * + `projects/{project}/muteConfigs/{config_id}` + * + `projects/{project}/locations/{location}/muteConfigs/{config_id}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_DeleteMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js new file mode 100644 index 00000000000..7d80dbadcc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. Name of the notification config to delete. The following list + * shows some examples of the format: + * + + * `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + * + + * `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` + * + + * `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteNotificationConfig(request); + console.log(response); + } + + callDeleteNotificationConfig(); + // [END securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js new file mode 100644 index 00000000000..1ed949da608 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_generated_SecurityCenter_DeleteResourceValueConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the ResourceValueConfig to delete + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteResourceValueConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteResourceValueConfig(request); + console.log(response); + } + + callDeleteResourceValueConfig(); + // [END securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js new file mode 100644 index 00000000000..317cde2e26c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. Name of the BigQuery export to retrieve. The following list shows + * some examples of the format: + * + + * `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + * + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + * + `projects/{project}locations/{location}//bigQueryExports/{export_id}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_GetBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js new file mode 100644 index 00000000000..bdee3a80881 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource) { + // [START securitycenter_v2_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. + */ + /** + * 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`. + */ + // const options = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END securitycenter_v2_generated_SecurityCenter_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js new file mode 100644 index 00000000000..47b0b08601c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. Name of the mute config to retrieve. The following list shows + * some examples of the format: + * + `organizations/{organization}/muteConfigs/{config_id}` + * + + * `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + * + `folders/{folder}/muteConfigs/{config_id}` + * + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + * + `projects/{project}/muteConfigs/{config_id}` + * + `projects/{project}/locations/{location}/muteConfigs/{config_id}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_GetMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js new file mode 100644 index 00000000000..fcf405cecde --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. Name of the notification config to get. The following list shows + * some examples of the format: + * + + * `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + * + + * `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` + * + + * `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getNotificationConfig(request); + console.log(response); + } + + callGetNotificationConfig(); + // [END securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js new file mode 100644 index 00000000000..023825c41a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_generated_SecurityCenter_GetResourceValueConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource value config to retrieve. Its format is + * organizations/{organization}/resourceValueConfigs/{config_id}. + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetResourceValueConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getResourceValueConfig(request); + console.log(response); + } + + callGetResourceValueConfig(); + // [END securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js new file mode 100644 index 00000000000..acfea02f280 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_generated_SecurityCenter_GetSimulation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization name or simulation name of this simulation + * Valid format: + * `organizations/{organization}/simulations/latest` + * `organizations/{organization}/simulations/{simulation}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetSimulation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSimulation(request); + console.log(response); + } + + callGetSimulation(); + // [END securitycenter_v2_generated_SecurityCenter_GetSimulation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js new file mode 100644 index 00000000000..41203efec24 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + callGetSource(); + // [END securitycenter_v2_generated_SecurityCenter_GetSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js new file mode 100644 index 00000000000..5c06609490c --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_generated_SecurityCenter_GetValuedResource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of this valued resource + * Valid format: + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetValuedResource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getValuedResource(request); + console.log(response); + } + + callGetValuedResource(); + // [END securitycenter_v2_generated_SecurityCenter_GetValuedResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js new file mode 100644 index 00000000000..b95183c426b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js @@ -0,0 +1,138 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, groupBy) { + // [START securitycenter_v2_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. + */ + /** + * Required. Name of the source to groupBy. If no location is specified, + * finding is assumed to be in global. + * The following list shows some examples: + * + `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + * + `folders/[folder_id]/sources/[source_id]` + * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + * + `projects/[project_id]/sources/[source_id]` + * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + * To groupBy across all sources provide a source_id of `-`. The following + * list shows some examples: + * + `organizations/{organization_id}/sources/-` + * + `organizations/{organization_id}/sources/-/locations/[location_id]` + * + `folders/{folder_id}/sources/-` + * + `folders/{folder_id}/sources/-/locations/[location_id]` + * + `projects/{project_id}/sources/-` + * + `projects/{project_id}/sources/-/locations/[location_id]` + */ + // 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 + * * 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: `=`, `:` + * * security_marks.marks: `=`, `:` + * * 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. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: "parent,resource_name". + */ + // const groupBy = 'abc123' + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGroupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupFindings(); + // [END securitycenter_v2_generated_SecurityCenter_GroupFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js new file mode 100644 index 00000000000..fd7ebda4f62 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_generated_SecurityCenter_ListAttackPaths_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of parent to list attack paths. + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + */ + // const parent = 'abc123' + /** + * The filter expression that filters the attack path in the response. + * Supported fields: + * * `valued_resources` supports = + */ + // const filter = 'abc123' + /** + * The value returned by the last `ListAttackPathsResponse`; indicates + * that this is a continuation of a prior `ListAttackPaths` 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListAttackPaths() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listAttackPathsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAttackPaths(); + // [END securitycenter_v2_generated_SecurityCenter_ListAttackPaths_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js new file mode 100644 index 00000000000..a61a2417283 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListBigQueryExports() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listBigQueryExportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBigQueryExports(); + // [END securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js new file mode 100644 index 00000000000..481b1cd1c23 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js @@ -0,0 +1,156 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. Name of the source the findings belong to. If no location is + * specified, the default is global. The following list shows some examples: + * + `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + * + `folders/[folder_id]/sources/[source_id]` + * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + * + `projects/[project_id]/sources/[source_id]` + * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + * To list across all sources provide a source_id of `-`. The following + * list shows some examples: + * + `organizations/{organization_id}/sources/-` + * + `organizations/{organization_id}/sources/-/locations/{location_id}` + * + `folders/{folder_id}/sources/-` + * + `folders/{folder_id}/sources/-locations/{location_id}` + * + `projects/{projects_id}/sources/-` + * + `projects/{projects_id}/sources/-/locations/{location_id}` + */ + // 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 + * * 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: `=`, `:` + * * security_marks.marks: `=`, `:` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` + */ + // 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,parent". 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,parent". Redundant space characters in the + * syntax are insignificant. "name desc,parent" and " + * name desc , parent " are equivalent. + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * security_marks.marks + */ + // const orderBy = 'abc123' + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [END securitycenter_v2_generated_SecurityCenter_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js new file mode 100644 index 00000000000..4c3cadf5ed5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. The parent, which owns the collection of mute configs. Its format + * is `organizations/[organization_id]", "folders/[folder_id]`, + * `projects/[project_id]`, + * `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, + * `projects/[project_id]/locations/[location_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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListMuteConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listMuteConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMuteConfigs(); + // [END securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js new file mode 100644 index 00000000000..7e477d62385 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * Required. The name of the parent in which to list the notification + * configurations. Its format is + * "organizations/[organization_id]/locations/[location_id]", + * "folders/[folder_id]/locations/[location_id]", or + * "projects/[project_id]/locations/[location_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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListNotificationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listNotificationConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListNotificationConfigs(); + // [END securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js new file mode 100644 index 00000000000..62d9cca0815 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_generated_SecurityCenter_ListResourceValueConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns the collection of resource value configs. + * Its format is + * `organizations/[organization_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 `ListResourceValueConfigs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListResourceValueConfigs` must match the call that provided the + * page token. + * page_size can be specified, and the new page_size will be used. + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListResourceValueConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listResourceValueConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListResourceValueConfigs(); + // [END securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js new file mode 100644 index 00000000000..faa02e7df5f --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSources(); + // [END securitycenter_v2_generated_SecurityCenter_ListSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js new file mode 100644 index 00000000000..d85336ee89e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js @@ -0,0 +1,98 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_generated_SecurityCenter_ListValuedResources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of parent to list exposed resources. + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + */ + // const parent = 'abc123' + /** + * The filter expression that filters the valued resources in the response. + * Supported fields: + * * `resource_value` supports = + * * `resource_type` supports = + */ + // const filter = 'abc123' + /** + * The value returned by the last `ListValuedResourcesResponse`; indicates + * that this is a continuation of a prior `ListValuedResources` 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 + /** + * Optional. The fields by which to order the valued resources response. + * Supported fields: + * * `exposed_score` + * * `resource_value` + * * `resource_type` + * Values should be a comma separated list of fields. For example: + * `exposed_score,resource_value`. + * The default sorting order is descending. To specify ascending or descending + * order for a field, append a " ASC" or a " DESC" suffix, respectively; for + * example: `exposed_score DESC`. + */ + // const orderBy = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListValuedResources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = securitycenterClient.listValuedResourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListValuedResources(); + // [END securitycenter_v2_generated_SecurityCenter_ListValuedResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js new file mode 100644 index 00000000000..f2134f465e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, state) { + // [START securitycenter_v2_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. + */ + /** + * Required. The relative resource + * name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * of the finding. If no location is specified, finding is assumed to be in + * global. The following list shows some examples: + * + + * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + * + + * `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + * + + * `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + * + + * `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + */ + // const name = 'abc123' + /** + * Required. The desired State of the finding. + */ + // const state = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetFindingState() { + // Construct request + const request = { + name, + state, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + callSetFindingState(); + // [END securitycenter_v2_generated_SecurityCenter_SetFindingState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js new file mode 100644 index 00000000000..b1eff3f2bc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, policy) { + // [START securitycenter_v2_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. + */ + /** + * 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 = {} + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END securitycenter_v2_generated_SecurityCenter_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js new file mode 100644 index 00000000000..1d00d726d5d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, mute) { + // [START securitycenter_v2_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. + */ + /** + * Required. The relative resource + * name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * of the finding. If no location is specified, finding is assumed to be in + * global. The following list shows some examples: + * + + * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + * + + * `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + * + + * `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + * + + * `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + */ + // const name = 'abc123' + /** + * Required. The desired state of the Mute. + */ + // const mute = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_SetMute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..cbeb24944e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, permissions) { + // [START securitycenter_v2_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. + */ + /** + * 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 = ['abc','def'] + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END securitycenter_v2_generated_SecurityCenter_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js new file mode 100644 index 00000000000..7ed0fd29fcf --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v2_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. + */ + /** + * 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/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_UpdateBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js new file mode 100644 index 00000000000..98bd94a4053 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(externalSystem) { + // [START securitycenter_v2_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. + */ + /** + * 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/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_UpdateExternalSystem_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js new file mode 100644 index 00000000000..e1061b07c24 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(finding) { + // [START securitycenter_v2_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. + */ + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + callUpdateFinding(); + // [END securitycenter_v2_generated_SecurityCenter_UpdateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js new file mode 100644 index 00000000000..25bd6ab2541 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(muteConfig) { + // [START securitycenter_v2_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. + */ + /** + * 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/securitycenter').v2; + + // 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_v2_generated_SecurityCenter_UpdateMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js new file mode 100644 index 00000000000..f3e87f0e710 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(notificationConfig) { + // [START securitycenter_v2_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. + */ + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateNotificationConfig() { + // Construct request + const request = { + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.updateNotificationConfig(request); + console.log(response); + } + + callUpdateNotificationConfig(); + // [END securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js new file mode 100644 index 00000000000..4fad0d3fe9e --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resourceValueConfig) { + // [START securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource value config being updated. + */ + // const resourceValueConfig = {} + /** + * The list of fields to be updated. + * If empty all mutable fields will be updated. + * To update nested fields, include the top level field in the mask + * For example, to update gcp_metadata.resource_type, include the + * "gcp_metadata" field mask + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateResourceValueConfig() { + // Construct request + const request = { + resourceValueConfig, + }; + + // Run request + const response = await securitycenterClient.updateResourceValueConfig(request); + console.log(response); + } + + callUpdateResourceValueConfig(); + // [END securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js new file mode 100644 index 00000000000..25b9591bbdf --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(securityMarks) { + // [START securitycenter_v2_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. + */ + /** + * 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 = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + callUpdateSecurityMarks(); + // [END securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js new file mode 100644 index 00000000000..1f44431bfb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(source) { + // [START securitycenter_v2_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. + */ + /** + * 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/securitycenter').v2; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + callUpdateSource(); + // [END securitycenter_v2_generated_SecurityCenter_UpdateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json new file mode 100644 index 00000000000..c59a76de87b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json @@ -0,0 +1,1823 @@ +{ + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_async", + "title": "SecurityCenter batchCreateResourceValueConfigs Sample", + "origin": "API_DEFINITION", + "description": " Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.", + "canonical": true, + "file": "security_center.batch_create_resource_value_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateResourceValueConfigs", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "BatchCreateResourceValueConfigs", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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. If no location is specified, findings are muted in global. 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": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BulkMuteFindings", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.BulkMuteFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "mute_state", + "type": ".google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "BulkMuteFindings", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.BulkMuteFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_async", + "title": "SecurityCenter createBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Creates a BigQuery export.", + "canonical": true, + "file": "security_center.create_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBigQueryExport", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateBigQueryExport", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "big_query_export", + "type": ".google.cloud.securitycenter.v2.BigQueryExport" + }, + { + "name": "big_query_export_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "CreateBigQueryExport", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding in a location. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v2.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v2.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMuteConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateMuteConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mute_config", + "type": ".google.cloud.securitycenter.v2.MuteConfig" + }, + { + "name": "mute_config_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "CreateMuteConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v2.NotificationConfig" + } + ], + "resultType": ".google.cloud.securitycenter.v2.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v2.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v2.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_async", + "title": "SecurityCenter deleteBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing BigQuery export.", + "canonical": true, + "file": "security_center.delete_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBigQueryExport", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteBigQueryExport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteBigQueryExport", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_async", + "title": "SecurityCenter deleteMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing mute config. If no location is specified, default is global.", + "canonical": true, + "file": "security_center.delete_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMuteConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteMuteConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteMuteConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_async", + "title": "SecurityCenter deleteResourceValueConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a ResourceValueConfig.", + "canonical": true, + "file": "security_center.delete_resource_value_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteResourceValueConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteResourceValueConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_async", + "title": "SecurityCenter getBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Gets a BigQuery export.", + "canonical": true, + "file": "security_center.get_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBigQueryExport", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetBigQueryExport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GetBigQueryExport", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_GetSimulation_async", + "title": "SecurityCenter getSimulation Sample", + "origin": "API_DEFINITION", + "description": " Get the simulation by name or the latest simulation for the given organization.", + "canonical": true, + "file": "security_center.get_simulation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSimulation", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetSimulation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.Simulation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GetSimulation", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetSimulation", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_GetValuedResource_async", + "title": "SecurityCenter getValuedResource Sample", + "origin": "API_DEFINITION", + "description": " Get the valued resource by name", + "canonical": true, + "file": "security_center.get_valued_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetValuedResource", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetValuedResource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.ValuedResource", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GetValuedResource", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetValuedResource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v2.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.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_GetMuteConfig_async", + "title": "SecurityCenter getMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a mute config. If no location is specified, default is global.", + "canonical": true, + "file": "security_center.get_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMuteConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetMuteConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GetMuteConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_async", + "title": "SecurityCenter getResourceValueConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a ResourceValueConfig.", + "canonical": true, + "file": "security_center.get_resource_value_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetResourceValueConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.ResourceValueConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GetResourceValueConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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 in a location. If no location is specified, findings are assumed to be in global To group across all sources provide a `-` as the source id. The following list shows some examples: + `/v2/organizations/{organization_id}/sources/-/findings` + `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + `/v2/folders/{folder_id}/sources/-/findings` + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` + `/v2/projects/{project_id}/sources/-/findings` + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings`", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 130, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v2.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_ListAttackPaths_async", + "title": "SecurityCenter listAttackPaths Sample", + "origin": "API_DEFINITION", + "description": " Lists the attack paths for a set of simulation results or valued resources and filter.", + "canonical": true, + "file": "security_center.list_attack_paths.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAttackPaths", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListAttackPaths", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v2.ListAttackPathsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "ListAttackPaths", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListAttackPaths", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBigQueryExports", + "fullName": "google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "ListBigQueryExports", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListBigQueryExports", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources for a given location provide a `-` as the source id. If no location is specified, finding are assumed to be in global. The following list shows some examples: + `/v2/organizations/{organization_id}/sources/-/findings` + `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings`", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 148, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v2.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_async", + "title": "SecurityCenter listMuteConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists mute configs. If no location is specified, default is global.", + "canonical": true, + "file": "security_center.list_mute_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMuteConfigs", + "fullName": "google.cloud.securitycenter.v2.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.v2.ListMuteConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "ListMuteConfigs", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListMuteConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListNotificationConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_async", + "title": "SecurityCenter listResourceValueConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists all ResourceValueConfigs.", + "canonical": true, + "file": "security_center.list_resource_value_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListResourceValueConfigs", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.ListResourceValueConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "ListResourceValueConfigs", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v2.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.v2.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_ListValuedResources_async", + "title": "SecurityCenter listValuedResources Sample", + "origin": "API_DEFINITION", + "description": " Lists the valued resources for a set of simulation results and filter.", + "canonical": true, + "file": "security_center.list_valued_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListValuedResources", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListValuedResources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v2.ListValuedResourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "ListValuedResources", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListValuedResources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding. If no location is specified, finding is assumed to be in global", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v2.Finding.State" + } + ], + "resultType": ".google.cloud.securitycenter.v2.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v2.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.v2.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_SetMute_async", + "title": "SecurityCenter setMute Sample", + "origin": "API_DEFINITION", + "description": " Updates the mute state of a finding. If no location is specified, finding is assumed to be in global", + "canonical": true, + "file": "security_center.set_mute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMute", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetMute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "mute", + "type": ".google.cloud.securitycenter.v2.Finding.Mute" + } + ], + "resultType": ".google.cloud.securitycenter.v2.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "SetMute", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetMute", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v2.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.v2.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBigQueryExport", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateBigQueryExport", + "async": true, + "parameters": [ + { + "name": "big_query_export", + "type": ".google.cloud.securitycenter.v2.BigQueryExport" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v2.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateBigQueryExport", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_async", + "title": "SecurityCenter updateExternalSystem Sample", + "origin": "API_DEFINITION", + "description": " Updates external system. This is for a given finding. If no location is specified, finding is assumed to be in global", + "canonical": true, + "file": "security_center.update_external_system.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExternalSystem", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateExternalSystem", + "async": true, + "parameters": [ + { + "name": "external_system", + "type": ".google.cloud.securitycenter.v2.ExternalSystem" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v2.ExternalSystem", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateExternalSystem", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateExternalSystem", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. If no location is specified, finding is assumed to be in global. 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": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v2.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v2.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_async", + "title": "SecurityCenter updateMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a mute config. If no location is specified, default is global.", + "canonical": true, + "file": "security_center.update_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMuteConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateMuteConfig", + "async": true, + "parameters": [ + { + "name": "mute_config", + "type": ".google.cloud.securitycenter.v2.MuteConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v2.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateMuteConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v2.NotificationConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v2.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_async", + "title": "SecurityCenter updateResourceValueConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing ResourceValueConfigs with new rules.", + "canonical": true, + "file": "security_center.update_resource_value_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateResourceValueConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfig", + "async": true, + "parameters": [ + { + "name": "resource_value_config", + "type": ".google.cloud.securitycenter.v2.ResourceValueConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v2.ResourceValueConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateResourceValueConfig", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks. For Finding Security marks, if no location is specified, finding is assumed to be in global. Assets Security Marks can only be accessed through global endpoint.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v2.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v2.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v2_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": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v2.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v2.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/index.ts new file mode 100644 index 00000000000..d0cf15cbb55 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/index.ts @@ -0,0 +1,30 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta1 from './v1beta1'; +import * as v1p1beta1 from './v1p1beta1'; +import * as v2 from './v2'; + +const SecurityCenterClient = v1.SecurityCenterClient; +type SecurityCenterClient = v1.SecurityCenterClient; + +export {v1, v1beta1, v1p1beta1, v2, SecurityCenterClient}; +export default {v1, v1beta1, v1p1beta1, v2, SecurityCenterClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-securitycenter/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..bf53b41973b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1/gapic_metadata.json @@ -0,0 +1,721 @@ +{ + "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": { + "CreateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "createSecurityHealthAnalyticsCustomModule" + ] + }, + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "DeleteSecurityHealthAnalyticsCustomModule": { + "methods": [ + "deleteSecurityHealthAnalyticsCustomModule" + ] + }, + "GetSimulation": { + "methods": [ + "getSimulation" + ] + }, + "GetValuedResource": { + "methods": [ + "getValuedResource" + ] + }, + "GetBigQueryExport": { + "methods": [ + "getBigQueryExport" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetEffectiveSecurityHealthAnalyticsCustomModule": { + "methods": [ + "getEffectiveSecurityHealthAnalyticsCustomModule" + ] + }, + "GetSecurityHealthAnalyticsCustomModule": { + "methods": [ + "getSecurityHealthAnalyticsCustomModule" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetMute": { + "methods": [ + "setMute" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "SimulateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "simulateSecurityHealthAnalyticsCustomModule" + ] + }, + "UpdateExternalSystem": { + "methods": [ + "updateExternalSystem" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "updateSecurityHealthAnalyticsCustomModule" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "CreateBigQueryExport": { + "methods": [ + "createBigQueryExport" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "deleteBigQueryExport" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "updateBigQueryExport" + ] + }, + "CreateEventThreatDetectionCustomModule": { + "methods": [ + "createEventThreatDetectionCustomModule" + ] + }, + "DeleteEventThreatDetectionCustomModule": { + "methods": [ + "deleteEventThreatDetectionCustomModule" + ] + }, + "GetEventThreatDetectionCustomModule": { + "methods": [ + "getEventThreatDetectionCustomModule" + ] + }, + "UpdateEventThreatDetectionCustomModule": { + "methods": [ + "updateEventThreatDetectionCustomModule" + ] + }, + "ValidateEventThreatDetectionCustomModule": { + "methods": [ + "validateEventThreatDetectionCustomModule" + ] + }, + "GetEffectiveEventThreatDetectionCustomModule": { + "methods": [ + "getEffectiveEventThreatDetectionCustomModule" + ] + }, + "BatchCreateResourceValueConfigs": { + "methods": [ + "batchCreateResourceValueConfigs" + ] + }, + "DeleteResourceValueConfig": { + "methods": [ + "deleteResourceValueConfig" + ] + }, + "GetResourceValueConfig": { + "methods": [ + "getResourceValueConfig" + ] + }, + "UpdateResourceValueConfig": { + "methods": [ + "updateResourceValueConfig" + ] + }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListDescendantSecurityHealthAnalyticsCustomModules": { + "methods": [ + "listDescendantSecurityHealthAnalyticsCustomModules", + "listDescendantSecurityHealthAnalyticsCustomModulesStream", + "listDescendantSecurityHealthAnalyticsCustomModulesAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListEffectiveSecurityHealthAnalyticsCustomModules": { + "methods": [ + "listEffectiveSecurityHealthAnalyticsCustomModules", + "listEffectiveSecurityHealthAnalyticsCustomModulesStream", + "listEffectiveSecurityHealthAnalyticsCustomModulesAsync" + ] + }, + "ListSecurityHealthAnalyticsCustomModules": { + "methods": [ + "listSecurityHealthAnalyticsCustomModules", + "listSecurityHealthAnalyticsCustomModulesStream", + "listSecurityHealthAnalyticsCustomModulesAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + }, + "ListBigQueryExports": { + "methods": [ + "listBigQueryExports", + "listBigQueryExportsStream", + "listBigQueryExportsAsync" + ] + }, + "ListDescendantEventThreatDetectionCustomModules": { + "methods": [ + "listDescendantEventThreatDetectionCustomModules", + "listDescendantEventThreatDetectionCustomModulesStream", + "listDescendantEventThreatDetectionCustomModulesAsync" + ] + }, + "ListEventThreatDetectionCustomModules": { + "methods": [ + "listEventThreatDetectionCustomModules", + "listEventThreatDetectionCustomModulesStream", + "listEventThreatDetectionCustomModulesAsync" + ] + }, + "ListEffectiveEventThreatDetectionCustomModules": { + "methods": [ + "listEffectiveEventThreatDetectionCustomModules", + "listEffectiveEventThreatDetectionCustomModulesStream", + "listEffectiveEventThreatDetectionCustomModulesAsync" + ] + }, + "ListResourceValueConfigs": { + "methods": [ + "listResourceValueConfigs", + "listResourceValueConfigsStream", + "listResourceValueConfigsAsync" + ] + }, + "ListValuedResources": { + "methods": [ + "listValuedResources", + "listValuedResourcesStream", + "listValuedResourcesAsync" + ] + }, + "ListAttackPaths": { + "methods": [ + "listAttackPaths", + "listAttackPathsStream", + "listAttackPathsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "createSecurityHealthAnalyticsCustomModule" + ] + }, + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "DeleteSecurityHealthAnalyticsCustomModule": { + "methods": [ + "deleteSecurityHealthAnalyticsCustomModule" + ] + }, + "GetSimulation": { + "methods": [ + "getSimulation" + ] + }, + "GetValuedResource": { + "methods": [ + "getValuedResource" + ] + }, + "GetBigQueryExport": { + "methods": [ + "getBigQueryExport" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetEffectiveSecurityHealthAnalyticsCustomModule": { + "methods": [ + "getEffectiveSecurityHealthAnalyticsCustomModule" + ] + }, + "GetSecurityHealthAnalyticsCustomModule": { + "methods": [ + "getSecurityHealthAnalyticsCustomModule" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetMute": { + "methods": [ + "setMute" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "SimulateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "simulateSecurityHealthAnalyticsCustomModule" + ] + }, + "UpdateExternalSystem": { + "methods": [ + "updateExternalSystem" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "updateSecurityHealthAnalyticsCustomModule" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "CreateBigQueryExport": { + "methods": [ + "createBigQueryExport" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "deleteBigQueryExport" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "updateBigQueryExport" + ] + }, + "CreateEventThreatDetectionCustomModule": { + "methods": [ + "createEventThreatDetectionCustomModule" + ] + }, + "DeleteEventThreatDetectionCustomModule": { + "methods": [ + "deleteEventThreatDetectionCustomModule" + ] + }, + "GetEventThreatDetectionCustomModule": { + "methods": [ + "getEventThreatDetectionCustomModule" + ] + }, + "UpdateEventThreatDetectionCustomModule": { + "methods": [ + "updateEventThreatDetectionCustomModule" + ] + }, + "ValidateEventThreatDetectionCustomModule": { + "methods": [ + "validateEventThreatDetectionCustomModule" + ] + }, + "GetEffectiveEventThreatDetectionCustomModule": { + "methods": [ + "getEffectiveEventThreatDetectionCustomModule" + ] + }, + "BatchCreateResourceValueConfigs": { + "methods": [ + "batchCreateResourceValueConfigs" + ] + }, + "DeleteResourceValueConfig": { + "methods": [ + "deleteResourceValueConfig" + ] + }, + "GetResourceValueConfig": { + "methods": [ + "getResourceValueConfig" + ] + }, + "UpdateResourceValueConfig": { + "methods": [ + "updateResourceValueConfig" + ] + }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListDescendantSecurityHealthAnalyticsCustomModules": { + "methods": [ + "listDescendantSecurityHealthAnalyticsCustomModules", + "listDescendantSecurityHealthAnalyticsCustomModulesStream", + "listDescendantSecurityHealthAnalyticsCustomModulesAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListEffectiveSecurityHealthAnalyticsCustomModules": { + "methods": [ + "listEffectiveSecurityHealthAnalyticsCustomModules", + "listEffectiveSecurityHealthAnalyticsCustomModulesStream", + "listEffectiveSecurityHealthAnalyticsCustomModulesAsync" + ] + }, + "ListSecurityHealthAnalyticsCustomModules": { + "methods": [ + "listSecurityHealthAnalyticsCustomModules", + "listSecurityHealthAnalyticsCustomModulesStream", + "listSecurityHealthAnalyticsCustomModulesAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + }, + "ListBigQueryExports": { + "methods": [ + "listBigQueryExports", + "listBigQueryExportsStream", + "listBigQueryExportsAsync" + ] + }, + "ListDescendantEventThreatDetectionCustomModules": { + "methods": [ + "listDescendantEventThreatDetectionCustomModules", + "listDescendantEventThreatDetectionCustomModulesStream", + "listDescendantEventThreatDetectionCustomModulesAsync" + ] + }, + "ListEventThreatDetectionCustomModules": { + "methods": [ + "listEventThreatDetectionCustomModules", + "listEventThreatDetectionCustomModulesStream", + "listEventThreatDetectionCustomModulesAsync" + ] + }, + "ListEffectiveEventThreatDetectionCustomModules": { + "methods": [ + "listEffectiveEventThreatDetectionCustomModules", + "listEffectiveEventThreatDetectionCustomModulesStream", + "listEffectiveEventThreatDetectionCustomModulesAsync" + ] + }, + "ListResourceValueConfigs": { + "methods": [ + "listResourceValueConfigs", + "listResourceValueConfigsStream", + "listResourceValueConfigsAsync" + ] + }, + "ListValuedResources": { + "methods": [ + "listValuedResources", + "listValuedResourcesStream", + "listValuedResourcesAsync" + ] + }, + "ListAttackPaths": { + "methods": [ + "listAttackPaths", + "listAttackPathsStream", + "listAttackPathsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1/index.ts new file mode 100644 index 00000000000..750912594f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {SecurityCenterClient} from './security_center_client'; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client.ts new file mode 100644 index 00000000000..5952c112138 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -0,0 +1,12666 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * 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'; +const version = require('../../../package.json').version; + +/** + * V1 APIs for Security Center service. + * @class + * @memberof v1 + */ +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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('security-center'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + securityCenterStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of 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/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * 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: true}, 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; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'securitycenter.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + attackPathPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}' + ), + folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}/securityMarks' + ), + folderAssetsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}' + ), + folderBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/bigQueryExports/{export}' + ), + folderConstraintNamePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/policies/{constraint_name}' + ), + folderEventThreatDetectionSettingsModulePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}' + ), + folderLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/muteConfigs/{mute_config}' + ), + folderMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/muteConfigs/{mute_config}' + ), + folderNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/notificationConfigs/{notification_config}' + ), + folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/securityHealthAnalyticsSettings/customModules/{custom_module}' + ), + folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}' + ), + folderSourcePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}' + ), + folderSourceFindingExternalSystemsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), + folderSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' + ), + folderSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + organizationAssetsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), + organizationBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/bigQueryExports/{export}' + ), + organizationConstraintNamePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/policies/{constraint_name}' + ), + organizationEventThreatDetectionSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/eventThreatDetectionSettings' + ), + organizationEventThreatDetectionSettingsModulePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}' + ), + organizationLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/muteConfigs/{mute_config}' + ), + organizationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/muteConfigs/{mute_config}' + ), + organizationNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationConfigs/{notification_config}' + ), + organizationSecurityHealthAnalyticsSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/securityHealthAnalyticsSettings' + ), + organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/securityHealthAnalyticsSettings/customModules/{custom_module}' + ), + organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}' + ), + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), + organizationSimulationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/simulations/{simulation}' + ), + organizationSourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + organizationSourceFindingExternalSystemsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), + organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + organizationSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}/securityMarks' + ), + projectAssetsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}' + ), + projectBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/bigQueryExports/{export}' + ), + projectConstraintNamePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/policies/{constraint_name}' + ), + projectEventThreatDetectionSettingsModulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}' + ), + projectLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/muteConfigs/{mute_config}' + ), + projectMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/muteConfigs/{mute_config}' + ), + projectNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/notificationConfigs/{notification_config}' + ), + projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/securityHealthAnalyticsSettings/customModules/{custom_module}' + ), + projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}' + ), + projectSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}' + ), + projectSourceFindingExternalSystemsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), + projectSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/securityMarks' + ), + projectSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}' + ), + resourceValueConfigPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/resourceValueConfigs/{resource_value_config}' + ), + simulationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/simulations/{simulation}' + ), + valuedResourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}' + ), + }; + + // 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 this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), + groupFindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), + listAssets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listAssetsResults'), + listDescendantSecurityHealthAnalyticsCustomModules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'securityHealthAnalyticsCustomModules'), + listFindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listFindingsResults'), + listMuteConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'muteConfigs'), + listNotificationConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'notificationConfigs'), + listEffectiveSecurityHealthAnalyticsCustomModules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'effectiveSecurityHealthAnalyticsCustomModules'), + listSecurityHealthAnalyticsCustomModules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'securityHealthAnalyticsCustomModules'), + listSources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sources'), + listBigQueryExports: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'bigQueryExports'), + listDescendantEventThreatDetectionCustomModules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'eventThreatDetectionCustomModules'), + listEventThreatDetectionCustomModules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'eventThreatDetectionCustomModules'), + listEffectiveEventThreatDetectionCustomModules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'effectiveEventThreatDetectionCustomModules'), + listResourceValueConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceValueConfigs'), + listValuedResources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'valuedResources'), + listAttackPaths: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attackPaths') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + 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(lroOptions).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; + const runAssetDiscoveryMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty') 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), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.securitycenter.v1.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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.securityCenterStub) { + return this.securityCenterStub; + } + + // Put together the "service stub" for + // google.cloud.securitycenter.v1.SecurityCenter. + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.securitycenter.v1.SecurityCenter') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.securitycenter.v1.SecurityCenter, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const securityCenterStubMethods = + ['bulkMuteFindings', 'createSecurityHealthAnalyticsCustomModule', 'createSource', 'createFinding', 'createMuteConfig', 'createNotificationConfig', 'deleteMuteConfig', 'deleteNotificationConfig', 'deleteSecurityHealthAnalyticsCustomModule', 'getSimulation', 'getValuedResource', 'getBigQueryExport', 'getIamPolicy', 'getMuteConfig', 'getNotificationConfig', 'getOrganizationSettings', 'getEffectiveSecurityHealthAnalyticsCustomModule', 'getSecurityHealthAnalyticsCustomModule', 'getSource', 'groupAssets', 'groupFindings', 'listAssets', 'listDescendantSecurityHealthAnalyticsCustomModules', 'listFindings', 'listMuteConfigs', 'listNotificationConfigs', 'listEffectiveSecurityHealthAnalyticsCustomModules', 'listSecurityHealthAnalyticsCustomModules', 'listSources', 'runAssetDiscovery', 'setFindingState', 'setMute', 'setIamPolicy', 'testIamPermissions', 'simulateSecurityHealthAnalyticsCustomModule', 'updateExternalSystem', 'updateFinding', 'updateMuteConfig', 'updateNotificationConfig', 'updateOrganizationSettings', 'updateSecurityHealthAnalyticsCustomModule', 'updateSource', 'updateSecurityMarks', 'createBigQueryExport', 'deleteBigQueryExport', 'updateBigQueryExport', 'listBigQueryExports', 'createEventThreatDetectionCustomModule', 'deleteEventThreatDetectionCustomModule', 'getEventThreatDetectionCustomModule', 'listDescendantEventThreatDetectionCustomModules', 'listEventThreatDetectionCustomModules', 'updateEventThreatDetectionCustomModule', 'validateEventThreatDetectionCustomModule', 'getEffectiveEventThreatDetectionCustomModule', 'listEffectiveEventThreatDetectionCustomModules', 'batchCreateResourceValueConfigs', 'deleteResourceValueConfig', 'getResourceValueConfig', 'listResourceValueConfigs', 'updateResourceValueConfig', 'listValuedResources', 'listAttackPaths']; + 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); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securityCenterStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the + * given CRM parent, and also creates inherited + * SecurityHealthAnalyticsCustomModules for all CRM descendants of the given + * parent. These modules are enabled by default. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new custom module's parent. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} request.securityHealthAnalyticsCustomModule + * Required. SecurityHealthAnalytics custom module to create. The provided + * name is ignored and reset with provided parent information and + * server-generated 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 {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.create_security_health_analytics_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async + */ + createSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>; + createSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + createSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + createSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createSecurityHealthAnalyticsCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSecurityHealthAnalyticsCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('createSecurityHealthAnalyticsCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest|undefined, {}|undefined + ]>; + createSource( + request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest|null|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; + createSource( + request?: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('createSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest|undefined, {}|undefined + ]>; + createFinding( + request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest|null|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; + createFinding( + request?: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createFinding request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createFinding(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest|undefined, + {}|undefined + ]) => { + this._log.info('createFinding response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.MuteConfig|MuteConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createMuteConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createMuteConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createMuteConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('createMuteConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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]`, `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 contain 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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|undefined, {}|undefined + ]>; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|null|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; + createNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('createNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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}`, + * `projects/{project}/muteConfigs/{config_id}`, + * `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + * `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + * `projects/{project}/locations/global/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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteMuteConfig request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMuteConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteMuteConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteMuteConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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]`, + * `folders/[folder_id]/notificationConfigs/[config_id]`, + * or `projects/[project_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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|undefined, {}|undefined + ]>; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|null|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; + deleteNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified SecurityHealthAnalyticsCustomModule and all of its + * descendants in the CRM hierarchy. This method is only supported for + * resident custom modules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the custom module to delete. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + * `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + * or + * `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_async + */ + deleteSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>; + deleteSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + deleteSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + deleteSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteSecurityHealthAnalyticsCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSecurityHealthAnalyticsCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteSecurityHealthAnalyticsCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get the simulation by name or the latest simulation for the given + * organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The organization name or simulation name of this simulation + * + * Valid format: + * `organizations/{organization}/simulations/latest` + * `organizations/{organization}/simulations/{simulation}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.Simulation|Simulation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_simulation.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetSimulation_async + */ + getSimulation( + request?: protos.google.cloud.securitycenter.v1.IGetSimulationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.ISimulation, + protos.google.cloud.securitycenter.v1.IGetSimulationRequest|undefined, {}|undefined + ]>; + getSimulation( + request: protos.google.cloud.securitycenter.v1.IGetSimulationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISimulation, + protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, + {}|null|undefined>): void; + getSimulation( + request: protos.google.cloud.securitycenter.v1.IGetSimulationRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISimulation, + protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, + {}|null|undefined>): void; + getSimulation( + request?: protos.google.cloud.securitycenter.v1.IGetSimulationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.ISimulation, + protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISimulation, + protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISimulation, + protos.google.cloud.securitycenter.v1.IGetSimulationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSimulation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISimulation, + protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSimulation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSimulation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISimulation, + protos.google.cloud.securitycenter.v1.IGetSimulationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSimulation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get the valued resource by name + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of this valued resource + * + * Valid format: + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_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 {@link protos.google.cloud.securitycenter.v1.ValuedResource|ValuedResource}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_valued_resource.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetValuedResource_async + */ + getValuedResource( + request?: protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IValuedResource, + protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|undefined, {}|undefined + ]>; + getValuedResource( + request: protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IValuedResource, + protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>): void; + getValuedResource( + request: protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IValuedResource, + protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>): void; + getValuedResource( + request?: protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IValuedResource, + protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IValuedResource, + protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IValuedResource, + protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getValuedResource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IValuedResource, + protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getValuedResource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getValuedResource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IValuedResource, + protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getValuedResource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the BigQuery 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 {@link protos.google.cloud.securitycenter.v1.BigQueryExport|BigQueryExport}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getBigQueryExport request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBigQueryExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBigQueryExport(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBigQueryExport response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + 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; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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}`, + * `projects/{project}/muteConfigs/{config_id}`, + * `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + * `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + * `projects/{project}/locations/global/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 {@link protos.google.cloud.securitycenter.v1.MuteConfig|MuteConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getMuteConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMuteConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getMuteConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getMuteConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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]`, + * `folders/[folder_id]/notificationConfigs/[config_id]`, + * or `projects/[project_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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|undefined, {}|undefined + ]>; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|null|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; + getNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.OrganizationSettings|OrganizationSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|undefined, {}|undefined + ]>; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|null|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; + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getOrganizationSettings request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getOrganizationSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getOrganizationSettings(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|undefined, + {}|undefined + ]) => { + this._log.info('getOrganizationSettings response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the effective custom module to get. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + * `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + * or + * `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_async + */ + getEffectiveSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>; + getEffectiveSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + getEffectiveSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + getEffectiveSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getEffectiveSecurityHealthAnalyticsCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEffectiveSecurityHealthAnalyticsCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEffectiveSecurityHealthAnalyticsCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Retrieves a SecurityHealthAnalyticsCustomModule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the custom module to get. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + * `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + * or + * `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_security_health_analytics_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_async + */ + getSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>; + getSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + getSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + getSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSecurityHealthAnalyticsCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSecurityHealthAnalyticsCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSecurityHealthAnalyticsCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest|undefined, {}|undefined + ]>; + getSource( + request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + options: CallOptions, + callback: Callback< + 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; + getSource( + request?: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * of the finding. Example: + * `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.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 {@link protos.google.cloud.securitycenter.v1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|undefined, {}|undefined + ]>; + setFindingState( + request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|null|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; + setFindingState( + request?: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setFindingState request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setFindingState response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setFindingState(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|undefined, + {}|undefined + ]) => { + this._log.info('setFindingState response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * of the finding. Example: + * `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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setMute request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setMute response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setMute(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest|undefined, + {}|undefined + ]) => { + this._log.info('setMute response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {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. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + 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; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + 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; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Simulates a given SecurityHealthAnalyticsCustomModule and Resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative resource name of the organization, project, or + * folder. For more information about relative resource names, see [Relative + * Resource + * Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * Example: `organizations/{organization_id}` + * @param {google.cloud.securitycenter.v1.CustomConfig} request.customConfig + * Required. The custom configuration that you need to test. + * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} request.resource + * Required. Resource data to simulate custom module against. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse|SimulateSecurityHealthAnalyticsCustomModuleResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_async + */ + simulateSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>; + simulateSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + simulateSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + simulateSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('simulateSecurityHealthAnalyticsCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('simulateSecurityHealthAnalyticsCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, + protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('simulateSecurityHealthAnalyticsCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.ExternalSystem|ExternalSystem}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'external_system.name': request.externalSystem!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateExternalSystem request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExternalSystem response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateExternalSystem(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IExternalSystem, + protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateExternalSystem response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|undefined, {}|undefined + ]>; + updateFinding( + request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|null|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; + updateFinding( + request?: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'finding.name': request.finding!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateFinding request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateFinding(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateFinding response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.MuteConfig|MuteConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'mute_config.name': request.muteConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateMuteConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateMuteConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateMuteConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateMuteConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * + * 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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|undefined, {}|undefined + ]>; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|null|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; + updateNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.OrganizationSettings|OrganizationSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined + ]>; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + options: CallOptions, + 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, + 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|Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateOrganizationSettings request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateOrganizationSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateOrganizationSettings(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateOrganizationSettings response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the SecurityHealthAnalyticsCustomModule under the given name based + * on the given update mask. Updating the enablement state is supported on + * both resident and inherited modules (though resident modules cannot have an + * enablement state of "inherited"). Updating the display name and custom + * config of a module is supported on resident modules only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} request.securityHealthAnalyticsCustomModule + * Required. The SecurityHealthAnalytics custom module to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. The only fields that can be updated are + * `enablement_state` and `custom_config`. If empty or set to the wildcard + * value `*`, both `enablement_state` and `custom_config` are updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_security_health_analytics_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_async + */ + updateSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>; + updateSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + updateSecurityHealthAnalyticsCustomModule( + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + updateSecurityHealthAnalyticsCustomModule( + request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'security_health_analytics_custom_module.name': request.securityHealthAnalyticsCustomModule!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSecurityHealthAnalyticsCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSecurityHealthAnalyticsCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSecurityHealthAnalyticsCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|undefined, {}|undefined + ]>; + updateSource( + request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|null|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; + updateSource( + request?: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'source.name': request.source!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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. Must be + * 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. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.SecurityMarks|SecurityMarks}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSecurityMarks request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSecurityMarks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSecurityMarks(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.ISecurityMarks, + protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSecurityMarks response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource of the new BigQuery export. Its + * format is `organizations/[organization_id]`, `folders/[folder_id]`, or + * `projects/[project_id]`. + * @param {google.cloud.securitycenter.v1.BigQueryExport} request.bigQueryExport + * Required. The BigQuery export being created. + * @param {string} request.bigQueryExportId + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.BigQueryExport|BigQueryExport}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createBigQueryExport request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBigQueryExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createBigQueryExport(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest|undefined, + {}|undefined + ]) => { + this._log.info('createBigQueryExport response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an existing BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BigQuery 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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteBigQueryExport request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBigQueryExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteBigQueryExport(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteBigQueryExport response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 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 {@link protos.google.cloud.securitycenter.v1.BigQueryExport|BigQueryExport}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async + */ + updateBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|undefined, {}|undefined + ]>; + updateBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + updateBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + updateBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'big_query_export.name': request.bigQueryExport!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateBigQueryExport request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBigQueryExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateBigQueryExport(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateBigQueryExport response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a resident Event Threat Detection custom module at the scope of the + * given Resource Manager parent, and also creates inherited custom modules + * for all descendants of the given parent. These modules are enabled by + * default. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The new custom module's parent. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} request.eventThreatDetectionCustomModule + * Required. The module to create. The + * event_threat_detection_custom_module.name will be ignored and server + * generated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.create_event_threat_detection_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_async + */ + createEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>; + createEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + createEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + createEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createEventThreatDetectionCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEventThreatDetectionCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createEventThreatDetectionCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('createEventThreatDetectionCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified Event Threat Detection custom module and all of its + * descendants in the Resource Manager hierarchy. This method is only + * supported for resident custom modules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the custom module to delete. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + * * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + * * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_async + */ + deleteEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>; + deleteEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + deleteEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + deleteEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteEventThreatDetectionCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEventThreatDetectionCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteEventThreatDetectionCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteEventThreatDetectionCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets an Event Threat Detection custom module. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the custom module to get. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + * * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + * * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_event_threat_detection_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_async + */ + getEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>; + getEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + getEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + getEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getEventThreatDetectionCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEventThreatDetectionCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEventThreatDetectionCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEventThreatDetectionCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the Event Threat Detection custom module with the given name based + * on the given update mask. Updating the enablement state is supported for + * both resident and inherited modules (though resident modules cannot have an + * enablement state of "inherited"). Updating the display name or + * configuration of a module is supported for resident modules only. The type + * of a module cannot be changed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} request.eventThreatDetectionCustomModule + * Required. The module 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 {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_event_threat_detection_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_async + */ + updateEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>; + updateEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + updateEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + updateEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'event_threat_detection_custom_module.name': request.eventThreatDetectionCustomModule!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateEventThreatDetectionCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEventThreatDetectionCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateEventThreatDetectionCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateEventThreatDetectionCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Validates the given Event Threat Detection custom module. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent to validate the Custom Module under. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.rawText + * Required. The raw text of the module's contents. Used to generate error + * messages. + * @param {string} request.type + * Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse|ValidateEventThreatDetectionCustomModuleResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_async + */ + validateEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>; + validateEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + validateEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + validateEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('validateEventThreatDetectionCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('validateEventThreatDetectionCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.validateEventThreatDetectionCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, + protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('validateEventThreatDetectionCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets an effective Event Threat Detection custom module at the given level. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the effective Event Threat Detection custom + * module. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + * * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + * * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_async + */ + getEffectiveEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>; + getEffectiveEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + getEffectiveEventThreatDetectionCustomModule( + request: protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): void; + getEffectiveEventThreatDetectionCustomModule( + request?: protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getEffectiveEventThreatDetectionCustomModule request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEffectiveEventThreatDetectionCustomModule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEffectiveEventThreatDetectionCustomModule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, + protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEffectiveEventThreatDetectionCustomModule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a ResourceValueConfig for an organization. Maps user's tags to + * difference resource values for use by the attack path simulation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new ResourceValueConfig's parent. + * The parent field in the CreateResourceValueConfigRequest + * messages must either be empty or match this field. + * @param {number[]} request.requests + * Required. The resource value configs to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse|BatchCreateResourceValueConfigsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.batch_create_resource_value_configs.js + * region_tag:securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_async + */ + batchCreateResourceValueConfigs( + request?: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|undefined, {}|undefined + ]>; + batchCreateResourceValueConfigs( + request: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateResourceValueConfigs( + request: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateResourceValueConfigs( + request?: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('batchCreateResourceValueConfigs request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchCreateResourceValueConfigs response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.batchCreateResourceValueConfigs(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|undefined, + {}|undefined + ]) => { + this._log.info('batchCreateResourceValueConfigs response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a ResourceValueConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the ResourceValueConfig to delete + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.delete_resource_value_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_async + */ + deleteResourceValueConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|undefined, {}|undefined + ]>; + deleteResourceValueConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteResourceValueConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteResourceValueConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteResourceValueConfig request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteResourceValueConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteResourceValueConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteResourceValueConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a ResourceValueConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource value config to retrieve. Its format is + * `organizations/{organization}/resourceValueConfigs/{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 {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_resource_value_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_async + */ + getResourceValueConfig( + request?: protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|undefined, {}|undefined + ]>; + getResourceValueConfig( + request: protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + getResourceValueConfig( + request: protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + getResourceValueConfig( + request?: protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getResourceValueConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getResourceValueConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getResourceValueConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getResourceValueConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates an existing ResourceValueConfigs with new rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.ResourceValueConfig} request.resourceValueConfig + * Required. The resource value 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 {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_resource_value_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_async + */ + updateResourceValueConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|undefined, {}|undefined + ]>; + updateResourceValueConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + updateResourceValueConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + updateResourceValueConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource_value_config.name': request.resourceValueConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateResourceValueConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateResourceValueConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateResourceValueConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1.IResourceValueConfig, + protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateResourceValueConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * 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 {google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState} [request.muteState] + * Optional. All findings matching the given filter will have their mute state + * set to this value. The default value is `MUTED`. Setting this to + * `UNDEFINED` will clear the mute state on all matching findings. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('bulkMuteFindings response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('bulkMuteFindings request %j', request); + return this.innerApiCalls.bulkMuteFindings(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('bulkMuteFindings response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * 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>{ + this._log.info('bulkMuteFindings long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.bulkMuteFindings, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async + * @deprecated RunAssetDiscovery is deprecated and may be removed in a future version. + */ + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this.warn('DEP$SecurityCenter-$RunAssetDiscovery','RunAssetDiscovery is deprecated and may be removed in a future version.', 'DeprecationWarning'); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runAssetDiscovery response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runAssetDiscovery request %j', request); + return this.innerApiCalls.runAssetDiscovery(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('runAssetDiscovery response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * 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. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async + * @deprecated RunAssetDiscovery is deprecated and may be removed in a future version. + */ + async checkRunAssetDiscoveryProgress(name: string): Promise>{ + this.warn('DEP$SecurityCenter-$checkRunAssetDiscoveryProgress','checkRunAssetDiscoveryProgress is deprecated and may be removed in a future version.', 'DeprecationWarning'); + this._log.info('runAssetDiscovery long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * 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. The name of the parent to group the assets by. Its format is + * `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 + * 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 : ""` + * @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.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 {@link protos.google.cloud.securitycenter.v1.GroupResult|GroupResult}. + * 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 `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @deprecated GroupAssets is deprecated and may be removed in a future version. + */ + 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IGroupResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IGroupResult>): + Promise<[ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest|null, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this.warn('DEP$SecurityCenter-$GroupAssets','GroupAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IGroupResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('groupAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('groupAssets request %j', request); + return this.innerApiCalls + .groupAssets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest|null, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + ]) => { + this._log.info('groupAssets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `groupAssets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent to group the assets by. Its format is + * `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 + * 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 : ""` + * @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.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 {@link protos.google.cloud.securitycenter.v1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @deprecated GroupAssets is deprecated and may be removed in a future version. + */ + groupAssetsStream( + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this.warn('DEP$SecurityCenter-$GroupAssets','GroupAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); + this._log.info('groupAssets stream %j', request); + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * Required. The name of the parent to group the assets by. Its format is + * `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 + * 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 : ""` + * @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.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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.group_assets.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GroupAssets_async + * @deprecated GroupAssets is deprecated and may be removed in a future version. + */ + groupAssetsAsync( + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this.warn('DEP$SecurityCenter-$GroupAssets','GroupAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); + this._log.info('groupAssets iterate %j', request); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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 + * + * @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]`, + * `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 + * 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: `=`, `:` + * @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 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 {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.GroupResult|GroupResult}. + * 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 `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IGroupResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IGroupResult>): + Promise<[ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IGroupResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('groupFindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('groupFindings request %j', request); + return this.innerApiCalls + .groupFindings(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + ]) => { + this._log.info('groupFindings values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `groupFindings`, but returns a NodeJS Stream object. + * @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]`, + * `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 + * 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: `=`, `:` + * @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 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 {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + groupFindingsStream( + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupFindings stream %j', request); + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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/-` + * @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` + * + * * 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: `=`, `:` + * @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 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupFindings iterate %j', request); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource that contains the assets. The + * value that you can specify on parent depends on the method in which you + * specify parent. You can specify one of the following values: + * `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 + * 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 : ""` + * @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 + * 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 {@link protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult|ListAssetsResult}. + * 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 `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @deprecated ListAssets is deprecated and may be removed in a future version. + */ + 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult>): + Promise<[ + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1.IListAssetsRequest|null, + protos.google.cloud.securitycenter.v1.IListAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this.warn('DEP$SecurityCenter-$ListAssets','ListAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAssets request %j', request); + return this.innerApiCalls + .listAssets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1.IListAssetsRequest|null, + protos.google.cloud.securitycenter.v1.IListAssetsResponse + ]) => { + this._log.info('listAssets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAssets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource that contains the assets. The + * value that you can specify on parent depends on the method in which you + * specify parent. You can specify one of the following values: + * `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 + * 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 : ""` + * @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 + * 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 {@link protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @deprecated ListAssets is deprecated and may be removed in a future version. + */ + listAssetsStream( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this.warn('DEP$SecurityCenter-$ListAssets','ListAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); + this._log.info('listAssets stream %j', request); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * Required. The name of the parent resource that contains the assets. The + * value that you can specify on parent depends on the method in which you + * specify parent. You can specify one of the following values: + * `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 + * 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 : ""` + * @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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_assets.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListAssets_async + * @deprecated ListAssets is deprecated and may be removed in a future version. + */ + listAssetsAsync( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this.warn('DEP$SecurityCenter-$ListAssets','ListAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); + this._log.info('listAssets iterate %j', request); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of all resident SecurityHealthAnalyticsCustomModules under + * the given CRM parent and all of the parent’s CRM descendants. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list descendant custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. + * 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 `listDescendantSecurityHealthAnalyticsCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDescendantSecurityHealthAnalyticsCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse + ]>; + listDescendantSecurityHealthAnalyticsCustomModules( + request: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): void; + listDescendantSecurityHealthAnalyticsCustomModules( + request: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): void; + listDescendantSecurityHealthAnalyticsCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDescendantSecurityHealthAnalyticsCustomModules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDescendantSecurityHealthAnalyticsCustomModules request %j', request); + return this.innerApiCalls + .listDescendantSecurityHealthAnalyticsCustomModules(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse + ]) => { + this._log.info('listDescendantSecurityHealthAnalyticsCustomModules values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDescendantSecurityHealthAnalyticsCustomModules`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list descendant custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} 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 `listDescendantSecurityHealthAnalyticsCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDescendantSecurityHealthAnalyticsCustomModulesStream( + request?: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDescendantSecurityHealthAnalyticsCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDescendantSecurityHealthAnalyticsCustomModules stream %j', request); + return this.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream( + this.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDescendantSecurityHealthAnalyticsCustomModules`, 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. Name of parent to list descendant custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_async + */ + listDescendantSecurityHealthAnalyticsCustomModulesAsync( + request?: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDescendantSecurityHealthAnalyticsCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDescendantSecurityHealthAnalyticsCustomModules iterate %j', request); + return this.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate( + this.innerApiCalls['listDescendantSecurityHealthAnalyticsCustomModules'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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]`, + * `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 + * 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: `=`, `:` + * * 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 + * 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 + * 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 {@link protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult|ListFindingsResult}. + * 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult>): + Promise<[ + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v1.IListFindingsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFindings request %j', request); + return this.innerApiCalls + .listFindings(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v1.IListFindingsResponse + ]) => { + this._log.info('listFindings values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listFindings`, but returns a NodeJS Stream object. + * @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]`, + * `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 + * 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: `=`, `:` + * * 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 + * 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 + * 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 {@link protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFindingsStream( + request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFindings stream %j', request); + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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/-` + * @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` + * + * * 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: `=`, `:` + * * 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 + * 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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFindings iterate %j', request); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + request as {}, + 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 {@link protos.google.cloud.securitycenter.v1.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMuteConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMuteConfigs request %j', request); + return this.innerApiCalls + .listMuteConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IMuteConfig[], + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest|null, + protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + ]) => { + this._log.info('listMuteConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listMuteConfigs`, 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 {@link protos.google.cloud.securitycenter.v1.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMuteConfigs stream %j', request); + return this.descriptors.page.listMuteConfigs.createStream( + this.innerApiCalls.listMuteConfigs as 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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMuteConfigs iterate %j', request); + return this.descriptors.page.listMuteConfigs.asyncIterate( + this.innerApiCalls['listMuteConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists notification configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent in which to list the notification + * configurations. 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 + * 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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.INotificationConfig[], + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + ]>; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options: CallOptions, + 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; + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig>): + Promise<[ + protos.google.cloud.securitycenter.v1.INotificationConfig[], + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listNotificationConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listNotificationConfigs request %j', request); + return this.innerApiCalls + .listNotificationConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.INotificationConfig[], + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + ]) => { + this._log.info('listNotificationConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listNotificationConfigs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent in which to list the notification + * configurations. 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 + * 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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listNotificationConfigsStream( + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listNotificationConfigs stream %j', request); + return this.descriptors.page.listNotificationConfigs.createStream( + this.innerApiCalls.listNotificationConfigs as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * Required. The name of the parent in which to list the notification + * configurations. 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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listNotificationConfigs iterate %j', request); + return this.descriptors.page.listNotificationConfigs.asyncIterate( + this.innerApiCalls['listNotificationConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the + * given parent. This includes resident modules defined at the scope of the + * parent, and inherited modules, inherited from CRM ancestors. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list effective custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule}. + * 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 `listEffectiveSecurityHealthAnalyticsCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEffectiveSecurityHealthAnalyticsCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse + ]>; + listEffectiveSecurityHealthAnalyticsCustomModules( + request: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>): void; + listEffectiveSecurityHealthAnalyticsCustomModules( + request: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>): void; + listEffectiveSecurityHealthAnalyticsCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules request %j', request); + return this.innerApiCalls + .listEffectiveSecurityHealthAnalyticsCustomModules(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse + ]) => { + this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEffectiveSecurityHealthAnalyticsCustomModules`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list effective custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule} 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 `listEffectiveSecurityHealthAnalyticsCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEffectiveSecurityHealthAnalyticsCustomModulesStream( + request?: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEffectiveSecurityHealthAnalyticsCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules stream %j', request); + return this.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream( + this.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEffectiveSecurityHealthAnalyticsCustomModules`, 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. Name of parent to list effective custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_async + */ + listEffectiveSecurityHealthAnalyticsCustomModulesAsync( + request?: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEffectiveSecurityHealthAnalyticsCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules iterate %j', request); + return this.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate( + this.innerApiCalls['listEffectiveSecurityHealthAnalyticsCustomModules'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of all SecurityHealthAnalyticsCustomModules for the given + * parent. This includes resident modules defined at the scope of the parent, + * and inherited modules, inherited from CRM ancestors. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. + * 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 `listSecurityHealthAnalyticsCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecurityHealthAnalyticsCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse + ]>; + listSecurityHealthAnalyticsCustomModules( + request: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): void; + listSecurityHealthAnalyticsCustomModules( + request: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): void; + listSecurityHealthAnalyticsCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSecurityHealthAnalyticsCustomModules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSecurityHealthAnalyticsCustomModules request %j', request); + return this.innerApiCalls + .listSecurityHealthAnalyticsCustomModules(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse + ]) => { + this._log.info('listSecurityHealthAnalyticsCustomModules values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSecurityHealthAnalyticsCustomModules`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} 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 `listSecurityHealthAnalyticsCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecurityHealthAnalyticsCustomModulesStream( + request?: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSecurityHealthAnalyticsCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSecurityHealthAnalyticsCustomModules stream %j', request); + return this.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream( + this.innerApiCalls.listSecurityHealthAnalyticsCustomModules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSecurityHealthAnalyticsCustomModules`, 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. Name of parent to list custom modules. Its format is + * `organizations/{organization}/securityHealthAnalyticsSettings`, + * `folders/{folder}/securityHealthAnalyticsSettings`, or + * `projects/{project}/securityHealthAnalyticsSettings` + * @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 {string} request.pageToken + * The value returned by the last call indicating a continuation + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_async + */ + listSecurityHealthAnalyticsCustomModulesAsync( + request?: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSecurityHealthAnalyticsCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSecurityHealthAnalyticsCustomModules iterate %j', request); + return this.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate( + this.innerApiCalls['listSecurityHealthAnalyticsCustomModules'] as GaxCall, + request as {}, + 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 {@link protos.google.cloud.securitycenter.v1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSources( + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.ISource[], + protos.google.cloud.securitycenter.v1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1.IListSourcesResponse + ]>; + listSources( + request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + options: CallOptions, + 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; + listSources( + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISource>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISource>): + Promise<[ + protos.google.cloud.securitycenter.v1.ISource[], + protos.google.cloud.securitycenter.v1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1.IListSourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.ISource>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSources request %j', request); + return this.innerApiCalls + .listSources(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.ISource[], + protos.google.cloud.securitycenter.v1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1.IListSourcesResponse + ]) => { + this._log.info('listSources values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSources`, but returns a NodeJS Stream object. + * @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 {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSourcesStream( + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSources stream %j', request); + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSources iterate %j', request); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + request as {}, + 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 {@link protos.google.cloud.securitycenter.v1.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBigQueryExports values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBigQueryExports request %j', request); + return this.innerApiCalls + .listBigQueryExports(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IBigQueryExport[], + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest|null, + protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + ]) => { + this._log.info('listBigQueryExports values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBigQueryExports`, 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 {@link protos.google.cloud.securitycenter.v1.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBigQueryExports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBigQueryExports stream %j', request); + return this.descriptors.page.listBigQueryExports.createStream( + this.innerApiCalls.listBigQueryExports as 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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBigQueryExports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBigQueryExports iterate %j', request); + return this.descriptors.page.listBigQueryExports.asyncIterate( + this.innerApiCalls['listBigQueryExports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all resident Event Threat Detection custom modules under the + * given Resource Manager parent and its descendants. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the parent to list custom modules under. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to + * retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDescendantEventThreatDetectionCustomModules` must match the call that + * provided the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. + * 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 `listDescendantEventThreatDetectionCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDescendantEventThreatDetectionCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse + ]>; + listDescendantEventThreatDetectionCustomModules( + request: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): void; + listDescendantEventThreatDetectionCustomModules( + request: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): void; + listDescendantEventThreatDetectionCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDescendantEventThreatDetectionCustomModules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDescendantEventThreatDetectionCustomModules request %j', request); + return this.innerApiCalls + .listDescendantEventThreatDetectionCustomModules(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse + ]) => { + this._log.info('listDescendantEventThreatDetectionCustomModules values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDescendantEventThreatDetectionCustomModules`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the parent to list custom modules under. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to + * retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDescendantEventThreatDetectionCustomModules` must match the call that + * provided the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule} 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 `listDescendantEventThreatDetectionCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDescendantEventThreatDetectionCustomModulesStream( + request?: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDescendantEventThreatDetectionCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDescendantEventThreatDetectionCustomModules stream %j', request); + return this.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream( + this.innerApiCalls.listDescendantEventThreatDetectionCustomModules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDescendantEventThreatDetectionCustomModules`, 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. Name of the parent to list custom modules under. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to + * retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDescendantEventThreatDetectionCustomModules` must match the call that + * provided the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_async + */ + listDescendantEventThreatDetectionCustomModulesAsync( + request?: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDescendantEventThreatDetectionCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDescendantEventThreatDetectionCustomModules iterate %j', request); + return this.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate( + this.innerApiCalls['listDescendantEventThreatDetectionCustomModules'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all Event Threat Detection custom modules for the given + * Resource Manager parent. This includes resident modules defined at the + * scope of the parent along with modules inherited from ancestors. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the parent to list custom modules under. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters provided to + * `ListEventThreatDetectionCustomModules` must match the call that provided + * the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. + * 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 `listEventThreatDetectionCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEventThreatDetectionCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse + ]>; + listEventThreatDetectionCustomModules( + request: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): void; + listEventThreatDetectionCustomModules( + request: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): void; + listEventThreatDetectionCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEventThreatDetectionCustomModules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEventThreatDetectionCustomModules request %j', request); + return this.innerApiCalls + .listEventThreatDetectionCustomModules(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse + ]) => { + this._log.info('listEventThreatDetectionCustomModules values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEventThreatDetectionCustomModules`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the parent to list custom modules under. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters provided to + * `ListEventThreatDetectionCustomModules` must match the call that provided + * the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule} 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 `listEventThreatDetectionCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEventThreatDetectionCustomModulesStream( + request?: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEventThreatDetectionCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEventThreatDetectionCustomModules stream %j', request); + return this.descriptors.page.listEventThreatDetectionCustomModules.createStream( + this.innerApiCalls.listEventThreatDetectionCustomModules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEventThreatDetectionCustomModules`, 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. Name of the parent to list custom modules under. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters provided to + * `ListEventThreatDetectionCustomModules` must match the call that provided + * the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_async + */ + listEventThreatDetectionCustomModulesAsync( + request?: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEventThreatDetectionCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEventThreatDetectionCustomModules iterate %j', request); + return this.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate( + this.innerApiCalls['listEventThreatDetectionCustomModules'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all effective Event Threat Detection custom modules for the + * given parent. This includes resident modules defined at the scope of the + * parent along with modules inherited from its ancestors. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the parent to list custom modules for. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to + * retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListEffectiveEventThreatDetectionCustomModules` must match the call that + * provided the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule}. + * 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 `listEffectiveEventThreatDetectionCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEffectiveEventThreatDetectionCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse + ]>; + listEffectiveEventThreatDetectionCustomModules( + request: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>): void; + listEffectiveEventThreatDetectionCustomModules( + request: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>): void; + listEffectiveEventThreatDetectionCustomModules( + request?: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>): + Promise<[ + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEffectiveEventThreatDetectionCustomModules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEffectiveEventThreatDetectionCustomModules request %j', request); + return this.innerApiCalls + .listEffectiveEventThreatDetectionCustomModules(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[], + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest|null, + protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse + ]) => { + this._log.info('listEffectiveEventThreatDetectionCustomModules values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEffectiveEventThreatDetectionCustomModules`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the parent to list custom modules for. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to + * retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListEffectiveEventThreatDetectionCustomModules` must match the call that + * provided the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule} 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 `listEffectiveEventThreatDetectionCustomModulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEffectiveEventThreatDetectionCustomModulesStream( + request?: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEffectiveEventThreatDetectionCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEffectiveEventThreatDetectionCustomModules stream %j', request); + return this.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream( + this.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEffectiveEventThreatDetectionCustomModules`, 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. Name of the parent to list custom modules for. + * + * Its format is: + * + * * `organizations/{organization}/eventThreatDetectionSettings`. + * * `folders/{folder}/eventThreatDetectionSettings`. + * * `projects/{project}/eventThreatDetectionSettings`. + * @param {string} request.pageToken + * A page token, received from a previous + * `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to + * retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListEffectiveEventThreatDetectionCustomModules` must match the call that + * provided the page token. + * @param {number} request.pageSize + * The maximum number of modules 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 {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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_async + */ + listEffectiveEventThreatDetectionCustomModulesAsync( + request?: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEffectiveEventThreatDetectionCustomModules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEffectiveEventThreatDetectionCustomModules iterate %j', request); + return this.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate( + this.innerApiCalls['listEffectiveEventThreatDetectionCustomModules'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all ResourceValueConfigs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of resource value configs. + * Its format is + * `organizations/[organization_id]` + * @param {number} request.pageSize + * The number of results 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 `ListResourceValueConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListResourceValueConfigs` must match the call that provided the + * page token. + * + * page_size can be specified, and the new page_size will be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig}. + * 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 `listResourceValueConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listResourceValueConfigs( + request?: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IResourceValueConfig[], + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest|null, + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse + ]>; + listResourceValueConfigs( + request: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IResourceValueConfig>): void; + listResourceValueConfigs( + request: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IResourceValueConfig>): void; + listResourceValueConfigs( + request?: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IResourceValueConfig>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IResourceValueConfig>): + Promise<[ + protos.google.cloud.securitycenter.v1.IResourceValueConfig[], + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest|null, + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IResourceValueConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listResourceValueConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listResourceValueConfigs request %j', request); + return this.innerApiCalls + .listResourceValueConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IResourceValueConfig[], + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest|null, + protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse + ]) => { + this._log.info('listResourceValueConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listResourceValueConfigs`, 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 resource value configs. + * Its format is + * `organizations/[organization_id]` + * @param {number} request.pageSize + * The number of results 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 `ListResourceValueConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListResourceValueConfigs` must match the call that provided the + * page token. + * + * page_size can be specified, and the new page_size will be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig} 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 `listResourceValueConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listResourceValueConfigsStream( + request?: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listResourceValueConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listResourceValueConfigs stream %j', request); + return this.descriptors.page.listResourceValueConfigs.createStream( + this.innerApiCalls.listResourceValueConfigs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listResourceValueConfigs`, 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 resource value configs. + * Its format is + * `organizations/[organization_id]` + * @param {number} request.pageSize + * The number of results 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 `ListResourceValueConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListResourceValueConfigs` must match the call that provided the + * page token. + * + * page_size can be specified, and the new page_size will be used. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_resource_value_configs.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_async + */ + listResourceValueConfigsAsync( + request?: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listResourceValueConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listResourceValueConfigs iterate %j', request); + return this.descriptors.page.listResourceValueConfigs.asyncIterate( + this.innerApiCalls['listResourceValueConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the valued resources for a set of simulation results and filter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list valued resources. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * @param {string} request.filter + * The filter expression that filters the valued resources in the response. + * Supported fields: + * + * * `resource_value` supports = + * * `resource_type` supports = + * @param {string} request.pageToken + * The value returned by the last `ListValuedResourcesResponse`; indicates + * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] + * Optional. The fields by which to order the valued resources response. + * + * Supported fields: + * + * * `exposed_score` + * + * * `resource_value` + * + * * `resource_type` + * + * * `resource` + * + * * `display_name` + * + * Values should be a comma separated list of fields. For example: + * `exposed_score,resource_value`. + * + * The default sorting order is descending. To specify ascending or descending + * order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for + * example: `exposed_score DESC`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.ValuedResource|ValuedResource}. + * 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 `listValuedResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listValuedResources( + request?: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IValuedResource[], + protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest|null, + protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse + ]>; + listValuedResources( + request: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IValuedResource>): void; + listValuedResources( + request: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IValuedResource>): void; + listValuedResources( + request?: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IValuedResource>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IValuedResource>): + Promise<[ + protos.google.cloud.securitycenter.v1.IValuedResource[], + protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest|null, + protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IValuedResource>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listValuedResources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listValuedResources request %j', request); + return this.innerApiCalls + .listValuedResources(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IValuedResource[], + protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest|null, + protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse + ]) => { + this._log.info('listValuedResources values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listValuedResources`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list valued resources. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * @param {string} request.filter + * The filter expression that filters the valued resources in the response. + * Supported fields: + * + * * `resource_value` supports = + * * `resource_type` supports = + * @param {string} request.pageToken + * The value returned by the last `ListValuedResourcesResponse`; indicates + * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] + * Optional. The fields by which to order the valued resources response. + * + * Supported fields: + * + * * `exposed_score` + * + * * `resource_value` + * + * * `resource_type` + * + * * `resource` + * + * * `display_name` + * + * Values should be a comma separated list of fields. For example: + * `exposed_score,resource_value`. + * + * The default sorting order is descending. To specify ascending or descending + * order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for + * example: `exposed_score DESC`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.ValuedResource|ValuedResource} 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 `listValuedResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listValuedResourcesStream( + request?: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listValuedResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listValuedResources stream %j', request); + return this.descriptors.page.listValuedResources.createStream( + this.innerApiCalls.listValuedResources as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listValuedResources`, 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. Name of parent to list valued resources. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * @param {string} request.filter + * The filter expression that filters the valued resources in the response. + * Supported fields: + * + * * `resource_value` supports = + * * `resource_type` supports = + * @param {string} request.pageToken + * The value returned by the last `ListValuedResourcesResponse`; indicates + * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] + * Optional. The fields by which to order the valued resources response. + * + * Supported fields: + * + * * `exposed_score` + * + * * `resource_value` + * + * * `resource_type` + * + * * `resource` + * + * * `display_name` + * + * Values should be a comma separated list of fields. For example: + * `exposed_score,resource_value`. + * + * The default sorting order is descending. To specify ascending or descending + * order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for + * example: `exposed_score DESC`. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.ValuedResource|ValuedResource}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_valued_resources.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListValuedResources_async + */ + listValuedResourcesAsync( + request?: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listValuedResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listValuedResources iterate %j', request); + return this.descriptors.page.listValuedResources.asyncIterate( + this.innerApiCalls['listValuedResources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the attack paths for a set of simulation results or valued resources + * and filter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list attack paths. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + * @param {string} request.filter + * The filter expression that filters the attack path in the response. + * Supported fields: + * + * * `valued_resources` supports = + * @param {string} request.pageToken + * The value returned by the last `ListAttackPathsResponse`; indicates + * that this is a continuation of a prior `ListAttackPaths` 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 {@link protos.google.cloud.securitycenter.v1.AttackPath|AttackPath}. + * 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 `listAttackPathsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAttackPaths( + request?: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1.IAttackPath[], + protos.google.cloud.securitycenter.v1.IListAttackPathsRequest|null, + protos.google.cloud.securitycenter.v1.IListAttackPathsResponse + ]>; + listAttackPaths( + request: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IAttackPath>): void; + listAttackPaths( + request: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IAttackPath>): void; + listAttackPaths( + request?: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IAttackPath>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IAttackPath>): + Promise<[ + protos.google.cloud.securitycenter.v1.IAttackPath[], + protos.google.cloud.securitycenter.v1.IListAttackPathsRequest|null, + protos.google.cloud.securitycenter.v1.IListAttackPathsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v1.IAttackPath>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAttackPaths values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAttackPaths request %j', request); + return this.innerApiCalls + .listAttackPaths(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1.IAttackPath[], + protos.google.cloud.securitycenter.v1.IListAttackPathsRequest|null, + protos.google.cloud.securitycenter.v1.IListAttackPathsResponse + ]) => { + this._log.info('listAttackPaths values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAttackPaths`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list attack paths. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + * @param {string} request.filter + * The filter expression that filters the attack path in the response. + * Supported fields: + * + * * `valued_resources` supports = + * @param {string} request.pageToken + * The value returned by the last `ListAttackPathsResponse`; indicates + * that this is a continuation of a prior `ListAttackPaths` 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 {@link protos.google.cloud.securitycenter.v1.AttackPath|AttackPath} 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 `listAttackPathsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAttackPathsStream( + request?: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAttackPaths']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAttackPaths stream %j', request); + return this.descriptors.page.listAttackPaths.createStream( + this.innerApiCalls.listAttackPaths as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAttackPaths`, 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. Name of parent to list attack paths. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + * @param {string} request.filter + * The filter expression that filters the attack path in the response. + * Supported fields: + * + * * `valued_resources` supports = + * @param {string} request.pageToken + * The value returned by the last `ListAttackPathsResponse`; indicates + * that this is a continuation of a prior `ListAttackPaths` 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1.AttackPath|AttackPath}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_attack_paths.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListAttackPaths_async + */ + listAttackPathsAsync( + request?: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAttackPaths']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAttackPaths iterate %j', request); + return this.descriptors.page.listAttackPaths.asyncIterate( + this.innerApiCalls['listAttackPaths'] as GaxCall, + request as {}, + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified attackPath resource name string. + * + * @param {string} organization + * @param {string} simulation + * @param {string} valued_resource + * @param {string} attack_path + * @returns {string} Resource name string. + */ + attackPathPath(organization:string,simulation:string,valuedResource:string,attackPath:string) { + return this.pathTemplates.attackPathPathTemplate.render({ + organization: organization, + simulation: simulation, + valued_resource: valuedResource, + attack_path: attackPath, + }); + } + + /** + * Parse the organization from AttackPath resource. + * + * @param {string} attackPathName + * A fully-qualified path representing AttackPath resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromAttackPathName(attackPathName: string) { + return this.pathTemplates.attackPathPathTemplate.match(attackPathName).organization; + } + + /** + * Parse the simulation from AttackPath resource. + * + * @param {string} attackPathName + * A fully-qualified path representing AttackPath resource. + * @returns {string} A string representing the simulation. + */ + matchSimulationFromAttackPathName(attackPathName: string) { + return this.pathTemplates.attackPathPathTemplate.match(attackPathName).simulation; + } + + /** + * Parse the valued_resource from AttackPath resource. + * + * @param {string} attackPathName + * A fully-qualified path representing AttackPath resource. + * @returns {string} A string representing the valued_resource. + */ + matchValuedResourceFromAttackPathName(attackPathName: string) { + return this.pathTemplates.attackPathPathTemplate.match(attackPathName).valued_resource; + } + + /** + * Parse the attack_path from AttackPath resource. + * + * @param {string} attackPathName + * A fully-qualified path representing AttackPath resource. + * @returns {string} A string representing the attack_path. + */ + matchAttackPathFromAttackPathName(attackPathName: string) { + return this.pathTemplates.attackPathPathTemplate.match(attackPathName).attack_path; + } + + /** + * Return a fully-qualified folderAssetSecurityMarks resource name string. + * + * @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 folderAssets resource name string. + * + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetsPath(folder:string,asset:string) { + return this.pathTemplates.folderAssetsPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAssets resource. + * + * @param {string} folderAssetsName + * A fully-qualified path representing folder_assets resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetsName(folderAssetsName: string) { + return this.pathTemplates.folderAssetsPathTemplate.match(folderAssetsName).folder; + } + + /** + * Parse the asset from FolderAssets resource. + * + * @param {string} folderAssetsName + * A fully-qualified path representing folder_assets resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetsName(folderAssetsName: string) { + return this.pathTemplates.folderAssetsPathTemplate.match(folderAssetsName).asset; + } + + /** + * Return a fully-qualified folderBigQueryExports resource name string. + * + * @param {string} folder + * @param {string} exportParam + * @returns {string} Resource name string. + */ + folderBigQueryExportsPath(folder:string,exportParam:string) { + return this.pathTemplates.folderBigQueryExportsPathTemplate.render({ + folder: folder, + export: exportParam, + }); + } + + /** + * Parse the folder from FolderBigQueryExports resource. + * + * @param {string} folderBigQueryExportsName + * A fully-qualified path representing folder_bigQueryExports resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderBigQueryExportsName(folderBigQueryExportsName: string) { + return this.pathTemplates.folderBigQueryExportsPathTemplate.match(folderBigQueryExportsName).folder; + } + + /** + * Parse the export from FolderBigQueryExports resource. + * + * @param {string} folderBigQueryExportsName + * A fully-qualified path representing folder_bigQueryExports resource. + * @returns {string} A string representing the export. + */ + matchExportFromFolderBigQueryExportsName(folderBigQueryExportsName: string) { + return this.pathTemplates.folderBigQueryExportsPathTemplate.match(folderBigQueryExportsName).export; + } + + /** + * Return a fully-qualified folderConstraintName resource name string. + * + * @param {string} folder + * @param {string} constraint_name + * @returns {string} Resource name string. + */ + folderConstraintNamePath(folder:string,constraintName:string) { + return this.pathTemplates.folderConstraintNamePathTemplate.render({ + folder: folder, + constraint_name: constraintName, + }); + } + + /** + * Parse the folder from FolderConstraintName resource. + * + * @param {string} folderConstraintNameName + * A fully-qualified path representing folder_constraint_name resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderConstraintNameName(folderConstraintNameName: string) { + return this.pathTemplates.folderConstraintNamePathTemplate.match(folderConstraintNameName).folder; + } + + /** + * Parse the constraint_name from FolderConstraintName resource. + * + * @param {string} folderConstraintNameName + * A fully-qualified path representing folder_constraint_name resource. + * @returns {string} A string representing the constraint_name. + */ + matchConstraintNameFromFolderConstraintNameName(folderConstraintNameName: string) { + return this.pathTemplates.folderConstraintNamePathTemplate.match(folderConstraintNameName).constraint_name; + } + + /** + * Return a fully-qualified folderEventThreatDetectionSettingsModule resource name string. + * + * @param {string} folder + * @param {string} module + * @returns {string} Resource name string. + */ + folderEventThreatDetectionSettingsModulePath(folder:string,module:string) { + return this.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.render({ + folder: folder, + module: module, + }); + } + + /** + * Parse the folder from FolderEventThreatDetectionSettingsModule resource. + * + * @param {string} folderEventThreatDetectionSettingsModuleName + * A fully-qualified path representing folder_eventThreatDetectionSettings_module resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderEventThreatDetectionSettingsModuleName(folderEventThreatDetectionSettingsModuleName: string) { + return this.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match(folderEventThreatDetectionSettingsModuleName).folder; + } + + /** + * Parse the module from FolderEventThreatDetectionSettingsModule resource. + * + * @param {string} folderEventThreatDetectionSettingsModuleName + * A fully-qualified path representing folder_eventThreatDetectionSettings_module resource. + * @returns {string} A string representing the module. + */ + matchModuleFromFolderEventThreatDetectionSettingsModuleName(folderEventThreatDetectionSettingsModuleName: string) { + return this.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match(folderEventThreatDetectionSettingsModuleName).module; + } + + /** + * Return a fully-qualified folderLocationMuteConfigs resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} mute_config + * @returns {string} Resource name string. + */ + folderLocationMuteConfigsPath(folder:string,location:string,muteConfig:string) { + return this.pathTemplates.folderLocationMuteConfigsPathTemplate.render({ + folder: folder, + location: location, + mute_config: muteConfig, + }); + } + + /** + * Parse the folder from FolderLocationMuteConfigs resource. + * + * @param {string} folderLocationMuteConfigsName + * A fully-qualified path representing folder_location_muteConfigs resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { + return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).folder; + } + + /** + * Parse the location from FolderLocationMuteConfigs resource. + * + * @param {string} folderLocationMuteConfigsName + * A fully-qualified path representing folder_location_muteConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { + return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).location; + } + + /** + * Parse the mute_config from FolderLocationMuteConfigs resource. + * + * @param {string} folderLocationMuteConfigsName + * A fully-qualified path representing folder_location_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { + return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified folderMuteConfigs resource name string. + * + * @param {string} folder + * @param {string} mute_config + * @returns {string} Resource name string. + */ + folderMuteConfigsPath(folder:string,muteConfig:string) { + return this.pathTemplates.folderMuteConfigsPathTemplate.render({ + folder: folder, + mute_config: muteConfig, + }); + } + + /** + * Parse the folder from FolderMuteConfigs resource. + * + * @param {string} folderMuteConfigsName + * A fully-qualified path representing folder_muteConfigs resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMuteConfigsName(folderMuteConfigsName: string) { + return this.pathTemplates.folderMuteConfigsPathTemplate.match(folderMuteConfigsName).folder; + } + + /** + * Parse the mute_config from FolderMuteConfigs resource. + * + * @param {string} folderMuteConfigsName + * A fully-qualified path representing folder_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromFolderMuteConfigsName(folderMuteConfigsName: string) { + return this.pathTemplates.folderMuteConfigsPathTemplate.match(folderMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified folderNotificationConfigs resource name string. + * + * @param {string} folder + * @param {string} notification_config + * @returns {string} Resource name string. + */ + folderNotificationConfigsPath(folder:string,notificationConfig:string) { + return this.pathTemplates.folderNotificationConfigsPathTemplate.render({ + folder: folder, + notification_config: notificationConfig, + }); + } + + /** + * Parse the folder from FolderNotificationConfigs resource. + * + * @param {string} folderNotificationConfigsName + * A fully-qualified path representing folder_notificationConfigs resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationConfigsName(folderNotificationConfigsName: string) { + return this.pathTemplates.folderNotificationConfigsPathTemplate.match(folderNotificationConfigsName).folder; + } + + /** + * Parse the notification_config from FolderNotificationConfigs resource. + * + * @param {string} folderNotificationConfigsName + * A fully-qualified path representing folder_notificationConfigs resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromFolderNotificationConfigsName(folderNotificationConfigsName: string) { + return this.pathTemplates.folderNotificationConfigsPathTemplate.match(folderNotificationConfigsName).notification_config; + } + + /** + * Return a fully-qualified folderSecurityHealthAnalyticsSettingsCustomModule resource name string. + * + * @param {string} folder + * @param {string} custom_module + * @returns {string} Resource name string. + */ + folderSecurityHealthAnalyticsSettingsCustomModulePath(folder:string,customModule:string) { + return this.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render({ + folder: folder, + custom_module: customModule, + }); + } + + /** + * Parse the folder from FolderSecurityHealthAnalyticsSettingsCustomModule resource. + * + * @param {string} folderSecurityHealthAnalyticsSettingsCustomModuleName + * A fully-qualified path representing folder_securityHealthAnalyticsSettings_custom_module resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSecurityHealthAnalyticsSettingsCustomModuleName(folderSecurityHealthAnalyticsSettingsCustomModuleName: string) { + return this.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(folderSecurityHealthAnalyticsSettingsCustomModuleName).folder; + } + + /** + * Parse the custom_module from FolderSecurityHealthAnalyticsSettingsCustomModule resource. + * + * @param {string} folderSecurityHealthAnalyticsSettingsCustomModuleName + * A fully-qualified path representing folder_securityHealthAnalyticsSettings_custom_module resource. + * @returns {string} A string representing the custom_module. + */ + matchCustomModuleFromFolderSecurityHealthAnalyticsSettingsCustomModuleName(folderSecurityHealthAnalyticsSettingsCustomModuleName: string) { + return this.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(folderSecurityHealthAnalyticsSettingsCustomModuleName).custom_module; + } + + /** + * Return a fully-qualified folderSecurityHealthAnalyticsSettingsEffectiveCustomModule resource name string. + * + * @param {string} folder + * @param {string} effective_custom_module + * @returns {string} Resource name string. + */ + folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePath(folder:string,effectiveCustomModule:string) { + return this.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render({ + folder: folder, + effective_custom_module: effectiveCustomModule, + }); + } + + /** + * Parse the folder from FolderSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. + * + * @param {string} folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName + * A fully-qualified path representing folder_securityHealthAnalyticsSettings_effective_custom_module resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { + return this.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).folder; + } + + /** + * Parse the effective_custom_module from FolderSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. + * + * @param {string} folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName + * A fully-qualified path representing folder_securityHealthAnalyticsSettings_effective_custom_module resource. + * @returns {string} A string representing the effective_custom_module. + */ + matchEffectiveCustomModuleFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { + return this.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).effective_custom_module; + } + + /** + * 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 folderSourceFindingExternalSystems resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + folderSourceFindingExternalSystemsPath(folder:string,source:string,finding:string,externalsystem:string) { + return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.render({ + folder: folder, + source: source, + finding: finding, + externalsystem: externalsystem, + }); + } + + /** + * Parse the folder from FolderSourceFindingExternalSystems resource. + * + * @param {string} folderSourceFindingExternalSystemsName + * A fully-qualified path representing folder_source_finding_externalSystems resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingExternalSystemsName(folderSourceFindingExternalSystemsName: string) { + return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match(folderSourceFindingExternalSystemsName).folder; + } + + /** + * Parse the source from FolderSourceFindingExternalSystems resource. + * + * @param {string} folderSourceFindingExternalSystemsName + * A fully-qualified path representing folder_source_finding_externalSystems resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingExternalSystemsName(folderSourceFindingExternalSystemsName: string) { + return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match(folderSourceFindingExternalSystemsName).source; + } + + /** + * Parse the finding from FolderSourceFindingExternalSystems resource. + * + * @param {string} folderSourceFindingExternalSystemsName + * A fully-qualified path representing folder_source_finding_externalSystems resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingExternalSystemsName(folderSourceFindingExternalSystemsName: string) { + return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match(folderSourceFindingExternalSystemsName).finding; + } + + /** + * Parse the externalsystem from FolderSourceFindingExternalSystems resource. + * + * @param {string} folderSourceFindingExternalSystemsName + * A fully-qualified path representing folder_source_finding_externalSystems resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromFolderSourceFindingExternalSystemsName(folderSourceFindingExternalSystemsName: string) { + return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match(folderSourceFindingExternalSystemsName).externalsystem; + } + + /** + * 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; + } + + /** + * Return a fully-qualified folderSourceFindings resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingsPath(folder:string,source:string,finding:string) { + return this.pathTemplates.folderSourceFindingsPathTemplate.render({ + folder: folder, + source: source, + finding: finding, + }); + } + + /** + * Parse the folder from FolderSourceFindings resource. + * + * @param {string} folderSourceFindingsName + * A fully-qualified path representing folder_source_findings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingsName(folderSourceFindingsName: string) { + return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).folder; + } + + /** + * Parse the source from FolderSourceFindings resource. + * + * @param {string} folderSourceFindingsName + * A fully-qualified path representing folder_source_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingsName(folderSourceFindingsName: string) { + return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).source; + } + + /** + * Parse the finding from FolderSourceFindings resource. + * + * @param {string} folderSourceFindingsName + * A fully-qualified path representing folder_source_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingsName(folderSourceFindingsName: string) { + return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).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: 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 organizationAssetSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetSecurityMarksPath(organization:string,asset:string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).organization; + } + + /** + * Parse the asset from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).asset; + } + + /** + * Return a fully-qualified organizationAssets resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetsPath(organization:string,asset:string) { + return this.pathTemplates.organizationAssetsPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAssets resource. + * + * @param {string} organizationAssetsName + * A fully-qualified path representing organization_assets resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetsName(organizationAssetsName: string) { + return this.pathTemplates.organizationAssetsPathTemplate.match(organizationAssetsName).organization; + } + + /** + * Parse the asset from OrganizationAssets resource. + * + * @param {string} organizationAssetsName + * A fully-qualified path representing organization_assets resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetsName(organizationAssetsName: string) { + return this.pathTemplates.organizationAssetsPathTemplate.match(organizationAssetsName).asset; + } + + /** + * Return a fully-qualified organizationBigQueryExports resource name string. + * + * @param {string} organization + * @param {string} exportParam + * @returns {string} Resource name string. + */ + organizationBigQueryExportsPath(organization:string,exportParam:string) { + return this.pathTemplates.organizationBigQueryExportsPathTemplate.render({ + organization: organization, + export: exportParam, + }); + } + + /** + * Parse the organization from OrganizationBigQueryExports resource. + * + * @param {string} organizationBigQueryExportsName + * A fully-qualified path representing organization_bigQueryExports resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationBigQueryExportsName(organizationBigQueryExportsName: string) { + return this.pathTemplates.organizationBigQueryExportsPathTemplate.match(organizationBigQueryExportsName).organization; + } + + /** + * Parse the export from OrganizationBigQueryExports resource. + * + * @param {string} organizationBigQueryExportsName + * A fully-qualified path representing organization_bigQueryExports resource. + * @returns {string} A string representing the export. + */ + matchExportFromOrganizationBigQueryExportsName(organizationBigQueryExportsName: string) { + return this.pathTemplates.organizationBigQueryExportsPathTemplate.match(organizationBigQueryExportsName).export; + } + + /** + * Return a fully-qualified organizationConstraintName resource name string. + * + * @param {string} organization + * @param {string} constraint_name + * @returns {string} Resource name string. + */ + organizationConstraintNamePath(organization:string,constraintName:string) { + return this.pathTemplates.organizationConstraintNamePathTemplate.render({ + organization: organization, + constraint_name: constraintName, + }); + } + + /** + * Parse the organization from OrganizationConstraintName resource. + * + * @param {string} organizationConstraintNameName + * A fully-qualified path representing organization_constraint_name resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationConstraintNameName(organizationConstraintNameName: string) { + return this.pathTemplates.organizationConstraintNamePathTemplate.match(organizationConstraintNameName).organization; + } + + /** + * Parse the constraint_name from OrganizationConstraintName resource. + * + * @param {string} organizationConstraintNameName + * A fully-qualified path representing organization_constraint_name resource. + * @returns {string} A string representing the constraint_name. + */ + matchConstraintNameFromOrganizationConstraintNameName(organizationConstraintNameName: string) { + return this.pathTemplates.organizationConstraintNamePathTemplate.match(organizationConstraintNameName).constraint_name; + } + + /** + * Return a fully-qualified organizationEventThreatDetectionSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationEventThreatDetectionSettingsPath(organization:string) { + return this.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationEventThreatDetectionSettings resource. + * + * @param {string} organizationEventThreatDetectionSettingsName + * A fully-qualified path representing organization_eventThreatDetectionSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationEventThreatDetectionSettingsName(organizationEventThreatDetectionSettingsName: string) { + return this.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.match(organizationEventThreatDetectionSettingsName).organization; + } + + /** + * Return a fully-qualified organizationEventThreatDetectionSettingsModule resource name string. + * + * @param {string} organization + * @param {string} module + * @returns {string} Resource name string. + */ + organizationEventThreatDetectionSettingsModulePath(organization:string,module:string) { + return this.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.render({ + organization: organization, + module: module, + }); + } + + /** + * Parse the organization from OrganizationEventThreatDetectionSettingsModule resource. + * + * @param {string} organizationEventThreatDetectionSettingsModuleName + * A fully-qualified path representing organization_eventThreatDetectionSettings_module resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationEventThreatDetectionSettingsModuleName(organizationEventThreatDetectionSettingsModuleName: string) { + return this.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match(organizationEventThreatDetectionSettingsModuleName).organization; + } + + /** + * Parse the module from OrganizationEventThreatDetectionSettingsModule resource. + * + * @param {string} organizationEventThreatDetectionSettingsModuleName + * A fully-qualified path representing organization_eventThreatDetectionSettings_module resource. + * @returns {string} A string representing the module. + */ + matchModuleFromOrganizationEventThreatDetectionSettingsModuleName(organizationEventThreatDetectionSettingsModuleName: string) { + return this.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match(organizationEventThreatDetectionSettingsModuleName).module; + } + + /** + * Return a fully-qualified organizationLocationMuteConfigs resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} mute_config + * @returns {string} Resource name string. + */ + organizationLocationMuteConfigsPath(organization:string,location:string,muteConfig:string) { + return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.render({ + organization: organization, + location: location, + mute_config: muteConfig, + }); + } + + /** + * Parse the organization from OrganizationLocationMuteConfigs resource. + * + * @param {string} organizationLocationMuteConfigsName + * A fully-qualified path representing organization_location_muteConfigs resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { + return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).organization; + } + + /** + * Parse the location from OrganizationLocationMuteConfigs resource. + * + * @param {string} organizationLocationMuteConfigsName + * A fully-qualified path representing organization_location_muteConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { + return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).location; + } + + /** + * Parse the mute_config from OrganizationLocationMuteConfigs resource. + * + * @param {string} organizationLocationMuteConfigsName + * A fully-qualified path representing organization_location_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { + return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified organizationMuteConfigs resource name string. + * + * @param {string} organization + * @param {string} mute_config + * @returns {string} Resource name string. + */ + organizationMuteConfigsPath(organization:string,muteConfig:string) { + return this.pathTemplates.organizationMuteConfigsPathTemplate.render({ + organization: organization, + mute_config: muteConfig, + }); + } + + /** + * Parse the organization from OrganizationMuteConfigs resource. + * + * @param {string} organizationMuteConfigsName + * A fully-qualified path representing organization_muteConfigs resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMuteConfigsName(organizationMuteConfigsName: string) { + return this.pathTemplates.organizationMuteConfigsPathTemplate.match(organizationMuteConfigsName).organization; + } + + /** + * Parse the mute_config from OrganizationMuteConfigs resource. + * + * @param {string} organizationMuteConfigsName + * A fully-qualified path representing organization_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromOrganizationMuteConfigsName(organizationMuteConfigsName: string) { + return this.pathTemplates.organizationMuteConfigsPathTemplate.match(organizationMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified organizationNotificationConfigs resource name string. + * + * @param {string} organization + * @param {string} notification_config + * @returns {string} Resource name string. + */ + organizationNotificationConfigsPath(organization:string,notificationConfig:string) { + return this.pathTemplates.organizationNotificationConfigsPathTemplate.render({ + organization: organization, + notification_config: notificationConfig, + }); + } + + /** + * Parse the organization from OrganizationNotificationConfigs resource. + * + * @param {string} organizationNotificationConfigsName + * A fully-qualified path representing organization_notificationConfigs resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationConfigsName(organizationNotificationConfigsName: string) { + return this.pathTemplates.organizationNotificationConfigsPathTemplate.match(organizationNotificationConfigsName).organization; + } + + /** + * Parse the notification_config from OrganizationNotificationConfigs resource. + * + * @param {string} organizationNotificationConfigsName + * A fully-qualified path representing organization_notificationConfigs resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromOrganizationNotificationConfigsName(organizationNotificationConfigsName: string) { + return this.pathTemplates.organizationNotificationConfigsPathTemplate.match(organizationNotificationConfigsName).notification_config; + } + + /** + * Return a fully-qualified organizationSecurityHealthAnalyticsSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSecurityHealthAnalyticsSettingsPath(organization:string) { + return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationSecurityHealthAnalyticsSettings resource. + * + * @param {string} organizationSecurityHealthAnalyticsSettingsName + * A fully-qualified path representing organization_securityHealthAnalyticsSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsName(organizationSecurityHealthAnalyticsSettingsName: string) { + return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.match(organizationSecurityHealthAnalyticsSettingsName).organization; + } + + /** + * Return a fully-qualified organizationSecurityHealthAnalyticsSettingsCustomModule resource name string. + * + * @param {string} organization + * @param {string} custom_module + * @returns {string} Resource name string. + */ + organizationSecurityHealthAnalyticsSettingsCustomModulePath(organization:string,customModule:string) { + return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render({ + organization: organization, + custom_module: customModule, + }); + } + + /** + * Parse the organization from OrganizationSecurityHealthAnalyticsSettingsCustomModule resource. + * + * @param {string} organizationSecurityHealthAnalyticsSettingsCustomModuleName + * A fully-qualified path representing organization_securityHealthAnalyticsSettings_custom_module resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName(organizationSecurityHealthAnalyticsSettingsCustomModuleName: string) { + return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(organizationSecurityHealthAnalyticsSettingsCustomModuleName).organization; + } + + /** + * Parse the custom_module from OrganizationSecurityHealthAnalyticsSettingsCustomModule resource. + * + * @param {string} organizationSecurityHealthAnalyticsSettingsCustomModuleName + * A fully-qualified path representing organization_securityHealthAnalyticsSettings_custom_module resource. + * @returns {string} A string representing the custom_module. + */ + matchCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName(organizationSecurityHealthAnalyticsSettingsCustomModuleName: string) { + return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(organizationSecurityHealthAnalyticsSettingsCustomModuleName).custom_module; + } + + /** + * Return a fully-qualified organizationSecurityHealthAnalyticsSettingsEffectiveCustomModule resource name string. + * + * @param {string} organization + * @param {string} effective_custom_module + * @returns {string} Resource name string. + */ + organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePath(organization:string,effectiveCustomModule:string) { + return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render({ + organization: organization, + effective_custom_module: effectiveCustomModule, + }); + } + + /** + * Parse the organization from OrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. + * + * @param {string} organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName + * A fully-qualified path representing organization_securityHealthAnalyticsSettings_effective_custom_module resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { + return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).organization; + } + + /** + * Parse the effective_custom_module from OrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. + * + * @param {string} organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName + * A fully-qualified path representing organization_securityHealthAnalyticsSettings_effective_custom_module resource. + * @returns {string} A string representing the effective_custom_module. + */ + matchEffectiveCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { + return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).effective_custom_module; + } + + /** + * 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: 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 organizationSimulation resource name string. + * + * @param {string} organization + * @param {string} simulation + * @returns {string} Resource name string. + */ + organizationSimulationPath(organization:string,simulation:string) { + return this.pathTemplates.organizationSimulationPathTemplate.render({ + organization: organization, + simulation: simulation, + }); + } + + /** + * Parse the organization from OrganizationSimulation resource. + * + * @param {string} organizationSimulationName + * A fully-qualified path representing OrganizationSimulation resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSimulationName(organizationSimulationName: string) { + return this.pathTemplates.organizationSimulationPathTemplate.match(organizationSimulationName).organization; + } + + /** + * Parse the simulation from OrganizationSimulation resource. + * + * @param {string} organizationSimulationName + * A fully-qualified path representing OrganizationSimulation resource. + * @returns {string} A string representing the simulation. + */ + matchSimulationFromOrganizationSimulationName(organizationSimulationName: string) { + return this.pathTemplates.organizationSimulationPathTemplate.match(organizationSimulationName).simulation; + } + + /** + * 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 organizationSourceFindingExternalSystems resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + organizationSourceFindingExternalSystemsPath(organization:string,source:string,finding:string,externalsystem:string) { + return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + externalsystem: externalsystem, + }); + } + + /** + * Parse the organization from OrganizationSourceFindingExternalSystems resource. + * + * @param {string} organizationSourceFindingExternalSystemsName + * A fully-qualified path representing organization_source_finding_externalSystems resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingExternalSystemsName(organizationSourceFindingExternalSystemsName: string) { + return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match(organizationSourceFindingExternalSystemsName).organization; + } + + /** + * Parse the source from OrganizationSourceFindingExternalSystems resource. + * + * @param {string} organizationSourceFindingExternalSystemsName + * A fully-qualified path representing organization_source_finding_externalSystems resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingExternalSystemsName(organizationSourceFindingExternalSystemsName: string) { + return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match(organizationSourceFindingExternalSystemsName).source; + } + + /** + * Parse the finding from OrganizationSourceFindingExternalSystems resource. + * + * @param {string} organizationSourceFindingExternalSystemsName + * A fully-qualified path representing organization_source_finding_externalSystems resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingExternalSystemsName(organizationSourceFindingExternalSystemsName: string) { + return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match(organizationSourceFindingExternalSystemsName).finding; + } + + /** + * Parse the externalsystem from OrganizationSourceFindingExternalSystems resource. + * + * @param {string} organizationSourceFindingExternalSystemsName + * A fully-qualified path representing organization_source_finding_externalSystems resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromOrganizationSourceFindingExternalSystemsName(organizationSourceFindingExternalSystemsName: string) { + return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match(organizationSourceFindingExternalSystemsName).externalsystem; + } + + /** + * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingSecurityMarksPath(organization:string,source:string,finding:string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).organization; + } + + /** + * Parse the source from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).source; + } + + /** + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).finding; + } + + /** + * Return a fully-qualified organizationSourceFindings resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingsPath(organization:string,source:string,finding:string) { + return this.pathTemplates.organizationSourceFindingsPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFindings resource. + * + * @param {string} organizationSourceFindingsName + * A fully-qualified path representing organization_source_findings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { + return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).organization; + } + + /** + * Parse the source from OrganizationSourceFindings resource. + * + * @param {string} organizationSourceFindingsName + * A fully-qualified path representing organization_source_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { + return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).source; + } + + /** + * Parse the finding from OrganizationSourceFindings resource. + * + * @param {string} organizationSourceFindingsName + * A fully-qualified path representing organization_source_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { + return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).finding; + } + + /** + * 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 projectAssets resource name string. + * + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetsPath(project:string,asset:string) { + return this.pathTemplates.projectAssetsPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAssets resource. + * + * @param {string} projectAssetsName + * A fully-qualified path representing project_assets resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetsName(projectAssetsName: string) { + return this.pathTemplates.projectAssetsPathTemplate.match(projectAssetsName).project; + } + + /** + * Parse the asset from ProjectAssets resource. + * + * @param {string} projectAssetsName + * A fully-qualified path representing project_assets resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetsName(projectAssetsName: string) { + return this.pathTemplates.projectAssetsPathTemplate.match(projectAssetsName).asset; + } + + /** + * Return a fully-qualified projectBigQueryExports resource name string. + * + * @param {string} project + * @param {string} exportParam + * @returns {string} Resource name string. + */ + projectBigQueryExportsPath(project:string,exportParam:string) { + return this.pathTemplates.projectBigQueryExportsPathTemplate.render({ + project: project, + export: exportParam, + }); + } + + /** + * Parse the project from ProjectBigQueryExports resource. + * + * @param {string} projectBigQueryExportsName + * A fully-qualified path representing project_bigQueryExports resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectBigQueryExportsName(projectBigQueryExportsName: string) { + return this.pathTemplates.projectBigQueryExportsPathTemplate.match(projectBigQueryExportsName).project; + } + + /** + * Parse the export from ProjectBigQueryExports resource. + * + * @param {string} projectBigQueryExportsName + * A fully-qualified path representing project_bigQueryExports resource. + * @returns {string} A string representing the export. + */ + matchExportFromProjectBigQueryExportsName(projectBigQueryExportsName: string) { + return this.pathTemplates.projectBigQueryExportsPathTemplate.match(projectBigQueryExportsName).export; + } + + /** + * Return a fully-qualified projectConstraintName resource name string. + * + * @param {string} project + * @param {string} constraint_name + * @returns {string} Resource name string. + */ + projectConstraintNamePath(project:string,constraintName:string) { + return this.pathTemplates.projectConstraintNamePathTemplate.render({ + project: project, + constraint_name: constraintName, + }); + } + + /** + * Parse the project from ProjectConstraintName resource. + * + * @param {string} projectConstraintNameName + * A fully-qualified path representing project_constraint_name resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConstraintNameName(projectConstraintNameName: string) { + return this.pathTemplates.projectConstraintNamePathTemplate.match(projectConstraintNameName).project; + } + + /** + * Parse the constraint_name from ProjectConstraintName resource. + * + * @param {string} projectConstraintNameName + * A fully-qualified path representing project_constraint_name resource. + * @returns {string} A string representing the constraint_name. + */ + matchConstraintNameFromProjectConstraintNameName(projectConstraintNameName: string) { + return this.pathTemplates.projectConstraintNamePathTemplate.match(projectConstraintNameName).constraint_name; + } + + /** + * Return a fully-qualified projectEventThreatDetectionSettingsModule resource name string. + * + * @param {string} project + * @param {string} module + * @returns {string} Resource name string. + */ + projectEventThreatDetectionSettingsModulePath(project:string,module:string) { + return this.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.render({ + project: project, + module: module, + }); + } + + /** + * Parse the project from ProjectEventThreatDetectionSettingsModule resource. + * + * @param {string} projectEventThreatDetectionSettingsModuleName + * A fully-qualified path representing project_eventThreatDetectionSettings_module resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectEventThreatDetectionSettingsModuleName(projectEventThreatDetectionSettingsModuleName: string) { + return this.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match(projectEventThreatDetectionSettingsModuleName).project; + } + + /** + * Parse the module from ProjectEventThreatDetectionSettingsModule resource. + * + * @param {string} projectEventThreatDetectionSettingsModuleName + * A fully-qualified path representing project_eventThreatDetectionSettings_module resource. + * @returns {string} A string representing the module. + */ + matchModuleFromProjectEventThreatDetectionSettingsModuleName(projectEventThreatDetectionSettingsModuleName: string) { + return this.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match(projectEventThreatDetectionSettingsModuleName).module; + } + + /** + * Return a fully-qualified projectLocationMuteConfigs resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mute_config + * @returns {string} Resource name string. + */ + projectLocationMuteConfigsPath(project:string,location:string,muteConfig:string) { + return this.pathTemplates.projectLocationMuteConfigsPathTemplate.render({ + project: project, + location: location, + mute_config: muteConfig, + }); + } + + /** + * Parse the project from ProjectLocationMuteConfigs resource. + * + * @param {string} projectLocationMuteConfigsName + * A fully-qualified path representing project_location_muteConfigs resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { + return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).project; + } + + /** + * Parse the location from ProjectLocationMuteConfigs resource. + * + * @param {string} projectLocationMuteConfigsName + * A fully-qualified path representing project_location_muteConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { + return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).location; + } + + /** + * Parse the mute_config from ProjectLocationMuteConfigs resource. + * + * @param {string} projectLocationMuteConfigsName + * A fully-qualified path representing project_location_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { + return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified projectMuteConfigs resource name string. + * + * @param {string} project + * @param {string} mute_config + * @returns {string} Resource name string. + */ + projectMuteConfigsPath(project:string,muteConfig:string) { + return this.pathTemplates.projectMuteConfigsPathTemplate.render({ + project: project, + mute_config: muteConfig, + }); + } + + /** + * Parse the project from ProjectMuteConfigs resource. + * + * @param {string} projectMuteConfigsName + * A fully-qualified path representing project_muteConfigs resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMuteConfigsName(projectMuteConfigsName: string) { + return this.pathTemplates.projectMuteConfigsPathTemplate.match(projectMuteConfigsName).project; + } + + /** + * Parse the mute_config from ProjectMuteConfigs resource. + * + * @param {string} projectMuteConfigsName + * A fully-qualified path representing project_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromProjectMuteConfigsName(projectMuteConfigsName: string) { + return this.pathTemplates.projectMuteConfigsPathTemplate.match(projectMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified projectNotificationConfigs resource name string. + * + * @param {string} project + * @param {string} notification_config + * @returns {string} Resource name string. + */ + projectNotificationConfigsPath(project:string,notificationConfig:string) { + return this.pathTemplates.projectNotificationConfigsPathTemplate.render({ + project: project, + notification_config: notificationConfig, + }); + } + + /** + * Parse the project from ProjectNotificationConfigs resource. + * + * @param {string} projectNotificationConfigsName + * A fully-qualified path representing project_notificationConfigs resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationConfigsName(projectNotificationConfigsName: string) { + return this.pathTemplates.projectNotificationConfigsPathTemplate.match(projectNotificationConfigsName).project; + } + + /** + * Parse the notification_config from ProjectNotificationConfigs resource. + * + * @param {string} projectNotificationConfigsName + * A fully-qualified path representing project_notificationConfigs resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromProjectNotificationConfigsName(projectNotificationConfigsName: string) { + return this.pathTemplates.projectNotificationConfigsPathTemplate.match(projectNotificationConfigsName).notification_config; + } + + /** + * Return a fully-qualified projectSecurityHealthAnalyticsSettingsCustomModule resource name string. + * + * @param {string} project + * @param {string} custom_module + * @returns {string} Resource name string. + */ + projectSecurityHealthAnalyticsSettingsCustomModulePath(project:string,customModule:string) { + return this.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render({ + project: project, + custom_module: customModule, + }); + } + + /** + * Parse the project from ProjectSecurityHealthAnalyticsSettingsCustomModule resource. + * + * @param {string} projectSecurityHealthAnalyticsSettingsCustomModuleName + * A fully-qualified path representing project_securityHealthAnalyticsSettings_custom_module resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSecurityHealthAnalyticsSettingsCustomModuleName(projectSecurityHealthAnalyticsSettingsCustomModuleName: string) { + return this.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(projectSecurityHealthAnalyticsSettingsCustomModuleName).project; + } + + /** + * Parse the custom_module from ProjectSecurityHealthAnalyticsSettingsCustomModule resource. + * + * @param {string} projectSecurityHealthAnalyticsSettingsCustomModuleName + * A fully-qualified path representing project_securityHealthAnalyticsSettings_custom_module resource. + * @returns {string} A string representing the custom_module. + */ + matchCustomModuleFromProjectSecurityHealthAnalyticsSettingsCustomModuleName(projectSecurityHealthAnalyticsSettingsCustomModuleName: string) { + return this.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(projectSecurityHealthAnalyticsSettingsCustomModuleName).custom_module; + } + + /** + * Return a fully-qualified projectSecurityHealthAnalyticsSettingsEffectiveCustomModule resource name string. + * + * @param {string} project + * @param {string} effective_custom_module + * @returns {string} Resource name string. + */ + projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePath(project:string,effectiveCustomModule:string) { + return this.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render({ + project: project, + effective_custom_module: effectiveCustomModule, + }); + } + + /** + * Parse the project from ProjectSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. + * + * @param {string} projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName + * A fully-qualified path representing project_securityHealthAnalyticsSettings_effective_custom_module resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { + return this.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).project; + } + + /** + * Parse the effective_custom_module from ProjectSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. + * + * @param {string} projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName + * A fully-qualified path representing project_securityHealthAnalyticsSettings_effective_custom_module resource. + * @returns {string} A string representing the effective_custom_module. + */ + matchEffectiveCustomModuleFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { + return this.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).effective_custom_module; + } + + /** + * Return a fully-qualified projectSource resource name string. + * + * @param {string} project + * @param {string} source + * @returns {string} Resource name string. + */ + projectSourcePath(project:string,source:string) { + return this.pathTemplates.projectSourcePathTemplate.render({ + project: project, + source: source, + }); + } + + /** + * Parse the project from ProjectSource resource. + * + * @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 projectSourceFindingExternalSystems resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + projectSourceFindingExternalSystemsPath(project:string,source:string,finding:string,externalsystem:string) { + return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.render({ + project: project, + source: source, + finding: finding, + externalsystem: externalsystem, + }); + } + + /** + * Parse the project from ProjectSourceFindingExternalSystems resource. + * + * @param {string} projectSourceFindingExternalSystemsName + * A fully-qualified path representing project_source_finding_externalSystems resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingExternalSystemsName(projectSourceFindingExternalSystemsName: string) { + return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match(projectSourceFindingExternalSystemsName).project; + } + + /** + * Parse the source from ProjectSourceFindingExternalSystems resource. + * + * @param {string} projectSourceFindingExternalSystemsName + * A fully-qualified path representing project_source_finding_externalSystems resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingExternalSystemsName(projectSourceFindingExternalSystemsName: string) { + return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match(projectSourceFindingExternalSystemsName).source; + } + + /** + * Parse the finding from ProjectSourceFindingExternalSystems resource. + * + * @param {string} projectSourceFindingExternalSystemsName + * A fully-qualified path representing project_source_finding_externalSystems resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingExternalSystemsName(projectSourceFindingExternalSystemsName: string) { + return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match(projectSourceFindingExternalSystemsName).finding; + } + + /** + * Parse the externalsystem from ProjectSourceFindingExternalSystems resource. + * + * @param {string} projectSourceFindingExternalSystemsName + * A fully-qualified path representing project_source_finding_externalSystems resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromProjectSourceFindingExternalSystemsName(projectSourceFindingExternalSystemsName: string) { + return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match(projectSourceFindingExternalSystemsName).externalsystem; + } + + /** + * 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 ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the 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; + } + + /** + * Return a fully-qualified projectSourceFindings resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingsPath(project:string,source:string,finding:string) { + return this.pathTemplates.projectSourceFindingsPathTemplate.render({ + project: project, + source: source, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceFindings resource. + * + * @param {string} projectSourceFindingsName + * A fully-qualified path representing project_source_findings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingsName(projectSourceFindingsName: string) { + return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).project; + } + + /** + * Parse the source from ProjectSourceFindings resource. + * + * @param {string} projectSourceFindingsName + * A fully-qualified path representing project_source_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingsName(projectSourceFindingsName: string) { + return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).source; + } + + /** + * Parse the finding from ProjectSourceFindings resource. + * + * @param {string} projectSourceFindingsName + * A fully-qualified path representing project_source_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingsName(projectSourceFindingsName: string) { + return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).finding; + } + + /** + * Return a fully-qualified resourceValueConfig resource name string. + * + * @param {string} organization + * @param {string} resource_value_config + * @returns {string} Resource name string. + */ + resourceValueConfigPath(organization:string,resourceValueConfig:string) { + return this.pathTemplates.resourceValueConfigPathTemplate.render({ + organization: organization, + resource_value_config: resourceValueConfig, + }); + } + + /** + * Parse the organization from ResourceValueConfig resource. + * + * @param {string} resourceValueConfigName + * A fully-qualified path representing ResourceValueConfig resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromResourceValueConfigName(resourceValueConfigName: string) { + return this.pathTemplates.resourceValueConfigPathTemplate.match(resourceValueConfigName).organization; + } + + /** + * Parse the resource_value_config from ResourceValueConfig resource. + * + * @param {string} resourceValueConfigName + * A fully-qualified path representing ResourceValueConfig resource. + * @returns {string} A string representing the resource_value_config. + */ + matchResourceValueConfigFromResourceValueConfigName(resourceValueConfigName: string) { + return this.pathTemplates.resourceValueConfigPathTemplate.match(resourceValueConfigName).resource_value_config; + } + + /** + * Return a fully-qualified simulation resource name string. + * + * @param {string} organization + * @param {string} simulation + * @returns {string} Resource name string. + */ + simulationPath(organization:string,simulation:string) { + return this.pathTemplates.simulationPathTemplate.render({ + organization: organization, + simulation: simulation, + }); + } + + /** + * Parse the organization from Simulation resource. + * + * @param {string} simulationName + * A fully-qualified path representing Simulation resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromSimulationName(simulationName: string) { + return this.pathTemplates.simulationPathTemplate.match(simulationName).organization; + } + + /** + * Parse the simulation from Simulation resource. + * + * @param {string} simulationName + * A fully-qualified path representing Simulation resource. + * @returns {string} A string representing the simulation. + */ + matchSimulationFromSimulationName(simulationName: string) { + return this.pathTemplates.simulationPathTemplate.match(simulationName).simulation; + } + + /** + * Return a fully-qualified valuedResource resource name string. + * + * @param {string} organization + * @param {string} simulation + * @param {string} valued_resource + * @returns {string} Resource name string. + */ + valuedResourcePath(organization:string,simulation:string,valuedResource:string) { + return this.pathTemplates.valuedResourcePathTemplate.render({ + organization: organization, + simulation: simulation, + valued_resource: valuedResource, + }); + } + + /** + * Parse the organization from ValuedResource resource. + * + * @param {string} valuedResourceName + * A fully-qualified path representing ValuedResource resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromValuedResourceName(valuedResourceName: string) { + return this.pathTemplates.valuedResourcePathTemplate.match(valuedResourceName).organization; + } + + /** + * Parse the simulation from ValuedResource resource. + * + * @param {string} valuedResourceName + * A fully-qualified path representing ValuedResource resource. + * @returns {string} A string representing the simulation. + */ + matchSimulationFromValuedResourceName(valuedResourceName: string) { + return this.pathTemplates.valuedResourcePathTemplate.match(valuedResourceName).simulation; + } + + /** + * Parse the valued_resource from ValuedResource resource. + * + * @param {string} valuedResourceName + * A fully-qualified path representing ValuedResource resource. + * @returns {string} A string representing the valued_resource. + */ + matchValuedResourceFromValuedResourceName(valuedResourceName: string) { + return this.pathTemplates.valuedResourcePathTemplate.match(valuedResourceName).valued_resource; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client_config.json b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client_config.json new file mode 100644 index 00000000000..84de80f3eba --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -0,0 +1,309 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v1.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": { + "BulkMuteFindings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecurityHealthAnalyticsCustomModule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "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" + }, + "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", + "retry_params_name": "default" + }, + "DeleteSecurityHealthAnalyticsCustomModule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSimulation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetValuedResource": { + "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", + "retry_params_name": "default" + }, + "GetMuteConfig": { + "retry_codes_name": "non_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", + "retry_params_name": "default" + }, + "GetEffectiveSecurityHealthAnalyticsCustomModule": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSecurityHealthAnalyticsCustomModule": { + "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": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDescendantSecurityHealthAnalyticsCustomModules": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 480000, + "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", + "retry_params_name": "default" + }, + "ListEffectiveSecurityHealthAnalyticsCustomModules": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSecurityHealthAnalyticsCustomModules": { + "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" + }, + "SetMute": { + "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" + }, + "SimulateSecurityHealthAnalyticsCustomModule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateExternalSystem": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFinding": { + "timeout_millis": 60000, + "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", + "retry_params_name": "default" + }, + "UpdateOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityHealthAnalyticsCustomModule": { + "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": 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" + }, + "CreateEventThreatDetectionCustomModule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEventThreatDetectionCustomModule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEventThreatDetectionCustomModule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDescendantEventThreatDetectionCustomModules": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEventThreatDetectionCustomModules": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEventThreatDetectionCustomModule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ValidateEventThreatDetectionCustomModule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEffectiveEventThreatDetectionCustomModule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEffectiveEventThreatDetectionCustomModules": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateResourceValueConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteResourceValueConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetResourceValueConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListResourceValueConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateResourceValueConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListValuedResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAttackPaths": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_proto_list.json new file mode 100644 index 00000000000..4a842ba0b8b --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -0,0 +1,57 @@ +[ + "../../protos/google/cloud/securitycenter/v1/access.proto", + "../../protos/google/cloud/securitycenter/v1/application.proto", + "../../protos/google/cloud/securitycenter/v1/asset.proto", + "../../protos/google/cloud/securitycenter/v1/attack_exposure.proto", + "../../protos/google/cloud/securitycenter/v1/attack_path.proto", + "../../protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto", + "../../protos/google/cloud/securitycenter/v1/bigquery_export.proto", + "../../protos/google/cloud/securitycenter/v1/chokepoint.proto", + "../../protos/google/cloud/securitycenter/v1/cloud_armor.proto", + "../../protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto", + "../../protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.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/container.proto", + "../../protos/google/cloud/securitycenter/v1/database.proto", + "../../protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto", + "../../protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto", + "../../protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto", + "../../protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto", + "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", + "../../protos/google/cloud/securitycenter/v1/external_exposure.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/group_membership.proto", + "../../protos/google/cloud/securitycenter/v1/iam_binding.proto", + "../../protos/google/cloud/securitycenter/v1/indicator.proto", + "../../protos/google/cloud/securitycenter/v1/kernel_rootkit.proto", + "../../protos/google/cloud/securitycenter/v1/kubernetes.proto", + "../../protos/google/cloud/securitycenter/v1/label.proto", + "../../protos/google/cloud/securitycenter/v1/load_balancer.proto", + "../../protos/google/cloud/securitycenter/v1/log_entry.proto", + "../../protos/google/cloud/securitycenter/v1/mitre_attack.proto", + "../../protos/google/cloud/securitycenter/v1/mute_config.proto", + "../../protos/google/cloud/securitycenter/v1/notebook.proto", + "../../protos/google/cloud/securitycenter/v1/notification_config.proto", + "../../protos/google/cloud/securitycenter/v1/notification_message.proto", + "../../protos/google/cloud/securitycenter/v1/org_policy.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/resource_value_config.proto", + "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto", + "../../protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto", + "../../protos/google/cloud/securitycenter/v1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1/security_posture.proto", + "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", + "../../protos/google/cloud/securitycenter/v1/simulation.proto", + "../../protos/google/cloud/securitycenter/v1/source.proto", + "../../protos/google/cloud/securitycenter/v1/toxic_combination.proto", + "../../protos/google/cloud/securitycenter/v1/valued_resource.proto", + "../../protos/google/cloud/securitycenter/v1/vulnerability.proto" +] diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..02da4303dc4 --- /dev/null +++ b/owl-bot-staging/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/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/index.ts new file mode 100644 index 00000000000..750912594f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {SecurityCenterClient} from './security_center_client'; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client.ts new file mode 100644 index 00000000000..7b564ee1062 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -0,0 +1,3681 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * 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'; +const version = require('../../../package.json').version; + +/** + * V1 Beta APIs for Security Center service. + * @class + * @memberof v1beta1 + */ +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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('security-center'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + securityCenterStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of 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/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * 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: true}, 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; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'securitycenter.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + assetPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), + findingPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + 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' + ), + sourcePathTemplate: new this._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 this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), + groupFindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), + listAssets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listAssetsResults'), + listFindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'findings'), + listSources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sources') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + 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(lroOptions).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 this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.securityCenterStub) { + return this.securityCenterStub; + } + + // Put together the "service stub" for + // google.cloud.securitycenter.v1beta1.SecurityCenter. + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.securitycenter.v1beta1.SecurityCenter') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.securitycenter.v1beta1.SecurityCenter, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const 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 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); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securityCenterStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|undefined, {}|undefined + ]>; + createSource( + request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|null|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; + createSource( + request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('createSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|undefined, {}|undefined + ]>; + createFinding( + request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|null|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; + createFinding( + request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createFinding request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createFinding(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|undefined, + {}|undefined + ]) => { + this._log.info('createFinding response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + 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; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.OrganizationSettings|OrganizationSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|undefined, {}|undefined + ]>; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|null|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; + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getOrganizationSettings request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getOrganizationSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getOrganizationSettings(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|undefined, + {}|undefined + ]) => { + this._log.info('getOrganizationSettings response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|undefined, {}|undefined + ]>; + getSource( + request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|null|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; + getSource( + request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|undefined, {}|undefined + ]>; + setFindingState( + request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|null|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; + setFindingState( + request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setFindingState request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setFindingState response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setFindingState(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|undefined, + {}|undefined + ]) => { + this._log.info('setFindingState response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {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. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + 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; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + 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; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|undefined, {}|undefined + ]>; + updateFinding( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|null|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; + updateFinding( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'finding.name': request.finding!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateFinding request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateFinding(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateFinding response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.OrganizationSettings|OrganizationSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined + ]>; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|null|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; + updateOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateOrganizationSettings request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateOrganizationSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateOrganizationSettings(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateOrganizationSettings response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|undefined, {}|undefined + ]>; + updateSource( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|null|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; + updateSource( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'source.name': request.source!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.SecurityMarks|SecurityMarks}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|undefined, {}|undefined + ]>; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|null|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; + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSecurityMarks request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSecurityMarks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSecurityMarks(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSecurityMarks response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * 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): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + options: CallOptions, + callback: Callback< + 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; + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runAssetDiscovery response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runAssetDiscovery request %j', request); + return this.innerApiCalls.runAssetDiscovery(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('runAssetDiscovery response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * 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. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async + */ + async checkRunAssetDiscoveryProgress(name: string): Promise>{ + this._log.info('runAssetDiscovery long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|GroupResult}. + * 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 `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest|null, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('groupAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('groupAssets request %j', request); + return this.innerApiCalls + .groupAssets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest|null, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + ]) => { + this._log.info('groupAssets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `groupAssets`, but returns a NodeJS Stream object. + * @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 {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + groupAssetsStream( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupAssets stream %j', request); + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupAssets iterate %j', request); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|GroupResult}. + * 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 `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('groupFindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('groupFindings request %j', request); + return this.innerApiCalls + .groupFindings(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + ]) => { + this._log.info('groupFindings values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `groupFindings`, but returns a NodeJS Stream object. + * @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 {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + groupFindingsStream( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupFindings stream %j', request); + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupFindings iterate %j', request); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult|ListAssetsResult}. + * 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 `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest|null, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAssets request %j', request); + return this.innerApiCalls + .listAssets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest|null, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + ]) => { + this._log.info('listAssets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAssets`, but returns a NodeJS Stream object. + * @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 {@link protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAssetsStream( + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAssets stream %j', request); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAssets iterate %j', request); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|Finding}. + * 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.IFinding[], + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFindings request %j', request); + return this.innerApiCalls + .listFindings(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1beta1.IFinding[], + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + ]) => { + this._log.info('listFindings values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listFindings`, but returns a NodeJS Stream object. + * @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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFindingsStream( + request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFindings stream %j', request); + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1beta1.Finding|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFindings iterate %j', request); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + request as {}, + 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 {@link protos.google.cloud.securitycenter.v1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSources( + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISource[], + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + ]>; + listSources( + request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options: CallOptions, + 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; + listSources( + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.ISource>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.ISource>): + Promise<[ + protos.google.cloud.securitycenter.v1beta1.ISource[], + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1beta1.ISource>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSources request %j', request); + return this.innerApiCalls + .listSources(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1beta1.ISource[], + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + ]) => { + this._log.info('listSources values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSources`, but returns a NodeJS Stream object. + * @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 {@link protos.google.cloud.securitycenter.v1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSourcesStream( + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSources stream %j', request); + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSources iterate %j', request); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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. + * + * @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: organization, + source: source, + finding: 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: 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 organizationAssetSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetSecurityMarksPath(organization:string,asset:string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).organization; + } + + /** + * Parse the asset from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).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: 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 organizationSourceFindingSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingSecurityMarksPath(organization:string,source:string,finding:string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).organization; + } + + /** + * Parse the source from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).source; + } + + /** + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).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: organization, + source: 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. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json new file mode 100644 index 00000000000..a1a7e2d9386 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json @@ -0,0 +1,116 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v1beta1.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": 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": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 480000, + "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": 480000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json new file mode 100644 index 00000000000..d10dce6c60d --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../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/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json new file mode 100644 index 00000000000..c0d8ccc6990 --- /dev/null +++ b/owl-bot-staging/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/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/index.ts new file mode 100644 index 00000000000..750912594f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {SecurityCenterClient} from './security_center_client'; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts new file mode 100644 index 00000000000..96fdf7781be --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -0,0 +1,5466 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * 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'; +const version = require('../../../package.json').version; + +/** + * V1p1Beta1 APIs for Security Center service. + * @class + * @memberof v1p1beta1 + */ +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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('security-center'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + securityCenterStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of 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/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * 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: true}, 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; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'securitycenter.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + folderAssetPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}' + ), + 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' + ), + 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' + ), + 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, + // (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 this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), + groupFindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), + listAssets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listAssetsResults'), + listFindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listFindingsResults'), + listNotificationConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'notificationConfigs'), + listSources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sources') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + 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(lroOptions).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 this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.securityCenterStub) { + return this.securityCenterStub; + } + + // Put together the "service stub" for + // google.cloud.securitycenter.v1p1beta1.SecurityCenter. + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.securitycenter.v1p1beta1.SecurityCenter') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.securitycenter.v1p1beta1.SecurityCenter, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const 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 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); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securityCenterStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|undefined, {}|undefined + ]>; + createSource( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|null|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; + createSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('createSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|undefined, {}|undefined + ]>; + createFinding( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|null|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; + createFinding( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createFinding request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createFinding(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|undefined, + {}|undefined + ]) => { + this._log.info('createFinding response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|undefined, {}|undefined + ]>; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|null|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; + createNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('createNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|undefined, {}|undefined + ]>; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|null|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; + deleteNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + 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; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|undefined, {}|undefined + ]>; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|null|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; + getNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings|OrganizationSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|undefined, {}|undefined + ]>; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|null|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; + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getOrganizationSettings request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getOrganizationSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getOrganizationSettings(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|undefined, + {}|undefined + ]) => { + this._log.info('getOrganizationSettings response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|undefined, {}|undefined + ]>; + getSource( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|null|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; + getSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|undefined, {}|undefined + ]>; + setFindingState( + request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|null|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; + setFindingState( + request?: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setFindingState request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setFindingState response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setFindingState(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|undefined, + {}|undefined + ]) => { + this._log.info('setFindingState response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {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. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + 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; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + 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; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|undefined, {}|undefined + ]>; + updateFinding( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|null|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; + updateFinding( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'finding.name': request.finding!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateFinding request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateFinding(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateFinding response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|undefined, {}|undefined + ]>; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|null|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; + updateNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings|OrganizationSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined + ]>; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + options: CallOptions, + 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, + 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|Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateOrganizationSettings request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateOrganizationSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateOrganizationSettings(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateOrganizationSettings response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|undefined, {}|undefined + ]>; + updateSource( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|null|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; + updateSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'source.name': request.source!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks|SecurityMarks}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|undefined, {}|undefined + ]>; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|null|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; + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSecurityMarks request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSecurityMarks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSecurityMarks(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSecurityMarks response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * 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): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runAssetDiscovery response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runAssetDiscovery request %j', request); + return this.innerApiCalls.runAssetDiscovery(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('runAssetDiscovery response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * 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. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async + */ + async checkRunAssetDiscoveryProgress(name: string): Promise>{ + this._log.info('runAssetDiscovery long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * 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], 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 + * 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 : ""` + * @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.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 {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|GroupResult}. + * 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 `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('groupAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('groupAssets request %j', request); + return this.innerApiCalls + .groupAssets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + ]) => { + this._log.info('groupAssets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `groupAssets`, but returns a NodeJS Stream object. + * @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], 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 + * 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 : ""` + * @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.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 {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + groupAssetsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupAssets stream %j', request); + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * Required. Name of the organization to groupBy. Its format is + * "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 + * 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 : ""` + * @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.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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupAssets iterate %j', request); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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 + * + * @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]", + * 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 + * 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 : ""` + * @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 + * * severity + * + * 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 {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|GroupResult}. + * 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 `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('groupFindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('groupFindings request %j', request); + return this.innerApiCalls + .groupFindings(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + ]) => { + this._log.info('groupFindings values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `groupFindings`, but returns a NodeJS Stream object. + * @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]", + * 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 + * 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 : ""` + * @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 + * * severity + * + * 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 {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + groupFindingsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupFindings stream %j', request); + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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/- + * @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: `=`, `>`, `<`, `>=`, `<=` + * * 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 : ""` + * @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 + * * severity + * + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupFindings iterate %j', request); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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], 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 + * 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 : ""` + * @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 + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult|ListAssetsResult}. + * 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 `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAssets request %j', request); + return this.innerApiCalls + .listAssets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + ]) => { + this._log.info('listAssets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAssets`, but returns a NodeJS Stream object. + * @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], 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 + * 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 : ""` + * @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 + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAssetsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAssets stream %j', request); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * Required. Name of the organization assets should belong to. Its format is + * "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 + * 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 : ""` + * @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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAssets iterate %j', request); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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], + * 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 + * 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 : ""` + * @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 + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult|ListFindingsResult}. + * 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFindings request %j', request); + return this.innerApiCalls + .listFindings(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + ]) => { + this._log.info('listFindings values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listFindings`, but returns a NodeJS Stream object. + * @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], + * 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 + * 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 : ""` + * @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 + * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFindingsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFindings stream %j', request); + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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/- + * @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: `=`, `>`, `<`, `>=`, `<=` + * * 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 : ""` + * @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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFindings iterate %j', request); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + request as {}, + 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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + ]>; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options: CallOptions, + 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; + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listNotificationConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listNotificationConfigs request %j', request); + return this.innerApiCalls + .listNotificationConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + ]) => { + this._log.info('listNotificationConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listNotificationConfigs`, but returns a NodeJS Stream object. + * @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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listNotificationConfigsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listNotificationConfigs stream %j', request); + return this.descriptors.page.listNotificationConfigs.createStream( + this.innerApiCalls.listNotificationConfigs as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listNotificationConfigs iterate %j', request); + return this.descriptors.page.listNotificationConfigs.asyncIterate( + this.innerApiCalls['listNotificationConfigs'] as GaxCall, + request as {}, + 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSources( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISource[], + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + ]>; + listSources( + request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options: CallOptions, + 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; + listSources( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource>): + Promise<[ + protos.google.cloud.securitycenter.v1p1beta1.ISource[], + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSources request %j', request); + return this.innerApiCalls + .listSources(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v1p1beta1.ISource[], + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + ]) => { + this._log.info('listSources values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSources`, but returns a NodeJS Stream object. + * @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 {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1p1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSourcesStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSources stream %j', request); + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v1p1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @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, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSources iterate %j', request); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAsset resource name string. + * + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetPath(folder:string,asset:string) { + return this.pathTemplates.folderAssetPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAsset resource. + * + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName).folder; + } + + /** + * Parse the asset from FolderAsset resource. + * + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName).asset; + } + + /** + * Return a fully-qualified folderAssetSecurityMarks resource name string. + * + * @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. + */ + folderSourceFindingPath(folder:string,source:string,finding:string) { + return this.pathTemplates.folderSourceFindingPathTemplate.render({ + folder: folder, + source: source, + finding: finding, + }); + } + + /** + * Parse the folder from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the folder. + */ + 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; + } + + /** + * 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; + } + + /** + * 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. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization:string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: 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: 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. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetSecurityMarksPath(organization:string,asset:string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).organization; + } + + /** + * Parse the asset from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).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: 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 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. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingSecurityMarksPath(organization:string,source:string,finding:string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).organization; + } + + /** + * Parse the source from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).source; + } + + /** + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).finding; + } + + /** + * Return a fully-qualified projectAsset resource name string. + * + * @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. + */ + projectSourcePath(project:string,source:string) { + return this.pathTemplates.projectSourcePathTemplate.render({ + project: project, + source: source, + }); + } + + /** + * Parse the project from ProjectSource resource. + * + * @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. + */ + 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 ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the 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; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json new file mode 100644 index 00000000000..b8821e07010 --- /dev/null +++ b/owl-bot-staging/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": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFinding": { + "timeout_millis": 60000, + "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", + "retry_params_name": "default" + }, + "GetSource": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 480000, + "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", + "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" + }, + "UpdateNotificationConfig": { + "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": 480000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json new file mode 100644 index 00000000000..dcb821bf6e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../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", + "../../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" +] diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/gapic_metadata.json b/owl-bot-staging/google-cloud-securitycenter/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..60fd987d039 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v2/gapic_metadata.json @@ -0,0 +1,459 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.securitycenter.v2", + "libraryPackage": "@google-cloud/securitycenter", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "BatchCreateResourceValueConfigs": { + "methods": [ + "batchCreateResourceValueConfigs" + ] + }, + "CreateBigQueryExport": { + "methods": [ + "createBigQueryExport" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "deleteBigQueryExport" + ] + }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "DeleteResourceValueConfig": { + "methods": [ + "deleteResourceValueConfig" + ] + }, + "GetBigQueryExport": { + "methods": [ + "getBigQueryExport" + ] + }, + "GetSimulation": { + "methods": [ + "getSimulation" + ] + }, + "GetValuedResource": { + "methods": [ + "getValuedResource" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetResourceValueConfig": { + "methods": [ + "getResourceValueConfig" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetMute": { + "methods": [ + "setMute" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "updateBigQueryExport" + ] + }, + "UpdateExternalSystem": { + "methods": [ + "updateExternalSystem" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateResourceValueConfig": { + "methods": [ + "updateResourceValueConfig" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAttackPaths": { + "methods": [ + "listAttackPaths", + "listAttackPathsStream", + "listAttackPathsAsync" + ] + }, + "ListBigQueryExports": { + "methods": [ + "listBigQueryExports", + "listBigQueryExportsStream", + "listBigQueryExportsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListResourceValueConfigs": { + "methods": [ + "listResourceValueConfigs", + "listResourceValueConfigsStream", + "listResourceValueConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + }, + "ListValuedResources": { + "methods": [ + "listValuedResources", + "listValuedResourcesStream", + "listValuedResourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "BatchCreateResourceValueConfigs": { + "methods": [ + "batchCreateResourceValueConfigs" + ] + }, + "CreateBigQueryExport": { + "methods": [ + "createBigQueryExport" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "deleteBigQueryExport" + ] + }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "DeleteResourceValueConfig": { + "methods": [ + "deleteResourceValueConfig" + ] + }, + "GetBigQueryExport": { + "methods": [ + "getBigQueryExport" + ] + }, + "GetSimulation": { + "methods": [ + "getSimulation" + ] + }, + "GetValuedResource": { + "methods": [ + "getValuedResource" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetResourceValueConfig": { + "methods": [ + "getResourceValueConfig" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetMute": { + "methods": [ + "setMute" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "updateBigQueryExport" + ] + }, + "UpdateExternalSystem": { + "methods": [ + "updateExternalSystem" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateResourceValueConfig": { + "methods": [ + "updateResourceValueConfig" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAttackPaths": { + "methods": [ + "listAttackPaths", + "listAttackPathsStream", + "listAttackPathsAsync" + ] + }, + "ListBigQueryExports": { + "methods": [ + "listBigQueryExports", + "listBigQueryExportsStream", + "listBigQueryExportsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListResourceValueConfigs": { + "methods": [ + "listResourceValueConfigs", + "listResourceValueConfigsStream", + "listResourceValueConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + }, + "ListValuedResources": { + "methods": [ + "listValuedResources", + "listValuedResourcesStream", + "listValuedResourcesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/v2/index.ts new file mode 100644 index 00000000000..750912594f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {SecurityCenterClient} from './security_center_client'; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client.ts b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client.ts new file mode 100644 index 00000000000..a0f1faca157 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client.ts @@ -0,0 +1,9119 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/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'; +const version = require('../../../package.json').version; + +/** + * V2 APIs for Security Center service. + * @class + * @memberof v2 + */ +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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('securitycenter'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + securityCenterStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of 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/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * 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: true}, 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; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'securitycenter.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}/securityMarks' + ), + folderConstraintNamePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/policies/{constraint_name}' + ), + folderLocationBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/bigQueryExports/{export}' + ), + folderLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/muteConfigs/{mute_config}' + ), + folderLocationNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/notificationConfigs/{notification_config}' + ), + folderMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/muteConfigs/{mute_config}' + ), + folderSourcePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}' + ), + 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' + ), + folderSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}' + ), + folderSourceLocationFindingExternalsystemPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}' + ), + folderSourceLocationFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks' + ), + folderSourceLocationFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/locations/{location}/findings/{finding}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + organizationConstraintNamePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/policies/{constraint_name}' + ), + organizationLocationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}' + ), + organizationLocationBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/bigQueryExports/{export}' + ), + organizationLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/muteConfigs/{mute_config}' + ), + organizationLocationNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/notificationConfigs/{notification_config}' + ), + organizationLocationResourceValueConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}' + ), + organizationLocationSimluationValuedResourcesPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}' + ), + organizationLocationSimulationValuedResourceAttackPathsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}' + ), + organizationLocationSimulationsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/simulations/{simluation}' + ), + organizationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/muteConfigs/{mute_config}' + ), + organizationResourceValueConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/resourceValueConfigs/{resource_value_config}' + ), + organizationSimulationValuedResourceAttackPathsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}' + ), + organizationSimulationValuedResourcesPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}' + ), + organizationSimulationsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/simulations/{simulation}' + ), + organizationSourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + 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' + ), + organizationSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + organizationSourceLocationFindingExternalsystemPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}' + ), + organizationSourceLocationFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks' + ), + organizationSourceLocationFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}' + ), + projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}/securityMarks' + ), + projectConstraintNamePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/policies/{constraint_name}' + ), + projectLocationBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/bigQueryExports/{export}' + ), + projectLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/muteConfigs/{mute_config}' + ), + projectLocationNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notificationConfigs/{notification_config}' + ), + projectMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/muteConfigs/{mute_config}' + ), + projectSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}' + ), + 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' + ), + projectSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}' + ), + projectSourceLocationFindingExternalsystemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}' + ), + projectSourceLocationFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks' + ), + projectSourceLocationFindingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/locations/{location}/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 = { + groupFindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), + listAttackPaths: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attackPaths'), + listBigQueryExports: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'bigQueryExports'), + listFindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listFindingsResults'), + listMuteConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'muteConfigs'), + listNotificationConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'notificationConfigs'), + listResourceValueConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceValueConfigs'), + listSources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sources'), + listValuedResources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'valuedResources') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v2/{name=organizations/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=organizations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=organizations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=organizations/*/operations}',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const bulkMuteFindingsResponse = protoFilesRoot.lookup( + '.google.cloud.securitycenter.v2.BulkMuteFindingsResponse') as gax.protobuf.Type; + const bulkMuteFindingsMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + + this.descriptors.longrunning = { + bulkMuteFindings: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + bulkMuteFindingsResponse.decode.bind(bulkMuteFindingsResponse), + bulkMuteFindingsMetadata.decode.bind(bulkMuteFindingsMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.securitycenter.v2.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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.securityCenterStub) { + return this.securityCenterStub; + } + + // Put together the "service stub" for + // google.cloud.securitycenter.v2.SecurityCenter. + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.securitycenter.v2.SecurityCenter') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.securitycenter.v2.SecurityCenter, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const securityCenterStubMethods = + ['batchCreateResourceValueConfigs', 'bulkMuteFindings', 'createBigQueryExport', 'createFinding', 'createMuteConfig', 'createNotificationConfig', 'createSource', 'deleteBigQueryExport', 'deleteMuteConfig', 'deleteNotificationConfig', 'deleteResourceValueConfig', 'getBigQueryExport', 'getSimulation', 'getValuedResource', 'getIamPolicy', 'getMuteConfig', 'getNotificationConfig', 'getResourceValueConfig', 'getSource', 'groupFindings', 'listAttackPaths', 'listBigQueryExports', 'listFindings', 'listMuteConfigs', 'listNotificationConfigs', 'listResourceValueConfigs', 'listSources', 'listValuedResources', 'setFindingState', 'setIamPolicy', 'setMute', 'testIamPermissions', 'updateBigQueryExport', 'updateExternalSystem', 'updateFinding', 'updateMuteConfig', 'updateNotificationConfig', 'updateResourceValueConfig', 'updateSecurityMarks', 'updateSource']; + 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); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securityCenterStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a ResourceValueConfig for an organization. Maps user's tags to + * difference resource values for use by the attack path simulation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new ResourceValueConfig's parent. + * The parent field in the CreateResourceValueConfigRequest + * messages must either be empty or match this field. + * @param {number[]} request.requests + * Required. The resource value configs to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse|BatchCreateResourceValueConfigsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.batch_create_resource_value_configs.js + * region_tag:securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_async + */ + batchCreateResourceValueConfigs( + request?: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|undefined, {}|undefined + ]>; + batchCreateResourceValueConfigs( + request: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateResourceValueConfigs( + request: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateResourceValueConfigs( + request?: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('batchCreateResourceValueConfigs request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchCreateResourceValueConfigs response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.batchCreateResourceValueConfigs(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, + protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|undefined, + {}|undefined + ]) => { + this._log.info('batchCreateResourceValueConfigs response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource of the new BigQuery export. Its + * format is `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_id]`. + * @param {google.cloud.securitycenter.v2.BigQueryExport} request.bigQueryExport + * Required. The BigQuery export being created. + * @param {string} request.bigQueryExportId + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.BigQueryExport|BigQueryExport}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.create_big_query_export.js + * region_tag:securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_async + */ + createBigQueryExport( + request?: protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|undefined, {}|undefined + ]>; + createBigQueryExport( + request: protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + createBigQueryExport( + request: protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + createBigQueryExport( + request?: protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createBigQueryExport request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBigQueryExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createBigQueryExport(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|undefined, + {}|undefined + ]) => { + this._log.info('createBigQueryExport response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a finding in a location. 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. The following list + * shows some examples of the format: + * + + * `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_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.v2.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 {@link protos.google.cloud.securitycenter.v2.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.create_finding.js + * region_tag:securitycenter_v2_generated_SecurityCenter_CreateFinding_async + */ + createFinding( + request?: protos.google.cloud.securitycenter.v2.ICreateFindingRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ICreateFindingRequest|undefined, {}|undefined + ]>; + createFinding( + request: protos.google.cloud.securitycenter.v2.ICreateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, + {}|null|undefined>): void; + createFinding( + request: protos.google.cloud.securitycenter.v2.ICreateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, + {}|null|undefined>): void; + createFinding( + request?: protos.google.cloud.securitycenter.v2.ICreateFindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ICreateFindingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createFinding request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createFinding(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ICreateFindingRequest|undefined, + {}|undefined + ]) => { + this._log.info('createFinding response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_id]`. + * @param {google.cloud.securitycenter.v2.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 only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.MuteConfig|MuteConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.create_mute_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_CreateMuteConfig_async + */ + createMuteConfig( + request?: protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|undefined, {}|undefined + ]>; + createMuteConfig( + request: protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, + {}|null|undefined>): void; + createMuteConfig( + request: protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, + {}|null|undefined>): void; + createMuteConfig( + request?: protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.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 || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('createMuteConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createMuteConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createMuteConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('createMuteConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_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 contain alphanumeric + * characters, underscores, or hyphens only. + * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.create_notification_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_async + */ + createNotificationConfig( + request?: protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|undefined, {}|undefined + ]>; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>): void; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>): void; + createNotificationConfig( + request?: protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('createNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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.v2.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 {@link protos.google.cloud.securitycenter.v2.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.create_source.js + * region_tag:securitycenter_v2_generated_SecurityCenter_CreateSource_async + */ + createSource( + request?: protos.google.cloud.securitycenter.v2.ICreateSourceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.ICreateSourceRequest|undefined, {}|undefined + ]>; + createSource( + request: protos.google.cloud.securitycenter.v2.ICreateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, + {}|null|undefined>): void; + createSource( + request: protos.google.cloud.securitycenter.v2.ICreateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, + {}|null|undefined>): void; + createSource( + request?: protos.google.cloud.securitycenter.v2.ICreateSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.ICreateSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.ICreateSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('createSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an existing BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BigQuery export to delete. The following list + * shows some examples of the format: + * + * + + * `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + * + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + * + `projects/{project}/locations/{location}/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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.delete_big_query_export.js + * region_tag:securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_async + */ + deleteBigQueryExport( + request?: protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|undefined, {}|undefined + ]>; + deleteBigQueryExport( + request: protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + deleteBigQueryExport( + request: protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + deleteBigQueryExport( + request?: protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteBigQueryExport request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBigQueryExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteBigQueryExport(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteBigQueryExport response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an existing mute config. If no location is specified, default is + * global. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the mute config to delete. The following list shows some + * examples of the format: + * + * + `organizations/{organization}/muteConfigs/{config_id}` + * + + * `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + * + `folders/{folder}/muteConfigs/{config_id}` + * + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + * + `projects/{project}/muteConfigs/{config_id}` + * + `projects/{project}/locations/{location}/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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.delete_mute_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_async + */ + deleteMuteConfig( + request?: protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|undefined, {}|undefined + ]>; + deleteMuteConfig( + request: protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteMuteConfig( + request: protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteMuteConfig( + request?: protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('deleteMuteConfig request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMuteConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteMuteConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteMuteConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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. The following list + * shows some examples of the format: + * + * + + * `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + * + + * `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` + * + + * `projects/[project_id]/locations/[location_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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.delete_notification_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_async + */ + deleteNotificationConfig( + request?: protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|undefined, {}|undefined + ]>; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteNotificationConfig( + request?: protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a ResourceValueConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the ResourceValueConfig to delete + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.delete_resource_value_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_async + */ + deleteResourceValueConfig( + request?: protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|undefined, {}|undefined + ]>; + deleteResourceValueConfig( + request: protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteResourceValueConfig( + request: protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteResourceValueConfig( + request?: protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteResourceValueConfig request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteResourceValueConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteResourceValueConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteResourceValueConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the BigQuery export to retrieve. The following list shows + * some examples of the format: + * + * + + * `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + * + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + * + `projects/{project}locations/{location}//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 {@link protos.google.cloud.securitycenter.v2.BigQueryExport|BigQueryExport}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.get_big_query_export.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_async + */ + getBigQueryExport( + request?: protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|undefined, {}|undefined + ]>; + getBigQueryExport( + request: protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + getBigQueryExport( + request: protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + getBigQueryExport( + request?: protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getBigQueryExport request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBigQueryExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBigQueryExport(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBigQueryExport response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get the simulation by name or the latest simulation for the given + * organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The organization name or simulation name of this simulation + * + * Valid format: + * `organizations/{organization}/simulations/latest` + * `organizations/{organization}/simulations/{simulation}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.Simulation|Simulation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.get_simulation.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GetSimulation_async + */ + getSimulation( + request?: protos.google.cloud.securitycenter.v2.IGetSimulationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.ISimulation, + protos.google.cloud.securitycenter.v2.IGetSimulationRequest|undefined, {}|undefined + ]>; + getSimulation( + request: protos.google.cloud.securitycenter.v2.IGetSimulationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISimulation, + protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, + {}|null|undefined>): void; + getSimulation( + request: protos.google.cloud.securitycenter.v2.IGetSimulationRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISimulation, + protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, + {}|null|undefined>): void; + getSimulation( + request?: protos.google.cloud.securitycenter.v2.IGetSimulationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.ISimulation, + protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.ISimulation, + protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.ISimulation, + protos.google.cloud.securitycenter.v2.IGetSimulationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSimulation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.ISimulation, + protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSimulation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSimulation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.ISimulation, + protos.google.cloud.securitycenter.v2.IGetSimulationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSimulation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get the valued resource by name + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of this valued resource + * + * Valid format: + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_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 {@link protos.google.cloud.securitycenter.v2.ValuedResource|ValuedResource}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.get_valued_resource.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GetValuedResource_async + */ + getValuedResource( + request?: protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IValuedResource, + protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|undefined, {}|undefined + ]>; + getValuedResource( + request: protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IValuedResource, + protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>): void; + getValuedResource( + request: protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IValuedResource, + protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>): void; + getValuedResource( + request?: protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IValuedResource, + protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IValuedResource, + protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IValuedResource, + protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getValuedResource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IValuedResource, + protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getValuedResource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getValuedResource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IValuedResource, + protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getValuedResource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.get_iam_policy.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + 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; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a mute config. If no location is specified, default is + * global. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the mute config to retrieve. The following list shows + * some examples of the format: + * + * + `organizations/{organization}/muteConfigs/{config_id}` + * + + * `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + * + `folders/{folder}/muteConfigs/{config_id}` + * + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + * + `projects/{project}/muteConfigs/{config_id}` + * + `projects/{project}/locations/{location}/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 {@link protos.google.cloud.securitycenter.v2.MuteConfig|MuteConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.get_mute_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GetMuteConfig_async + */ + getMuteConfig( + request?: protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|undefined, {}|undefined + ]>; + getMuteConfig( + request: protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, + {}|null|undefined>): void; + getMuteConfig( + request: protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, + {}|null|undefined>): void; + getMuteConfig( + request?: protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getMuteConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMuteConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getMuteConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getMuteConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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. The following list shows + * some examples of the format: + * + * + + * `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + * + + * `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` + * + + * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.get_notification_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_async + */ + getNotificationConfig( + request?: protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|undefined, {}|undefined + ]>; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>): void; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>): void; + getNotificationConfig( + request?: protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a ResourceValueConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource value config to retrieve. Its format is + * organizations/{organization}/resourceValueConfigs/{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 {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.get_resource_value_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_async + */ + getResourceValueConfig( + request?: protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|undefined, {}|undefined + ]>; + getResourceValueConfig( + request: protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + getResourceValueConfig( + request: protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + getResourceValueConfig( + request?: protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getResourceValueConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getResourceValueConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getResourceValueConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getResourceValueConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.cloud.securitycenter.v2.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.get_source.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GetSource_async + */ + getSource( + request?: protos.google.cloud.securitycenter.v2.IGetSourceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IGetSourceRequest|undefined, {}|undefined + ]>; + getSource( + request: protos.google.cloud.securitycenter.v2.IGetSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, + {}|null|undefined>): void; + getSource( + request: protos.google.cloud.securitycenter.v2.IGetSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, + {}|null|undefined>): void; + getSource( + request?: protos.google.cloud.securitycenter.v2.IGetSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IGetSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IGetSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the state of a finding. If no location is specified, finding is + * assumed to be in global + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The [relative resource + * name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * of the finding. If no location is specified, finding is assumed to be in + * global. The following list shows some examples: + * + * + + * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + * + + * `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + * + + * `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + * + + * `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * @param {google.cloud.securitycenter.v2.Finding.State} request.state + * Required. The desired State of the 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 {@link protos.google.cloud.securitycenter.v2.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.set_finding_state.js + * region_tag:securitycenter_v2_generated_SecurityCenter_SetFindingState_async + */ + setFindingState( + request?: protos.google.cloud.securitycenter.v2.ISetFindingStateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|undefined, {}|undefined + ]>; + setFindingState( + request: protos.google.cloud.securitycenter.v2.ISetFindingStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, + {}|null|undefined>): void; + setFindingState( + request: protos.google.cloud.securitycenter.v2.ISetFindingStateRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, + {}|null|undefined>): void; + setFindingState( + request?: protos.google.cloud.securitycenter.v2.ISetFindingStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setFindingState request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setFindingState response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setFindingState(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|undefined, + {}|undefined + ]) => { + this._log.info('setFindingState response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {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. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.set_iam_policy.js + * region_tag:securitycenter_v2_generated_SecurityCenter_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + 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; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the mute state of a finding. If no location is specified, finding + * is assumed to be in global + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The [relative resource + * name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + * of the finding. If no location is specified, finding is assumed to be in + * global. The following list shows some examples: + * + * + + * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + * + + * `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + * + + * `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + * + + * `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.set_mute.js + * region_tag:securitycenter_v2_generated_SecurityCenter_SetMute_async + */ + setMute( + request?: protos.google.cloud.securitycenter.v2.ISetMuteRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetMuteRequest|undefined, {}|undefined + ]>; + setMute( + request: protos.google.cloud.securitycenter.v2.ISetMuteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, + {}|null|undefined>): void; + setMute( + request: protos.google.cloud.securitycenter.v2.ISetMuteRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, + {}|null|undefined>): void; + setMute( + request?: protos.google.cloud.securitycenter.v2.ISetMuteRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setMute request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setMute response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setMute(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.ISetMuteRequest|undefined, + {}|undefined + ]) => { + this._log.info('setMute response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.test_iam_permissions.js + * region_tag:securitycenter_v2_generated_SecurityCenter_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + 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; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v2.BigQueryExport} request.bigQueryExport + * Required. The BigQuery export 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 {@link protos.google.cloud.securitycenter.v2.BigQueryExport|BigQueryExport}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.update_big_query_export.js + * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateBigQueryExport_async + */ + updateBigQueryExport( + request?: protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|undefined, {}|undefined + ]>; + updateBigQueryExport( + request: protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + updateBigQueryExport( + request: protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>): void; + updateBigQueryExport( + request?: protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'big_query_export.name': request.bigQueryExport!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateBigQueryExport request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBigQueryExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateBigQueryExport(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IBigQueryExport, + protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateBigQueryExport response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates external system. This is for a given finding. If no location is + * specified, finding is assumed to be in global + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.ExternalSystem|ExternalSystem}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.update_external_system.js + * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_async + */ + updateExternalSystem( + request?: protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IExternalSystem, + protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|undefined, {}|undefined + ]>; + updateExternalSystem( + request: protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IExternalSystem, + protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, + {}|null|undefined>): void; + updateExternalSystem( + request: protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IExternalSystem, + protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, + {}|null|undefined>): void; + updateExternalSystem( + request?: protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IExternalSystem, + protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IExternalSystem, + protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IExternalSystem, + protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'external_system.name': request.externalSystem!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateExternalSystem request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IExternalSystem, + protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExternalSystem response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateExternalSystem(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IExternalSystem, + protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateExternalSystem response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates or updates a finding. If no location is specified, finding is + * assumed to be in global. 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.v2.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 {@link protos.google.cloud.securitycenter.v2.Finding|Finding}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.update_finding.js + * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateFinding_async + */ + updateFinding( + request?: protos.google.cloud.securitycenter.v2.IUpdateFindingRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|undefined, {}|undefined + ]>; + updateFinding( + request: protos.google.cloud.securitycenter.v2.IUpdateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, + {}|null|undefined>): void; + updateFinding( + request: protos.google.cloud.securitycenter.v2.IUpdateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, + {}|null|undefined>): void; + updateFinding( + request?: protos.google.cloud.securitycenter.v2.IUpdateFindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'finding.name': request.finding!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateFinding request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateFinding(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IFinding, + protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateFinding response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a mute config. If no location is specified, default is + * global. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.MuteConfig|MuteConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.update_mute_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_async + */ + updateMuteConfig( + request?: protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|undefined, {}|undefined + ]>; + updateMuteConfig( + request: protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, + {}|null|undefined>): void; + updateMuteConfig( + request: protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, + {}|null|undefined>): void; + updateMuteConfig( + request?: protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.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 || {}; + let routingParameter = {}; + { + const fieldValue = request.muteConfig?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.muteConfig?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.muteConfig?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('updateMuteConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateMuteConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateMuteConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IMuteConfig, + protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateMuteConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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.v2.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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|NotificationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.update_notification_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_async + */ + updateNotificationConfig( + request?: protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|undefined, {}|undefined + ]>; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>): void; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>): void; + updateNotificationConfig( + request?: protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateNotificationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateNotificationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateNotificationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.INotificationConfig, + protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateNotificationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates an existing ResourceValueConfigs with new rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v2.ResourceValueConfig} request.resourceValueConfig + * Required. The resource value config being updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * If empty all mutable fields will be updated. + * + * To update nested fields, include the top level field in the mask + * For example, to update gcp_metadata.resource_type, include the + * "gcp_metadata" 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 {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.update_resource_value_config.js + * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_async + */ + updateResourceValueConfig( + request?: protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|undefined, {}|undefined + ]>; + updateResourceValueConfig( + request: protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + updateResourceValueConfig( + request: protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>): void; + updateResourceValueConfig( + request?: protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource_value_config.name': request.resourceValueConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateResourceValueConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateResourceValueConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateResourceValueConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.IResourceValueConfig, + protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateResourceValueConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates security marks. For Finding Security marks, if no location is + * specified, finding is assumed to be in global. Assets Security Marks can + * only be accessed through global endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v2.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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.SecurityMarks|SecurityMarks}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.update_security_marks.js + * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_async + */ + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.ISecurityMarks, + protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|undefined, {}|undefined + ]>; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISecurityMarks, + protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>): void; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISecurityMarks, + protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>): void; + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.ISecurityMarks, + protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.ISecurityMarks, + protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.ISecurityMarks, + protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSecurityMarks request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.ISecurityMarks, + protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSecurityMarks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSecurityMarks(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.ISecurityMarks, + protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSecurityMarks response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.Source|Source}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.update_source.js + * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateSource_async + */ + updateSource( + request?: protos.google.cloud.securitycenter.v2.IUpdateSourceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|undefined, {}|undefined + ]>; + updateSource( + request: protos.google.cloud.securitycenter.v2.IUpdateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, + {}|null|undefined>): void; + updateSource( + request: protos.google.cloud.securitycenter.v2.IUpdateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, + {}|null|undefined>): void; + updateSource( + request?: protos.google.cloud.securitycenter.v2.IUpdateSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'source.name': request.source!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.securitycenter.v2.ISource, + protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSource response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Kicks off an LRO to bulk mute findings for a parent based on a filter. If + * no location is specified, findings are muted in global. 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. If no + * location is specified, findings are updated in global. The following list + * shows some examples: + * + * + `organizations/[organization_id]` + * + `organizations/[organization_id]/locations/[location_id]` + * + `folders/[folder_id]` + * + `folders/[folder_id]/locations/[location_id]` + * + `projects/[project_id]` + * + `projects/[project_id]/locations/[location_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 {google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState} [request.muteState] + * Optional. All findings matching the given filter will have their mute state + * set to this value. The default value is `MUTED`. Setting this to + * `UNDEFINED` will clear the mute state on all matching findings. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.bulk_mute_findings.js + * region_tag:securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_async + */ + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v2.IBulkMuteFindingsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v2.IBulkMuteFindingsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v2.IBulkMuteFindingsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v2.IBulkMuteFindingsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('bulkMuteFindings response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('bulkMuteFindings request %j', request); + return this.innerApiCalls.bulkMuteFindings(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('bulkMuteFindings response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.bulk_mute_findings.js + * region_tag:securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_async + */ + async checkBulkMuteFindingsProgress(name: string): Promise>{ + this._log.info('bulkMuteFindings long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.bulkMuteFindings, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Filters an organization or source's findings and groups them by their + * specified properties in a location. If no location is specified, findings + * are assumed to be in global + * + * To group across all sources provide a `-` as the source id. + * The following list shows some examples: + * + * + `/v2/organizations/{organization_id}/sources/-/findings` + * + + * `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + * + `/v2/folders/{folder_id}/sources/-/findings` + * + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` + * + `/v2/projects/{project_id}/sources/-/findings` + * + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. If no location is specified, + * finding is assumed to be in global. + * The following list shows some examples: + * + * + `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + * + `folders/[folder_id]/sources/[source_id]` + * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + * + `projects/[project_id]/sources/[source_id]` + * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + * + * To groupBy across all sources provide a source_id of `-`. The following + * list shows some examples: + * + * + `organizations/{organization_id}/sources/-` + * + `organizations/{organization_id}/sources/-/locations/[location_id]` + * + `folders/{folder_id}/sources/-` + * + `folders/{folder_id}/sources/-/locations/[location_id]` + * + `projects/{project_id}/sources/-` + * + `projects/{project_id}/sources/-/locations/[location_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 + * 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 + * * 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: `=`, `:` + * * security_marks.marks: `=`, `:` + * * 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. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: "parent,resource_name". + * @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 {@link protos.google.cloud.securitycenter.v2.GroupResult|GroupResult}. + * 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 `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + groupFindings( + request?: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IGroupResult[], + protos.google.cloud.securitycenter.v2.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v2.IGroupFindingsResponse + ]>; + groupFindings( + request: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IGroupResult>): void; + groupFindings( + request: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IGroupResult>): void; + groupFindings( + request?: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IGroupResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IGroupResult>): + Promise<[ + protos.google.cloud.securitycenter.v2.IGroupResult[], + protos.google.cloud.securitycenter.v2.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v2.IGroupFindingsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IGroupResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('groupFindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('groupFindings request %j', request); + return this.innerApiCalls + .groupFindings(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.IGroupResult[], + protos.google.cloud.securitycenter.v2.IGroupFindingsRequest|null, + protos.google.cloud.securitycenter.v2.IGroupFindingsResponse + ]) => { + this._log.info('groupFindings values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `groupFindings`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. If no location is specified, + * finding is assumed to be in global. + * The following list shows some examples: + * + * + `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + * + `folders/[folder_id]/sources/[source_id]` + * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + * + `projects/[project_id]/sources/[source_id]` + * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + * + * To groupBy across all sources provide a source_id of `-`. The following + * list shows some examples: + * + * + `organizations/{organization_id}/sources/-` + * + `organizations/{organization_id}/sources/-/locations/[location_id]` + * + `folders/{folder_id}/sources/-` + * + `folders/{folder_id}/sources/-/locations/[location_id]` + * + `projects/{project_id}/sources/-` + * + `projects/{project_id}/sources/-/locations/[location_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 + * 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 + * * 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: `=`, `:` + * * security_marks.marks: `=`, `:` + * * 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. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: "parent,resource_name". + * @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 {@link protos.google.cloud.securitycenter.v2.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + groupFindingsStream( + request?: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupFindings stream %j', request); + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * Required. Name of the source to groupBy. If no location is specified, + * finding is assumed to be in global. + * The following list shows some examples: + * + * + `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + * + `folders/[folder_id]/sources/[source_id]` + * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + * + `projects/[project_id]/sources/[source_id]` + * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + * + * To groupBy across all sources provide a source_id of `-`. The following + * list shows some examples: + * + * + `organizations/{organization_id}/sources/-` + * + `organizations/{organization_id}/sources/-/locations/[location_id]` + * + `folders/{folder_id}/sources/-` + * + `folders/{folder_id}/sources/-/locations/[location_id]` + * + `projects/{project_id}/sources/-` + * + `projects/{project_id}/sources/-/locations/[location_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 + * 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 + * * 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: `=`, `:` + * * security_marks.marks: `=`, `:` + * * 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. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: "parent,resource_name". + * @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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.group_findings.js + * region_tag:securitycenter_v2_generated_SecurityCenter_GroupFindings_async + */ + groupFindingsAsync( + request?: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('groupFindings iterate %j', request); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the attack paths for a set of simulation results or valued resources + * and filter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list attack paths. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + * @param {string} request.filter + * The filter expression that filters the attack path in the response. + * Supported fields: + * + * * `valued_resources` supports = + * @param {string} request.pageToken + * The value returned by the last `ListAttackPathsResponse`; indicates + * that this is a continuation of a prior `ListAttackPaths` 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 {@link protos.google.cloud.securitycenter.v2.AttackPath|AttackPath}. + * 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 `listAttackPathsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAttackPaths( + request?: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IAttackPath[], + protos.google.cloud.securitycenter.v2.IListAttackPathsRequest|null, + protos.google.cloud.securitycenter.v2.IListAttackPathsResponse + ]>; + listAttackPaths( + request: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IAttackPath>): void; + listAttackPaths( + request: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IAttackPath>): void; + listAttackPaths( + request?: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IAttackPath>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IAttackPath>): + Promise<[ + protos.google.cloud.securitycenter.v2.IAttackPath[], + protos.google.cloud.securitycenter.v2.IListAttackPathsRequest|null, + protos.google.cloud.securitycenter.v2.IListAttackPathsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IAttackPath>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAttackPaths values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAttackPaths request %j', request); + return this.innerApiCalls + .listAttackPaths(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.IAttackPath[], + protos.google.cloud.securitycenter.v2.IListAttackPathsRequest|null, + protos.google.cloud.securitycenter.v2.IListAttackPathsResponse + ]) => { + this._log.info('listAttackPaths values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAttackPaths`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list attack paths. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + * @param {string} request.filter + * The filter expression that filters the attack path in the response. + * Supported fields: + * + * * `valued_resources` supports = + * @param {string} request.pageToken + * The value returned by the last `ListAttackPathsResponse`; indicates + * that this is a continuation of a prior `ListAttackPaths` 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 {@link protos.google.cloud.securitycenter.v2.AttackPath|AttackPath} 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 `listAttackPathsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAttackPathsStream( + request?: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAttackPaths']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAttackPaths stream %j', request); + return this.descriptors.page.listAttackPaths.createStream( + this.innerApiCalls.listAttackPaths as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAttackPaths`, 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. Name of parent to list attack paths. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + * @param {string} request.filter + * The filter expression that filters the attack path in the response. + * Supported fields: + * + * * `valued_resources` supports = + * @param {string} request.pageToken + * The value returned by the last `ListAttackPathsResponse`; indicates + * that this is a continuation of a prior `ListAttackPaths` 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.AttackPath|AttackPath}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.list_attack_paths.js + * region_tag:securitycenter_v2_generated_SecurityCenter_ListAttackPaths_async + */ + listAttackPathsAsync( + request?: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAttackPaths']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAttackPaths iterate %j', request); + return this.descriptors.page.listAttackPaths.asyncIterate( + this.innerApiCalls['listAttackPaths'] as GaxCall, + request as {}, + 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]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBigQueryExports( + request?: protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IBigQueryExport[], + protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest|null, + protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse + ]>; + listBigQueryExports( + request: protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IBigQueryExport>): void; + listBigQueryExports( + request: protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IBigQueryExport>): void; + listBigQueryExports( + request?: protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IBigQueryExport>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IBigQueryExport>): + Promise<[ + protos.google.cloud.securitycenter.v2.IBigQueryExport[], + protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest|null, + protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, + protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IBigQueryExport>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBigQueryExports values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBigQueryExports request %j', request); + return this.innerApiCalls + .listBigQueryExports(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.IBigQueryExport[], + protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest|null, + protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse + ]) => { + this._log.info('listBigQueryExports values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBigQueryExports`, 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]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBigQueryExportsStream( + request?: protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBigQueryExports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBigQueryExports stream %j', request); + return this.descriptors.page.listBigQueryExports.createStream( + this.innerApiCalls.listBigQueryExports as 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]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, or + * `projects/[project_id]/locations/[location_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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.list_big_query_exports.js + * region_tag:securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_async + */ + listBigQueryExportsAsync( + request?: protos.google.cloud.securitycenter.v2.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBigQueryExports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBigQueryExports iterate %j', request); + return this.descriptors.page.listBigQueryExports.asyncIterate( + this.innerApiCalls['listBigQueryExports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists an organization or source's findings. + * + * To list across all sources for a given location provide a `-` as the source + * id. If no location is specified, finding are assumed to be in global. + * The following list shows some examples: + * + * + `/v2/organizations/{organization_id}/sources/-/findings` + * + + * `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. If no location is + * specified, the default is global. The following list shows some examples: + * + * + `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + * + `folders/[folder_id]/sources/[source_id]` + * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + * + `projects/[project_id]/sources/[source_id]` + * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + * + * To list across all sources provide a source_id of `-`. The following + * list shows some examples: + * + * + `organizations/{organization_id}/sources/-` + * + `organizations/{organization_id}/sources/-/locations/{location_id}` + * + `folders/{folder_id}/sources/-` + * + `folders/{folder_id}/sources/-locations/{location_id}` + * + `projects/{projects_id}/sources/-` + * + `projects/{projects_id}/sources/-/locations/{location_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 + * 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 + * * 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: `=`, `:` + * * security_marks.marks: `=`, `:` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * 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 + * example: "name,parent". 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,parent". Redundant space characters in the + * syntax are insignificant. "name desc,parent" and " + * name desc , parent " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * security_marks.marks + * @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 + * 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 {@link protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult|ListFindingsResult}. + * 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFindings( + request?: protos.google.cloud.securitycenter.v2.IListFindingsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v2.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v2.IListFindingsResponse + ]>; + listFindings( + request: protos.google.cloud.securitycenter.v2.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListFindingsRequest, + protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>): void; + listFindings( + request: protos.google.cloud.securitycenter.v2.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListFindingsRequest, + protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>): void; + listFindings( + request?: protos.google.cloud.securitycenter.v2.IListFindingsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IListFindingsRequest, + protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListFindingsRequest, + protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>): + Promise<[ + protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v2.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v2.IListFindingsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListFindingsRequest, + protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFindings request %j', request); + return this.innerApiCalls + .listFindings(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v2.IListFindingsRequest|null, + protos.google.cloud.securitycenter.v2.IListFindingsResponse + ]) => { + this._log.info('listFindings values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listFindings`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. If no location is + * specified, the default is global. The following list shows some examples: + * + * + `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + * + `folders/[folder_id]/sources/[source_id]` + * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + * + `projects/[project_id]/sources/[source_id]` + * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + * + * To list across all sources provide a source_id of `-`. The following + * list shows some examples: + * + * + `organizations/{organization_id}/sources/-` + * + `organizations/{organization_id}/sources/-/locations/{location_id}` + * + `folders/{folder_id}/sources/-` + * + `folders/{folder_id}/sources/-locations/{location_id}` + * + `projects/{projects_id}/sources/-` + * + `projects/{projects_id}/sources/-/locations/{location_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 + * 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 + * * 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: `=`, `:` + * * security_marks.marks: `=`, `:` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * 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 + * example: "name,parent". 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,parent". Redundant space characters in the + * syntax are insignificant. "name desc,parent" and " + * name desc , parent " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * security_marks.marks + * @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 + * 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 {@link protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFindingsStream( + request?: protos.google.cloud.securitycenter.v2.IListFindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFindings stream %j', request); + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * Required. Name of the source the findings belong to. If no location is + * specified, the default is global. The following list shows some examples: + * + * + `organizations/[organization_id]/sources/[source_id]` + * + + * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + * + `folders/[folder_id]/sources/[source_id]` + * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + * + `projects/[project_id]/sources/[source_id]` + * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + * + * To list across all sources provide a source_id of `-`. The following + * list shows some examples: + * + * + `organizations/{organization_id}/sources/-` + * + `organizations/{organization_id}/sources/-/locations/{location_id}` + * + `folders/{folder_id}/sources/-` + * + `folders/{folder_id}/sources/-locations/{location_id}` + * + `projects/{projects_id}/sources/-` + * + `projects/{projects_id}/sources/-/locations/{location_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 + * 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 + * * 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: `=`, `:` + * * security_marks.marks: `=`, `:` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * 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 + * example: "name,parent". 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,parent". Redundant space characters in the + * syntax are insignificant. "name desc,parent" and " + * name desc , parent " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * security_marks.marks + * @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 + * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.list_findings.js + * region_tag:securitycenter_v2_generated_SecurityCenter_ListFindings_async + */ + listFindingsAsync( + request?: protos.google.cloud.securitycenter.v2.IListFindingsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFindings iterate %j', request); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists mute configs. If no location is specified, default is + * global. + * + * @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]`, + * `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, + * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMuteConfigs( + request?: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IMuteConfig[], + protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest|null, + protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse + ]>; + listMuteConfigs( + request: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IMuteConfig>): void; + listMuteConfigs( + request: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IMuteConfig>): void; + listMuteConfigs( + request?: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IMuteConfig>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IMuteConfig>): + Promise<[ + protos.google.cloud.securitycenter.v2.IMuteConfig[], + protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest|null, + protos.google.cloud.securitycenter.v2.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 || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IMuteConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMuteConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMuteConfigs request %j', request); + return this.innerApiCalls + .listMuteConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.IMuteConfig[], + protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest|null, + protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse + ]) => { + this._log.info('listMuteConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listMuteConfigs`, 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]`, + * `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, + * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMuteConfigsStream( + request?: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMuteConfigs stream %j', request); + return this.descriptors.page.listMuteConfigs.createStream( + this.innerApiCalls.listMuteConfigs as 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]`, + * `organizations/[organization_id]/locations/[location_id]`, + * `folders/[folder_id]/locations/[location_id]`, + * `projects/[project_id]/locations/[location_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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.list_mute_configs.js + * region_tag:securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_async + */ + listMuteConfigsAsync( + request?: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMuteConfigs iterate %j', request); + return this.descriptors.page.listMuteConfigs.asyncIterate( + this.innerApiCalls['listMuteConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists notification configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent in which to list the notification + * configurations. Its format is + * "organizations/[organization_id]/locations/[location_id]", + * "folders/[folder_id]/locations/[location_id]", or + * "projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.INotificationConfig[], + protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse + ]>; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.INotificationConfig>): void; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.INotificationConfig>): void; + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.INotificationConfig>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.INotificationConfig>): + Promise<[ + protos.google.cloud.securitycenter.v2.INotificationConfig[], + protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.INotificationConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listNotificationConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listNotificationConfigs request %j', request); + return this.innerApiCalls + .listNotificationConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.INotificationConfig[], + protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest|null, + protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse + ]) => { + this._log.info('listNotificationConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listNotificationConfigs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent in which to list the notification + * configurations. Its format is + * "organizations/[organization_id]/locations/[location_id]", + * "folders/[folder_id]/locations/[location_id]", or + * "projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listNotificationConfigsStream( + request?: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listNotificationConfigs stream %j', request); + return this.descriptors.page.listNotificationConfigs.createStream( + this.innerApiCalls.listNotificationConfigs as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * Required. The name of the parent in which to list the notification + * configurations. Its format is + * "organizations/[organization_id]/locations/[location_id]", + * "folders/[folder_id]/locations/[location_id]", or + * "projects/[project_id]/locations/[location_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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.list_notification_configs.js + * region_tag:securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_async + */ + listNotificationConfigsAsync( + request?: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listNotificationConfigs iterate %j', request); + return this.descriptors.page.listNotificationConfigs.asyncIterate( + this.innerApiCalls['listNotificationConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all ResourceValueConfigs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of resource value configs. + * Its format is + * `organizations/[organization_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 `ListResourceValueConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListResourceValueConfigs` must match the call that provided the + * page token. + * + * page_size can be specified, and the new page_size will be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig}. + * 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 `listResourceValueConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listResourceValueConfigs( + request?: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IResourceValueConfig[], + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest|null, + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse + ]>; + listResourceValueConfigs( + request: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IResourceValueConfig>): void; + listResourceValueConfigs( + request: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IResourceValueConfig>): void; + listResourceValueConfigs( + request?: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IResourceValueConfig>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IResourceValueConfig>): + Promise<[ + protos.google.cloud.securitycenter.v2.IResourceValueConfig[], + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest|null, + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IResourceValueConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listResourceValueConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listResourceValueConfigs request %j', request); + return this.innerApiCalls + .listResourceValueConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.IResourceValueConfig[], + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest|null, + protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse + ]) => { + this._log.info('listResourceValueConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listResourceValueConfigs`, 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 resource value configs. + * Its format is + * `organizations/[organization_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 `ListResourceValueConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListResourceValueConfigs` must match the call that provided the + * page token. + * + * page_size can be specified, and the new page_size will be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig} 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 `listResourceValueConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listResourceValueConfigsStream( + request?: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listResourceValueConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listResourceValueConfigs stream %j', request); + return this.descriptors.page.listResourceValueConfigs.createStream( + this.innerApiCalls.listResourceValueConfigs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listResourceValueConfigs`, 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 resource value configs. + * Its format is + * `organizations/[organization_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 `ListResourceValueConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListResourceValueConfigs` must match the call that provided the + * page token. + * + * page_size can be specified, and the new page_size will be used. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.list_resource_value_configs.js + * region_tag:securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_async + */ + listResourceValueConfigsAsync( + request?: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listResourceValueConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listResourceValueConfigs iterate %j', request); + return this.descriptors.page.listResourceValueConfigs.asyncIterate( + this.innerApiCalls['listResourceValueConfigs'] as GaxCall, + request as {}, + 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 {@link protos.google.cloud.securitycenter.v2.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSources( + request?: protos.google.cloud.securitycenter.v2.IListSourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.ISource[], + protos.google.cloud.securitycenter.v2.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v2.IListSourcesResponse + ]>; + listSources( + request: protos.google.cloud.securitycenter.v2.IListSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListSourcesRequest, + protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ISource>): void; + listSources( + request: protos.google.cloud.securitycenter.v2.IListSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListSourcesRequest, + protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ISource>): void; + listSources( + request?: protos.google.cloud.securitycenter.v2.IListSourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IListSourcesRequest, + protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ISource>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListSourcesRequest, + protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ISource>): + Promise<[ + protos.google.cloud.securitycenter.v2.ISource[], + protos.google.cloud.securitycenter.v2.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v2.IListSourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListSourcesRequest, + protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.ISource>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSources request %j', request); + return this.innerApiCalls + .listSources(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.ISource[], + protos.google.cloud.securitycenter.v2.IListSourcesRequest|null, + protos.google.cloud.securitycenter.v2.IListSourcesResponse + ]) => { + this._log.info('listSources values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSources`, but returns a NodeJS Stream object. + * @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 {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v2.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSourcesStream( + request?: protos.google.cloud.securitycenter.v2.IListSourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSources stream %j', request); + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as GaxCall, + request, + callSettings + ); + } + +/** + * 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 + * 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 {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.list_sources.js + * region_tag:securitycenter_v2_generated_SecurityCenter_ListSources_async + */ + listSourcesAsync( + request?: protos.google.cloud.securitycenter.v2.IListSourcesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSources iterate %j', request); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the valued resources for a set of simulation results and filter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list exposed resources. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * @param {string} request.filter + * The filter expression that filters the valued resources in the response. + * Supported fields: + * + * * `resource_value` supports = + * * `resource_type` supports = + * @param {string} request.pageToken + * The value returned by the last `ListValuedResourcesResponse`; indicates + * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] + * Optional. The fields by which to order the valued resources response. + * + * Supported fields: + * + * * `exposed_score` + * + * * `resource_value` + * + * * `resource_type` + * + * Values should be a comma separated list of fields. For example: + * `exposed_score,resource_value`. + * + * The default sorting order is descending. To specify ascending or descending + * order for a field, append a " ASC" or a " DESC" suffix, respectively; for + * example: `exposed_score DESC`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v2.ValuedResource|ValuedResource}. + * 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 `listValuedResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listValuedResources( + request?: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.securitycenter.v2.IValuedResource[], + protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest|null, + protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse + ]>; + listValuedResources( + request: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IValuedResource>): void; + listValuedResources( + request: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IValuedResource>): void; + listValuedResources( + request?: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IValuedResource>, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IValuedResource>): + Promise<[ + protos.google.cloud.securitycenter.v2.IValuedResource[], + protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest|null, + protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, + protos.google.cloud.securitycenter.v2.IValuedResource>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listValuedResources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listValuedResources request %j', request); + return this.innerApiCalls + .listValuedResources(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.securitycenter.v2.IValuedResource[], + protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest|null, + protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse + ]) => { + this._log.info('listValuedResources values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listValuedResources`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of parent to list exposed resources. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * @param {string} request.filter + * The filter expression that filters the valued resources in the response. + * Supported fields: + * + * * `resource_value` supports = + * * `resource_type` supports = + * @param {string} request.pageToken + * The value returned by the last `ListValuedResourcesResponse`; indicates + * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] + * Optional. The fields by which to order the valued resources response. + * + * Supported fields: + * + * * `exposed_score` + * + * * `resource_value` + * + * * `resource_type` + * + * Values should be a comma separated list of fields. For example: + * `exposed_score,resource_value`. + * + * The default sorting order is descending. To specify ascending or descending + * order for a field, append a " ASC" or a " DESC" suffix, respectively; for + * example: `exposed_score DESC`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v2.ValuedResource|ValuedResource} 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 `listValuedResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listValuedResourcesStream( + request?: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listValuedResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listValuedResources stream %j', request); + return this.descriptors.page.listValuedResources.createStream( + this.innerApiCalls.listValuedResources as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listValuedResources`, 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. Name of parent to list exposed resources. + * + * Valid formats: + * `organizations/{organization}`, + * `organizations/{organization}/simulations/{simulation}` + * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + * @param {string} request.filter + * The filter expression that filters the valued resources in the response. + * Supported fields: + * + * * `resource_value` supports = + * * `resource_type` supports = + * @param {string} request.pageToken + * The value returned by the last `ListValuedResourcesResponse`; indicates + * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] + * Optional. The fields by which to order the valued resources response. + * + * Supported fields: + * + * * `exposed_score` + * + * * `resource_value` + * + * * `resource_type` + * + * Values should be a comma separated list of fields. For example: + * `exposed_score,resource_value`. + * + * The default sorting order is descending. To specify ascending or descending + * order for a field, append a " ASC" or a " DESC" suffix, respectively; for + * example: `exposed_score DESC`. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.securitycenter.v2.ValuedResource|ValuedResource}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/security_center.list_valued_resources.js + * region_tag:securitycenter_v2_generated_SecurityCenter_ListValuedResources_async + */ + listValuedResourcesAsync( + request?: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listValuedResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listValuedResources iterate %j', request); + return this.descriptors.page.listValuedResources.asyncIterate( + this.innerApiCalls['listValuedResources'] as GaxCall, + request as {}, + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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, + optionsOrCallback?: + | 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]> { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, + optionsOrCallback?: + | 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 { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAssetSecurityMarks resource name string. + * + * @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 folderConstraintName resource name string. + * + * @param {string} folder + * @param {string} constraint_name + * @returns {string} Resource name string. + */ + folderConstraintNamePath(folder:string,constraintName:string) { + return this.pathTemplates.folderConstraintNamePathTemplate.render({ + folder: folder, + constraint_name: constraintName, + }); + } + + /** + * Parse the folder from FolderConstraintName resource. + * + * @param {string} folderConstraintNameName + * A fully-qualified path representing folder_constraint_name resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderConstraintNameName(folderConstraintNameName: string) { + return this.pathTemplates.folderConstraintNamePathTemplate.match(folderConstraintNameName).folder; + } + + /** + * Parse the constraint_name from FolderConstraintName resource. + * + * @param {string} folderConstraintNameName + * A fully-qualified path representing folder_constraint_name resource. + * @returns {string} A string representing the constraint_name. + */ + matchConstraintNameFromFolderConstraintNameName(folderConstraintNameName: string) { + return this.pathTemplates.folderConstraintNamePathTemplate.match(folderConstraintNameName).constraint_name; + } + + /** + * Return a fully-qualified folderLocationBigQueryExports resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} exportParam + * @returns {string} Resource name string. + */ + folderLocationBigQueryExportsPath(folder:string,location:string,exportParam:string) { + return this.pathTemplates.folderLocationBigQueryExportsPathTemplate.render({ + folder: folder, + location: location, + export: exportParam, + }); + } + + /** + * Parse the folder from FolderLocationBigQueryExports resource. + * + * @param {string} folderLocationBigQueryExportsName + * A fully-qualified path representing folder_location_bigQueryExports resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBigQueryExportsName(folderLocationBigQueryExportsName: string) { + return this.pathTemplates.folderLocationBigQueryExportsPathTemplate.match(folderLocationBigQueryExportsName).folder; + } + + /** + * Parse the location from FolderLocationBigQueryExports resource. + * + * @param {string} folderLocationBigQueryExportsName + * A fully-qualified path representing folder_location_bigQueryExports resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBigQueryExportsName(folderLocationBigQueryExportsName: string) { + return this.pathTemplates.folderLocationBigQueryExportsPathTemplate.match(folderLocationBigQueryExportsName).location; + } + + /** + * Parse the export from FolderLocationBigQueryExports resource. + * + * @param {string} folderLocationBigQueryExportsName + * A fully-qualified path representing folder_location_bigQueryExports resource. + * @returns {string} A string representing the export. + */ + matchExportFromFolderLocationBigQueryExportsName(folderLocationBigQueryExportsName: string) { + return this.pathTemplates.folderLocationBigQueryExportsPathTemplate.match(folderLocationBigQueryExportsName).export; + } + + /** + * Return a fully-qualified folderLocationMuteConfigs resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} mute_config + * @returns {string} Resource name string. + */ + folderLocationMuteConfigsPath(folder:string,location:string,muteConfig:string) { + return this.pathTemplates.folderLocationMuteConfigsPathTemplate.render({ + folder: folder, + location: location, + mute_config: muteConfig, + }); + } + + /** + * Parse the folder from FolderLocationMuteConfigs resource. + * + * @param {string} folderLocationMuteConfigsName + * A fully-qualified path representing folder_location_muteConfigs resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { + return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).folder; + } + + /** + * Parse the location from FolderLocationMuteConfigs resource. + * + * @param {string} folderLocationMuteConfigsName + * A fully-qualified path representing folder_location_muteConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { + return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).location; + } + + /** + * Parse the mute_config from FolderLocationMuteConfigs resource. + * + * @param {string} folderLocationMuteConfigsName + * A fully-qualified path representing folder_location_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { + return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified folderLocationNotificationConfigs resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} notification_config + * @returns {string} Resource name string. + */ + folderLocationNotificationConfigsPath(folder:string,location:string,notificationConfig:string) { + return this.pathTemplates.folderLocationNotificationConfigsPathTemplate.render({ + folder: folder, + location: location, + notification_config: notificationConfig, + }); + } + + /** + * Parse the folder from FolderLocationNotificationConfigs resource. + * + * @param {string} folderLocationNotificationConfigsName + * A fully-qualified path representing folder_location_notificationConfigs resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationNotificationConfigsName(folderLocationNotificationConfigsName: string) { + return this.pathTemplates.folderLocationNotificationConfigsPathTemplate.match(folderLocationNotificationConfigsName).folder; + } + + /** + * Parse the location from FolderLocationNotificationConfigs resource. + * + * @param {string} folderLocationNotificationConfigsName + * A fully-qualified path representing folder_location_notificationConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationNotificationConfigsName(folderLocationNotificationConfigsName: string) { + return this.pathTemplates.folderLocationNotificationConfigsPathTemplate.match(folderLocationNotificationConfigsName).location; + } + + /** + * Parse the notification_config from FolderLocationNotificationConfigs resource. + * + * @param {string} folderLocationNotificationConfigsName + * A fully-qualified path representing folder_location_notificationConfigs resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromFolderLocationNotificationConfigsName(folderLocationNotificationConfigsName: string) { + return this.pathTemplates.folderLocationNotificationConfigsPathTemplate.match(folderLocationNotificationConfigsName).notification_config; + } + + /** + * Return a fully-qualified folderMuteConfigs resource name string. + * + * @param {string} folder + * @param {string} mute_config + * @returns {string} Resource name string. + */ + folderMuteConfigsPath(folder:string,muteConfig:string) { + return this.pathTemplates.folderMuteConfigsPathTemplate.render({ + folder: folder, + mute_config: muteConfig, + }); + } + + /** + * Parse the folder from FolderMuteConfigs resource. + * + * @param {string} folderMuteConfigsName + * A fully-qualified path representing folder_muteConfigs resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMuteConfigsName(folderMuteConfigsName: string) { + return this.pathTemplates.folderMuteConfigsPathTemplate.match(folderMuteConfigsName).folder; + } + + /** + * Parse the mute_config from FolderMuteConfigs resource. + * + * @param {string} folderMuteConfigsName + * A fully-qualified path representing folder_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromFolderMuteConfigsName(folderMuteConfigsName: string) { + return this.pathTemplates.folderMuteConfigsPathTemplate.match(folderMuteConfigsName).mute_config; + } + + /** + * 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 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. + * + * @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; + } + + /** + * Return a fully-qualified folderSourceFindings resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingsPath(folder:string,source:string,finding:string) { + return this.pathTemplates.folderSourceFindingsPathTemplate.render({ + folder: folder, + source: source, + finding: finding, + }); + } + + /** + * Parse the folder from FolderSourceFindings resource. + * + * @param {string} folderSourceFindingsName + * A fully-qualified path representing folder_source_findings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingsName(folderSourceFindingsName: string) { + return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).folder; + } + + /** + * Parse the source from FolderSourceFindings resource. + * + * @param {string} folderSourceFindingsName + * A fully-qualified path representing folder_source_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingsName(folderSourceFindingsName: string) { + return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).source; + } + + /** + * Parse the finding from FolderSourceFindings resource. + * + * @param {string} folderSourceFindingsName + * A fully-qualified path representing folder_source_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingsName(folderSourceFindingsName: string) { + return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).finding; + } + + /** + * Return a fully-qualified folderSourceLocationFindingExternalsystem resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} location + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + folderSourceLocationFindingExternalsystemPath(folder:string,source:string,location:string,finding:string,externalsystem:string) { + return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.render({ + folder: folder, + source: source, + location: location, + finding: finding, + externalsystem: externalsystem, + }); + } + + /** + * Parse the folder from FolderSourceLocationFindingExternalsystem resource. + * + * @param {string} folderSourceLocationFindingExternalsystemName + * A fully-qualified path representing folder_source_location_finding_externalsystem resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).folder; + } + + /** + * Parse the source from FolderSourceLocationFindingExternalsystem resource. + * + * @param {string} folderSourceLocationFindingExternalsystemName + * A fully-qualified path representing folder_source_location_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).source; + } + + /** + * Parse the location from FolderSourceLocationFindingExternalsystem resource. + * + * @param {string} folderSourceLocationFindingExternalsystemName + * A fully-qualified path representing folder_source_location_finding_externalsystem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).location; + } + + /** + * Parse the finding from FolderSourceLocationFindingExternalsystem resource. + * + * @param {string} folderSourceLocationFindingExternalsystemName + * A fully-qualified path representing folder_source_location_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).finding; + } + + /** + * Parse the externalsystem from FolderSourceLocationFindingExternalsystem resource. + * + * @param {string} folderSourceLocationFindingExternalsystemName + * A fully-qualified path representing folder_source_location_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).externalsystem; + } + + /** + * Return a fully-qualified folderSourceLocationFindingSecurityMarks resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} location + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceLocationFindingSecurityMarksPath(folder:string,source:string,location:string,finding:string) { + return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.render({ + folder: folder, + source: source, + location: location, + finding: finding, + }); + } + + /** + * Parse the folder from FolderSourceLocationFindingSecurityMarks resource. + * + * @param {string} folderSourceLocationFindingSecurityMarksName + * A fully-qualified path representing folder_source_location_finding_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceLocationFindingSecurityMarksName(folderSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match(folderSourceLocationFindingSecurityMarksName).folder; + } + + /** + * Parse the source from FolderSourceLocationFindingSecurityMarks resource. + * + * @param {string} folderSourceLocationFindingSecurityMarksName + * A fully-qualified path representing folder_source_location_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceLocationFindingSecurityMarksName(folderSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match(folderSourceLocationFindingSecurityMarksName).source; + } + + /** + * Parse the location from FolderSourceLocationFindingSecurityMarks resource. + * + * @param {string} folderSourceLocationFindingSecurityMarksName + * A fully-qualified path representing folder_source_location_finding_securityMarks resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderSourceLocationFindingSecurityMarksName(folderSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match(folderSourceLocationFindingSecurityMarksName).location; + } + + /** + * Parse the finding from FolderSourceLocationFindingSecurityMarks resource. + * + * @param {string} folderSourceLocationFindingSecurityMarksName + * A fully-qualified path representing folder_source_location_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceLocationFindingSecurityMarksName(folderSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match(folderSourceLocationFindingSecurityMarksName).finding; + } + + /** + * Return a fully-qualified folderSourceLocationFindings resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} location + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceLocationFindingsPath(folder:string,source:string,location:string,finding:string) { + return this.pathTemplates.folderSourceLocationFindingsPathTemplate.render({ + folder: folder, + source: source, + location: location, + finding: finding, + }); + } + + /** + * Parse the folder from FolderSourceLocationFindings resource. + * + * @param {string} folderSourceLocationFindingsName + * A fully-qualified path representing folder_source_location_findings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceLocationFindingsName(folderSourceLocationFindingsName: string) { + return this.pathTemplates.folderSourceLocationFindingsPathTemplate.match(folderSourceLocationFindingsName).folder; + } + + /** + * Parse the source from FolderSourceLocationFindings resource. + * + * @param {string} folderSourceLocationFindingsName + * A fully-qualified path representing folder_source_location_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceLocationFindingsName(folderSourceLocationFindingsName: string) { + return this.pathTemplates.folderSourceLocationFindingsPathTemplate.match(folderSourceLocationFindingsName).source; + } + + /** + * Parse the location from FolderSourceLocationFindings resource. + * + * @param {string} folderSourceLocationFindingsName + * A fully-qualified path representing folder_source_location_findings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderSourceLocationFindingsName(folderSourceLocationFindingsName: string) { + return this.pathTemplates.folderSourceLocationFindingsPathTemplate.match(folderSourceLocationFindingsName).location; + } + + /** + * Parse the finding from FolderSourceLocationFindings resource. + * + * @param {string} folderSourceLocationFindingsName + * A fully-qualified path representing folder_source_location_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceLocationFindingsName(folderSourceLocationFindingsName: string) { + return this.pathTemplates.folderSourceLocationFindingsPathTemplate.match(folderSourceLocationFindingsName).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: 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 organizationAssetSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetSecurityMarksPath(organization:string,asset:string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).organization; + } + + /** + * Parse the asset from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).asset; + } + + /** + * Return a fully-qualified organizationConstraintName resource name string. + * + * @param {string} organization + * @param {string} constraint_name + * @returns {string} Resource name string. + */ + organizationConstraintNamePath(organization:string,constraintName:string) { + return this.pathTemplates.organizationConstraintNamePathTemplate.render({ + organization: organization, + constraint_name: constraintName, + }); + } + + /** + * Parse the organization from OrganizationConstraintName resource. + * + * @param {string} organizationConstraintNameName + * A fully-qualified path representing organization_constraint_name resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationConstraintNameName(organizationConstraintNameName: string) { + return this.pathTemplates.organizationConstraintNamePathTemplate.match(organizationConstraintNameName).organization; + } + + /** + * Parse the constraint_name from OrganizationConstraintName resource. + * + * @param {string} organizationConstraintNameName + * A fully-qualified path representing organization_constraint_name resource. + * @returns {string} A string representing the constraint_name. + */ + matchConstraintNameFromOrganizationConstraintNameName(organizationConstraintNameName: string) { + return this.pathTemplates.organizationConstraintNamePathTemplate.match(organizationConstraintNameName).constraint_name; + } + + /** + * Return a fully-qualified organizationLocation resource name string. + * + * @param {string} organization + * @param {string} location + * @returns {string} Resource name string. + */ + organizationLocationPath(organization:string,location:string) { + return this.pathTemplates.organizationLocationPathTemplate.render({ + organization: organization, + location: location, + }); + } + + /** + * Parse the organization from OrganizationLocation resource. + * + * @param {string} organizationLocationName + * A fully-qualified path representing OrganizationLocation resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationName(organizationLocationName: string) { + return this.pathTemplates.organizationLocationPathTemplate.match(organizationLocationName).organization; + } + + /** + * Parse the location from OrganizationLocation resource. + * + * @param {string} organizationLocationName + * A fully-qualified path representing OrganizationLocation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationName(organizationLocationName: string) { + return this.pathTemplates.organizationLocationPathTemplate.match(organizationLocationName).location; + } + + /** + * Return a fully-qualified organizationLocationBigQueryExports resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} exportParam + * @returns {string} Resource name string. + */ + organizationLocationBigQueryExportsPath(organization:string,location:string,exportParam:string) { + return this.pathTemplates.organizationLocationBigQueryExportsPathTemplate.render({ + organization: organization, + location: location, + export: exportParam, + }); + } + + /** + * Parse the organization from OrganizationLocationBigQueryExports resource. + * + * @param {string} organizationLocationBigQueryExportsName + * A fully-qualified path representing organization_location_bigQueryExports resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBigQueryExportsName(organizationLocationBigQueryExportsName: string) { + return this.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match(organizationLocationBigQueryExportsName).organization; + } + + /** + * Parse the location from OrganizationLocationBigQueryExports resource. + * + * @param {string} organizationLocationBigQueryExportsName + * A fully-qualified path representing organization_location_bigQueryExports resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBigQueryExportsName(organizationLocationBigQueryExportsName: string) { + return this.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match(organizationLocationBigQueryExportsName).location; + } + + /** + * Parse the export from OrganizationLocationBigQueryExports resource. + * + * @param {string} organizationLocationBigQueryExportsName + * A fully-qualified path representing organization_location_bigQueryExports resource. + * @returns {string} A string representing the export. + */ + matchExportFromOrganizationLocationBigQueryExportsName(organizationLocationBigQueryExportsName: string) { + return this.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match(organizationLocationBigQueryExportsName).export; + } + + /** + * Return a fully-qualified organizationLocationMuteConfigs resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} mute_config + * @returns {string} Resource name string. + */ + organizationLocationMuteConfigsPath(organization:string,location:string,muteConfig:string) { + return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.render({ + organization: organization, + location: location, + mute_config: muteConfig, + }); + } + + /** + * Parse the organization from OrganizationLocationMuteConfigs resource. + * + * @param {string} organizationLocationMuteConfigsName + * A fully-qualified path representing organization_location_muteConfigs resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { + return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).organization; + } + + /** + * Parse the location from OrganizationLocationMuteConfigs resource. + * + * @param {string} organizationLocationMuteConfigsName + * A fully-qualified path representing organization_location_muteConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { + return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).location; + } + + /** + * Parse the mute_config from OrganizationLocationMuteConfigs resource. + * + * @param {string} organizationLocationMuteConfigsName + * A fully-qualified path representing organization_location_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { + return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified organizationLocationNotificationConfigs resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} notification_config + * @returns {string} Resource name string. + */ + organizationLocationNotificationConfigsPath(organization:string,location:string,notificationConfig:string) { + return this.pathTemplates.organizationLocationNotificationConfigsPathTemplate.render({ + organization: organization, + location: location, + notification_config: notificationConfig, + }); + } + + /** + * Parse the organization from OrganizationLocationNotificationConfigs resource. + * + * @param {string} organizationLocationNotificationConfigsName + * A fully-qualified path representing organization_location_notificationConfigs resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationNotificationConfigsName(organizationLocationNotificationConfigsName: string) { + return this.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match(organizationLocationNotificationConfigsName).organization; + } + + /** + * Parse the location from OrganizationLocationNotificationConfigs resource. + * + * @param {string} organizationLocationNotificationConfigsName + * A fully-qualified path representing organization_location_notificationConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationNotificationConfigsName(organizationLocationNotificationConfigsName: string) { + return this.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match(organizationLocationNotificationConfigsName).location; + } + + /** + * Parse the notification_config from OrganizationLocationNotificationConfigs resource. + * + * @param {string} organizationLocationNotificationConfigsName + * A fully-qualified path representing organization_location_notificationConfigs resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromOrganizationLocationNotificationConfigsName(organizationLocationNotificationConfigsName: string) { + return this.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match(organizationLocationNotificationConfigsName).notification_config; + } + + /** + * Return a fully-qualified organizationLocationResourceValueConfigs resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} resource_value_config + * @returns {string} Resource name string. + */ + organizationLocationResourceValueConfigsPath(organization:string,location:string,resourceValueConfig:string) { + return this.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.render({ + organization: organization, + location: location, + resource_value_config: resourceValueConfig, + }); + } + + /** + * Parse the organization from OrganizationLocationResourceValueConfigs resource. + * + * @param {string} organizationLocationResourceValueConfigsName + * A fully-qualified path representing organization_location_resourceValueConfigs resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationResourceValueConfigsName(organizationLocationResourceValueConfigsName: string) { + return this.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match(organizationLocationResourceValueConfigsName).organization; + } + + /** + * Parse the location from OrganizationLocationResourceValueConfigs resource. + * + * @param {string} organizationLocationResourceValueConfigsName + * A fully-qualified path representing organization_location_resourceValueConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationResourceValueConfigsName(organizationLocationResourceValueConfigsName: string) { + return this.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match(organizationLocationResourceValueConfigsName).location; + } + + /** + * Parse the resource_value_config from OrganizationLocationResourceValueConfigs resource. + * + * @param {string} organizationLocationResourceValueConfigsName + * A fully-qualified path representing organization_location_resourceValueConfigs resource. + * @returns {string} A string representing the resource_value_config. + */ + matchResourceValueConfigFromOrganizationLocationResourceValueConfigsName(organizationLocationResourceValueConfigsName: string) { + return this.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match(organizationLocationResourceValueConfigsName).resource_value_config; + } + + /** + * Return a fully-qualified organizationLocationSimluationValuedResources resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} simluation + * @param {string} valued_resource + * @returns {string} Resource name string. + */ + organizationLocationSimluationValuedResourcesPath(organization:string,location:string,simluation:string,valuedResource:string) { + return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.render({ + organization: organization, + location: location, + simluation: simluation, + valued_resource: valuedResource, + }); + } + + /** + * Parse the organization from OrganizationLocationSimluationValuedResources resource. + * + * @param {string} organizationLocationSimluationValuedResourcesName + * A fully-qualified path representing organization_location_simluation_valuedResources resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSimluationValuedResourcesName(organizationLocationSimluationValuedResourcesName: string) { + return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match(organizationLocationSimluationValuedResourcesName).organization; + } + + /** + * Parse the location from OrganizationLocationSimluationValuedResources resource. + * + * @param {string} organizationLocationSimluationValuedResourcesName + * A fully-qualified path representing organization_location_simluation_valuedResources resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSimluationValuedResourcesName(organizationLocationSimluationValuedResourcesName: string) { + return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match(organizationLocationSimluationValuedResourcesName).location; + } + + /** + * Parse the simluation from OrganizationLocationSimluationValuedResources resource. + * + * @param {string} organizationLocationSimluationValuedResourcesName + * A fully-qualified path representing organization_location_simluation_valuedResources resource. + * @returns {string} A string representing the simluation. + */ + matchSimluationFromOrganizationLocationSimluationValuedResourcesName(organizationLocationSimluationValuedResourcesName: string) { + return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match(organizationLocationSimluationValuedResourcesName).simluation; + } + + /** + * Parse the valued_resource from OrganizationLocationSimluationValuedResources resource. + * + * @param {string} organizationLocationSimluationValuedResourcesName + * A fully-qualified path representing organization_location_simluation_valuedResources resource. + * @returns {string} A string representing the valued_resource. + */ + matchValuedResourceFromOrganizationLocationSimluationValuedResourcesName(organizationLocationSimluationValuedResourcesName: string) { + return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match(organizationLocationSimluationValuedResourcesName).valued_resource; + } + + /** + * Return a fully-qualified organizationLocationSimulationValuedResourceAttackPaths resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} simulation + * @param {string} valued_resource + * @param {string} attack_path + * @returns {string} Resource name string. + */ + organizationLocationSimulationValuedResourceAttackPathsPath(organization:string,location:string,simulation:string,valuedResource:string,attackPath:string) { + return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.render({ + organization: organization, + location: location, + simulation: simulation, + valued_resource: valuedResource, + attack_path: attackPath, + }); + } + + /** + * Parse the organization from OrganizationLocationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationLocationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).organization; + } + + /** + * Parse the location from OrganizationLocationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationLocationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).location; + } + + /** + * Parse the simulation from OrganizationLocationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationLocationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the simulation. + */ + matchSimulationFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).simulation; + } + + /** + * Parse the valued_resource from OrganizationLocationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationLocationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the valued_resource. + */ + matchValuedResourceFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).valued_resource; + } + + /** + * Parse the attack_path from OrganizationLocationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationLocationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the attack_path. + */ + matchAttackPathFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).attack_path; + } + + /** + * Return a fully-qualified organizationLocationSimulations resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} simluation + * @returns {string} Resource name string. + */ + organizationLocationSimulationsPath(organization:string,location:string,simluation:string) { + return this.pathTemplates.organizationLocationSimulationsPathTemplate.render({ + organization: organization, + location: location, + simluation: simluation, + }); + } + + /** + * Parse the organization from OrganizationLocationSimulations resource. + * + * @param {string} organizationLocationSimulationsName + * A fully-qualified path representing organization_location_simulations resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSimulationsName(organizationLocationSimulationsName: string) { + return this.pathTemplates.organizationLocationSimulationsPathTemplate.match(organizationLocationSimulationsName).organization; + } + + /** + * Parse the location from OrganizationLocationSimulations resource. + * + * @param {string} organizationLocationSimulationsName + * A fully-qualified path representing organization_location_simulations resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSimulationsName(organizationLocationSimulationsName: string) { + return this.pathTemplates.organizationLocationSimulationsPathTemplate.match(organizationLocationSimulationsName).location; + } + + /** + * Parse the simluation from OrganizationLocationSimulations resource. + * + * @param {string} organizationLocationSimulationsName + * A fully-qualified path representing organization_location_simulations resource. + * @returns {string} A string representing the simluation. + */ + matchSimluationFromOrganizationLocationSimulationsName(organizationLocationSimulationsName: string) { + return this.pathTemplates.organizationLocationSimulationsPathTemplate.match(organizationLocationSimulationsName).simluation; + } + + /** + * Return a fully-qualified organizationMuteConfigs resource name string. + * + * @param {string} organization + * @param {string} mute_config + * @returns {string} Resource name string. + */ + organizationMuteConfigsPath(organization:string,muteConfig:string) { + return this.pathTemplates.organizationMuteConfigsPathTemplate.render({ + organization: organization, + mute_config: muteConfig, + }); + } + + /** + * Parse the organization from OrganizationMuteConfigs resource. + * + * @param {string} organizationMuteConfigsName + * A fully-qualified path representing organization_muteConfigs resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMuteConfigsName(organizationMuteConfigsName: string) { + return this.pathTemplates.organizationMuteConfigsPathTemplate.match(organizationMuteConfigsName).organization; + } + + /** + * Parse the mute_config from OrganizationMuteConfigs resource. + * + * @param {string} organizationMuteConfigsName + * A fully-qualified path representing organization_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromOrganizationMuteConfigsName(organizationMuteConfigsName: string) { + return this.pathTemplates.organizationMuteConfigsPathTemplate.match(organizationMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified organizationResourceValueConfigs resource name string. + * + * @param {string} organization + * @param {string} resource_value_config + * @returns {string} Resource name string. + */ + organizationResourceValueConfigsPath(organization:string,resourceValueConfig:string) { + return this.pathTemplates.organizationResourceValueConfigsPathTemplate.render({ + organization: organization, + resource_value_config: resourceValueConfig, + }); + } + + /** + * Parse the organization from OrganizationResourceValueConfigs resource. + * + * @param {string} organizationResourceValueConfigsName + * A fully-qualified path representing organization_resourceValueConfigs resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationResourceValueConfigsName(organizationResourceValueConfigsName: string) { + return this.pathTemplates.organizationResourceValueConfigsPathTemplate.match(organizationResourceValueConfigsName).organization; + } + + /** + * Parse the resource_value_config from OrganizationResourceValueConfigs resource. + * + * @param {string} organizationResourceValueConfigsName + * A fully-qualified path representing organization_resourceValueConfigs resource. + * @returns {string} A string representing the resource_value_config. + */ + matchResourceValueConfigFromOrganizationResourceValueConfigsName(organizationResourceValueConfigsName: string) { + return this.pathTemplates.organizationResourceValueConfigsPathTemplate.match(organizationResourceValueConfigsName).resource_value_config; + } + + /** + * Return a fully-qualified organizationSimulationValuedResourceAttackPaths resource name string. + * + * @param {string} organization + * @param {string} simulation + * @param {string} valued_resource + * @param {string} attack_path + * @returns {string} Resource name string. + */ + organizationSimulationValuedResourceAttackPathsPath(organization:string,simulation:string,valuedResource:string,attackPath:string) { + return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.render({ + organization: organization, + simulation: simulation, + valued_resource: valuedResource, + attack_path: attackPath, + }); + } + + /** + * Parse the organization from OrganizationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSimulationValuedResourceAttackPathsName(organizationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match(organizationSimulationValuedResourceAttackPathsName).organization; + } + + /** + * Parse the simulation from OrganizationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the simulation. + */ + matchSimulationFromOrganizationSimulationValuedResourceAttackPathsName(organizationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match(organizationSimulationValuedResourceAttackPathsName).simulation; + } + + /** + * Parse the valued_resource from OrganizationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the valued_resource. + */ + matchValuedResourceFromOrganizationSimulationValuedResourceAttackPathsName(organizationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match(organizationSimulationValuedResourceAttackPathsName).valued_resource; + } + + /** + * Parse the attack_path from OrganizationSimulationValuedResourceAttackPaths resource. + * + * @param {string} organizationSimulationValuedResourceAttackPathsName + * A fully-qualified path representing organization_simulation_valued_resource_attackPaths resource. + * @returns {string} A string representing the attack_path. + */ + matchAttackPathFromOrganizationSimulationValuedResourceAttackPathsName(organizationSimulationValuedResourceAttackPathsName: string) { + return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match(organizationSimulationValuedResourceAttackPathsName).attack_path; + } + + /** + * Return a fully-qualified organizationSimulationValuedResources resource name string. + * + * @param {string} organization + * @param {string} simulation + * @param {string} valued_resource + * @returns {string} Resource name string. + */ + organizationSimulationValuedResourcesPath(organization:string,simulation:string,valuedResource:string) { + return this.pathTemplates.organizationSimulationValuedResourcesPathTemplate.render({ + organization: organization, + simulation: simulation, + valued_resource: valuedResource, + }); + } + + /** + * Parse the organization from OrganizationSimulationValuedResources resource. + * + * @param {string} organizationSimulationValuedResourcesName + * A fully-qualified path representing organization_simulation_valuedResources resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSimulationValuedResourcesName(organizationSimulationValuedResourcesName: string) { + return this.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match(organizationSimulationValuedResourcesName).organization; + } + + /** + * Parse the simulation from OrganizationSimulationValuedResources resource. + * + * @param {string} organizationSimulationValuedResourcesName + * A fully-qualified path representing organization_simulation_valuedResources resource. + * @returns {string} A string representing the simulation. + */ + matchSimulationFromOrganizationSimulationValuedResourcesName(organizationSimulationValuedResourcesName: string) { + return this.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match(organizationSimulationValuedResourcesName).simulation; + } + + /** + * Parse the valued_resource from OrganizationSimulationValuedResources resource. + * + * @param {string} organizationSimulationValuedResourcesName + * A fully-qualified path representing organization_simulation_valuedResources resource. + * @returns {string} A string representing the valued_resource. + */ + matchValuedResourceFromOrganizationSimulationValuedResourcesName(organizationSimulationValuedResourcesName: string) { + return this.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match(organizationSimulationValuedResourcesName).valued_resource; + } + + /** + * Return a fully-qualified organizationSimulations resource name string. + * + * @param {string} organization + * @param {string} simulation + * @returns {string} Resource name string. + */ + organizationSimulationsPath(organization:string,simulation:string) { + return this.pathTemplates.organizationSimulationsPathTemplate.render({ + organization: organization, + simulation: simulation, + }); + } + + /** + * Parse the organization from OrganizationSimulations resource. + * + * @param {string} organizationSimulationsName + * A fully-qualified path representing organization_simulations resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSimulationsName(organizationSimulationsName: string) { + return this.pathTemplates.organizationSimulationsPathTemplate.match(organizationSimulationsName).organization; + } + + /** + * Parse the simulation from OrganizationSimulations resource. + * + * @param {string} organizationSimulationsName + * A fully-qualified path representing organization_simulations resource. + * @returns {string} A string representing the simulation. + */ + matchSimulationFromOrganizationSimulationsName(organizationSimulationsName: string) { + return this.pathTemplates.organizationSimulationsPathTemplate.match(organizationSimulationsName).simulation; + } + + /** + * 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 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. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingSecurityMarksPath(organization:string,source:string,finding:string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).organization; + } + + /** + * Parse the source from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).source; + } + + /** + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).finding; + } + + /** + * Return a fully-qualified organizationSourceFindings resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingsPath(organization:string,source:string,finding:string) { + return this.pathTemplates.organizationSourceFindingsPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFindings resource. + * + * @param {string} organizationSourceFindingsName + * A fully-qualified path representing organization_source_findings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { + return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).organization; + } + + /** + * Parse the source from OrganizationSourceFindings resource. + * + * @param {string} organizationSourceFindingsName + * A fully-qualified path representing organization_source_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { + return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).source; + } + + /** + * Parse the finding from OrganizationSourceFindings resource. + * + * @param {string} organizationSourceFindingsName + * A fully-qualified path representing organization_source_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { + return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).finding; + } + + /** + * Return a fully-qualified organizationSourceLocationFindingExternalsystem resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} location + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + organizationSourceLocationFindingExternalsystemPath(organization:string,source:string,location:string,finding:string,externalsystem:string) { + return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.render({ + organization: organization, + source: source, + location: location, + finding: finding, + externalsystem: externalsystem, + }); + } + + /** + * Parse the organization from OrganizationSourceLocationFindingExternalsystem resource. + * + * @param {string} organizationSourceLocationFindingExternalsystemName + * A fully-qualified path representing organization_source_location_finding_externalsystem resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).organization; + } + + /** + * Parse the source from OrganizationSourceLocationFindingExternalsystem resource. + * + * @param {string} organizationSourceLocationFindingExternalsystemName + * A fully-qualified path representing organization_source_location_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).source; + } + + /** + * Parse the location from OrganizationSourceLocationFindingExternalsystem resource. + * + * @param {string} organizationSourceLocationFindingExternalsystemName + * A fully-qualified path representing organization_source_location_finding_externalsystem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).location; + } + + /** + * Parse the finding from OrganizationSourceLocationFindingExternalsystem resource. + * + * @param {string} organizationSourceLocationFindingExternalsystemName + * A fully-qualified path representing organization_source_location_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).finding; + } + + /** + * Parse the externalsystem from OrganizationSourceLocationFindingExternalsystem resource. + * + * @param {string} organizationSourceLocationFindingExternalsystemName + * A fully-qualified path representing organization_source_location_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).externalsystem; + } + + /** + * Return a fully-qualified organizationSourceLocationFindingSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} location + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceLocationFindingSecurityMarksPath(organization:string,source:string,location:string,finding:string) { + return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.render({ + organization: organization, + source: source, + location: location, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceLocationFindingSecurityMarks resource. + * + * @param {string} organizationSourceLocationFindingSecurityMarksName + * A fully-qualified path representing organization_source_location_finding_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceLocationFindingSecurityMarksName(organizationSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match(organizationSourceLocationFindingSecurityMarksName).organization; + } + + /** + * Parse the source from OrganizationSourceLocationFindingSecurityMarks resource. + * + * @param {string} organizationSourceLocationFindingSecurityMarksName + * A fully-qualified path representing organization_source_location_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceLocationFindingSecurityMarksName(organizationSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match(organizationSourceLocationFindingSecurityMarksName).source; + } + + /** + * Parse the location from OrganizationSourceLocationFindingSecurityMarks resource. + * + * @param {string} organizationSourceLocationFindingSecurityMarksName + * A fully-qualified path representing organization_source_location_finding_securityMarks resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationSourceLocationFindingSecurityMarksName(organizationSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match(organizationSourceLocationFindingSecurityMarksName).location; + } + + /** + * Parse the finding from OrganizationSourceLocationFindingSecurityMarks resource. + * + * @param {string} organizationSourceLocationFindingSecurityMarksName + * A fully-qualified path representing organization_source_location_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceLocationFindingSecurityMarksName(organizationSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match(organizationSourceLocationFindingSecurityMarksName).finding; + } + + /** + * Return a fully-qualified organizationSourceLocationFindings resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} location + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceLocationFindingsPath(organization:string,source:string,location:string,finding:string) { + return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.render({ + organization: organization, + source: source, + location: location, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceLocationFindings resource. + * + * @param {string} organizationSourceLocationFindingsName + * A fully-qualified path representing organization_source_location_findings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceLocationFindingsName(organizationSourceLocationFindingsName: string) { + return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.match(organizationSourceLocationFindingsName).organization; + } + + /** + * Parse the source from OrganizationSourceLocationFindings resource. + * + * @param {string} organizationSourceLocationFindingsName + * A fully-qualified path representing organization_source_location_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceLocationFindingsName(organizationSourceLocationFindingsName: string) { + return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.match(organizationSourceLocationFindingsName).source; + } + + /** + * Parse the location from OrganizationSourceLocationFindings resource. + * + * @param {string} organizationSourceLocationFindingsName + * A fully-qualified path representing organization_source_location_findings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationSourceLocationFindingsName(organizationSourceLocationFindingsName: string) { + return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.match(organizationSourceLocationFindingsName).location; + } + + /** + * Parse the finding from OrganizationSourceLocationFindings resource. + * + * @param {string} organizationSourceLocationFindingsName + * A fully-qualified path representing organization_source_location_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceLocationFindingsName(organizationSourceLocationFindingsName: string) { + return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.match(organizationSourceLocationFindingsName).finding; + } + + /** + * 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 projectConstraintName resource name string. + * + * @param {string} project + * @param {string} constraint_name + * @returns {string} Resource name string. + */ + projectConstraintNamePath(project:string,constraintName:string) { + return this.pathTemplates.projectConstraintNamePathTemplate.render({ + project: project, + constraint_name: constraintName, + }); + } + + /** + * Parse the project from ProjectConstraintName resource. + * + * @param {string} projectConstraintNameName + * A fully-qualified path representing project_constraint_name resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConstraintNameName(projectConstraintNameName: string) { + return this.pathTemplates.projectConstraintNamePathTemplate.match(projectConstraintNameName).project; + } + + /** + * Parse the constraint_name from ProjectConstraintName resource. + * + * @param {string} projectConstraintNameName + * A fully-qualified path representing project_constraint_name resource. + * @returns {string} A string representing the constraint_name. + */ + matchConstraintNameFromProjectConstraintNameName(projectConstraintNameName: string) { + return this.pathTemplates.projectConstraintNamePathTemplate.match(projectConstraintNameName).constraint_name; + } + + /** + * Return a fully-qualified projectLocationBigQueryExports resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} exportParam + * @returns {string} Resource name string. + */ + projectLocationBigQueryExportsPath(project:string,location:string,exportParam:string) { + return this.pathTemplates.projectLocationBigQueryExportsPathTemplate.render({ + project: project, + location: location, + export: exportParam, + }); + } + + /** + * Parse the project from ProjectLocationBigQueryExports resource. + * + * @param {string} projectLocationBigQueryExportsName + * A fully-qualified path representing project_location_bigQueryExports resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBigQueryExportsName(projectLocationBigQueryExportsName: string) { + return this.pathTemplates.projectLocationBigQueryExportsPathTemplate.match(projectLocationBigQueryExportsName).project; + } + + /** + * Parse the location from ProjectLocationBigQueryExports resource. + * + * @param {string} projectLocationBigQueryExportsName + * A fully-qualified path representing project_location_bigQueryExports resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBigQueryExportsName(projectLocationBigQueryExportsName: string) { + return this.pathTemplates.projectLocationBigQueryExportsPathTemplate.match(projectLocationBigQueryExportsName).location; + } + + /** + * Parse the export from ProjectLocationBigQueryExports resource. + * + * @param {string} projectLocationBigQueryExportsName + * A fully-qualified path representing project_location_bigQueryExports resource. + * @returns {string} A string representing the export. + */ + matchExportFromProjectLocationBigQueryExportsName(projectLocationBigQueryExportsName: string) { + return this.pathTemplates.projectLocationBigQueryExportsPathTemplate.match(projectLocationBigQueryExportsName).export; + } + + /** + * Return a fully-qualified projectLocationMuteConfigs resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mute_config + * @returns {string} Resource name string. + */ + projectLocationMuteConfigsPath(project:string,location:string,muteConfig:string) { + return this.pathTemplates.projectLocationMuteConfigsPathTemplate.render({ + project: project, + location: location, + mute_config: muteConfig, + }); + } + + /** + * Parse the project from ProjectLocationMuteConfigs resource. + * + * @param {string} projectLocationMuteConfigsName + * A fully-qualified path representing project_location_muteConfigs resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { + return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).project; + } + + /** + * Parse the location from ProjectLocationMuteConfigs resource. + * + * @param {string} projectLocationMuteConfigsName + * A fully-qualified path representing project_location_muteConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { + return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).location; + } + + /** + * Parse the mute_config from ProjectLocationMuteConfigs resource. + * + * @param {string} projectLocationMuteConfigsName + * A fully-qualified path representing project_location_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { + return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified projectLocationNotificationConfigs resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notification_config + * @returns {string} Resource name string. + */ + projectLocationNotificationConfigsPath(project:string,location:string,notificationConfig:string) { + return this.pathTemplates.projectLocationNotificationConfigsPathTemplate.render({ + project: project, + location: location, + notification_config: notificationConfig, + }); + } + + /** + * Parse the project from ProjectLocationNotificationConfigs resource. + * + * @param {string} projectLocationNotificationConfigsName + * A fully-qualified path representing project_location_notificationConfigs resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationNotificationConfigsName(projectLocationNotificationConfigsName: string) { + return this.pathTemplates.projectLocationNotificationConfigsPathTemplate.match(projectLocationNotificationConfigsName).project; + } + + /** + * Parse the location from ProjectLocationNotificationConfigs resource. + * + * @param {string} projectLocationNotificationConfigsName + * A fully-qualified path representing project_location_notificationConfigs resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationNotificationConfigsName(projectLocationNotificationConfigsName: string) { + return this.pathTemplates.projectLocationNotificationConfigsPathTemplate.match(projectLocationNotificationConfigsName).location; + } + + /** + * Parse the notification_config from ProjectLocationNotificationConfigs resource. + * + * @param {string} projectLocationNotificationConfigsName + * A fully-qualified path representing project_location_notificationConfigs resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromProjectLocationNotificationConfigsName(projectLocationNotificationConfigsName: string) { + return this.pathTemplates.projectLocationNotificationConfigsPathTemplate.match(projectLocationNotificationConfigsName).notification_config; + } + + /** + * Return a fully-qualified projectMuteConfigs resource name string. + * + * @param {string} project + * @param {string} mute_config + * @returns {string} Resource name string. + */ + projectMuteConfigsPath(project:string,muteConfig:string) { + return this.pathTemplates.projectMuteConfigsPathTemplate.render({ + project: project, + mute_config: muteConfig, + }); + } + + /** + * Parse the project from ProjectMuteConfigs resource. + * + * @param {string} projectMuteConfigsName + * A fully-qualified path representing project_muteConfigs resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMuteConfigsName(projectMuteConfigsName: string) { + return this.pathTemplates.projectMuteConfigsPathTemplate.match(projectMuteConfigsName).project; + } + + /** + * Parse the mute_config from ProjectMuteConfigs resource. + * + * @param {string} projectMuteConfigsName + * A fully-qualified path representing project_muteConfigs resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromProjectMuteConfigsName(projectMuteConfigsName: string) { + return this.pathTemplates.projectMuteConfigsPathTemplate.match(projectMuteConfigsName).mute_config; + } + + /** + * Return a fully-qualified projectSource resource name string. + * + * @param {string} project + * @param {string} source + * @returns {string} Resource name string. + */ + projectSourcePath(project:string,source:string) { + return this.pathTemplates.projectSourcePathTemplate.render({ + project: project, + source: source, + }); + } + + /** + * Parse the project from ProjectSource resource. + * + * @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 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. + * + * @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 ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the 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; + } + + /** + * Return a fully-qualified projectSourceFindings resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingsPath(project:string,source:string,finding:string) { + return this.pathTemplates.projectSourceFindingsPathTemplate.render({ + project: project, + source: source, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceFindings resource. + * + * @param {string} projectSourceFindingsName + * A fully-qualified path representing project_source_findings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingsName(projectSourceFindingsName: string) { + return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).project; + } + + /** + * Parse the source from ProjectSourceFindings resource. + * + * @param {string} projectSourceFindingsName + * A fully-qualified path representing project_source_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingsName(projectSourceFindingsName: string) { + return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).source; + } + + /** + * Parse the finding from ProjectSourceFindings resource. + * + * @param {string} projectSourceFindingsName + * A fully-qualified path representing project_source_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingsName(projectSourceFindingsName: string) { + return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).finding; + } + + /** + * Return a fully-qualified projectSourceLocationFindingExternalsystem resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} location + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + projectSourceLocationFindingExternalsystemPath(project:string,source:string,location:string,finding:string,externalsystem:string) { + return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.render({ + project: project, + source: source, + location: location, + finding: finding, + externalsystem: externalsystem, + }); + } + + /** + * Parse the project from ProjectSourceLocationFindingExternalsystem resource. + * + * @param {string} projectSourceLocationFindingExternalsystemName + * A fully-qualified path representing project_source_location_finding_externalsystem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).project; + } + + /** + * Parse the source from ProjectSourceLocationFindingExternalsystem resource. + * + * @param {string} projectSourceLocationFindingExternalsystemName + * A fully-qualified path representing project_source_location_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).source; + } + + /** + * Parse the location from ProjectSourceLocationFindingExternalsystem resource. + * + * @param {string} projectSourceLocationFindingExternalsystemName + * A fully-qualified path representing project_source_location_finding_externalsystem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).location; + } + + /** + * Parse the finding from ProjectSourceLocationFindingExternalsystem resource. + * + * @param {string} projectSourceLocationFindingExternalsystemName + * A fully-qualified path representing project_source_location_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).finding; + } + + /** + * Parse the externalsystem from ProjectSourceLocationFindingExternalsystem resource. + * + * @param {string} projectSourceLocationFindingExternalsystemName + * A fully-qualified path representing project_source_location_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { + return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).externalsystem; + } + + /** + * Return a fully-qualified projectSourceLocationFindingSecurityMarks resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} location + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceLocationFindingSecurityMarksPath(project:string,source:string,location:string,finding:string) { + return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.render({ + project: project, + source: source, + location: location, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceLocationFindingSecurityMarks resource. + * + * @param {string} projectSourceLocationFindingSecurityMarksName + * A fully-qualified path representing project_source_location_finding_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceLocationFindingSecurityMarksName(projectSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match(projectSourceLocationFindingSecurityMarksName).project; + } + + /** + * Parse the source from ProjectSourceLocationFindingSecurityMarks resource. + * + * @param {string} projectSourceLocationFindingSecurityMarksName + * A fully-qualified path representing project_source_location_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceLocationFindingSecurityMarksName(projectSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match(projectSourceLocationFindingSecurityMarksName).source; + } + + /** + * Parse the location from ProjectSourceLocationFindingSecurityMarks resource. + * + * @param {string} projectSourceLocationFindingSecurityMarksName + * A fully-qualified path representing project_source_location_finding_securityMarks resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectSourceLocationFindingSecurityMarksName(projectSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match(projectSourceLocationFindingSecurityMarksName).location; + } + + /** + * Parse the finding from ProjectSourceLocationFindingSecurityMarks resource. + * + * @param {string} projectSourceLocationFindingSecurityMarksName + * A fully-qualified path representing project_source_location_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceLocationFindingSecurityMarksName(projectSourceLocationFindingSecurityMarksName: string) { + return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match(projectSourceLocationFindingSecurityMarksName).finding; + } + + /** + * Return a fully-qualified projectSourceLocationFindings resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} location + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceLocationFindingsPath(project:string,source:string,location:string,finding:string) { + return this.pathTemplates.projectSourceLocationFindingsPathTemplate.render({ + project: project, + source: source, + location: location, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceLocationFindings resource. + * + * @param {string} projectSourceLocationFindingsName + * A fully-qualified path representing project_source_location_findings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceLocationFindingsName(projectSourceLocationFindingsName: string) { + return this.pathTemplates.projectSourceLocationFindingsPathTemplate.match(projectSourceLocationFindingsName).project; + } + + /** + * Parse the source from ProjectSourceLocationFindings resource. + * + * @param {string} projectSourceLocationFindingsName + * A fully-qualified path representing project_source_location_findings resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceLocationFindingsName(projectSourceLocationFindingsName: string) { + return this.pathTemplates.projectSourceLocationFindingsPathTemplate.match(projectSourceLocationFindingsName).source; + } + + /** + * Parse the location from ProjectSourceLocationFindings resource. + * + * @param {string} projectSourceLocationFindingsName + * A fully-qualified path representing project_source_location_findings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectSourceLocationFindingsName(projectSourceLocationFindingsName: string) { + return this.pathTemplates.projectSourceLocationFindingsPathTemplate.match(projectSourceLocationFindingsName).location; + } + + /** + * Parse the finding from ProjectSourceLocationFindings resource. + * + * @param {string} projectSourceLocationFindingsName + * A fully-qualified path representing project_source_location_findings resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceLocationFindingsName(projectSourceLocationFindingsName: string) { + return this.pathTemplates.projectSourceLocationFindingsPathTemplate.match(projectSourceLocationFindingsName).finding; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client_config.json b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client_config.json new file mode 100644 index 00000000000..22214ca4974 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client_config.json @@ -0,0 +1,186 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v2.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": { + "BatchCreateResourceValueConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BulkMuteFindings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFinding": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateNotificationConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNotificationConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteResourceValueConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSimulation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetValuedResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetNotificationConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetResourceValueConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAttackPaths": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBigQueryExports": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMuteConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNotificationConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListResourceValueConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListValuedResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetFindingState": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMute": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateExternalSystem": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFinding": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNotificationConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateResourceValueConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityMarks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_proto_list.json b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_proto_list.json new file mode 100644 index 00000000000..774021938b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_proto_list.json @@ -0,0 +1,57 @@ +[ + "../../protos/google/cloud/securitycenter/v2/access.proto", + "../../protos/google/cloud/securitycenter/v2/affected_resources.proto", + "../../protos/google/cloud/securitycenter/v2/ai_model.proto", + "../../protos/google/cloud/securitycenter/v2/application.proto", + "../../protos/google/cloud/securitycenter/v2/attack_exposure.proto", + "../../protos/google/cloud/securitycenter/v2/attack_path.proto", + "../../protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto", + "../../protos/google/cloud/securitycenter/v2/bigquery_export.proto", + "../../protos/google/cloud/securitycenter/v2/chokepoint.proto", + "../../protos/google/cloud/securitycenter/v2/cloud_armor.proto", + "../../protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto", + "../../protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto", + "../../protos/google/cloud/securitycenter/v2/compliance.proto", + "../../protos/google/cloud/securitycenter/v2/connection.proto", + "../../protos/google/cloud/securitycenter/v2/contact_details.proto", + "../../protos/google/cloud/securitycenter/v2/container.proto", + "../../protos/google/cloud/securitycenter/v2/data_access_event.proto", + "../../protos/google/cloud/securitycenter/v2/data_flow_event.proto", + "../../protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto", + "../../protos/google/cloud/securitycenter/v2/database.proto", + "../../protos/google/cloud/securitycenter/v2/disk.proto", + "../../protos/google/cloud/securitycenter/v2/exfiltration.proto", + "../../protos/google/cloud/securitycenter/v2/external_system.proto", + "../../protos/google/cloud/securitycenter/v2/file.proto", + "../../protos/google/cloud/securitycenter/v2/finding.proto", + "../../protos/google/cloud/securitycenter/v2/folder.proto", + "../../protos/google/cloud/securitycenter/v2/group_membership.proto", + "../../protos/google/cloud/securitycenter/v2/iam_binding.proto", + "../../protos/google/cloud/securitycenter/v2/indicator.proto", + "../../protos/google/cloud/securitycenter/v2/ip_rules.proto", + "../../protos/google/cloud/securitycenter/v2/job.proto", + "../../protos/google/cloud/securitycenter/v2/kernel_rootkit.proto", + "../../protos/google/cloud/securitycenter/v2/kubernetes.proto", + "../../protos/google/cloud/securitycenter/v2/label.proto", + "../../protos/google/cloud/securitycenter/v2/load_balancer.proto", + "../../protos/google/cloud/securitycenter/v2/log_entry.proto", + "../../protos/google/cloud/securitycenter/v2/mitre_attack.proto", + "../../protos/google/cloud/securitycenter/v2/mute_config.proto", + "../../protos/google/cloud/securitycenter/v2/network.proto", + "../../protos/google/cloud/securitycenter/v2/notebook.proto", + "../../protos/google/cloud/securitycenter/v2/notification_config.proto", + "../../protos/google/cloud/securitycenter/v2/notification_message.proto", + "../../protos/google/cloud/securitycenter/v2/org_policy.proto", + "../../protos/google/cloud/securitycenter/v2/process.proto", + "../../protos/google/cloud/securitycenter/v2/resource.proto", + "../../protos/google/cloud/securitycenter/v2/resource_value_config.proto", + "../../protos/google/cloud/securitycenter/v2/security_marks.proto", + "../../protos/google/cloud/securitycenter/v2/security_posture.proto", + "../../protos/google/cloud/securitycenter/v2/securitycenter_service.proto", + "../../protos/google/cloud/securitycenter/v2/simulation.proto", + "../../protos/google/cloud/securitycenter/v2/source.proto", + "../../protos/google/cloud/securitycenter/v2/toxic_combination.proto", + "../../protos/google/cloud/securitycenter/v2/valued_resource.proto", + "../../protos/google/cloud/securitycenter/v2/vertex_ai.proto", + "../../protos/google/cloud/securitycenter/v2/vulnerability.proto" +] diff --git a/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1e447cf1ff6 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..be57255cffa --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {SecurityCenterClient} from '@google-cloud/security-center'; + +// check that the client class type name can be used +function doStuffWithSecurityCenterClient(client: SecurityCenterClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const securityCenterClient = new SecurityCenterClient(); + doStuffWithSecurityCenterClient(securityCenterClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-securitycenter/system-test/install.ts b/owl-bot-staging/google-cloud-securitycenter/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1.ts new file mode 100644 index 00000000000..9d759b51456 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -0,0 +1,11894 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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) + .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', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new securitycenterModule.v1.SecurityCenterClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new securitycenterModule.v1.SecurityCenterClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = securitycenterModule.v1.SecurityCenterClient.servicePath; + assert.strictEqual(servicePath, 'securitycenter.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = securitycenterModule.v1.SecurityCenterClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new securitycenterModule.v1.SecurityCenterClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new securitycenterModule.v1.SecurityCenterClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new securitycenterModule.v1.SecurityCenterClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new securitycenterModule.v1.SecurityCenterClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new securitycenterModule.v1.SecurityCenterClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + 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 for the initialized client', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + 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(); + }).catch(err => {throw err}); + }); + + 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('createSecurityHealthAnalyticsCustomModule', () => { + it('invokes createSecurityHealthAnalyticsCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() + ); + client.innerApiCalls.createSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.createSecurityHealthAnalyticsCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityHealthAnalyticsCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() + ); + client.innerApiCalls.createSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecurityHealthAnalyticsCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityHealthAnalyticsCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSecurityHealthAnalyticsCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityHealthAnalyticsCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createSecurityHealthAnalyticsCustomModule(request), expectedError); + }); + }); + + describe('createSource', () => { + it('invokes createSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createSource(request), expectedError); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createFinding(request), expectedError); + }); + }); + + describe('createMuteConfig', () => { + it('invokes createMuteConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateMuteConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ); + client.innerApiCalls.createMuteConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMuteConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IMuteConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateMuteConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createMuteConfig(request), expectedError); + }); + }); + + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createNotificationConfig(request), expectedError); + }); + }); + + describe('deleteMuteConfig', () => { + it('invokes deleteMuteConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMuteConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMuteConfig( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteMuteConfig(request), expectedError); + }); + }); + + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteNotificationConfig(request), expectedError); + }); + }); + + describe('deleteSecurityHealthAnalyticsCustomModule', () => { + it('invokes deleteSecurityHealthAnalyticsCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSecurityHealthAnalyticsCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityHealthAnalyticsCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSecurityHealthAnalyticsCustomModule( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityHealthAnalyticsCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSecurityHealthAnalyticsCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityHealthAnalyticsCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteSecurityHealthAnalyticsCustomModule(request), expectedError); + }); + }); + + describe('getSimulation', () => { + it('invokes getSimulation without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSimulationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSimulationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Simulation() + ); + client.innerApiCalls.getSimulation = stubSimpleCall(expectedResponse); + const [response] = await client.getSimulation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSimulation without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSimulationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSimulationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Simulation() + ); + client.innerApiCalls.getSimulation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSimulation( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISimulation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSimulation with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSimulationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSimulationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSimulation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSimulation(request), expectedError); + const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSimulation with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSimulationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSimulationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSimulation(request), expectedError); + }); + }); + + describe('getValuedResource', () => { + it('invokes getValuedResource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetValuedResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetValuedResourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ValuedResource() + ); + client.innerApiCalls.getValuedResource = stubSimpleCall(expectedResponse); + const [response] = await client.getValuedResource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getValuedResource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetValuedResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetValuedResourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ValuedResource() + ); + client.innerApiCalls.getValuedResource = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getValuedResource( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IValuedResource|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getValuedResource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetValuedResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetValuedResourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getValuedResource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getValuedResource(request), expectedError); + const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getValuedResource with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetValuedResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetValuedResourceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getValuedResource(request), expectedError); + }); + }); + + describe('getBigQueryExport', () => { + it('invokes getBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBigQueryExport(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('getMuteConfig', () => { + it('invokes getMuteConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetMuteConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ); + client.innerApiCalls.getMuteConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMuteConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IMuteConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetMuteConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getMuteConfig(request), expectedError); + }); + }); + + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getNotificationConfig(request), expectedError); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOrganizationSettings(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getOrganizationSettings(request), expectedError); + }); + }); + + describe('getEffectiveSecurityHealthAnalyticsCustomModule', () => { + it('invokes getEffectiveSecurityHealthAnalyticsCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule() + ); + client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.getEffectiveSecurityHealthAnalyticsCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEffectiveSecurityHealthAnalyticsCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule() + ); + client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEffectiveSecurityHealthAnalyticsCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEffectiveSecurityHealthAnalyticsCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEffectiveSecurityHealthAnalyticsCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEffectiveSecurityHealthAnalyticsCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEffectiveSecurityHealthAnalyticsCustomModule(request), expectedError); + }); + }); + + describe('getSecurityHealthAnalyticsCustomModule', () => { + it('invokes getSecurityHealthAnalyticsCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() + ); + client.innerApiCalls.getSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.getSecurityHealthAnalyticsCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityHealthAnalyticsCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() + ); + client.innerApiCalls.getSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSecurityHealthAnalyticsCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityHealthAnalyticsCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSecurityHealthAnalyticsCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityHealthAnalyticsCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSecurityHealthAnalyticsCustomModule(request), expectedError); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSource(request), expectedError); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setFindingState(request), expectedError); + }); + }); + + describe('setMute', () => { + it('invokes setMute without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.SetMuteRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.setMute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMute( + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.SetMuteRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setMute(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('simulateSecurityHealthAnalyticsCustomModule', () => { + it('invokes simulateSecurityHealthAnalyticsCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse() + ); + client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.simulateSecurityHealthAnalyticsCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes simulateSecurityHealthAnalyticsCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse() + ); + client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.simulateSecurityHealthAnalyticsCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes simulateSecurityHealthAnalyticsCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.simulateSecurityHealthAnalyticsCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes simulateSecurityHealthAnalyticsCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.simulateSecurityHealthAnalyticsCustomModule(request), expectedError); + }); + }); + + describe('updateExternalSystem', () => { + it('invokes updateExternalSystem without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', ['externalSystem', 'name']); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', ['externalSystem', 'name']); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + 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'); + client.innerApiCalls.updateExternalSystem = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExternalSystem(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateExternalSystem(request), expectedError); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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 = 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateFinding(request), expectedError); + }); + }); + + describe('updateMuteConfig', () => { + it('invokes updateMuteConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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 = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMuteConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IMuteConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig ??= {}; + 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'); + client.innerApiCalls.updateMuteConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMuteConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateMuteConfig(request), expectedError); + }); + }); + + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateNotificationConfig(request), expectedError); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateOrganizationSettings(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateOrganizationSettings(request), expectedError); + }); + }); + + describe('updateSecurityHealthAnalyticsCustomModule', () => { + it('invokes updateSecurityHealthAnalyticsCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest() + ); + request.securityHealthAnalyticsCustomModule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest', ['securityHealthAnalyticsCustomModule', 'name']); + request.securityHealthAnalyticsCustomModule.name = defaultValue1; + const expectedHeaderRequestParams = `security_health_analytics_custom_module.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() + ); + client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.updateSecurityHealthAnalyticsCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityHealthAnalyticsCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest() + ); + request.securityHealthAnalyticsCustomModule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest', ['securityHealthAnalyticsCustomModule', 'name']); + request.securityHealthAnalyticsCustomModule.name = defaultValue1; + const expectedHeaderRequestParams = `security_health_analytics_custom_module.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() + ); + client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityHealthAnalyticsCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityHealthAnalyticsCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest() + ); + request.securityHealthAnalyticsCustomModule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest', ['securityHealthAnalyticsCustomModule', 'name']); + request.securityHealthAnalyticsCustomModule.name = defaultValue1; + const expectedHeaderRequestParams = `security_health_analytics_custom_module.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSecurityHealthAnalyticsCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityHealthAnalyticsCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest() + ); + request.securityHealthAnalyticsCustomModule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest', ['securityHealthAnalyticsCustomModule', 'name']); + request.securityHealthAnalyticsCustomModule.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateSecurityHealthAnalyticsCustomModule(request), expectedError); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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 = 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateSource(request), expectedError); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + 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'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); + }); + + describe('createBigQueryExport', () => { + it('invokes createBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.createBigQueryExport = stubSimpleCall(expectedResponse); + const [response] = await client.createBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.createBigQueryExport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBigQueryExport( + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createBigQueryExport(request), expectedError); + }); + }); + + describe('deleteBigQueryExport', () => { + it('invokes deleteBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBigQueryExport = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBigQueryExport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBigQueryExport( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + 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'); + client.innerApiCalls.updateBigQueryExport = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateBigQueryExport(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateBigQueryExport(request), expectedError); + }); + }); + + describe('createEventThreatDetectionCustomModule', () => { + it('invokes createEventThreatDetectionCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() + ); + client.innerApiCalls.createEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.createEventThreatDetectionCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEventThreatDetectionCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() + ); + client.innerApiCalls.createEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEventThreatDetectionCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEventThreatDetectionCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createEventThreatDetectionCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEventThreatDetectionCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createEventThreatDetectionCustomModule(request), expectedError); + }); + }); + + describe('deleteEventThreatDetectionCustomModule', () => { + it('invokes deleteEventThreatDetectionCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEventThreatDetectionCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEventThreatDetectionCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEventThreatDetectionCustomModule( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEventThreatDetectionCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteEventThreatDetectionCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEventThreatDetectionCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteEventThreatDetectionCustomModule(request), expectedError); + }); + }); + + describe('getEventThreatDetectionCustomModule', () => { + it('invokes getEventThreatDetectionCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() + ); + client.innerApiCalls.getEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.getEventThreatDetectionCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEventThreatDetectionCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() + ); + client.innerApiCalls.getEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEventThreatDetectionCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEventThreatDetectionCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEventThreatDetectionCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEventThreatDetectionCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEventThreatDetectionCustomModule(request), expectedError); + }); + }); + + describe('updateEventThreatDetectionCustomModule', () => { + it('invokes updateEventThreatDetectionCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest() + ); + request.eventThreatDetectionCustomModule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest', ['eventThreatDetectionCustomModule', 'name']); + request.eventThreatDetectionCustomModule.name = defaultValue1; + const expectedHeaderRequestParams = `event_threat_detection_custom_module.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() + ); + client.innerApiCalls.updateEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.updateEventThreatDetectionCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEventThreatDetectionCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest() + ); + request.eventThreatDetectionCustomModule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest', ['eventThreatDetectionCustomModule', 'name']); + request.eventThreatDetectionCustomModule.name = defaultValue1; + const expectedHeaderRequestParams = `event_threat_detection_custom_module.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() + ); + client.innerApiCalls.updateEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEventThreatDetectionCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEventThreatDetectionCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest() + ); + request.eventThreatDetectionCustomModule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest', ['eventThreatDetectionCustomModule', 'name']); + request.eventThreatDetectionCustomModule.name = defaultValue1; + const expectedHeaderRequestParams = `event_threat_detection_custom_module.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEventThreatDetectionCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEventThreatDetectionCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest() + ); + request.eventThreatDetectionCustomModule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest', ['eventThreatDetectionCustomModule', 'name']); + request.eventThreatDetectionCustomModule.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateEventThreatDetectionCustomModule(request), expectedError); + }); + }); + + describe('validateEventThreatDetectionCustomModule', () => { + it('invokes validateEventThreatDetectionCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse() + ); + client.innerApiCalls.validateEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.validateEventThreatDetectionCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateEventThreatDetectionCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse() + ); + client.innerApiCalls.validateEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateEventThreatDetectionCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateEventThreatDetectionCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.validateEventThreatDetectionCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateEventThreatDetectionCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.validateEventThreatDetectionCustomModule(request), expectedError); + }); + }); + + describe('getEffectiveEventThreatDetectionCustomModule', () => { + it('invokes getEffectiveEventThreatDetectionCustomModule without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule() + ); + client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); + const [response] = await client.getEffectiveEventThreatDetectionCustomModule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEffectiveEventThreatDetectionCustomModule without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule() + ); + client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEffectiveEventThreatDetectionCustomModule( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEffectiveEventThreatDetectionCustomModule with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEffectiveEventThreatDetectionCustomModule(request), expectedError); + const actualRequest = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEffectiveEventThreatDetectionCustomModule with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEffectiveEventThreatDetectionCustomModule(request), expectedError); + }); + }); + + describe('batchCreateResourceValueConfigs', () => { + it('invokes batchCreateResourceValueConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse() + ); + client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateResourceValueConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateResourceValueConfigs without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse() + ); + client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateResourceValueConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateResourceValueConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateResourceValueConfigs(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateResourceValueConfigs with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.batchCreateResourceValueConfigs(request), expectedError); + }); + }); + + describe('deleteResourceValueConfig', () => { + it('invokes deleteResourceValueConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteResourceValueConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteResourceValueConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceValueConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteResourceValueConfig( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceValueConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteResourceValueConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteResourceValueConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceValueConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteResourceValueConfig(request), expectedError); + }); + }); + + describe('getResourceValueConfig', () => { + it('invokes getResourceValueConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ResourceValueConfig() + ); + client.innerApiCalls.getResourceValueConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getResourceValueConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceValueConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ResourceValueConfig() + ); + client.innerApiCalls.getResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getResourceValueConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IResourceValueConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceValueConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getResourceValueConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getResourceValueConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceValueConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GetResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getResourceValueConfig(request), expectedError); + }); + }); + + describe('updateResourceValueConfig', () => { + it('invokes updateResourceValueConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest() + ); + request.resourceValueConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); + request.resourceValueConfig.name = defaultValue1; + const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ResourceValueConfig() + ); + client.innerApiCalls.updateResourceValueConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateResourceValueConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceValueConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest() + ); + request.resourceValueConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); + request.resourceValueConfig.name = defaultValue1; + const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ResourceValueConfig() + ); + client.innerApiCalls.updateResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateResourceValueConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IResourceValueConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceValueConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest() + ); + request.resourceValueConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); + request.resourceValueConfig.name = defaultValue1; + const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateResourceValueConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateResourceValueConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceValueConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest() + ); + request.resourceValueConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); + request.resourceValueConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateResourceValueConfig(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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.bulkMuteFindings(request); + await assert.rejects(operation.promise(), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', + }); + await 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', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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(stub.calledOnce); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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(stub.calledOnce); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await 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(stub.calledOnce); + 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', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRunAssetDiscoveryProgress(''), expectedError); + assert(stub.calledOnce); + 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', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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(stub.calledOnce); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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(stub.calledOnce); + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.groupAssets, request)); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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(stub.calledOnce); + assert((client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.groupAssets, request)); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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(stub.calledOnce); + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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(stub.calledOnce); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.groupFindings, request)); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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(stub.calledOnce); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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(stub.calledOnce); + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert(stub.calledOnce); + assert((client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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(stub.calledOnce); + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert(stub.calledOnce); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDescendantSecurityHealthAnalyticsCustomModules', () => { + it('invokes listDescendantSecurityHealthAnalyticsCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + ]; + client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules = stubSimpleCall(expectedResponse); + const [response] = await client.listDescendantSecurityHealthAnalyticsCustomModules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDescendantSecurityHealthAnalyticsCustomModules without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + ]; + client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDescendantSecurityHealthAnalyticsCustomModules( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDescendantSecurityHealthAnalyticsCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDescendantSecurityHealthAnalyticsCustomModules(request), expectedError); + const actualRequest = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDescendantSecurityHealthAnalyticsCustomModulesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + ]; + client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDescendantSecurityHealthAnalyticsCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => { + 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.listDescendantSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules, request)); + assert( + (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDescendantSecurityHealthAnalyticsCustomModulesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDescendantSecurityHealthAnalyticsCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules, request)); + assert( + (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDescendantSecurityHealthAnalyticsCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + ]; + client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[] = []; + const iterable = client.listDescendantSecurityHealthAnalyticsCustomModulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDescendantSecurityHealthAnalyticsCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDescendantSecurityHealthAnalyticsCustomModulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFindings, request)); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMuteConfigs', () => { + it('invokes listMuteConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + ]; + client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listMuteConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + ]; + client.innerApiCalls.listMuteConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMuteConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IMuteConfig[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + ]; + client.descriptors.page.listMuteConfigs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMuteConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { + 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.listMuteConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMuteConfigs, request)); + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMuteConfigsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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.MuteConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMuteConfigs, request)); + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMuteConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), + ]; + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); + 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.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMuteConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMuteConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNotificationConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNotificationConfigs(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNotificationConfigsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNotificationConfigs, request)); + assert( + (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEffectiveSecurityHealthAnalyticsCustomModules', () => { + it('invokes listEffectiveSecurityHealthAnalyticsCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + ]; + client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules = stubSimpleCall(expectedResponse); + const [response] = await client.listEffectiveSecurityHealthAnalyticsCustomModules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEffectiveSecurityHealthAnalyticsCustomModules without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + ]; + client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEffectiveSecurityHealthAnalyticsCustomModules( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEffectiveSecurityHealthAnalyticsCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEffectiveSecurityHealthAnalyticsCustomModules(request), expectedError); + const actualRequest = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEffectiveSecurityHealthAnalyticsCustomModulesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + ]; + client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEffectiveSecurityHealthAnalyticsCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule) => { + 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.listEffectiveSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules, request)); + assert( + (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEffectiveSecurityHealthAnalyticsCustomModulesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEffectiveSecurityHealthAnalyticsCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules, request)); + assert( + (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEffectiveSecurityHealthAnalyticsCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), + ]; + client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[] = []; + const iterable = client.listEffectiveSecurityHealthAnalyticsCustomModulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEffectiveSecurityHealthAnalyticsCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEffectiveSecurityHealthAnalyticsCustomModulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSecurityHealthAnalyticsCustomModules', () => { + it('invokes listSecurityHealthAnalyticsCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + ]; + client.innerApiCalls.listSecurityHealthAnalyticsCustomModules = stubSimpleCall(expectedResponse); + const [response] = await client.listSecurityHealthAnalyticsCustomModules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityHealthAnalyticsCustomModules without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + ]; + client.innerApiCalls.listSecurityHealthAnalyticsCustomModules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSecurityHealthAnalyticsCustomModules( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityHealthAnalyticsCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSecurityHealthAnalyticsCustomModules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSecurityHealthAnalyticsCustomModules(request), expectedError); + const actualRequest = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityHealthAnalyticsCustomModulesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + ]; + client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSecurityHealthAnalyticsCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => { + 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.listSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSecurityHealthAnalyticsCustomModules, request)); + assert( + (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSecurityHealthAnalyticsCustomModulesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSecurityHealthAnalyticsCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSecurityHealthAnalyticsCustomModules, request)); + assert( + (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSecurityHealthAnalyticsCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), + ]; + client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[] = []; + const iterable = client.listSecurityHealthAnalyticsCustomModulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSecurityHealthAnalyticsCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSecurityHealthAnalyticsCustomModulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSources, request)); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSourcesAsync(request); + await 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( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBigQueryExports', () => { + it('invokes listBigQueryExports without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + ]; + client.innerApiCalls.listBigQueryExports = stubSimpleCall(expectedResponse); + const [response] = await client.listBigQueryExports(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + ]; + client.innerApiCalls.listBigQueryExports = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBigQueryExports( + 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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.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); + 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 () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + ]; + client.descriptors.page.listBigQueryExports.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBigQueryExportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.BigQueryExport[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.BigQueryExport) => { + 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.listBigQueryExports.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBigQueryExports, request)); + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBigQueryExportsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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.BigQueryExport[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.BigQueryExport) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBigQueryExports, request)); + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBigQueryExports without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), + ]; + client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(expectedResponse); + 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.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBigQueryExports with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBigQueryExportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IBigQueryExport[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDescendantEventThreatDetectionCustomModules', () => { + it('invokes listDescendantEventThreatDetectionCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + ]; + client.innerApiCalls.listDescendantEventThreatDetectionCustomModules = stubSimpleCall(expectedResponse); + const [response] = await client.listDescendantEventThreatDetectionCustomModules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDescendantEventThreatDetectionCustomModules without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + ]; + client.innerApiCalls.listDescendantEventThreatDetectionCustomModules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDescendantEventThreatDetectionCustomModules( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDescendantEventThreatDetectionCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDescendantEventThreatDetectionCustomModules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDescendantEventThreatDetectionCustomModules(request), expectedError); + const actualRequest = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDescendantEventThreatDetectionCustomModulesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + ]; + client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDescendantEventThreatDetectionCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => { + 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.listDescendantEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDescendantEventThreatDetectionCustomModules, request)); + assert( + (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDescendantEventThreatDetectionCustomModulesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDescendantEventThreatDetectionCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDescendantEventThreatDetectionCustomModules, request)); + assert( + (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDescendantEventThreatDetectionCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + ]; + client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[] = []; + const iterable = client.listDescendantEventThreatDetectionCustomModulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDescendantEventThreatDetectionCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDescendantEventThreatDetectionCustomModulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEventThreatDetectionCustomModules', () => { + it('invokes listEventThreatDetectionCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + ]; + client.innerApiCalls.listEventThreatDetectionCustomModules = stubSimpleCall(expectedResponse); + const [response] = await client.listEventThreatDetectionCustomModules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEventThreatDetectionCustomModules without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + ]; + client.innerApiCalls.listEventThreatDetectionCustomModules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEventThreatDetectionCustomModules( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEventThreatDetectionCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEventThreatDetectionCustomModules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEventThreatDetectionCustomModules(request), expectedError); + const actualRequest = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEventThreatDetectionCustomModulesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + ]; + client.descriptors.page.listEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEventThreatDetectionCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => { + 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.listEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEventThreatDetectionCustomModules, request)); + assert( + (client.descriptors.page.listEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEventThreatDetectionCustomModulesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEventThreatDetectionCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEventThreatDetectionCustomModules, request)); + assert( + (client.descriptors.page.listEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEventThreatDetectionCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), + ]; + client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[] = []; + const iterable = client.listEventThreatDetectionCustomModulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEventThreatDetectionCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEventThreatDetectionCustomModulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEffectiveEventThreatDetectionCustomModules', () => { + it('invokes listEffectiveEventThreatDetectionCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + ]; + client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules = stubSimpleCall(expectedResponse); + const [response] = await client.listEffectiveEventThreatDetectionCustomModules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEffectiveEventThreatDetectionCustomModules without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + ]; + client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEffectiveEventThreatDetectionCustomModules( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEffectiveEventThreatDetectionCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEffectiveEventThreatDetectionCustomModules(request), expectedError); + const actualRequest = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEffectiveEventThreatDetectionCustomModulesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + ]; + client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEffectiveEventThreatDetectionCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule) => { + 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.listEffectiveEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules, request)); + assert( + (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEffectiveEventThreatDetectionCustomModulesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEffectiveEventThreatDetectionCustomModulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules, request)); + assert( + (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEffectiveEventThreatDetectionCustomModules without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), + ]; + client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[] = []; + const iterable = client.listEffectiveEventThreatDetectionCustomModulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEffectiveEventThreatDetectionCustomModules with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEffectiveEventThreatDetectionCustomModulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listResourceValueConfigs', () => { + it('invokes listResourceValueConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + ]; + client.innerApiCalls.listResourceValueConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listResourceValueConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceValueConfigs without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + ]; + client.innerApiCalls.listResourceValueConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listResourceValueConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IResourceValueConfig[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceValueConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listResourceValueConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listResourceValueConfigs(request), expectedError); + const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceValueConfigsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + ]; + client.descriptors.page.listResourceValueConfigs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listResourceValueConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ResourceValueConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.ResourceValueConfig) => { + 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.listResourceValueConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceValueConfigs, request)); + assert( + (client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listResourceValueConfigsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceValueConfigs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listResourceValueConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ResourceValueConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.ResourceValueConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceValueConfigs, request)); + assert( + (client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceValueConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), + ]; + client.descriptors.page.listResourceValueConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IResourceValueConfig[] = []; + const iterable = client.listResourceValueConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceValueConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceValueConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listResourceValueConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IResourceValueConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listValuedResources', () => { + it('invokes listValuedResources without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + ]; + client.innerApiCalls.listValuedResources = stubSimpleCall(expectedResponse); + const [response] = await client.listValuedResources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listValuedResources without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + ]; + client.innerApiCalls.listValuedResources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listValuedResources( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IValuedResource[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listValuedResources with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listValuedResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listValuedResources(request), expectedError); + const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listValuedResourcesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + ]; + client.descriptors.page.listValuedResources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listValuedResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ValuedResource[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.ValuedResource) => { + 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.listValuedResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listValuedResources, request)); + assert( + (client.descriptors.page.listValuedResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listValuedResourcesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listValuedResources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listValuedResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ValuedResource[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.ValuedResource) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listValuedResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listValuedResources, request)); + assert( + (client.descriptors.page.listValuedResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listValuedResources without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), + ]; + client.descriptors.page.listValuedResources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IValuedResource[] = []; + const iterable = client.listValuedResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listValuedResources with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listValuedResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listValuedResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IValuedResource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAttackPaths', () => { + it('invokes listAttackPaths without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + ]; + client.innerApiCalls.listAttackPaths = stubSimpleCall(expectedResponse); + const [response] = await client.listAttackPaths(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttackPaths without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + ]; + client.innerApiCalls.listAttackPaths = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAttackPaths( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IAttackPath[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttackPaths with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAttackPaths = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAttackPaths(request), expectedError); + const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttackPathsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + ]; + client.descriptors.page.listAttackPaths.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAttackPathsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.AttackPath[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.AttackPath) => { + 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.listAttackPaths.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttackPaths, request)); + assert( + (client.descriptors.page.listAttackPaths.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAttackPathsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttackPaths.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAttackPathsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.AttackPath[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v1.AttackPath) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAttackPaths.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttackPaths, request)); + assert( + (client.descriptors.page.listAttackPaths.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttackPaths without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), + ]; + client.descriptors.page.listAttackPaths.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IAttackPath[] = []; + const iterable = client.listAttackPathsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttackPaths with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttackPaths.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAttackPathsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IAttackPath[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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); + } + }).catch(err => {throw err}); + }); + 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', + }); + await 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); + } + }).catch(err => {throw err}); + }); + 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', + }); + await 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); + } + }).catch(err => {throw err}); + }); + 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.IOperation[] = []; + 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', + }); + await 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.IOperation[] = []; + 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('attackPath', async () => { + const fakePath = "/rendered/path/attackPath"; + const expectedParameters = { + organization: "organizationValue", + simulation: "simulationValue", + valued_resource: "valuedResourceValue", + attack_path: "attackPathValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.attackPathPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attackPathPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attackPathPath', () => { + const result = client.attackPathPath("organizationValue", "simulationValue", "valuedResourceValue", "attackPathValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attackPathPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromAttackPathName', () => { + const result = client.matchOrganizationFromAttackPathName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.attackPathPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimulationFromAttackPathName', () => { + const result = client.matchSimulationFromAttackPathName(fakePath); + assert.strictEqual(result, "simulationValue"); + assert((client.pathTemplates.attackPathPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchValuedResourceFromAttackPathName', () => { + const result = client.matchValuedResourceFromAttackPathName(fakePath); + assert.strictEqual(result, "valuedResourceValue"); + assert((client.pathTemplates.attackPathPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttackPathFromAttackPathName', () => { + const result = client.matchAttackPathFromAttackPathName(fakePath); + assert.strictEqual(result, "attackPathValue"); + assert((client.pathTemplates.attackPathPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderAssetSecurityMarks', async () => { + const fakePath = "/rendered/path/folderAssetSecurityMarks"; + const expectedParameters = { + folder: "folderValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('folderAssets', async () => { + const fakePath = "/rendered/path/folderAssets"; + const expectedParameters = { + folder: "folderValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderAssetsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderAssetsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderAssetsPath', () => { + const result = client.folderAssetsPath("folderValue", "assetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderAssetsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderAssetsName', () => { + const result = client.matchFolderFromFolderAssetsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderAssetsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAssetFromFolderAssetsName', () => { + const result = client.matchAssetFromFolderAssetsName(fakePath); + assert.strictEqual(result, "assetValue"); + assert((client.pathTemplates.folderAssetsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderBigQueryExports', async () => { + const fakePath = "/rendered/path/folderBigQueryExports"; + const expectedParameters = { + folder: "folderValue", + export: "exportValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderBigQueryExportsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderBigQueryExportsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderBigQueryExportsPath', () => { + const result = client.folderBigQueryExportsPath("folderValue", "exportValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderBigQueryExportsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderBigQueryExportsName', () => { + const result = client.matchFolderFromFolderBigQueryExportsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExportFromFolderBigQueryExportsName', () => { + const result = client.matchExportFromFolderBigQueryExportsName(fakePath); + assert.strictEqual(result, "exportValue"); + assert((client.pathTemplates.folderBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderConstraintName', async () => { + const fakePath = "/rendered/path/folderConstraintName"; + const expectedParameters = { + folder: "folderValue", + constraint_name: "constraintNameValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderConstraintNamePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderConstraintNamePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderConstraintNamePath', () => { + const result = client.folderConstraintNamePath("folderValue", "constraintNameValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderConstraintNamePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderConstraintNameName', () => { + const result = client.matchFolderFromFolderConstraintNameName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConstraintNameFromFolderConstraintNameName', () => { + const result = client.matchConstraintNameFromFolderConstraintNameName(fakePath); + assert.strictEqual(result, "constraintNameValue"); + assert((client.pathTemplates.folderConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderEventThreatDetectionSettingsModule', async () => { + const fakePath = "/rendered/path/folderEventThreatDetectionSettingsModule"; + const expectedParameters = { + folder: "folderValue", + module: "moduleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderEventThreatDetectionSettingsModulePath', () => { + const result = client.folderEventThreatDetectionSettingsModulePath("folderValue", "moduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderEventThreatDetectionSettingsModuleName', () => { + const result = client.matchFolderFromFolderEventThreatDetectionSettingsModuleName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModuleFromFolderEventThreatDetectionSettingsModuleName', () => { + const result = client.matchModuleFromFolderEventThreatDetectionSettingsModuleName(fakePath); + assert.strictEqual(result, "moduleValue"); + assert((client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderLocationMuteConfigs', async () => { + const fakePath = "/rendered/path/folderLocationMuteConfigs"; + const expectedParameters = { + folder: "folderValue", + location: "locationValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationMuteConfigsPath', () => { + const result = client.folderLocationMuteConfigsPath("folderValue", "locationValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderLocationMuteConfigsName', () => { + const result = client.matchFolderFromFolderLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFolderLocationMuteConfigsName', () => { + const result = client.matchLocationFromFolderLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromFolderLocationMuteConfigsName', () => { + const result = client.matchMuteConfigFromFolderLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderMuteConfigs', async () => { + const fakePath = "/rendered/path/folderMuteConfigs"; + const expectedParameters = { + folder: "folderValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMuteConfigsPath', () => { + const result = client.folderMuteConfigsPath("folderValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMuteConfigsName', () => { + const result = client.matchFolderFromFolderMuteConfigsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromFolderMuteConfigsName', () => { + const result = client.matchMuteConfigFromFolderMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.folderMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderNotificationConfigs', async () => { + const fakePath = "/rendered/path/folderNotificationConfigs"; + const expectedParameters = { + folder: "folderValue", + notification_config: "notificationConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderNotificationConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderNotificationConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderNotificationConfigsPath', () => { + const result = client.folderNotificationConfigsPath("folderValue", "notificationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderNotificationConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderNotificationConfigsName', () => { + const result = client.matchFolderFromFolderNotificationConfigsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNotificationConfigFromFolderNotificationConfigsName', () => { + const result = client.matchNotificationConfigFromFolderNotificationConfigsName(fakePath); + assert.strictEqual(result, "notificationConfigValue"); + assert((client.pathTemplates.folderNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSecurityHealthAnalyticsSettingsCustomModule', async () => { + const fakePath = "/rendered/path/folderSecurityHealthAnalyticsSettingsCustomModule"; + const expectedParameters = { + folder: "folderValue", + custom_module: "customModuleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSecurityHealthAnalyticsSettingsCustomModulePath', () => { + const result = client.folderSecurityHealthAnalyticsSettingsCustomModulePath("folderValue", "customModuleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSecurityHealthAnalyticsSettingsCustomModuleName', () => { + const result = client.matchFolderFromFolderSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomModuleFromFolderSecurityHealthAnalyticsSettingsCustomModuleName', () => { + const result = client.matchCustomModuleFromFolderSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); + assert.strictEqual(result, "customModuleValue"); + assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSecurityHealthAnalyticsSettingsEffectiveCustomModule', async () => { + const fakePath = "/rendered/path/folderSecurityHealthAnalyticsSettingsEffectiveCustomModule"; + const expectedParameters = { + folder: "folderValue", + effective_custom_module: "effectiveCustomModuleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePath', () => { + const result = client.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePath("folderValue", "effectiveCustomModuleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { + const result = client.matchFolderFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEffectiveCustomModuleFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { + const result = client.matchEffectiveCustomModuleFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); + assert.strictEqual(result, "effectiveCustomModuleValue"); + assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSource', async () => { + 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', + }); + await 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('folderSourceFindingExternalSystems', async () => { + const fakePath = "/rendered/path/folderSourceFindingExternalSystems"; + 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', + }); + await client.initialize(); + client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingExternalSystemsPath', () => { + const result = client.folderSourceFindingExternalSystemsPath("folderValue", "sourceValue", "findingValue", "externalsystemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSourceFindingExternalSystemsName', () => { + const result = client.matchFolderFromFolderSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceFindingExternalSystemsName', () => { + const result = client.matchSourceFromFolderSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceFindingExternalSystemsName', () => { + const result = client.matchFindingFromFolderSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalsystemFromFolderSourceFindingExternalSystemsName', () => { + const result = client.matchExternalsystemFromFolderSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "externalsystemValue"); + assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSourceFindingSecurityMarks', async () => { + 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', + }); + await 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.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { + const result = client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSourceFindings', async () => { + const fakePath = "/rendered/path/folderSourceFindings"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSourceFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingsPath', () => { + const result = client.folderSourceFindingsPath("folderValue", "sourceValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSourceFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSourceFindingsName', () => { + const result = client.matchFolderFromFolderSourceFindingsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceFindingsName', () => { + const result = client.matchSourceFromFolderSourceFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceFindingsName', () => { + const result = client.matchFindingFromFolderSourceFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organization', async () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + 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', + }); + await 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('organizationAssets', async () => { + const fakePath = "/rendered/path/organizationAssets"; + const expectedParameters = { + organization: "organizationValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationAssetsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAssetsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationAssetsPath', () => { + const result = client.organizationAssetsPath("organizationValue", "assetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationAssetsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationAssetsName', () => { + const result = client.matchOrganizationFromOrganizationAssetsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationAssetsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAssetFromOrganizationAssetsName', () => { + const result = client.matchAssetFromOrganizationAssetsName(fakePath); + assert.strictEqual(result, "assetValue"); + assert((client.pathTemplates.organizationAssetsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationBigQueryExports', async () => { + const fakePath = "/rendered/path/organizationBigQueryExports"; + const expectedParameters = { + organization: "organizationValue", + export: "exportValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationBigQueryExportsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationBigQueryExportsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationBigQueryExportsPath', () => { + const result = client.organizationBigQueryExportsPath("organizationValue", "exportValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationBigQueryExportsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationBigQueryExportsName', () => { + const result = client.matchOrganizationFromOrganizationBigQueryExportsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExportFromOrganizationBigQueryExportsName', () => { + const result = client.matchExportFromOrganizationBigQueryExportsName(fakePath); + assert.strictEqual(result, "exportValue"); + assert((client.pathTemplates.organizationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationConstraintName', async () => { + const fakePath = "/rendered/path/organizationConstraintName"; + const expectedParameters = { + organization: "organizationValue", + constraint_name: "constraintNameValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationConstraintNamePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationConstraintNamePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationConstraintNamePath', () => { + const result = client.organizationConstraintNamePath("organizationValue", "constraintNameValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationConstraintNamePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationConstraintNameName', () => { + const result = client.matchOrganizationFromOrganizationConstraintNameName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConstraintNameFromOrganizationConstraintNameName', () => { + const result = client.matchConstraintNameFromOrganizationConstraintNameName(fakePath); + assert.strictEqual(result, "constraintNameValue"); + assert((client.pathTemplates.organizationConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationEventThreatDetectionSettings', async () => { + const fakePath = "/rendered/path/organizationEventThreatDetectionSettings"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationEventThreatDetectionSettingsPath', () => { + const result = client.organizationEventThreatDetectionSettingsPath("organizationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationEventThreatDetectionSettingsName', () => { + const result = client.matchOrganizationFromOrganizationEventThreatDetectionSettingsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationEventThreatDetectionSettingsModule', async () => { + const fakePath = "/rendered/path/organizationEventThreatDetectionSettingsModule"; + const expectedParameters = { + organization: "organizationValue", + module: "moduleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationEventThreatDetectionSettingsModulePath', () => { + const result = client.organizationEventThreatDetectionSettingsModulePath("organizationValue", "moduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationEventThreatDetectionSettingsModuleName', () => { + const result = client.matchOrganizationFromOrganizationEventThreatDetectionSettingsModuleName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModuleFromOrganizationEventThreatDetectionSettingsModuleName', () => { + const result = client.matchModuleFromOrganizationEventThreatDetectionSettingsModuleName(fakePath); + assert.strictEqual(result, "moduleValue"); + assert((client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationMuteConfigs', async () => { + const fakePath = "/rendered/path/organizationLocationMuteConfigs"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationMuteConfigsPath', () => { + const result = client.organizationLocationMuteConfigsPath("organizationValue", "locationValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationMuteConfigsName', () => { + const result = client.matchOrganizationFromOrganizationLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationMuteConfigsName', () => { + const result = client.matchLocationFromOrganizationLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromOrganizationLocationMuteConfigsName', () => { + const result = client.matchMuteConfigFromOrganizationLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationMuteConfigs', async () => { + const fakePath = "/rendered/path/organizationMuteConfigs"; + const expectedParameters = { + organization: "organizationValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMuteConfigsPath', () => { + const result = client.organizationMuteConfigsPath("organizationValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMuteConfigsName', () => { + const result = client.matchOrganizationFromOrganizationMuteConfigsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromOrganizationMuteConfigsName', () => { + const result = client.matchMuteConfigFromOrganizationMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.organizationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationNotificationConfigs', async () => { + const fakePath = "/rendered/path/organizationNotificationConfigs"; + const expectedParameters = { + organization: "organizationValue", + notification_config: "notificationConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationNotificationConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationNotificationConfigsPath', () => { + const result = client.organizationNotificationConfigsPath("organizationValue", "notificationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationNotificationConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationNotificationConfigsName', () => { + const result = client.matchOrganizationFromOrganizationNotificationConfigsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNotificationConfigFromOrganizationNotificationConfigsName', () => { + const result = client.matchNotificationConfigFromOrganizationNotificationConfigsName(fakePath); + assert.strictEqual(result, "notificationConfigValue"); + assert((client.pathTemplates.organizationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSecurityHealthAnalyticsSettings', async () => { + const fakePath = "/rendered/path/organizationSecurityHealthAnalyticsSettings"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSecurityHealthAnalyticsSettingsPath', () => { + const result = client.organizationSecurityHealthAnalyticsSettingsPath("organizationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsName', () => { + const result = client.matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSecurityHealthAnalyticsSettingsCustomModule', async () => { + const fakePath = "/rendered/path/organizationSecurityHealthAnalyticsSettingsCustomModule"; + const expectedParameters = { + organization: "organizationValue", + custom_module: "customModuleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSecurityHealthAnalyticsSettingsCustomModulePath', () => { + const result = client.organizationSecurityHealthAnalyticsSettingsCustomModulePath("organizationValue", "customModuleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName', () => { + const result = client.matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName', () => { + const result = client.matchCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); + assert.strictEqual(result, "customModuleValue"); + assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSecurityHealthAnalyticsSettingsEffectiveCustomModule', async () => { + const fakePath = "/rendered/path/organizationSecurityHealthAnalyticsSettingsEffectiveCustomModule"; + const expectedParameters = { + organization: "organizationValue", + effective_custom_module: "effectiveCustomModuleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePath', () => { + const result = client.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePath("organizationValue", "effectiveCustomModuleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { + const result = client.matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEffectiveCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { + const result = client.matchEffectiveCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); + assert.strictEqual(result, "effectiveCustomModuleValue"); + assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSettings', async () => { + const fakePath = "/rendered/path/organizationSettings"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('organizationSimulation', async () => { + const fakePath = "/rendered/path/organizationSimulation"; + const expectedParameters = { + organization: "organizationValue", + simulation: "simulationValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSimulationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSimulationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSimulationPath', () => { + const result = client.organizationSimulationPath("organizationValue", "simulationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSimulationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSimulationName', () => { + const result = client.matchOrganizationFromOrganizationSimulationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSimulationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimulationFromOrganizationSimulationName', () => { + const result = client.matchSimulationFromOrganizationSimulationName(fakePath); + assert.strictEqual(result, "simulationValue"); + assert((client.pathTemplates.organizationSimulationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSource', async () => { + const fakePath = "/rendered/path/organizationSource"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSourcePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourcePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourcePath', () => { + const result = client.organizationSourcePath("organizationValue", "sourceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourcePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceName', () => { + const result = client.matchOrganizationFromOrganizationSourceName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceName', () => { + const result = client.matchSourceFromOrganizationSourceName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSourceFindingExternalSystems', async () => { + const fakePath = "/rendered/path/organizationSourceFindingExternalSystems"; + 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', + }); + await client.initialize(); + client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingExternalSystemsPath', () => { + const result = client.organizationSourceFindingExternalSystemsPath("organizationValue", "sourceValue", "findingValue", "externalsystemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceFindingExternalSystemsName', () => { + const result = client.matchOrganizationFromOrganizationSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceFindingExternalSystemsName', () => { + const result = client.matchSourceFromOrganizationSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromOrganizationSourceFindingExternalSystemsName', () => { + const result = client.matchFindingFromOrganizationSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalsystemFromOrganizationSourceFindingExternalSystemsName', () => { + const result = client.matchExternalsystemFromOrganizationSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "externalsystemValue"); + assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSourceFindingSecurityMarks', async () => { + 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', + }); + await 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('organizationSourceFindings', async () => { + const fakePath = "/rendered/path/organizationSourceFindings"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSourceFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingsPath', () => { + const result = client.organizationSourceFindingsPath("organizationValue", "sourceValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourceFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceFindingsName', () => { + const result = client.matchOrganizationFromOrganizationSourceFindingsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceFindingsName', () => { + const result = client.matchSourceFromOrganizationSourceFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromOrganizationSourceFindingsName', () => { + const result = client.matchFindingFromOrganizationSourceFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectAssetSecurityMarks', async () => { + 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', + }); + await 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('projectAssets', async () => { + const fakePath = "/rendered/path/projectAssets"; + const expectedParameters = { + project: "projectValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectAssetsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectAssetsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectAssetsPath', () => { + const result = client.projectAssetsPath("projectValue", "assetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectAssetsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectAssetsName', () => { + const result = client.matchProjectFromProjectAssetsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectAssetsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAssetFromProjectAssetsName', () => { + const result = client.matchAssetFromProjectAssetsName(fakePath); + assert.strictEqual(result, "assetValue"); + assert((client.pathTemplates.projectAssetsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectBigQueryExports', async () => { + const fakePath = "/rendered/path/projectBigQueryExports"; + const expectedParameters = { + project: "projectValue", + export: "exportValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectBigQueryExportsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectBigQueryExportsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectBigQueryExportsPath', () => { + const result = client.projectBigQueryExportsPath("projectValue", "exportValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectBigQueryExportsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectBigQueryExportsName', () => { + const result = client.matchProjectFromProjectBigQueryExportsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExportFromProjectBigQueryExportsName', () => { + const result = client.matchExportFromProjectBigQueryExportsName(fakePath); + assert.strictEqual(result, "exportValue"); + assert((client.pathTemplates.projectBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectConstraintName', async () => { + const fakePath = "/rendered/path/projectConstraintName"; + const expectedParameters = { + project: "projectValue", + constraint_name: "constraintNameValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectConstraintNamePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectConstraintNamePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectConstraintNamePath', () => { + const result = client.projectConstraintNamePath("projectValue", "constraintNameValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectConstraintNamePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectConstraintNameName', () => { + const result = client.matchProjectFromProjectConstraintNameName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConstraintNameFromProjectConstraintNameName', () => { + const result = client.matchConstraintNameFromProjectConstraintNameName(fakePath); + assert.strictEqual(result, "constraintNameValue"); + assert((client.pathTemplates.projectConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectEventThreatDetectionSettingsModule', async () => { + const fakePath = "/rendered/path/projectEventThreatDetectionSettingsModule"; + const expectedParameters = { + project: "projectValue", + module: "moduleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectEventThreatDetectionSettingsModulePath', () => { + const result = client.projectEventThreatDetectionSettingsModulePath("projectValue", "moduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectEventThreatDetectionSettingsModuleName', () => { + const result = client.matchProjectFromProjectEventThreatDetectionSettingsModuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModuleFromProjectEventThreatDetectionSettingsModuleName', () => { + const result = client.matchModuleFromProjectEventThreatDetectionSettingsModuleName(fakePath); + assert.strictEqual(result, "moduleValue"); + assert((client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationMuteConfigs', async () => { + const fakePath = "/rendered/path/projectLocationMuteConfigs"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationMuteConfigsPath', () => { + const result = client.projectLocationMuteConfigsPath("projectValue", "locationValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationMuteConfigsName', () => { + const result = client.matchProjectFromProjectLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationMuteConfigsName', () => { + const result = client.matchLocationFromProjectLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromProjectLocationMuteConfigsName', () => { + const result = client.matchMuteConfigFromProjectLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectMuteConfigs', async () => { + const fakePath = "/rendered/path/projectMuteConfigs"; + const expectedParameters = { + project: "projectValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMuteConfigsPath', () => { + const result = client.projectMuteConfigsPath("projectValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMuteConfigsName', () => { + const result = client.matchProjectFromProjectMuteConfigsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromProjectMuteConfigsName', () => { + const result = client.matchMuteConfigFromProjectMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.projectMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectNotificationConfigs', async () => { + const fakePath = "/rendered/path/projectNotificationConfigs"; + const expectedParameters = { + project: "projectValue", + notification_config: "notificationConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectNotificationConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectNotificationConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectNotificationConfigsPath', () => { + const result = client.projectNotificationConfigsPath("projectValue", "notificationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectNotificationConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectNotificationConfigsName', () => { + const result = client.matchProjectFromProjectNotificationConfigsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNotificationConfigFromProjectNotificationConfigsName', () => { + const result = client.matchNotificationConfigFromProjectNotificationConfigsName(fakePath); + assert.strictEqual(result, "notificationConfigValue"); + assert((client.pathTemplates.projectNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSecurityHealthAnalyticsSettingsCustomModule', async () => { + const fakePath = "/rendered/path/projectSecurityHealthAnalyticsSettingsCustomModule"; + const expectedParameters = { + project: "projectValue", + custom_module: "customModuleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSecurityHealthAnalyticsSettingsCustomModulePath', () => { + const result = client.projectSecurityHealthAnalyticsSettingsCustomModulePath("projectValue", "customModuleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSecurityHealthAnalyticsSettingsCustomModuleName', () => { + const result = client.matchProjectFromProjectSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomModuleFromProjectSecurityHealthAnalyticsSettingsCustomModuleName', () => { + const result = client.matchCustomModuleFromProjectSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); + assert.strictEqual(result, "customModuleValue"); + assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSecurityHealthAnalyticsSettingsEffectiveCustomModule', async () => { + const fakePath = "/rendered/path/projectSecurityHealthAnalyticsSettingsEffectiveCustomModule"; + const expectedParameters = { + project: "projectValue", + effective_custom_module: "effectiveCustomModuleValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePath', () => { + const result = client.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePath("projectValue", "effectiveCustomModuleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { + const result = client.matchProjectFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEffectiveCustomModuleFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { + const result = client.matchEffectiveCustomModuleFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); + assert.strictEqual(result, "effectiveCustomModuleValue"); + assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSource', async () => { + 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', + }); + await 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('projectSourceFindingExternalSystems', async () => { + const fakePath = "/rendered/path/projectSourceFindingExternalSystems"; + 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', + }); + await client.initialize(); + client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingExternalSystemsPath', () => { + const result = client.projectSourceFindingExternalSystemsPath("projectValue", "sourceValue", "findingValue", "externalsystemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSourceFindingExternalSystemsName', () => { + const result = client.matchProjectFromProjectSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromProjectSourceFindingExternalSystemsName', () => { + const result = client.matchSourceFromProjectSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromProjectSourceFindingExternalSystemsName', () => { + const result = client.matchFindingFromProjectSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalsystemFromProjectSourceFindingExternalSystemsName', () => { + const result = client.matchExternalsystemFromProjectSourceFindingExternalSystemsName(fakePath); + assert.strictEqual(result, "externalsystemValue"); + assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSourceFindingSecurityMarks', async () => { + 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', + }); + await 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('matchSourceFromProjectSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((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)); + }); + }); + + describe('projectSourceFindings', async () => { + const fakePath = "/rendered/path/projectSourceFindings"; + const expectedParameters = { + project: "projectValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSourceFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingsPath', () => { + const result = client.projectSourceFindingsPath("projectValue", "sourceValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSourceFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSourceFindingsName', () => { + const result = client.matchProjectFromProjectSourceFindingsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromProjectSourceFindingsName', () => { + const result = client.matchSourceFromProjectSourceFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromProjectSourceFindingsName', () => { + const result = client.matchFindingFromProjectSourceFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('resourceValueConfig', async () => { + const fakePath = "/rendered/path/resourceValueConfig"; + const expectedParameters = { + organization: "organizationValue", + resource_value_config: "resourceValueConfigValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.resourceValueConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.resourceValueConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('resourceValueConfigPath', () => { + const result = client.resourceValueConfigPath("organizationValue", "resourceValueConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.resourceValueConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromResourceValueConfigName', () => { + const result = client.matchOrganizationFromResourceValueConfigName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.resourceValueConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchResourceValueConfigFromResourceValueConfigName', () => { + const result = client.matchResourceValueConfigFromResourceValueConfigName(fakePath); + assert.strictEqual(result, "resourceValueConfigValue"); + assert((client.pathTemplates.resourceValueConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('simulation', async () => { + const fakePath = "/rendered/path/simulation"; + const expectedParameters = { + organization: "organizationValue", + simulation: "simulationValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.simulationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.simulationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('simulationPath', () => { + const result = client.simulationPath("organizationValue", "simulationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.simulationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromSimulationName', () => { + const result = client.matchOrganizationFromSimulationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.simulationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimulationFromSimulationName', () => { + const result = client.matchSimulationFromSimulationName(fakePath); + assert.strictEqual(result, "simulationValue"); + assert((client.pathTemplates.simulationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('valuedResource', async () => { + const fakePath = "/rendered/path/valuedResource"; + const expectedParameters = { + organization: "organizationValue", + simulation: "simulationValue", + valued_resource: "valuedResourceValue", + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.valuedResourcePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.valuedResourcePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('valuedResourcePath', () => { + const result = client.valuedResourcePath("organizationValue", "simulationValue", "valuedResourceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.valuedResourcePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromValuedResourceName', () => { + const result = client.matchOrganizationFromValuedResourceName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.valuedResourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimulationFromValuedResourceName', () => { + const result = client.matchSimulationFromValuedResourceName(fakePath); + assert.strictEqual(result, "simulationValue"); + assert((client.pathTemplates.valuedResourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchValuedResourceFromValuedResourceName', () => { + const result = client.matchValuedResourceFromValuedResourceName(fakePath); + assert.strictEqual(result, "valuedResourceValue"); + assert((client.pathTemplates.valuedResourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts new file mode 100644 index 00000000000..0bdc83ed249 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -0,0 +1,3237 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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) + .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', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = securitycenterModule.v1beta1.SecurityCenterClient.servicePath; + assert.strictEqual(servicePath, 'securitycenter.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = securitycenterModule.v1beta1.SecurityCenterClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new securitycenterModule.v1beta1.SecurityCenterClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new securitycenterModule.v1beta1.SecurityCenterClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + 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 for the initialized client', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + 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(); + }).catch(err => {throw err}); + }); + + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createSource(request), expectedError); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createFinding(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOrganizationSettings(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getOrganizationSettings(request), expectedError); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSource(request), expectedError); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setFindingState(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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 = 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateFinding(request), expectedError); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateOrganizationSettings(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateOrganizationSettings(request), expectedError); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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 = 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateSource(request), expectedError); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + 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'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.runAssetDiscovery(request); + await assert.rejects(operation.promise(), expectedError); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', + }); + await 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.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.groupAssets, request)); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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.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( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.groupFindings, request)); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAssetsAsync(request); + await 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( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFindings, request)); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); + 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 () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSources, request)); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSourcesAsync(request); + await 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( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('asset', async () => { + 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', + }); + await 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', async () => { + 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', + }); + await 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', async () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + 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', + }); + await 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', async () => { + const fakePath = "/rendered/path/organizationSettings"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + 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', + }); + await 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', async () => { + 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', + }); + await 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/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts new file mode 100644 index 00000000000..a388c67efe6 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -0,0 +1,4368 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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) + .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', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = securitycenterModule.v1p1beta1.SecurityCenterClient.servicePath; + assert.strictEqual(servicePath, 'securitycenter.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = securitycenterModule.v1p1beta1.SecurityCenterClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new securitycenterModule.v1p1beta1.SecurityCenterClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + 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 for the initialized client', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + 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(); + }).catch(err => {throw err}); + }); + + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createSource(request), expectedError); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createFinding(request), expectedError); + }); + }); + + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createNotificationConfig(request), expectedError); + }); + }); + + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteNotificationConfig(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getNotificationConfig(request), expectedError); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOrganizationSettings(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getOrganizationSettings(request), expectedError); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSource(request), expectedError); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setFindingState(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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 = 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateFinding(request), expectedError); + }); + }); + + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateNotificationConfig(request), expectedError); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateOrganizationSettings(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); + request.organizationSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateOrganizationSettings(request), expectedError); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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 = 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateSource(request), expectedError); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + 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'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + 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().catch(err => {throw err}); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.runAssetDiscovery(request); + await assert.rejects(operation.promise(), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', + }); + await 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.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.groupAssets, request)); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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.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( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.groupFindings, request)); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAssetsAsync(request); + await 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( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFindings, request)); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNotificationConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNotificationConfigs(request), expectedError); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNotificationConfigsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNotificationConfigs, request)); + assert( + (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); + 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 () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSources, request)); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSourcesAsync(request); + await 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( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('folderAsset', async () => { + const fakePath = "/rendered/path/folderAsset"; + const expectedParameters = { + folder: "folderValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderAssetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderAssetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderAssetPath', () => { + const result = client.folderAssetPath("folderValue", "assetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderAssetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderAssetName', () => { + const result = client.matchFolderFromFolderAssetName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderAssetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAssetFromFolderAssetName', () => { + const result = client.matchAssetFromFolderAssetName(fakePath); + assert.strictEqual(result, "assetValue"); + assert((client.pathTemplates.folderAssetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderAssetSecurityMarks', async () => { + const fakePath = "/rendered/path/folderAssetSecurityMarks"; + const expectedParameters = { + folder: "folderValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + 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', + }); + await 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', async () => { + const fakePath = "/rendered/path/folderSourceFinding"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSourceFindingPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingPath', () => { + const result = client.folderSourceFindingPath("folderValue", "sourceValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSourceFindingPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + 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', async () => { + 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', + }); + await 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.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { + const result = client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('notificationConfig', async () => { + 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', + }); + await 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', async () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('organizationAsset', async () => { + 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', + }); + await 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', async () => { + 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', + }); + await 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', async () => { + const fakePath = "/rendered/path/organizationSettings"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('organizationSource', async () => { + const fakePath = "/rendered/path/organizationSource"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSourcePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourcePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourcePath', () => { + const result = client.organizationSourcePath("organizationValue", "sourceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourcePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceName', () => { + const result = client.matchOrganizationFromOrganizationSourceName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceName', () => { + const result = client.matchSourceFromOrganizationSourceName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSourceFinding', async () => { + 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', + }); + await client.initialize(); + client.pathTemplates.organizationSourceFindingPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingPathTemplate.match = + sinon.stub().returns(expectedParameters); + + 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', async () => { + 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', + }); + await 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('projectAsset', async () => { + 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', + }); + await 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', async () => { + 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', + }); + await 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', async () => { + 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', + }); + await 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', async () => { + 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', + }); + await 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', async () => { + 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', + }); + await 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('matchSourceFromProjectSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((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)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v2.ts b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v2.ts new file mode 100644 index 00000000000..de8659027bd --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v2.ts @@ -0,0 +1,8513 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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) + .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('v2.SecurityCenterClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new securitycenterModule.v2.SecurityCenterClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new securitycenterModule.v2.SecurityCenterClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = securitycenterModule.v2.SecurityCenterClient.servicePath; + assert.strictEqual(servicePath, 'securitycenter.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = securitycenterModule.v2.SecurityCenterClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new securitycenterModule.v2.SecurityCenterClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new securitycenterModule.v2.SecurityCenterClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new securitycenterModule.v2.SecurityCenterClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new securitycenterModule.v2.SecurityCenterClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'securitycenter.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new securitycenterModule.v2.SecurityCenterClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = securitycenterModule.v2.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitycenterModule.v2.SecurityCenterClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v2.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 initialized client', done => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v2.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.v2.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('batchCreateResourceValueConfigs', () => { + it('invokes batchCreateResourceValueConfigs without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse() + ); + client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateResourceValueConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateResourceValueConfigs without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse() + ); + client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateResourceValueConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateResourceValueConfigs with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateResourceValueConfigs(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateResourceValueConfigs with closed client', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.batchCreateResourceValueConfigs(request), expectedError); + }); + }); + + describe('createBigQueryExport', () => { + it('invokes createBigQueryExport without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateBigQueryExportRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BigQueryExport() + ); + client.innerApiCalls.createBigQueryExport = stubSimpleCall(expectedResponse); + const [response] = await client.createBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateBigQueryExportRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BigQueryExport() + ); + client.innerApiCalls.createBigQueryExport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBigQueryExport( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBigQueryExport|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateBigQueryExportRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createBigQueryExport(request), expectedError); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); + const [response] = await client.createFinding(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFinding( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IFinding|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateFindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateFindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createFinding(request), expectedError); + }); + }); + + describe('createMuteConfig', () => { + it('invokes createMuteConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + // path template: organizations/*/locations/{location=*} + request.parent = 'organizations/value/locations/value'; + // path template: folders/*/locations/{location=*} + request.parent = 'folders/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.MuteConfig() + ); + client.innerApiCalls.createMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.createMuteConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + // path template: organizations/*/locations/{location=*} + request.parent = 'organizations/value/locations/value'; + // path template: folders/*/locations/{location=*} + request.parent = 'folders/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.MuteConfig() + ); + client.innerApiCalls.createMuteConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMuteConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IMuteConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + // path template: organizations/*/locations/{location=*} + request.parent = 'organizations/value/locations/value'; + // path template: folders/*/locations/{location=*} + request.parent = 'folders/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createMuteConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMuteConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + // path template: organizations/*/locations/{location=*} + request.parent = 'organizations/value/locations/value'; + // path template: folders/*/locations/{location=*} + request.parent = 'folders/value/locations/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createMuteConfig(request), expectedError); + }); + }); + + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = stubSimpleCall(expectedResponse); + const [response] = await client.createNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNotificationConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.INotificationConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateNotificationConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createNotificationConfig(request), expectedError); + }); + }); + + describe('createSource', () => { + it('invokes createSource without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Source() + ); + client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); + const [response] = await client.createSource(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Source() + ); + client.innerApiCalls.createSource = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSource( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISource|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.CreateSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateSourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createSource(request), expectedError); + }); + }); + + describe('deleteBigQueryExport', () => { + it('invokes deleteBigQueryExport without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBigQueryExport = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBigQueryExport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBigQueryExport( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteBigQueryExport(request), expectedError); + }); + }); + + describe('deleteMuteConfig', () => { + it('invokes deleteMuteConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.name = 'projects/value/locations/value/muteConfigs/value'; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.name = 'organizations/value/locations/value/muteConfigs/value'; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMuteConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.name = 'projects/value/locations/value/muteConfigs/value'; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.name = 'organizations/value/locations/value/muteConfigs/value'; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMuteConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMuteConfig( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.name = 'projects/value/locations/value/muteConfigs/value'; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.name = 'organizations/value/locations/value/muteConfigs/value'; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMuteConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteMuteConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.name = 'projects/value/locations/value/muteConfigs/value'; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.name = 'organizations/value/locations/value/muteConfigs/value'; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteMuteConfig(request), expectedError); + }); + }); + + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteNotificationConfig(request), expectedError); + }); + }); + + describe('deleteResourceValueConfig', () => { + it('invokes deleteResourceValueConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteResourceValueConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteResourceValueConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceValueConfig without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteResourceValueConfig( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceValueConfig with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteResourceValueConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteResourceValueConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceValueConfig with closed client', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteResourceValueConfig(request), expectedError); + }); + }); + + describe('getBigQueryExport', () => { + it('invokes getBigQueryExport without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BigQueryExport() + ); + client.innerApiCalls.getBigQueryExport = stubSimpleCall(expectedResponse); + const [response] = await client.getBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BigQueryExport() + ); + client.innerApiCalls.getBigQueryExport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBigQueryExport( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBigQueryExport|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetBigQueryExportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetBigQueryExportRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBigQueryExport(request), expectedError); + }); + }); + + describe('getSimulation', () => { + it('invokes getSimulation without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetSimulationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSimulationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Simulation() + ); + client.innerApiCalls.getSimulation = stubSimpleCall(expectedResponse); + const [response] = await client.getSimulation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSimulation without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetSimulationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSimulationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Simulation() + ); + client.innerApiCalls.getSimulation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSimulation( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISimulation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSimulation with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetSimulationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSimulationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSimulation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSimulation(request), expectedError); + const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSimulation with closed client', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetSimulationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSimulationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSimulation(request), expectedError); + }); + }); + + describe('getValuedResource', () => { + it('invokes getValuedResource without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetValuedResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetValuedResourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ValuedResource() + ); + client.innerApiCalls.getValuedResource = stubSimpleCall(expectedResponse); + const [response] = await client.getValuedResource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getValuedResource without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetValuedResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetValuedResourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ValuedResource() + ); + client.innerApiCalls.getValuedResource = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getValuedResource( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IValuedResource|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getValuedResource with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetValuedResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetValuedResourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getValuedResource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getValuedResource(request), expectedError); + const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getValuedResource with closed client', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetValuedResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetValuedResourceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getValuedResource(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('getMuteConfig', () => { + it('invokes getMuteConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.name = 'projects/value/locations/value/muteConfigs/value'; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.name = 'organizations/value/locations/value/muteConfigs/value'; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.MuteConfig() + ); + client.innerApiCalls.getMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getMuteConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.name = 'projects/value/locations/value/muteConfigs/value'; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.name = 'organizations/value/locations/value/muteConfigs/value'; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.MuteConfig() + ); + client.innerApiCalls.getMuteConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMuteConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IMuteConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.name = 'projects/value/locations/value/muteConfigs/value'; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.name = 'organizations/value/locations/value/muteConfigs/value'; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.getMuteConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMuteConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetMuteConfigRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.name = 'projects/value/locations/value/muteConfigs/value'; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.name = 'organizations/value/locations/value/muteConfigs/value'; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getMuteConfig(request), expectedError); + }); + }); + + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNotificationConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.INotificationConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetNotificationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetNotificationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getNotificationConfig(request), expectedError); + }); + }); + + describe('getResourceValueConfig', () => { + it('invokes getResourceValueConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ResourceValueConfig() + ); + client.innerApiCalls.getResourceValueConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getResourceValueConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceValueConfig without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ResourceValueConfig() + ); + client.innerApiCalls.getResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getResourceValueConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IResourceValueConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceValueConfig with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getResourceValueConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getResourceValueConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceValueConfig with closed client', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetResourceValueConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetResourceValueConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getResourceValueConfig(request), expectedError); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Source() + ); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Source() + ); + client.innerApiCalls.getSource = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSource( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISource|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GetSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSource(request), expectedError); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setFindingState( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IFinding|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SetFindingStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.SetFindingStateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setFindingState(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('setMute', () => { + it('invokes setMute without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SetMuteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.SetMuteRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Finding() + ); + client.innerApiCalls.setMute = stubSimpleCall(expectedResponse); + const [response] = await client.setMute(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SetMuteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.SetMuteRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Finding() + ); + client.innerApiCalls.setMute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMute( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IFinding|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SetMuteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SetMuteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.SetMuteRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setMute(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('updateBigQueryExport', () => { + it('invokes updateBigQueryExport without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BigQueryExport() + ); + client.innerApiCalls.updateBigQueryExport = stubSimpleCall(expectedResponse); + const [response] = await client.updateBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BigQueryExport() + ); + client.innerApiCalls.updateBigQueryExport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBigQueryExport( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBigQueryExport|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); + request.bigQueryExport.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateBigQueryExport(request), expectedError); + }); + }); + + describe('updateExternalSystem', () => { + it('invokes updateExternalSystem without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateExternalSystemRequest', ['externalSystem', 'name']); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ExternalSystem() + ); + client.innerApiCalls.updateExternalSystem = stubSimpleCall(expectedResponse); + const [response] = await client.updateExternalSystem(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateExternalSystemRequest', ['externalSystem', 'name']); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ExternalSystem() + ); + client.innerApiCalls.updateExternalSystem = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExternalSystem( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IExternalSystem|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateExternalSystemRequest', ['externalSystem', 'name']); + request.externalSystem.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateExternalSystem(request), expectedError); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateFindingRequest', ['finding', 'name']); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateFindingRequest', ['finding', 'name']); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFinding( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IFinding|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateFindingRequest', ['finding', 'name']); + request.finding.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateFinding(request), expectedError); + }); + }); + + describe('updateMuteConfig', () => { + it('invokes updateMuteConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateMuteConfigRequest() + ); + request.muteConfig = {}; + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'projects/value/locations/value/muteConfigs/value'; + request.muteConfig = {}; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'organizations/value/locations/value/muteConfigs/value'; + request.muteConfig = {}; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.MuteConfig() + ); + client.innerApiCalls.updateMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateMuteConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateMuteConfigRequest() + ); + request.muteConfig = {}; + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'projects/value/locations/value/muteConfigs/value'; + request.muteConfig = {}; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'organizations/value/locations/value/muteConfigs/value'; + request.muteConfig = {}; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.MuteConfig() + ); + client.innerApiCalls.updateMuteConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMuteConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IMuteConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateMuteConfigRequest() + ); + request.muteConfig = {}; + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'projects/value/locations/value/muteConfigs/value'; + request.muteConfig = {}; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'organizations/value/locations/value/muteConfigs/value'; + request.muteConfig = {}; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMuteConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMuteConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateMuteConfigRequest() + ); + request.muteConfig = {}; + // path template: projects/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'projects/value/locations/value/muteConfigs/value'; + request.muteConfig = {}; + // path template: organizations/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'organizations/value/locations/value/muteConfigs/value'; + request.muteConfig = {}; + // path template: folders/*/locations/{location=*}/muteConfigs/* + request.muteConfig.name = 'folders/value/locations/value/muteConfigs/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateMuteConfig(request), expectedError); + }); + }); + + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNotificationConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.INotificationConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateNotificationConfig(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); + request.notificationConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateNotificationConfig(request), expectedError); + }); + }); + + describe('updateResourceValueConfig', () => { + it('invokes updateResourceValueConfig without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest() + ); + request.resourceValueConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); + request.resourceValueConfig.name = defaultValue1; + const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ResourceValueConfig() + ); + client.innerApiCalls.updateResourceValueConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateResourceValueConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceValueConfig without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest() + ); + request.resourceValueConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); + request.resourceValueConfig.name = defaultValue1; + const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ResourceValueConfig() + ); + client.innerApiCalls.updateResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateResourceValueConfig( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IResourceValueConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceValueConfig with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest() + ); + request.resourceValueConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); + request.resourceValueConfig.name = defaultValue1; + const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateResourceValueConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateResourceValueConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceValueConfig with closed client', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest() + ); + request.resourceValueConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); + request.resourceValueConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateResourceValueConfig(request), expectedError); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall(expectedResponse); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISecurityMarks|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest', ['securityMarks', 'name']); + request.securityMarks.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSourceRequest', ['source', 'name']); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSourceRequest', ['source', 'name']); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISource|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSourceRequest', ['source', 'name']); + request.source.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateSource(request), expectedError); + }); + }); + + describe('bulkMuteFindings', () => { + it('invokes bulkMuteFindings without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BulkMuteFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.BulkMuteFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BulkMuteFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.BulkMuteFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BulkMuteFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.BulkMuteFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.BulkMuteFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.bulkMuteFindings(request); + await assert.rejects(operation.promise(), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + ]; + client.innerApiCalls.groupFindings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupFindings( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IGroupResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.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.v2.GroupResult[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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.v2.GroupResult[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.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.groupFindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.groupFindings, request)); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupFindings without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), + ]; + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupFindings with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.groupFindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAttackPaths', () => { + it('invokes listAttackPaths without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + ]; + client.innerApiCalls.listAttackPaths = stubSimpleCall(expectedResponse); + const [response] = await client.listAttackPaths(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttackPaths without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + ]; + client.innerApiCalls.listAttackPaths = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAttackPaths( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IAttackPath[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttackPaths with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAttackPaths = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAttackPaths(request), expectedError); + const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttackPathsStream without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + ]; + client.descriptors.page.listAttackPaths.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAttackPathsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v2.AttackPath[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.AttackPath) => { + 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.listAttackPaths.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttackPaths, request)); + assert( + (client.descriptors.page.listAttackPaths.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAttackPathsStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttackPaths.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAttackPathsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v2.AttackPath[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.AttackPath) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAttackPaths.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttackPaths, request)); + assert( + (client.descriptors.page.listAttackPaths.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttackPaths without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), + ]; + client.descriptors.page.listAttackPaths.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.IAttackPath[] = []; + const iterable = client.listAttackPathsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttackPaths with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttackPaths.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAttackPathsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.IAttackPath[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBigQueryExports', () => { + it('invokes listBigQueryExports without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + ]; + client.innerApiCalls.listBigQueryExports = stubSimpleCall(expectedResponse); + const [response] = await client.listBigQueryExports(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + ]; + client.innerApiCalls.listBigQueryExports = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBigQueryExports( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBigQueryExport[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + ]; + client.descriptors.page.listBigQueryExports.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBigQueryExportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v2.BigQueryExport[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.BigQueryExport) => { + 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.listBigQueryExports.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBigQueryExports, request)); + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBigQueryExportsStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + 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.v2.BigQueryExport[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.BigQueryExport) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBigQueryExports, request)); + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBigQueryExports without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), + ]; + client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.IBigQueryExport[] = []; + const iterable = client.listBigQueryExportsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBigQueryExports with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBigQueryExportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.IBigQueryExport[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + ]; + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + ]; + client.innerApiCalls.listFindings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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.v2.ListFindingsResponse.ListFindingsResult[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFindings, request)); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFindings without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), + ]; + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFindings with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListFindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMuteConfigs', () => { + it('invokes listMuteConfigs without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs + request.parent = 'projects/value/locations/value/muteConfigs'; + // path template: organizations/*/locations/{location=*}/muteConfigs + request.parent = 'organizations/value/locations/value/muteConfigs'; + // path template: folders/*/locations/{location=*}/muteConfigs + request.parent = 'folders/value/locations/value/muteConfigs'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + ]; + client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listMuteConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs + request.parent = 'projects/value/locations/value/muteConfigs'; + // path template: organizations/*/locations/{location=*}/muteConfigs + request.parent = 'organizations/value/locations/value/muteConfigs'; + // path template: folders/*/locations/{location=*}/muteConfigs + request.parent = 'folders/value/locations/value/muteConfigs'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + ]; + client.innerApiCalls.listMuteConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMuteConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IMuteConfig[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs + request.parent = 'projects/value/locations/value/muteConfigs'; + // path template: organizations/*/locations/{location=*}/muteConfigs + request.parent = 'organizations/value/locations/value/muteConfigs'; + // path template: folders/*/locations/{location=*}/muteConfigs + request.parent = 'folders/value/locations/value/muteConfigs'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listMuteConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMuteConfigs(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs + request.parent = 'projects/value/locations/value/muteConfigs'; + // path template: organizations/*/locations/{location=*}/muteConfigs + request.parent = 'organizations/value/locations/value/muteConfigs'; + // path template: folders/*/locations/{location=*}/muteConfigs + request.parent = 'folders/value/locations/value/muteConfigs'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + ]; + client.descriptors.page.listMuteConfigs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMuteConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v2.MuteConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.MuteConfig) => { + 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.listMuteConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMuteConfigs, request)); + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMuteConfigsStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs + request.parent = 'projects/value/locations/value/muteConfigs'; + // path template: organizations/*/locations/{location=*}/muteConfigs + request.parent = 'organizations/value/locations/value/muteConfigs'; + // path template: folders/*/locations/{location=*}/muteConfigs + request.parent = 'folders/value/locations/value/muteConfigs'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + 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.v2.MuteConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.MuteConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMuteConfigs, request)); + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMuteConfigs without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs + request.parent = 'projects/value/locations/value/muteConfigs'; + // path template: organizations/*/locations/{location=*}/muteConfigs + request.parent = 'organizations/value/locations/value/muteConfigs'; + // path template: folders/*/locations/{location=*}/muteConfigs + request.parent = 'folders/value/locations/value/muteConfigs'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), + ]; + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.IMuteConfig[] = []; + const iterable = client.listMuteConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMuteConfigs with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() + ); + // path template: projects/*/locations/{location=*}/muteConfigs + request.parent = 'projects/value/locations/value/muteConfigs'; + // path template: organizations/*/locations/{location=*}/muteConfigs + request.parent = 'organizations/value/locations/value/muteConfigs'; + // path template: folders/*/locations/{location=*}/muteConfigs + request.parent = 'folders/value/locations/value/muteConfigs'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMuteConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.IMuteConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + ]; + client.innerApiCalls.listNotificationConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listNotificationConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + ]; + client.innerApiCalls.listNotificationConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNotificationConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.INotificationConfig[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNotificationConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNotificationConfigs(request), expectedError); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.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.v2.NotificationConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNotificationConfigsStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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.v2.NotificationConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.NotificationConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNotificationConfigs, request)); + assert( + (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), + ]; + client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNotificationConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listResourceValueConfigs', () => { + it('invokes listResourceValueConfigs without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + ]; + client.innerApiCalls.listResourceValueConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listResourceValueConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceValueConfigs without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + ]; + client.innerApiCalls.listResourceValueConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listResourceValueConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IResourceValueConfig[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceValueConfigs with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listResourceValueConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listResourceValueConfigs(request), expectedError); + const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceValueConfigsStream without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + ]; + client.descriptors.page.listResourceValueConfigs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listResourceValueConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v2.ResourceValueConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.ResourceValueConfig) => { + 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.listResourceValueConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceValueConfigs, request)); + assert( + (client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listResourceValueConfigsStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceValueConfigs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listResourceValueConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v2.ResourceValueConfig[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.ResourceValueConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceValueConfigs, request)); + assert( + (client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceValueConfigs without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), + ]; + client.descriptors.page.listResourceValueConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.IResourceValueConfig[] = []; + const iterable = client.listResourceValueConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceValueConfigs with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceValueConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listResourceValueConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.IResourceValueConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + ]; + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + ]; + client.innerApiCalls.listSources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSources( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISource[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.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); + 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 () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.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.v2.Source[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + 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.v2.Source[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.Source) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSources, request)); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), + ]; + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.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( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listValuedResources', () => { + it('invokes listValuedResources without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + ]; + client.innerApiCalls.listValuedResources = stubSimpleCall(expectedResponse); + const [response] = await client.listValuedResources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listValuedResources without error using callback', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + ]; + client.innerApiCalls.listValuedResources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listValuedResources( + request, + (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IValuedResource[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listValuedResources with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listValuedResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listValuedResources(request), expectedError); + const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listValuedResourcesStream without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + ]; + client.descriptors.page.listValuedResources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listValuedResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v2.ValuedResource[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.ValuedResource) => { + 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.listValuedResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listValuedResources, request)); + assert( + (client.descriptors.page.listValuedResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listValuedResourcesStream with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listValuedResources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listValuedResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v2.ValuedResource[] = []; + stream.on('data', (response: protos.google.cloud.securitycenter.v2.ValuedResource) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listValuedResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listValuedResources, request)); + assert( + (client.descriptors.page.listValuedResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listValuedResources without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), + ]; + client.descriptors.page.listValuedResources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v2.IValuedResource[] = []; + const iterable = client.listValuedResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listValuedResources with error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listValuedResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listValuedResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v2.IValuedResource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.v2.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); + } + }).catch(err => {throw err}); + }); + 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.v2.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.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.v2.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); + } + }).catch(err => {throw err}); + }); + 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.v2.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.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.v2.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); + } + }).catch(err => {throw err}); + }); + 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.v2.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.v2.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.IOperation[] = []; + 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.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('folderAssetSecurityMarks', async () => { + const fakePath = "/rendered/path/folderAssetSecurityMarks"; + const expectedParameters = { + folder: "folderValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('folderConstraintName', async () => { + const fakePath = "/rendered/path/folderConstraintName"; + const expectedParameters = { + folder: "folderValue", + constraint_name: "constraintNameValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderConstraintNamePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderConstraintNamePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderConstraintNamePath', () => { + const result = client.folderConstraintNamePath("folderValue", "constraintNameValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderConstraintNamePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderConstraintNameName', () => { + const result = client.matchFolderFromFolderConstraintNameName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConstraintNameFromFolderConstraintNameName', () => { + const result = client.matchConstraintNameFromFolderConstraintNameName(fakePath); + assert.strictEqual(result, "constraintNameValue"); + assert((client.pathTemplates.folderConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderLocationBigQueryExports', async () => { + const fakePath = "/rendered/path/folderLocationBigQueryExports"; + const expectedParameters = { + folder: "folderValue", + location: "locationValue", + export: "exportValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBigQueryExportsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationBigQueryExportsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationBigQueryExportsPath', () => { + const result = client.folderLocationBigQueryExportsPath("folderValue", "locationValue", "exportValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderLocationBigQueryExportsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderLocationBigQueryExportsName', () => { + const result = client.matchFolderFromFolderLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFolderLocationBigQueryExportsName', () => { + const result = client.matchLocationFromFolderLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.folderLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExportFromFolderLocationBigQueryExportsName', () => { + const result = client.matchExportFromFolderLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "exportValue"); + assert((client.pathTemplates.folderLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderLocationMuteConfigs', async () => { + const fakePath = "/rendered/path/folderLocationMuteConfigs"; + const expectedParameters = { + folder: "folderValue", + location: "locationValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationMuteConfigsPath', () => { + const result = client.folderLocationMuteConfigsPath("folderValue", "locationValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderLocationMuteConfigsName', () => { + const result = client.matchFolderFromFolderLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFolderLocationMuteConfigsName', () => { + const result = client.matchLocationFromFolderLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromFolderLocationMuteConfigsName', () => { + const result = client.matchMuteConfigFromFolderLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderLocationNotificationConfigs', async () => { + const fakePath = "/rendered/path/folderLocationNotificationConfigs"; + const expectedParameters = { + folder: "folderValue", + location: "locationValue", + notification_config: "notificationConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationNotificationConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationNotificationConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationNotificationConfigsPath', () => { + const result = client.folderLocationNotificationConfigsPath("folderValue", "locationValue", "notificationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderLocationNotificationConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderLocationNotificationConfigsName', () => { + const result = client.matchFolderFromFolderLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFolderLocationNotificationConfigsName', () => { + const result = client.matchLocationFromFolderLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.folderLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNotificationConfigFromFolderLocationNotificationConfigsName', () => { + const result = client.matchNotificationConfigFromFolderLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "notificationConfigValue"); + assert((client.pathTemplates.folderLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderMuteConfigs', async () => { + const fakePath = "/rendered/path/folderMuteConfigs"; + const expectedParameters = { + folder: "folderValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderMuteConfigsPath', () => { + const result = client.folderMuteConfigsPath("folderValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderMuteConfigsName', () => { + const result = client.matchFolderFromFolderMuteConfigsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromFolderMuteConfigsName', () => { + const result = client.matchMuteConfigFromFolderMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.folderMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSource', async () => { + const fakePath = "/rendered/path/folderSource"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('folderSourceFindingExternalsystem', async () => { + const fakePath = "/rendered/path/folderSourceFindingExternalsystem"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + finding: "findingValue", + externalsystem: "externalsystemValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/folderSourceFindingSecurityMarks"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { + const result = client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSourceFindings', async () => { + const fakePath = "/rendered/path/folderSourceFindings"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSourceFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingsPath', () => { + const result = client.folderSourceFindingsPath("folderValue", "sourceValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSourceFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSourceFindingsName', () => { + const result = client.matchFolderFromFolderSourceFindingsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceFindingsName', () => { + const result = client.matchSourceFromFolderSourceFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceFindingsName', () => { + const result = client.matchFindingFromFolderSourceFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSourceLocationFindingExternalsystem', async () => { + const fakePath = "/rendered/path/folderSourceLocationFindingExternalsystem"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + externalsystem: "externalsystemValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceLocationFindingExternalsystemPath', () => { + const result = client.folderSourceLocationFindingExternalsystemPath("folderValue", "sourceValue", "locationValue", "findingValue", "externalsystemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSourceLocationFindingExternalsystemName', () => { + const result = client.matchFolderFromFolderSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceLocationFindingExternalsystemName', () => { + const result = client.matchSourceFromFolderSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFolderSourceLocationFindingExternalsystemName', () => { + const result = client.matchLocationFromFolderSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceLocationFindingExternalsystemName', () => { + const result = client.matchFindingFromFolderSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalsystemFromFolderSourceLocationFindingExternalsystemName', () => { + const result = client.matchExternalsystemFromFolderSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "externalsystemValue"); + assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSourceLocationFindingSecurityMarks', async () => { + const fakePath = "/rendered/path/folderSourceLocationFindingSecurityMarks"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceLocationFindingSecurityMarksPath', () => { + const result = client.folderSourceLocationFindingSecurityMarksPath("folderValue", "sourceValue", "locationValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSourceLocationFindingSecurityMarksName', () => { + const result = client.matchFolderFromFolderSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceLocationFindingSecurityMarksName', () => { + const result = client.matchSourceFromFolderSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFolderSourceLocationFindingSecurityMarksName', () => { + const result = client.matchLocationFromFolderSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceLocationFindingSecurityMarksName', () => { + const result = client.matchFindingFromFolderSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSourceLocationFindings', async () => { + const fakePath = "/rendered/path/folderSourceLocationFindings"; + const expectedParameters = { + folder: "folderValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSourceLocationFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceLocationFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceLocationFindingsPath', () => { + const result = client.folderSourceLocationFindingsPath("folderValue", "sourceValue", "locationValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSourceLocationFindingsName', () => { + const result = client.matchFolderFromFolderSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromFolderSourceLocationFindingsName', () => { + const result = client.matchSourceFromFolderSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFolderSourceLocationFindingsName', () => { + const result = client.matchLocationFromFolderSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromFolderSourceLocationFindingsName', () => { + const result = client.matchFindingFromFolderSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organization', async () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/organizationAssetSecurityMarks"; + const expectedParameters = { + organization: "organizationValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('organizationConstraintName', async () => { + const fakePath = "/rendered/path/organizationConstraintName"; + const expectedParameters = { + organization: "organizationValue", + constraint_name: "constraintNameValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationConstraintNamePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationConstraintNamePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationConstraintNamePath', () => { + const result = client.organizationConstraintNamePath("organizationValue", "constraintNameValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationConstraintNamePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationConstraintNameName', () => { + const result = client.matchOrganizationFromOrganizationConstraintNameName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConstraintNameFromOrganizationConstraintNameName', () => { + const result = client.matchConstraintNameFromOrganizationConstraintNameName(fakePath); + assert.strictEqual(result, "constraintNameValue"); + assert((client.pathTemplates.organizationConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocation', async () => { + const fakePath = "/rendered/path/organizationLocation"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationPath', () => { + const result = client.organizationLocationPath("organizationValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationName', () => { + const result = client.matchOrganizationFromOrganizationLocationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationName', () => { + const result = client.matchLocationFromOrganizationLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationBigQueryExports', async () => { + const fakePath = "/rendered/path/organizationLocationBigQueryExports"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + export: "exportValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationBigQueryExportsPath', () => { + const result = client.organizationLocationBigQueryExportsPath("organizationValue", "locationValue", "exportValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationBigQueryExportsName', () => { + const result = client.matchOrganizationFromOrganizationLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationBigQueryExportsName', () => { + const result = client.matchLocationFromOrganizationLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExportFromOrganizationLocationBigQueryExportsName', () => { + const result = client.matchExportFromOrganizationLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "exportValue"); + assert((client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationMuteConfigs', async () => { + const fakePath = "/rendered/path/organizationLocationMuteConfigs"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationMuteConfigsPath', () => { + const result = client.organizationLocationMuteConfigsPath("organizationValue", "locationValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationMuteConfigsName', () => { + const result = client.matchOrganizationFromOrganizationLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationMuteConfigsName', () => { + const result = client.matchLocationFromOrganizationLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromOrganizationLocationMuteConfigsName', () => { + const result = client.matchMuteConfigFromOrganizationLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationNotificationConfigs', async () => { + const fakePath = "/rendered/path/organizationLocationNotificationConfigs"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + notification_config: "notificationConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationNotificationConfigsPath', () => { + const result = client.organizationLocationNotificationConfigsPath("organizationValue", "locationValue", "notificationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationNotificationConfigsName', () => { + const result = client.matchOrganizationFromOrganizationLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationNotificationConfigsName', () => { + const result = client.matchLocationFromOrganizationLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNotificationConfigFromOrganizationLocationNotificationConfigsName', () => { + const result = client.matchNotificationConfigFromOrganizationLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "notificationConfigValue"); + assert((client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationResourceValueConfigs', async () => { + const fakePath = "/rendered/path/organizationLocationResourceValueConfigs"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + resource_value_config: "resourceValueConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationResourceValueConfigsPath', () => { + const result = client.organizationLocationResourceValueConfigsPath("organizationValue", "locationValue", "resourceValueConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationResourceValueConfigsName', () => { + const result = client.matchOrganizationFromOrganizationLocationResourceValueConfigsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationResourceValueConfigsName', () => { + const result = client.matchLocationFromOrganizationLocationResourceValueConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchResourceValueConfigFromOrganizationLocationResourceValueConfigsName', () => { + const result = client.matchResourceValueConfigFromOrganizationLocationResourceValueConfigsName(fakePath); + assert.strictEqual(result, "resourceValueConfigValue"); + assert((client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSimluationValuedResources', async () => { + const fakePath = "/rendered/path/organizationLocationSimluationValuedResources"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + simluation: "simluationValue", + valued_resource: "valuedResourceValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSimluationValuedResourcesPath', () => { + const result = client.organizationLocationSimluationValuedResourcesPath("organizationValue", "locationValue", "simluationValue", "valuedResourceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSimluationValuedResourcesName', () => { + const result = client.matchOrganizationFromOrganizationLocationSimluationValuedResourcesName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSimluationValuedResourcesName', () => { + const result = client.matchLocationFromOrganizationLocationSimluationValuedResourcesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimluationFromOrganizationLocationSimluationValuedResourcesName', () => { + const result = client.matchSimluationFromOrganizationLocationSimluationValuedResourcesName(fakePath); + assert.strictEqual(result, "simluationValue"); + assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchValuedResourceFromOrganizationLocationSimluationValuedResourcesName', () => { + const result = client.matchValuedResourceFromOrganizationLocationSimluationValuedResourcesName(fakePath); + assert.strictEqual(result, "valuedResourceValue"); + assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSimulationValuedResourceAttackPaths', async () => { + const fakePath = "/rendered/path/organizationLocationSimulationValuedResourceAttackPaths"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + simulation: "simulationValue", + valued_resource: "valuedResourceValue", + attack_path: "attackPathValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSimulationValuedResourceAttackPathsPath', () => { + const result = client.organizationLocationSimulationValuedResourceAttackPathsPath("organizationValue", "locationValue", "simulationValue", "valuedResourceValue", "attackPathValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchOrganizationFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchLocationFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimulationFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchSimulationFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "simulationValue"); + assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchValuedResourceFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchValuedResourceFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "valuedResourceValue"); + assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttackPathFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchAttackPathFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "attackPathValue"); + assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSimulations', async () => { + const fakePath = "/rendered/path/organizationLocationSimulations"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + simluation: "simluationValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSimulationsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSimulationsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSimulationsPath', () => { + const result = client.organizationLocationSimulationsPath("organizationValue", "locationValue", "simluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSimulationsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSimulationsName', () => { + const result = client.matchOrganizationFromOrganizationLocationSimulationsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSimulationsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSimulationsName', () => { + const result = client.matchLocationFromOrganizationLocationSimulationsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSimulationsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimluationFromOrganizationLocationSimulationsName', () => { + const result = client.matchSimluationFromOrganizationLocationSimulationsName(fakePath); + assert.strictEqual(result, "simluationValue"); + assert((client.pathTemplates.organizationLocationSimulationsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationMuteConfigs', async () => { + const fakePath = "/rendered/path/organizationMuteConfigs"; + const expectedParameters = { + organization: "organizationValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationMuteConfigsPath', () => { + const result = client.organizationMuteConfigsPath("organizationValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationMuteConfigsName', () => { + const result = client.matchOrganizationFromOrganizationMuteConfigsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromOrganizationMuteConfigsName', () => { + const result = client.matchMuteConfigFromOrganizationMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.organizationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationResourceValueConfigs', async () => { + const fakePath = "/rendered/path/organizationResourceValueConfigs"; + const expectedParameters = { + organization: "organizationValue", + resource_value_config: "resourceValueConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationResourceValueConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationResourceValueConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationResourceValueConfigsPath', () => { + const result = client.organizationResourceValueConfigsPath("organizationValue", "resourceValueConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationResourceValueConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationResourceValueConfigsName', () => { + const result = client.matchOrganizationFromOrganizationResourceValueConfigsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationResourceValueConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchResourceValueConfigFromOrganizationResourceValueConfigsName', () => { + const result = client.matchResourceValueConfigFromOrganizationResourceValueConfigsName(fakePath); + assert.strictEqual(result, "resourceValueConfigValue"); + assert((client.pathTemplates.organizationResourceValueConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSimulationValuedResourceAttackPaths', async () => { + const fakePath = "/rendered/path/organizationSimulationValuedResourceAttackPaths"; + const expectedParameters = { + organization: "organizationValue", + simulation: "simulationValue", + valued_resource: "valuedResourceValue", + attack_path: "attackPathValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSimulationValuedResourceAttackPathsPath', () => { + const result = client.organizationSimulationValuedResourceAttackPathsPath("organizationValue", "simulationValue", "valuedResourceValue", "attackPathValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchOrganizationFromOrganizationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimulationFromOrganizationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchSimulationFromOrganizationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "simulationValue"); + assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchValuedResourceFromOrganizationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchValuedResourceFromOrganizationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "valuedResourceValue"); + assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttackPathFromOrganizationSimulationValuedResourceAttackPathsName', () => { + const result = client.matchAttackPathFromOrganizationSimulationValuedResourceAttackPathsName(fakePath); + assert.strictEqual(result, "attackPathValue"); + assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSimulationValuedResources', async () => { + const fakePath = "/rendered/path/organizationSimulationValuedResources"; + const expectedParameters = { + organization: "organizationValue", + simulation: "simulationValue", + valued_resource: "valuedResourceValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSimulationValuedResourcesPath', () => { + const result = client.organizationSimulationValuedResourcesPath("organizationValue", "simulationValue", "valuedResourceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSimulationValuedResourcesName', () => { + const result = client.matchOrganizationFromOrganizationSimulationValuedResourcesName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimulationFromOrganizationSimulationValuedResourcesName', () => { + const result = client.matchSimulationFromOrganizationSimulationValuedResourcesName(fakePath); + assert.strictEqual(result, "simulationValue"); + assert((client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchValuedResourceFromOrganizationSimulationValuedResourcesName', () => { + const result = client.matchValuedResourceFromOrganizationSimulationValuedResourcesName(fakePath); + assert.strictEqual(result, "valuedResourceValue"); + assert((client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSimulations', async () => { + const fakePath = "/rendered/path/organizationSimulations"; + const expectedParameters = { + organization: "organizationValue", + simulation: "simulationValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSimulationsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSimulationsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSimulationsPath', () => { + const result = client.organizationSimulationsPath("organizationValue", "simulationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSimulationsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSimulationsName', () => { + const result = client.matchOrganizationFromOrganizationSimulationsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSimulationsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSimulationFromOrganizationSimulationsName', () => { + const result = client.matchSimulationFromOrganizationSimulationsName(fakePath); + assert.strictEqual(result, "simulationValue"); + assert((client.pathTemplates.organizationSimulationsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSource', async () => { + const fakePath = "/rendered/path/organizationSource"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSourcePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourcePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourcePath', () => { + const result = client.organizationSourcePath("organizationValue", "sourceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourcePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceName', () => { + const result = client.matchOrganizationFromOrganizationSourceName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceName', () => { + const result = client.matchSourceFromOrganizationSourceName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSourceFindingExternalsystem', async () => { + const fakePath = "/rendered/path/organizationSourceFindingExternalsystem"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + finding: "findingValue", + externalsystem: "externalsystemValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/organizationSourceFindingSecurityMarks"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('organizationSourceFindings', async () => { + const fakePath = "/rendered/path/organizationSourceFindings"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSourceFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingsPath', () => { + const result = client.organizationSourceFindingsPath("organizationValue", "sourceValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourceFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceFindingsName', () => { + const result = client.matchOrganizationFromOrganizationSourceFindingsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceFindingsName', () => { + const result = client.matchSourceFromOrganizationSourceFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromOrganizationSourceFindingsName', () => { + const result = client.matchFindingFromOrganizationSourceFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSourceLocationFindingExternalsystem', async () => { + const fakePath = "/rendered/path/organizationSourceLocationFindingExternalsystem"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + externalsystem: "externalsystemValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceLocationFindingExternalsystemPath', () => { + const result = client.organizationSourceLocationFindingExternalsystemPath("organizationValue", "sourceValue", "locationValue", "findingValue", "externalsystemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceLocationFindingExternalsystemName', () => { + const result = client.matchOrganizationFromOrganizationSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceLocationFindingExternalsystemName', () => { + const result = client.matchSourceFromOrganizationSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationSourceLocationFindingExternalsystemName', () => { + const result = client.matchLocationFromOrganizationSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromOrganizationSourceLocationFindingExternalsystemName', () => { + const result = client.matchFindingFromOrganizationSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalsystemFromOrganizationSourceLocationFindingExternalsystemName', () => { + const result = client.matchExternalsystemFromOrganizationSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "externalsystemValue"); + assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSourceLocationFindingSecurityMarks', async () => { + const fakePath = "/rendered/path/organizationSourceLocationFindingSecurityMarks"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceLocationFindingSecurityMarksPath', () => { + const result = client.organizationSourceLocationFindingSecurityMarksPath("organizationValue", "sourceValue", "locationValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceLocationFindingSecurityMarksName', () => { + const result = client.matchOrganizationFromOrganizationSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceLocationFindingSecurityMarksName', () => { + const result = client.matchSourceFromOrganizationSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationSourceLocationFindingSecurityMarksName', () => { + const result = client.matchLocationFromOrganizationSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromOrganizationSourceLocationFindingSecurityMarksName', () => { + const result = client.matchFindingFromOrganizationSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSourceLocationFindings', async () => { + const fakePath = "/rendered/path/organizationSourceLocationFindings"; + const expectedParameters = { + organization: "organizationValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSourceLocationFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceLocationFindingsPath', () => { + const result = client.organizationSourceLocationFindingsPath("organizationValue", "sourceValue", "locationValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSourceLocationFindingsName', () => { + const result = client.matchOrganizationFromOrganizationSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromOrganizationSourceLocationFindingsName', () => { + const result = client.matchSourceFromOrganizationSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationSourceLocationFindingsName', () => { + const result = client.matchLocationFromOrganizationSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromOrganizationSourceLocationFindingsName', () => { + const result = client.matchFindingFromOrganizationSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectAssetSecurityMarks', async () => { + const fakePath = "/rendered/path/projectAssetSecurityMarks"; + const expectedParameters = { + project: "projectValue", + asset: "assetValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('projectConstraintName', async () => { + const fakePath = "/rendered/path/projectConstraintName"; + const expectedParameters = { + project: "projectValue", + constraint_name: "constraintNameValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectConstraintNamePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectConstraintNamePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectConstraintNamePath', () => { + const result = client.projectConstraintNamePath("projectValue", "constraintNameValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectConstraintNamePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectConstraintNameName', () => { + const result = client.matchProjectFromProjectConstraintNameName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConstraintNameFromProjectConstraintNameName', () => { + const result = client.matchConstraintNameFromProjectConstraintNameName(fakePath); + assert.strictEqual(result, "constraintNameValue"); + assert((client.pathTemplates.projectConstraintNamePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationBigQueryExports', async () => { + const fakePath = "/rendered/path/projectLocationBigQueryExports"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + export: "exportValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBigQueryExportsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationBigQueryExportsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationBigQueryExportsPath', () => { + const result = client.projectLocationBigQueryExportsPath("projectValue", "locationValue", "exportValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationBigQueryExportsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationBigQueryExportsName', () => { + const result = client.matchProjectFromProjectLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationBigQueryExportsName', () => { + const result = client.matchLocationFromProjectLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExportFromProjectLocationBigQueryExportsName', () => { + const result = client.matchExportFromProjectLocationBigQueryExportsName(fakePath); + assert.strictEqual(result, "exportValue"); + assert((client.pathTemplates.projectLocationBigQueryExportsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationMuteConfigs', async () => { + const fakePath = "/rendered/path/projectLocationMuteConfigs"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationMuteConfigsPath', () => { + const result = client.projectLocationMuteConfigsPath("projectValue", "locationValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationMuteConfigsName', () => { + const result = client.matchProjectFromProjectLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationMuteConfigsName', () => { + const result = client.matchLocationFromProjectLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromProjectLocationMuteConfigsName', () => { + const result = client.matchMuteConfigFromProjectLocationMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationNotificationConfigs', async () => { + const fakePath = "/rendered/path/projectLocationNotificationConfigs"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + notification_config: "notificationConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationNotificationConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationNotificationConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationNotificationConfigsPath', () => { + const result = client.projectLocationNotificationConfigsPath("projectValue", "locationValue", "notificationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationNotificationConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationNotificationConfigsName', () => { + const result = client.matchProjectFromProjectLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationNotificationConfigsName', () => { + const result = client.matchLocationFromProjectLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNotificationConfigFromProjectLocationNotificationConfigsName', () => { + const result = client.matchNotificationConfigFromProjectLocationNotificationConfigsName(fakePath); + assert.strictEqual(result, "notificationConfigValue"); + assert((client.pathTemplates.projectLocationNotificationConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectMuteConfigs', async () => { + const fakePath = "/rendered/path/projectMuteConfigs"; + const expectedParameters = { + project: "projectValue", + mute_config: "muteConfigValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectMuteConfigsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectMuteConfigsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectMuteConfigsPath', () => { + const result = client.projectMuteConfigsPath("projectValue", "muteConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectMuteConfigsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectMuteConfigsName', () => { + const result = client.matchProjectFromProjectMuteConfigsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMuteConfigFromProjectMuteConfigsName', () => { + const result = client.matchMuteConfigFromProjectMuteConfigsName(fakePath); + assert.strictEqual(result, "muteConfigValue"); + assert((client.pathTemplates.projectMuteConfigsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSource', async () => { + const fakePath = "/rendered/path/projectSource"; + const expectedParameters = { + project: "projectValue", + source: "sourceValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('projectSourceFindingExternalsystem', async () => { + const fakePath = "/rendered/path/projectSourceFindingExternalsystem"; + const expectedParameters = { + project: "projectValue", + source: "sourceValue", + finding: "findingValue", + externalsystem: "externalsystemValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/projectSourceFindingSecurityMarks"; + const expectedParameters = { + project: "projectValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('matchSourceFromProjectSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((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)); + }); + }); + + describe('projectSourceFindings', async () => { + const fakePath = "/rendered/path/projectSourceFindings"; + const expectedParameters = { + project: "projectValue", + source: "sourceValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSourceFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingsPath', () => { + const result = client.projectSourceFindingsPath("projectValue", "sourceValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSourceFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSourceFindingsName', () => { + const result = client.matchProjectFromProjectSourceFindingsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromProjectSourceFindingsName', () => { + const result = client.matchSourceFromProjectSourceFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromProjectSourceFindingsName', () => { + const result = client.matchFindingFromProjectSourceFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSourceLocationFindingExternalsystem', async () => { + const fakePath = "/rendered/path/projectSourceLocationFindingExternalsystem"; + const expectedParameters = { + project: "projectValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + externalsystem: "externalsystemValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceLocationFindingExternalsystemPath', () => { + const result = client.projectSourceLocationFindingExternalsystemPath("projectValue", "sourceValue", "locationValue", "findingValue", "externalsystemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSourceLocationFindingExternalsystemName', () => { + const result = client.matchProjectFromProjectSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromProjectSourceLocationFindingExternalsystemName', () => { + const result = client.matchSourceFromProjectSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectSourceLocationFindingExternalsystemName', () => { + const result = client.matchLocationFromProjectSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromProjectSourceLocationFindingExternalsystemName', () => { + const result = client.matchFindingFromProjectSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalsystemFromProjectSourceLocationFindingExternalsystemName', () => { + const result = client.matchExternalsystemFromProjectSourceLocationFindingExternalsystemName(fakePath); + assert.strictEqual(result, "externalsystemValue"); + assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSourceLocationFindingSecurityMarks', async () => { + const fakePath = "/rendered/path/projectSourceLocationFindingSecurityMarks"; + const expectedParameters = { + project: "projectValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceLocationFindingSecurityMarksPath', () => { + const result = client.projectSourceLocationFindingSecurityMarksPath("projectValue", "sourceValue", "locationValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSourceLocationFindingSecurityMarksName', () => { + const result = client.matchProjectFromProjectSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromProjectSourceLocationFindingSecurityMarksName', () => { + const result = client.matchSourceFromProjectSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectSourceLocationFindingSecurityMarksName', () => { + const result = client.matchLocationFromProjectSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromProjectSourceLocationFindingSecurityMarksName', () => { + const result = client.matchFindingFromProjectSourceLocationFindingSecurityMarksName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSourceLocationFindings', async () => { + const fakePath = "/rendered/path/projectSourceLocationFindings"; + const expectedParameters = { + project: "projectValue", + source: "sourceValue", + location: "locationValue", + finding: "findingValue", + }; + const client = new securitycenterModule.v2.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSourceLocationFindingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceLocationFindingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceLocationFindingsPath', () => { + const result = client.projectSourceLocationFindingsPath("projectValue", "sourceValue", "locationValue", "findingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSourceLocationFindingsName', () => { + const result = client.matchProjectFromProjectSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSourceFromProjectSourceLocationFindingsName', () => { + const result = client.matchSourceFromProjectSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "sourceValue"); + assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectSourceLocationFindingsName', () => { + const result = client.matchLocationFromProjectSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFindingFromProjectSourceLocationFindingsName', () => { + const result = client.matchFindingFromProjectSourceLocationFindingsName(fakePath); + assert.strictEqual(result, "findingValue"); + assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-securitycenter/tsconfig.json b/owl-bot-staging/google-cloud-securitycenter/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-cloud-securitycenter/webpack.config.js b/owl-bot-staging/google-cloud-securitycenter/webpack.config.js new file mode 100644 index 00000000000..4aeca8bf63a --- /dev/null +++ b/owl-bot-staging/google-cloud-securitycenter/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'SecurityCenter', + filename: './security-center.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From e3b20595622bda243771903830f7f9c71225be38 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 17 Mar 2026 02:23:30 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-securitycenter/.OwlBot.yaml | 19 - .../google-cloud-securitycenter/.eslintignore | 7 - .../.eslintrc.json | 3 - .../.gitattributes | 4 - .../google-cloud-securitycenter/.gitignore | 14 - .../google-cloud-securitycenter/.jsdoc.js | 55 - .../google-cloud-securitycenter/.mocharc.js | 33 - .../google-cloud-securitycenter/.nycrc | 24 - .../.prettierignore | 6 - .../.prettierrc.js | 22 - .../CODE_OF_CONDUCT.md | 94 - .../CONTRIBUTING.md | 76 - .../google-cloud-securitycenter/LICENSE | 202 - .../google-cloud-securitycenter/README.md | 261 - .../cloud/securitycenter/v1/access.proto | 111 - .../cloud/securitycenter/v1/application.proto | 36 - .../cloud/securitycenter/v1/asset.proto | 136 - .../securitycenter/v1/attack_exposure.proto | 71 - .../cloud/securitycenter/v1/attack_path.proto | 131 - .../v1/backup_disaster_recovery.proto | 88 - .../securitycenter/v1/bigquery_export.proto | 103 - .../cloud/securitycenter/v1/cloud_armor.proto | 114 - .../v1/cloud_dlp_data_profile.proto | 113 - .../v1/cloud_dlp_inspection.proto | 54 - .../cloud/securitycenter/v1/compliance.proto | 39 - .../cloud/securitycenter/v1/connection.proto | 66 - .../securitycenter/v1/contact_details.proto | 37 - .../cloud/securitycenter/v1/container.proto | 48 - .../cloud/securitycenter/v1/database.proto | 63 - ...event_threat_detection_custom_module.proto | 85 - ...urity_health_analytics_custom_module.proto | 81 - ...event_threat_detection_custom_module.proto | 102 - ...tion_custom_module_validation_errors.proto | 59 - .../securitycenter/v1/exfiltration.proto | 57 - .../securitycenter/v1/external_system.proto | 103 - .../google/cloud/securitycenter/v1/file.proto | 65 - .../cloud/securitycenter/v1/finding.proto | 485 - .../cloud/securitycenter/v1/folder.proto | 36 - .../securitycenter/v1/group_membership.proto | 47 - .../cloud/securitycenter/v1/iam_binding.proto | 52 - .../cloud/securitycenter/v1/indicator.proto | 98 - .../securitycenter/v1/kernel_rootkit.proto | 62 - .../cloud/securitycenter/v1/kubernetes.proto | 216 - .../cloud/securitycenter/v1/label.proto | 37 - .../securitycenter/v1/load_balancer.proto | 32 - .../cloud/securitycenter/v1/log_entry.proto | 55 - .../securitycenter/v1/mitre_attack.proto | 299 - .../cloud/securitycenter/v1/mute_config.proto | 130 - .../cloud/securitycenter/v1/notebook.proto | 44 - .../v1/notification_config.proto | 101 - .../v1/notification_message.proto | 44 - .../cloud/securitycenter/v1/org_policy.proto | 42 - .../v1/organization_settings.proto | 87 - .../cloud/securitycenter/v1/process.proto | 74 - .../cloud/securitycenter/v1/resource.proto | 253 - .../v1/resource_value_config.proto | 123 - .../v1/run_asset_discovery_response.proto | 51 - ...urity_health_analytics_custom_config.proto | 101 - ...urity_health_analytics_custom_module.proto | 110 - .../securitycenter/v1/security_marks.proto | 69 - .../securitycenter/v1/security_posture.proto | 76 - .../v1/securitycenter_service.proto | 3188 - .../cloud/securitycenter/v1/simulation.proto | 56 - .../cloud/securitycenter/v1/source.proto | 69 - .../securitycenter/v1/toxic_combination.proto | 41 - .../securitycenter/v1/valued_resource.proto | 88 - .../securitycenter/v1/vulnerability.proto | 319 - .../cloud/securitycenter/v1beta1/asset.proto | 92 - .../securitycenter/v1beta1/finding.proto | 109 - .../v1beta1/organization_settings.proto | 78 - .../run_asset_discovery_response.proto | 48 - .../v1beta1/security_marks.proto | 52 - .../v1beta1/securitycenter_service.proto | 823 - .../cloud/securitycenter/v1beta1/source.proto | 55 - .../securitycenter/v1p1beta1/asset.proto | 134 - .../securitycenter/v1p1beta1/finding.proto | 145 - .../securitycenter/v1p1beta1/folder.proto | 37 - .../v1p1beta1/notification_config.proto | 107 - .../v1p1beta1/notification_message.proto | 43 - .../v1p1beta1/organization_settings.proto | 85 - .../securitycenter/v1p1beta1/resource.proto | 52 - .../run_asset_discovery_response.proto | 51 - .../v1p1beta1/security_marks.proto | 69 - .../v1p1beta1/securitycenter_service.proto | 1351 - .../securitycenter/v1p1beta1/source.proto | 68 - .../cloud/securitycenter/v2/access.proto | 111 - .../v2/affected_resources.proto | 31 - .../cloud/securitycenter/v2/ai_model.proto | 67 - .../cloud/securitycenter/v2/application.proto | 36 - .../securitycenter/v2/attack_exposure.proto | 72 - .../cloud/securitycenter/v2/attack_path.proto | 132 - .../v2/backup_disaster_recovery.proto | 88 - .../securitycenter/v2/bigquery_export.proto | 107 - .../cloud/securitycenter/v2/chokepoint.proto | 35 - .../cloud/securitycenter/v2/cloud_armor.proto | 122 - .../v2/cloud_dlp_data_profile.proto | 57 - .../v2/cloud_dlp_inspection.proto | 54 - .../cloud/securitycenter/v2/compliance.proto | 39 - .../cloud/securitycenter/v2/connection.proto | 66 - .../securitycenter/v2/contact_details.proto | 37 - .../cloud/securitycenter/v2/container.proto | 48 - .../securitycenter/v2/data_access_event.proto | 59 - .../securitycenter/v2/data_flow_event.proto | 63 - .../v2/data_retention_deletion_event.proto | 68 - .../cloud/securitycenter/v2/database.proto | 63 - .../google/cloud/securitycenter/v2/disk.proto | 32 - .../securitycenter/v2/exfiltration.proto | 57 - .../securitycenter/v2/external_system.proto | 112 - .../google/cloud/securitycenter/v2/file.proto | 95 - .../cloud/securitycenter/v2/finding.proto | 546 - .../cloud/securitycenter/v2/folder.proto | 36 - .../securitycenter/v2/group_membership.proto | 47 - .../cloud/securitycenter/v2/iam_binding.proto | 52 - .../cloud/securitycenter/v2/indicator.proto | 99 - .../cloud/securitycenter/v2/ip_rules.proto | 108 - .../google/cloud/securitycenter/v2/job.proto | 63 - .../securitycenter/v2/kernel_rootkit.proto | 62 - .../cloud/securitycenter/v2/kubernetes.proto | 216 - .../cloud/securitycenter/v2/label.proto | 37 - .../securitycenter/v2/load_balancer.proto | 32 - .../cloud/securitycenter/v2/log_entry.proto | 56 - .../securitycenter/v2/mitre_attack.proto | 517 - .../cloud/securitycenter/v2/mute_config.proto | 128 - .../cloud/securitycenter/v2/network.proto | 32 - .../cloud/securitycenter/v2/notebook.proto | 44 - .../v2/notification_config.proto | 110 - .../v2/notification_message.proto | 44 - .../cloud/securitycenter/v2/org_policy.proto | 43 - .../cloud/securitycenter/v2/process.proto | 78 - .../cloud/securitycenter/v2/resource.proto | 275 - .../v2/resource_value_config.proto | 126 - .../securitycenter/v2/security_marks.proto | 86 - .../securitycenter/v2/security_posture.proto | 76 - .../v2/securitycenter_service.proto | 2076 - .../cloud/securitycenter/v2/simulation.proto | 57 - .../cloud/securitycenter/v2/source.proto | 70 - .../securitycenter/v2/toxic_combination.proto | 42 - .../securitycenter/v2/valued_resource.proto | 89 - .../cloud/securitycenter/v2/vertex_ai.proto | 58 - .../securitycenter/v2/vulnerability.proto | 345 - .../protos/protos.d.ts | 64568 ------ .../protos/protos.js | 165024 --------------- .../protos/protos.json | 17570 -- ...ter.batch_create_resource_value_configs.js | 68 - .../v1/security_center.bulk_mute_findings.js | 93 - ...security_center.create_big_query_export.js | 76 - ...te_event_threat_detection_custom_module.js | 72 - .../v1/security_center.create_finding.js | 75 - .../v1/security_center.create_mute_config.js | 76 - ...urity_center.create_notification_config.js | 78 - ...security_health_analytics_custom_module.js | 71 - .../v1/security_center.create_source.js | 68 - ...security_center.delete_big_query_export.js | 64 - ...te_event_threat_detection_custom_module.js | 65 - .../v1/security_center.delete_mute_config.js | 67 - ...urity_center.delete_notification_config.js | 64 - ...ity_center.delete_resource_value_config.js | 61 - ...security_health_analytics_custom_module.js | 65 - .../security_center.get_big_query_export.js | 64 - ...ve_event_threat_detection_custom_module.js | 66 - ...security_health_analytics_custom_module.js | 65 - ...et_event_threat_detection_custom_module.js | 65 - .../v1/security_center.get_iam_policy.js | 67 - .../v1/security_center.get_mute_config.js | 67 - ...security_center.get_notification_config.js | 64 - ...curity_center.get_organization_settings.js | 62 - ...curity_center.get_resource_value_config.js | 62 - ...security_health_analytics_custom_module.js | 65 - .../v1/security_center.get_simulation.js | 64 - .../v1/security_center.get_source.js | 62 - .../v1/security_center.get_valued_resource.js | 63 - .../v1/security_center.group_assets.js | 176 - .../v1/security_center.group_findings.js | 174 - .../v1/security_center.list_assets.js | 187 - .../v1/security_center.list_attack_paths.js | 85 - .../security_center.list_big_query_exports.js | 79 - ...t_event_threat_detection_custom_modules.js | 83 - ...ecurity_health_analytics_custom_modules.js | 75 - ...e_event_threat_detection_custom_modules.js | 83 - ...ecurity_health_analytics_custom_modules.js | 75 - ...t_event_threat_detection_custom_modules.js | 83 - .../v1/security_center.list_findings.js | 191 - .../v1/security_center.list_mute_configs.js | 79 - ...curity_center.list_notification_configs.js | 76 - ...rity_center.list_resource_value_configs.js | 81 - ...ecurity_health_analytics_custom_modules.js | 75 - .../v1/security_center.list_sources.js | 76 - .../security_center.list_valued_resources.js | 100 - .../v1/security_center.run_asset_discovery.js | 63 - .../v1/security_center.set_finding_state.js | 76 - .../v1/security_center.set_iam_policy.js | 77 - .../generated/v1/security_center.set_mute.js | 71 - ...security_health_analytics_custom_module.js | 75 - .../security_center.test_iam_permissions.js | 70 - ...security_center.update_big_query_export.js | 66 - ...te_event_threat_detection_custom_module.js | 66 - .../security_center.update_external_system.js | 66 - .../v1/security_center.update_finding.js | 74 - .../v1/security_center.update_mute_config.js | 66 - ...urity_center.update_notification_config.js | 66 - ...ity_center.update_organization_settings.js | 66 - ...ity_center.update_resource_value_config.js | 66 - ...security_health_analytics_custom_module.js | 67 - .../security_center.update_security_marks.js | 75 - .../v1/security_center.update_source.js | 66 - ...te_event_threat_detection_custom_module.js | 76 - ...tadata_google.cloud.securitycenter.v1.json | 2907 - .../v1beta1/security_center.create_finding.js | 75 - .../v1beta1/security_center.create_source.js | 68 - .../v1beta1/security_center.get_iam_policy.js | 67 - ...curity_center.get_organization_settings.js | 62 - .../v1beta1/security_center.get_source.js | 62 - .../v1beta1/security_center.group_assets.js | 139 - .../v1beta1/security_center.group_findings.js | 118 - .../v1beta1/security_center.list_assets.js | 144 - .../v1beta1/security_center.list_findings.js | 121 - .../v1beta1/security_center.list_sources.js | 75 - .../security_center.run_asset_discovery.js | 63 - .../security_center.set_finding_state.js | 74 - .../v1beta1/security_center.set_iam_policy.js | 77 - .../security_center.test_iam_permissions.js | 70 - .../v1beta1/security_center.update_finding.js | 70 - ...ity_center.update_organization_settings.js | 65 - .../security_center.update_security_marks.js | 69 - .../v1beta1/security_center.update_source.js | 65 - ...a_google.cloud.securitycenter.v1beta1.json | 895 - .../security_center.create_finding.js | 73 - ...urity_center.create_notification_config.js | 75 - .../security_center.create_source.js | 68 - ...urity_center.delete_notification_config.js | 62 - .../security_center.get_iam_policy.js | 67 - ...security_center.get_notification_config.js | 62 - ...curity_center.get_organization_settings.js | 62 - .../v1p1beta1/security_center.get_source.js | 62 - .../v1p1beta1/security_center.group_assets.js | 176 - .../security_center.group_findings.js | 172 - .../v1p1beta1/security_center.list_assets.js | 185 - .../security_center.list_findings.js | 181 - ...curity_center.list_notification_configs.js | 75 - .../v1p1beta1/security_center.list_sources.js | 76 - .../security_center.run_asset_discovery.js | 63 - .../security_center.set_finding_state.js | 74 - .../security_center.set_iam_policy.js | 77 - .../security_center.test_iam_permissions.js | 70 - .../security_center.update_finding.js | 74 - ...urity_center.update_notification_config.js | 66 - ...ity_center.update_organization_settings.js | 66 - .../security_center.update_security_marks.js | 74 - .../security_center.update_source.js | 66 - ...google.cloud.securitycenter.v1p1beta1.json | 1123 - ...ter.batch_create_resource_value_configs.js | 68 - .../v2/security_center.bulk_mute_findings.js | 94 - ...security_center.create_big_query_export.js | 77 - .../v2/security_center.create_finding.js | 79 - .../v2/security_center.create_mute_config.js | 77 - ...urity_center.create_notification_config.js | 79 - .../v2/security_center.create_source.js | 68 - ...security_center.delete_big_query_export.js | 66 - .../v2/security_center.delete_mute_config.js | 69 - ...urity_center.delete_notification_config.js | 68 - ...ity_center.delete_resource_value_config.js | 61 - .../security_center.get_big_query_export.js | 66 - .../v2/security_center.get_iam_policy.js | 67 - .../v2/security_center.get_mute_config.js | 69 - ...security_center.get_notification_config.js | 68 - ...curity_center.get_resource_value_config.js | 62 - .../v2/security_center.get_simulation.js | 64 - .../v2/security_center.get_source.js | 62 - .../v2/security_center.get_valued_resource.js | 63 - .../v2/security_center.group_findings.js | 138 - .../v2/security_center.list_attack_paths.js | 85 - .../security_center.list_big_query_exports.js | 80 - .../v2/security_center.list_findings.js | 156 - .../v2/security_center.list_mute_configs.js | 82 - ...curity_center.list_notification_configs.js | 78 - ...rity_center.list_resource_value_configs.js | 81 - .../v2/security_center.list_sources.js | 76 - .../security_center.list_valued_resources.js | 98 - .../v2/security_center.set_finding_state.js | 79 - .../v2/security_center.set_iam_policy.js | 77 - .../generated/v2/security_center.set_mute.js | 79 - .../security_center.test_iam_permissions.js | 70 - ...security_center.update_big_query_export.js | 66 - .../security_center.update_external_system.js | 66 - .../v2/security_center.update_finding.js | 74 - .../v2/security_center.update_mute_config.js | 66 - ...urity_center.update_notification_config.js | 66 - ...ity_center.update_resource_value_config.js | 69 - .../security_center.update_security_marks.js | 68 - .../v2/security_center.update_source.js | 66 - ...tadata_google.cloud.securitycenter.v2.json | 1823 - .../google-cloud-securitycenter/src/index.ts | 30 - .../src/v1/gapic_metadata.json | 721 - .../src/v1/index.ts | 19 - .../src/v1/security_center_client.ts | 12666 -- .../src/v1/security_center_client_config.json | 309 - .../src/v1/security_center_proto_list.json | 57 - .../src/v1beta1/gapic_metadata.json | 223 - .../src/v1beta1/index.ts | 19 - .../src/v1beta1/security_center_client.ts | 3681 - .../security_center_client_config.json | 116 - .../v1beta1/security_center_proto_list.json | 9 - .../src/v1p1beta1/gapic_metadata.json | 277 - .../src/v1p1beta1/index.ts | 19 - .../src/v1p1beta1/security_center_client.ts | 5466 - .../security_center_client_config.json | 141 - .../v1p1beta1/security_center_proto_list.json | 13 - .../src/v2/gapic_metadata.json | 459 - .../src/v2/index.ts | 19 - .../src/v2/security_center_client.ts | 9119 - .../src/v2/security_center_client_config.json | 186 - .../src/v2/security_center_proto_list.json | 57 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../system-test/install.ts | 49 - .../test/gapic_security_center_v1.ts | 11894 -- .../test/gapic_security_center_v1beta1.ts | 3237 - .../test/gapic_security_center_v1p1beta1.ts | 4368 - .../test/gapic_security_center_v2.ts | 8513 - .../google-cloud-securitycenter/tsconfig.json | 22 - .../webpack.config.js | 64 - .../cloud/securitycenter/v1/chokepoint.proto | 0 .../v1/cloud_dlp_data_profile.proto | 58 +- .../securitycenter/v1/external_exposure.proto | 0 .../cloud/securitycenter/v1/finding.proto | 25 +- .../securitycenter/v1/group_membership.proto | 5 +- .../protos/protos.d.ts | 616 +- .../protos/protos.js | 1612 + .../protos/protos.json | 147 +- .../src/v1/security_center_proto_list.json | 2 + 330 files changed, 2458 insertions(+), 346982 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.OwlBot.yaml delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.gitignore delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.nycrc delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-securitycenter/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-securitycenter/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-securitycenter/LICENSE delete mode 100644 owl-bot-staging/google-cloud-securitycenter/README.md delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/application.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_exposure.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_path.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_armor.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/load_balancer.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/log_entry.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notebook.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/org_policy.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource_value_config.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_posture.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/simulation.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/valued_resource.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/access.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/affected_resources.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ai_model.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/application.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_exposure.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_path.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/bigquery_export.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/chokepoint.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_armor.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/compliance.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/connection.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/contact_details.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/container.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_access_event.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_flow_event.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/database.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/disk.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/exfiltration.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/external_system.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/file.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/folder.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/iam_binding.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/indicator.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ip_rules.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/job.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kernel_rootkit.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kubernetes.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/label.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/load_balancer.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/log_entry.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mitre_attack.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mute_config.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/network.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notebook.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_config.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_message.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/org_policy.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/process.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource_value_config.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_marks.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_posture.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/securitycenter_service.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/simulation.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/source.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/valued_resource.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vertex_ai.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vulnerability.proto delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client_config.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/index.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/index.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client_config.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v2.ts delete mode 100644 owl-bot-staging/google-cloud-securitycenter/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-securitycenter/webpack.config.js rename {owl-bot-staging => packages}/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto (100%) rename {owl-bot-staging => packages}/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.proto (100%) diff --git a/owl-bot-staging/google-cloud-securitycenter/.OwlBot.yaml b/owl-bot-staging/google-cloud-securitycenter/.OwlBot.yaml deleted file mode 100644 index 4fe79291747..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. - -deep-copy-regex: - - source: /google/cloud/securitycenter/google-cloud-securitycenter-nodejs - dest: /owl-bot-staging/google-cloud-securitycenter - -api-name: securitycenter \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/.eslintignore b/owl-bot-staging/google-cloud-securitycenter/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-securitycenter/.eslintrc.json b/owl-bot-staging/google-cloud-securitycenter/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-securitycenter/.gitattributes b/owl-bot-staging/google-cloud-securitycenter/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-securitycenter/.gitignore b/owl-bot-staging/google-cloud-securitycenter/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-securitycenter/.jsdoc.js b/owl-bot-staging/google-cloud-securitycenter/.jsdoc.js deleted file mode 100644 index 1a3be7ee39e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/security-center', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-securitycenter/.mocharc.js b/owl-bot-staging/google-cloud-securitycenter/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-securitycenter/.nycrc b/owl-bot-staging/google-cloud-securitycenter/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/.prettierignore b/owl-bot-staging/google-cloud-securitycenter/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-securitycenter/.prettierrc.js b/owl-bot-staging/google-cloud-securitycenter/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-securitycenter/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-securitycenter/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/CONTRIBUTING.md b/owl-bot-staging/google-cloud-securitycenter/CONTRIBUTING.md deleted file mode 100644 index d45b0e6328f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Securitycenter API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=securitycenter.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/LICENSE b/owl-bot-staging/google-cloud-securitycenter/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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/owl-bot-staging/google-cloud-securitycenter/README.md b/owl-bot-staging/google-cloud-securitycenter/README.md deleted file mode 100644 index fde765b5dfd..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/README.md +++ /dev/null @@ -1,261 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Security Command Center API: Nodejs Client][homepage] - -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 **stable** libraries -are addressed with the highest priority - -[![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) - -Security Command Center API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Security Command Center API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/securitycenter/latest) -* [Security Command Center API Documentation](https://cloud.google.com/security-command-center/docs/reference/rest) - -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) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Security Command Center API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/security-center -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| batch create resource value configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js) | -| bulk mute findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js) | -| create big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js) | -| create event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js) | -| create finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js) | -| create mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js) | -| create notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js) | -| create security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js) | -| create source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js) | -| delete big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js) | -| delete event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js) | -| delete mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js) | -| delete notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js) | -| delete resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js) | -| delete security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js) | -| get big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js) | -| get effective event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js) | -| get effective security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js) | -| get event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js) | -| get mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js) | -| get notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js) | -| get organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js) | -| get resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js) | -| get security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js) | -| get simulation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js) | -| get source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js) | -| get valued resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js) | -| group assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js) | -| group findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js) | -| list assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js) | -| list attack paths | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js) | -| list big query exports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js) | -| list descendant event threat detection custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js) | -| list descendant security health analytics custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js) | -| list effective event threat detection custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js) | -| list effective security health analytics custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js) | -| list event threat detection custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js) | -| list findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js) | -| list mute configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js) | -| list notification configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js) | -| list resource value configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js) | -| list security health analytics custom modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js) | -| list sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js) | -| list valued resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js) | -| run asset discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js) | -| set finding state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js) | -| set mute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js) | -| simulate security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js) | -| update big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js) | -| update event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js) | -| update external system | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js) | -| update finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js) | -| update mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js) | -| update notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js) | -| update organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js) | -| update resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js) | -| update security health analytics custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js) | -| update security marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js) | -| update source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js) | -| validate event threat detection custom module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json) | -| create finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js) | -| create source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js) | -| get organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js) | -| get source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js) | -| group assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js) | -| group findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js) | -| list assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js) | -| list findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js) | -| list sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js) | -| run asset discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js) | -| set finding state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js) | -| update finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js) | -| update organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js) | -| update security marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js) | -| update source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json) | -| create finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js) | -| create notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js) | -| create source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js) | -| delete notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js) | -| get notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js) | -| get organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js) | -| get source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js) | -| group assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js) | -| group findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js) | -| list assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js) | -| list findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js) | -| list notification configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js) | -| list sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js) | -| run asset discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js) | -| set finding state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js) | -| update finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js) | -| update notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js) | -| update organization settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js) | -| update security marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js) | -| update source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json) | -| batch create resource value configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js) | -| bulk mute findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js) | -| create big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js) | -| create finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js) | -| create mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js) | -| create notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js) | -| create source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js) | -| delete big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js) | -| delete mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js) | -| delete notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js) | -| delete resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js) | -| get big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js) | -| get mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js) | -| get notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js) | -| get resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js) | -| get simulation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js) | -| get source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js) | -| get valued resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js) | -| group findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js) | -| list attack paths | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js) | -| list big query exports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js) | -| list findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js) | -| list mute configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js) | -| list notification configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js) | -| list resource value configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js) | -| list sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js) | -| list valued resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js) | -| set finding state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js) | -| set mute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js) | -| update big query export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js) | -| update external system | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js) | -| update finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js) | -| update mute config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js) | -| update notification config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js) | -| update resource value config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js) | -| update security marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js) | -| update source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json) | - - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/security-center@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -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/google-cloud-node/blob/main/packages/google-cloud-securitycenter/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/LICENSE) - -[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/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto deleted file mode 100644 index da892b2bb60..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "AccessProto"; -option java_package = "com.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". - // - // The email address of the authenticated user or a service account acting on - // behalf of a 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". - string caller_ip = 2; - - // The caller IP's geolocation, which identifies where the call came from. - Geolocation caller_ip_geo = 3; - - // Type of user agent associated with the finding. For example, an operating - // system shell or an embedded or standalone application. - string user_agent_family = 4; - - // The caller's user agent string associated with the finding. - string user_agent = 12; - - // 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; - - // A string that represents the principal_subject that is associated with the - // identity. Unlike `principal_email`, `principal_subject` supports principals - // that aren't associated with email addresses, such as third party - // principals. For most identities, the format is - // `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`. - // Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, - // still use the legacy format `serviceAccount:{identity pool - // name}[{subject}]`. - string principal_subject = 7; - - // The name of the service account key that was used to create or exchange - // credentials when authenticating the service account that made 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; - - // The identity delegation history of an authenticated service account that - // made the request. The `serviceAccountDelegationInfo[]` object contains - // information about the real authorities that try to access Google Cloud - // 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; - - // A string that represents a username. The username provided depends on the - // type of the finding and is likely not an IAM principal. For example, this - // can be a system username if the finding is related to a virtual machine, or - // it can be an application login username. - string user_name = 11; -} - -// 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. -message Geolocation { - // A CLDR. - string region_code = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/application.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/application.proto deleted file mode 100644 index 8bdfee691b8..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/application.proto +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ApplicationProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Represents an application associated with a finding. -message Application { - // The base URI that identifies the network location of the application in - // which the vulnerability was detected. For example, `http://example.com`. - string base_uri = 1; - - // The full URI with payload that can be used to reproduce the - // vulnerability. For example, `http://example.com?p=aMmYgI6H`. - string full_uri = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto deleted file mode 100644 index 0da4f568ddf..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/folder.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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"; - -// Security Command Center representation of a Google Cloud -// 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}" - pattern: "folders/{folder}/assets/{asset}" - pattern: "projects/{project}/assets/{asset}" - plural: "assets" - singular: "asset" - }; - - // 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 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 Google Cloud resource. Examples include: APPLICATION, - // PROJECT, and ORGANIZATION. This is a case insensitive field defined by - // 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: - // 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; - - // 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 - // 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 - // 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; - - // 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 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 Security Command Center. - google.protobuf.Timestamp create_time = 9; - - // 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 - // 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; - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_exposure.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_exposure.proto deleted file mode 100644 index 1deb1dcea8e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_exposure.proto +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "AttackExposureProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// An attack exposure contains the results of an attack path simulation run. -message AttackExposure { - // This enum defines the various states an AttackExposure can be in. - enum State { - // The state is not specified. - STATE_UNSPECIFIED = 0; - - // The attack exposure has been calculated. - CALCULATED = 1; - - // The attack exposure has not been calculated. - NOT_CALCULATED = 2; - } - - // A number between 0 (inclusive) and infinity that represents how important - // this finding is to remediate. The higher the score, the more important it - // is to remediate. - double score = 1; - - // The most recent time the attack exposure was updated on this finding. - google.protobuf.Timestamp latest_calculation_time = 2; - - // The resource name of the attack path simulation result that contains the - // details regarding this attack exposure score. - // Example: `organizations/123/simulations/456/attackExposureResults/789` - string attack_exposure_result = 3; - - // What state this AttackExposure is in. This captures whether or not an - // attack exposure has been calculated or not. - State state = 4; - - // The number of high value resources that are exposed as a result of this - // finding. - int32 exposed_high_value_resources_count = 5; - - // The number of medium value resources that are exposed as a result of this - // finding. - int32 exposed_medium_value_resources_count = 6; - - // The number of high value resources that are exposed as a result of this - // finding. - int32 exposed_low_value_resources_count = 7; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_path.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_path.proto deleted file mode 100644 index 48cb6d301e7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/attack_path.proto +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "AttackPathProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// A path that an attacker could take to reach an exposed resource. -message AttackPath { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/AttackPath" - pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}" - plural: "attackPaths" - singular: "attackPath" - }; - - // Represents one point that an attacker passes through in this attack path. - message AttackPathNode { - // A finding that is associated with this node in the attack path. - message PathNodeAssociatedFinding { - // Canonical name of the associated findings. Example: - // `organizations/123/sources/456/findings/789` - string canonical_finding = 1; - - // The additional taxonomy group within findings from a given source. - string finding_category = 2; - - // Full resource name of the finding. - string name = 3; - } - - // The type of the incoming attack step node. - enum NodeType { - // Type not specified - NODE_TYPE_UNSPECIFIED = 0; - - // Incoming edge joined with AND - NODE_TYPE_AND = 1; - - // Incoming edge joined with OR - NODE_TYPE_OR = 2; - - // Incoming edge is defense - NODE_TYPE_DEFENSE = 3; - - // Incoming edge is attacker - NODE_TYPE_ATTACKER = 4; - } - - // Detailed steps the attack can take between path nodes. - message AttackStepNode { - // Unique ID for one Node - string uuid = 1; - - // Attack step type. Can be either AND, OR or DEFENSE - NodeType type = 2; - - // User friendly name of the attack step - string display_name = 3; - - // Attack step labels for metadata - map labels = 4; - - // Attack step description - string description = 5; - } - - // The name of the resource at this point in the attack path. - // The format of the name follows the Cloud Asset Inventory [resource - // name - // format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - string resource = 1; - - // The [supported resource - // type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - string resource_type = 2; - - // Human-readable name of this resource. - string display_name = 3; - - // The findings associated with this node in the attack path. - repeated PathNodeAssociatedFinding associated_findings = 4; - - // Unique id of the attack path node. - string uuid = 5; - - // A list of attack step nodes that exist in this attack path node. - repeated AttackStepNode attack_steps = 6; - } - - // Represents a connection between a source node and a destination node in - // this attack path. - message AttackPathEdge { - // The attack node uuid of the source node. - string source = 1; - - // The attack node uuid of the destination node. - string destination = 2; - } - - // The attack path name, for example, - // `organizations/12/simulation/34/valuedResources/56/attackPaths/78` - string name = 1; - - // A list of nodes that exist in this attack path. - repeated AttackPathNode path_nodes = 2; - - // A list of the edges between nodes in this attack path. - repeated AttackPathEdge edges = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto deleted file mode 100644 index 592ea75b1e0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupDisasterRecoveryProto"; -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 Google Cloud Backup and DR Service findings. -message BackupDisasterRecovery { - // The name of a Backup and DR template which comprises one or more backup - // policies. See the [Backup and DR - // documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp) - // for more information. For example, `snap-ov`. - string backup_template = 1; - - // The names of Backup and DR policies that are associated with a template - // and that define when to run a backup, how frequently to run a backup, and - // how long to retain the backup image. For example, `onvaults`. - repeated string policies = 2; - - // The name of a Backup and DR host, which is managed by the backup and - // recovery appliance and known to the management console. The host can be of - // type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file - // system, etc.), vCenter, or an ESX server. See the [Backup and DR - // documentation on - // hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications) - // for more information. For example, `centos7-01`. - string host = 3; - - // The names of Backup and DR applications. An application is a VM, database, - // or file system on a managed host monitored by a backup and recovery - // appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`, - // `centos7-01-vol02`. - repeated string applications = 4; - - // The name of the Backup and DR storage pool that the backup and recovery - // appliance is storing data in. The storage pool could be of type Cloud, - // Primary, Snapshot, or OnVault. See the [Backup and DR documentation on - // storage - // pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools). - // For example, `DiskPoolOne`. - string storage_pool = 5; - - // The names of Backup and DR advanced policy options of a policy applying to - // an application. See the [Backup and DR documentation on policy - // options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings). - // For example, `skipofflineappsincongrp, nounmap`. - repeated string policy_options = 6; - - // The name of the Backup and DR resource profile that specifies the storage - // media for backups of application and VM data. See the [Backup and DR - // documentation on - // profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile). - // For example, `GCP`. - string profile = 7; - - // The name of the Backup and DR appliance that captures, moves, and manages - // the lifecycle of backup data. For example, `backup-server-57137`. - string appliance = 8; - - // The backup type of the Backup and DR image. - // For example, `Snapshot`, `Remote Snapshot`, `OnVault`. - string backup_type = 9; - - // The timestamp at which the Backup and DR backup was created. - google.protobuf.Timestamp backup_create_time = 10; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto deleted file mode 100644 index 63265a9aa45..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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}" - plural: "bigQueryExports" - singular: "bigQueryExport" - }; - - // 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 BigQuery 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 BigQuery 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 BigQuery 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 and - // upload data to the BigQuery dataset. - string principal = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_armor.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_armor.proto deleted file mode 100644 index 7f63542ca90..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_armor.proto +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "CloudArmorProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Fields related to Google Cloud Armor findings. -message CloudArmor { - // Information about the [Google Cloud Armor security - // policy](https://cloud.google.com/armor/docs/security-policy-overview) - // relevant to the finding. - SecurityPolicy security_policy = 1; - - // Information about incoming requests evaluated by [Google Cloud Armor - // security - // policies](https://cloud.google.com/armor/docs/security-policy-overview). - Requests requests = 2; - - // Information about potential Layer 7 DDoS attacks identified by [Google - // Cloud Armor Adaptive - // Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). - AdaptiveProtection adaptive_protection = 3; - - // Information about DDoS attack volume and classification. - Attack attack = 4; - - // Distinguish between volumetric & protocol DDoS attack and - // application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS - // attacks, or "L_7" for Layer 7 DDoS attacks. - string threat_vector = 5; - - // Duration of attack from the start until the current moment (updated every 5 - // minutes). - google.protobuf.Duration duration = 6; -} - -// Information about the [Google Cloud Armor security -// policy](https://cloud.google.com/armor/docs/security-policy-overview) -// relevant to the finding. -message SecurityPolicy { - // The name of the Google Cloud Armor security policy, for example, - // "my-security-policy". - string name = 1; - - // The type of Google Cloud Armor security policy for example, 'backend - // security policy', 'edge security policy', 'network edge security policy', - // or 'always-on DDoS protection'. - string type = 2; - - // Whether or not the associated rule or policy is in preview mode. - bool preview = 3; -} - -// Information about the requests relevant to the finding. -message Requests { - // For 'Increasing deny ratio', the ratio is the denied traffic divided by the - // allowed traffic. For 'Allowed traffic spike', the ratio is the allowed - // traffic in the short term divided by allowed traffic in the long term. - double ratio = 1; - - // Allowed RPS (requests per second) in the short term. - int32 short_term_allowed = 2; - - // Allowed RPS (requests per second) over the long term. - int32 long_term_allowed = 3; - - // Denied RPS (requests per second) over the long term. - int32 long_term_denied = 4; -} - -// Information about [Google Cloud Armor Adaptive -// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). -message AdaptiveProtection { - // A score of 0 means that there is low confidence that the detected event is - // an actual attack. A score of 1 means that there is high confidence that the - // detected event is an attack. See the [Adaptive Protection - // documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) - // for further explanation. - double confidence = 1; -} - -// Information about DDoS attack volume and classification. -message Attack { - // Total PPS (packets per second) volume of attack. - int32 volume_pps = 1; - - // Total BPS (bytes per second) volume of attack. - int32 volume_bps = 2; - - // Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. - string classification = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto deleted file mode 100644 index b4408c9f14f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "CloudDlpDataProfileProto"; -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: "dlp.googleapis.com/TableDataProfile" - pattern: "projects/{project}/tableProfiles/{table_profile}" - pattern: "projects/{project}/locations/{location}/tableProfiles/{table_profile}" -}; - -// The [data profile](https://cloud.google.com/dlp/docs/data-profiles) -// associated with the finding. -message CloudDlpDataProfile { - // Parents for configurations that produce data profile findings. - enum ParentType { - // Unspecified parent type. - PARENT_TYPE_UNSPECIFIED = 0; - - // Organization-level configurations. - ORGANIZATION = 1; - - // Project-level configurations. - PROJECT = 2; - } - - // Name of the data profile, for example, - // `projects/123/locations/europe/tableProfiles/8383929`. - string data_profile = 1 [(google.api.resource_reference) = { - type: "dlp.googleapis.com/TableDataProfile" - }]; - - // The resource hierarchy level at which the data profile was generated. - ParentType parent_type = 2; - - // Type of information detected by SDP. - // Info type includes name, version and sensitivity of the detected - // information type. - repeated InfoType info_types = 3; -} - -// Type of information detected by the API. -message InfoType { - // Name of the information type. Either a name of your choosing when - // creating a CustomInfoType, or one of the names listed - // at - // https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference - // when specifying a built-in type. When sending Cloud DLP results to Data - // Catalog, infoType names should conform to the pattern - // `[A-Za-z0-9$_-]{1,64}`. - string name = 1; - - // Optional version name for this InfoType. - string version = 2; - - // Optional custom sensitivity for this InfoType. - // This only applies to data profiling. - SensitivityScore sensitivity_score = 3; -} - -// Score is calculated from of all elements in the data profile. -// A higher level means the data is more sensitive. -message SensitivityScore { - // Various sensitivity score levels for resources. - enum SensitivityScoreLevel { - // Unused. - SENSITIVITY_SCORE_LEVEL_UNSPECIFIED = 0; - - // No sensitive information detected. The resource isn't publicly - // accessible. - SENSITIVITY_LOW = 10; - - // Unable to determine sensitivity. - SENSITIVITY_UNKNOWN = 12; - - // Medium risk. Contains personally identifiable information (PII), - // potentially sensitive data, or fields with free-text data that are at a - // higher risk of having intermittent sensitive data. Consider limiting - // access. - SENSITIVITY_MODERATE = 20; - - // High risk. Sensitive personally identifiable information (SPII) can be - // present. Exfiltration of data can lead to user data loss. - // Re-identification of users might be possible. Consider limiting usage and - // or removing SPII. - SENSITIVITY_HIGH = 30; - } - - // The sensitivity score applied to the resource. - SensitivityScoreLevel score = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto deleted file mode 100644 index 2b8bb20c892..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "CloudDlpInspectionProto"; -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: "dlp.googleapis.com/DlpJob" - pattern: "projects/{project}/dlpJobs/{dlp_job}" - pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}" -}; - -// Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection -// job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced -// the finding. -message CloudDlpInspection { - // Name of the inspection job, for example, - // `projects/123/locations/europe/dlpJobs/i-8383929`. - string inspect_job = 1 - [(google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" }]; - - // The type of information (or - // *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, - // for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. - string info_type = 2; - - // The number of times Cloud DLP found this infoType within this job - // and resource. - int64 info_type_count = 3; - - // Whether Cloud DLP scanned the complete resource or a sampled subset. - bool full_scan = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto deleted file mode 100644 index f3d9f25c22c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 { - // Industry-wide compliance standards or benchmarks, such as CIS, PCI, and - // OWASP. - string standard = 1; - - // Version of the standard or benchmark, for example, 1.1 - string version = 2; - - // Policies within the standard or benchmark, for example, A.12.4.1 - repeated string ids = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto deleted file mode 100644 index 2ebccbca549..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto deleted file mode 100644 index b8928123299..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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"; - -// Details about specific contacts -message ContactDetails { - // A list of contacts - repeated Contact contacts = 1; -} - -// The email address of a contact. -message Contact { - // An email address. For example, "`person123@company.com`". - string email = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto deleted file mode 100644 index 6b639bbe700..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 { - // Name of the container. - string name = 1; - - // Container image URI provided when configuring a pod or container. This - // string can identify a container image version using mutable tags. - string uri = 2; - - // Optional container image ID, if 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; - - // The time that the container was created. - google.protobuf.Timestamp create_time = 5; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto deleted file mode 100644 index 69c9cd2b025..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 Cloud SQL instances or Cloud -// Spanner instances), or the database instance itself. Some database resources -// might not have the [full resource -// name](https://google.aip.dev/122#full-resource-names) populated because these -// resource types, such as Cloud SQL databases, are not yet supported by Cloud -// Asset Inventory. In these cases only the display name is provided. -message Database { - // Some database resources may not have the [full resource - // name](https://google.aip.dev/122#full-resource-names) populated because - // these resource types are not yet supported by Cloud Asset Inventory (e.g. - // Cloud SQL databases). In these cases only the display name will be - // provided. - // The [full resource name](https://google.aip.dev/122#full-resource-names) of - // the database that the user connected to, if it is supported by Cloud Asset - // Inventory. - string name = 1; - - // The human-readable name of the database that the user connected to. - string display_name = 2; - - // The username used to connect to the database. The username might not be an - // IAM principal and does not have a set format. - string user_name = 3; - - // The SQL statement that is associated with the database access. - string query = 4; - - // The target usernames, roles, or groups of an SQL privilege grant, which is - // not an IAM policy change. - repeated string grantees = 5; - - // The version of the database, for example, POSTGRES_14. - // See [the complete - // list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). - string version = 6; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto deleted file mode 100644 index 0e2d16833ea..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/struct.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "EffectiveEventThreatDetectionCustomModuleProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// An EffectiveEventThreatDetectionCustomModule is the representation of -// an Event Threat Detection custom module at a specified level of the -// resource hierarchy: organization, folder, or project. If a custom module is -// inherited from a parent organization or folder, the value of the -// `enablement_state` property in EffectiveEventThreatDetectionCustomModule is -// set to the value that is effective in the parent, instead of `INHERITED`. -// For example, if the module is enabled in a parent organization or folder, the -// effective `enablement_state` for the module in all child folders or projects -// is also `enabled`. EffectiveEventThreatDetectionCustomModule is read-only. -message EffectiveEventThreatDetectionCustomModule { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" - pattern: "organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}" - pattern: "folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}" - pattern: "projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}" - }; - - // The enablement state of the module. - enum EnablementState { - // Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0; - - // The module is enabled at the given level. - ENABLED = 1; - - // The module is disabled at the given level. - DISABLED = 2; - } - - // Output only. The resource name of the effective ETD custom module. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - // * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - // * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Config for the effective module. - google.protobuf.Struct config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The effective state of enablement for the module at the given - // level of the hierarchy. - EnablementState enablement_state = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Type for the module. e.g. CONFIGURABLE_BAD_IP. - string type = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The human readable name to be displayed for the module. - string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The description for the module. - string description = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto deleted file mode 100644 index 70093981f08..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/security_health_analytics_custom_config.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "EffectiveSecurityHealthAnalyticsCustomModuleProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// An EffectiveSecurityHealthAnalyticsCustomModule is the representation of -// a Security Health Analytics custom module at a specified level of the -// resource hierarchy: organization, folder, or project. If a custom module is -// inherited from a parent organization or folder, the value of the -// `enablementState` property in EffectiveSecurityHealthAnalyticsCustomModule is -// set to the value that is effective in the parent, instead of `INHERITED`. -// For example, if the module is enabled in a parent organization or folder, the -// effective enablement_state for the module in all child folders or projects is -// also `enabled`. EffectiveSecurityHealthAnalyticsCustomModule is read-only. -message EffectiveSecurityHealthAnalyticsCustomModule { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule" - pattern: "organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}" - pattern: "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}" - pattern: "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}" - }; - - // The enablement state of the module. - enum EnablementState { - // Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0; - - // The module is enabled at the given level. - ENABLED = 1; - - // The module is disabled at the given level. - DISABLED = 2; - } - - // Output only. The resource name of the custom module. - // Its format is - // "organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}", - // or - // "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}", - // or - // "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user-specified configuration for the module. - CustomConfig custom_config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The effective state of enablement for the module at the given - // level of the hierarchy. - EnablementState enablement_state = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The display name for the custom module. The name must be - // between 1 and 128 characters, start with a lowercase letter, and contain - // alphanumeric characters or underscores only. - string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto deleted file mode 100644 index a368cc95abe..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "EventThreatDetectionCustomModuleProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Represents an instance of an Event Threat Detection custom module, -// including its full module name, display name, enablement state, and last -// updated time. You can create a custom module at the organization, folder, or -// project level. Custom modules that you create at the organization or folder -// level are inherited by child folders and projects. -message EventThreatDetectionCustomModule { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - pattern: "organizations/{organization}/eventThreatDetectionSettings/customModules/{module}" - pattern: "folders/{folder}/eventThreatDetectionSettings/customModules/{module}" - pattern: "projects/{project}/eventThreatDetectionSettings/customModules/{module}" - }; - - // The enablement state of the module. - enum EnablementState { - // Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0; - - // The module is enabled at the given level. - ENABLED = 1; - - // The module is disabled at the given level. - DISABLED = 2; - - // When the enablement state is inherited. - INHERITED = 3; - } - - // Immutable. The resource name of the Event Threat Detection custom module. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - // * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - // * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Config for the module. For the resident module, its config value is defined - // at this level. For the inherited module, its config value is inherited from - // the ancestor module. - google.protobuf.Struct config = 2; - - // Output only. The closest ancestor module that this module inherits the - // enablement state from. The format is the same as the - // EventThreatDetectionCustomModule resource name. - string ancestor_module = 3 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - ]; - - // The state of enablement for the module at the given level of the hierarchy. - EnablementState enablement_state = 4; - - // Type for the module. e.g. CONFIGURABLE_BAD_IP. - string type = 5; - - // The human readable name to be displayed for the module. - string display_name = 6; - - // The description for the module. - string description = 7; - - // Output only. The time the module was last updated. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The editor the module was last updated by. - string last_editor = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto deleted file mode 100644 index 7865e3e596f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "EventThreatDetectionCustomModuleValidationErrorsProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// A list of zero or more errors encountered while validating the uploaded -// configuration of an Event Threat Detection Custom Module. -message CustomModuleValidationErrors { - repeated CustomModuleValidationError errors = 1; -} - -// An error encountered while validating the uploaded configuration of an -// Event Threat Detection Custom Module. -message CustomModuleValidationError { - // A description of the error, suitable for human consumption. Required. - string description = 1; - - // The path, in RFC 8901 JSON Pointer format, to the field that failed - // validation. This may be left empty if no specific field is affected. - string field_path = 2; - - // The initial position of the error in the uploaded text version of the - // module. This field may be omitted if no specific position applies, or if - // one could not be computed. - optional Position start = 3; - - // The end position of the error in the uploaded text version of the - // module. This field may be omitted if no specific position applies, or if - // one could not be computed.. - optional Position end = 4; -} - -// A position in the uploaded text version of a module. -message Position { - int32 line_number = 1; - - int32 column_number = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto deleted file mode 100644 index dea4c11a99f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 from one or more sources -// to one or more targets. The `sources` attribute lists the sources of the -// exfiltrated data. The `targets` attribute lists the destinations 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; - - // Total exfiltrated bytes processed for the entire job. - int64 total_exfiltrated_bytes = 3; -} - -// Resource where data was exfiltrated from or exfiltrated to. -message ExfilResource { - // The resource's [full resource - // name](https://cloud.google.com/apis/design/resource_names#full_resource_name). - string name = 1; - - // Subcomponents of the asset that was exfiltrated, like URIs used during - // exfiltration, table names, databases, and filenames. For example, multiple - // tables might have been exfiltrated from the same Cloud SQL instance, or - // multiple files might have been exfiltrated from the same Cloud Storage - // bucket. - repeated string components = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto deleted file mode 100644 index 6c3cd1d1221..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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}" - plural: "externalSystems" - singular: "externalSystem" - }; - - // Information about the ticket, if any, that is being used to track the - // resolution of the issue that is identified by this finding. - message TicketInfo { - // The identifier of the ticket in the ticket system. - string id = 1; - - // The assignee of the ticket in the ticket system. - string assignee = 2; - - // The description of the ticket in the ticket system. - string description = 3; - - // The link to the ticket in the ticket system. - string uri = 4; - - // The latest status of the ticket, as reported by the ticket system. - string status = 5; - - // The time when the ticket was last updated, as reported by the ticket - // system. - google.protobuf.Timestamp update_time = 6; - } - - // Full resource name of the external system, for example: - // "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; - - // The identifier that's used to track the finding's corresponding case in the - // external system. - string external_uid = 3; - - // The most recent status of the finding's corresponding case, as reported by - // the external system. - string status = 4; - - // The time when the case was last updated, as reported by the external - // system. - google.protobuf.Timestamp external_system_update_time = 5; - - // The link to the finding's corresponding case in the external system. - string case_uri = 6; - - // The priority of the finding's corresponding case in the external system. - string case_priority = 7; - - // The SLA of the finding's corresponding case in the external system. - google.protobuf.Timestamp case_sla = 9; - - // The time when the case was created, as reported by the external system. - google.protobuf.Timestamp case_create_time = 10; - - // The time when the case was closed, as reported by the external system. - google.protobuf.Timestamp case_close_time = 11; - - // Information about the ticket, if any, that is being used to track the - // resolution of the issue that is identified by this finding. - TicketInfo ticket_info = 8; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto deleted file mode 100644 index 52678aa358c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 { - // Path of the file in terms of underlying disk/partition identifiers. - message DiskPath { - // UUID of the partition (format - // https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid) - string partition_uuid = 1; - - // Relative path of the file in the partition as a JSON encoded string. - // Example: /home/user1/executable_file.sh - string relative_path = 2; - } - - // 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, 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. - string contents = 6; - - // Path of the file in terms of underlying disk/partition identifiers. - DiskPath disk_path = 7; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto deleted file mode 100644 index dd7a7e1a05c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ /dev/null @@ -1,485 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/access.proto"; -import "google/cloud/securitycenter/v1/application.proto"; -import "google/cloud/securitycenter/v1/attack_exposure.proto"; -import "google/cloud/securitycenter/v1/backup_disaster_recovery.proto"; -import "google/cloud/securitycenter/v1/chokepoint.proto"; -import "google/cloud/securitycenter/v1/cloud_armor.proto"; -import "google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto"; -import "google/cloud/securitycenter/v1/cloud_dlp_inspection.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/database.proto"; -import "google/cloud/securitycenter/v1/exfiltration.proto"; -import "google/cloud/securitycenter/v1/external_exposure.proto"; -import "google/cloud/securitycenter/v1/external_system.proto"; -import "google/cloud/securitycenter/v1/file.proto"; -import "google/cloud/securitycenter/v1/group_membership.proto"; -import "google/cloud/securitycenter/v1/iam_binding.proto"; -import "google/cloud/securitycenter/v1/indicator.proto"; -import "google/cloud/securitycenter/v1/kernel_rootkit.proto"; -import "google/cloud/securitycenter/v1/kubernetes.proto"; -import "google/cloud/securitycenter/v1/load_balancer.proto"; -import "google/cloud/securitycenter/v1/log_entry.proto"; -import "google/cloud/securitycenter/v1/mitre_attack.proto"; -import "google/cloud/securitycenter/v1/notebook.proto"; -import "google/cloud/securitycenter/v1/org_policy.proto"; -import "google/cloud/securitycenter/v1/process.proto"; -import "google/cloud/securitycenter/v1/security_marks.proto"; -import "google/cloud/securitycenter/v1/security_posture.proto"; -import "google/cloud/securitycenter/v1/toxic_combination.proto"; -import "google/cloud/securitycenter/v1/vulnerability.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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"; - -// Security Command Center finding. -// -// A finding is a record of assessment data like security, risk, health, or -// 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 { - 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}" - plural: "findings" - singular: "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 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 and public SSH access with weak or no - // passwords. - // - // 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; - } - - // 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. - 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; - - // Describes an error that prevents some SCC functionality. - SCC_ERROR = 5; - - // Describes a potential security risk due to a change in the security - // posture. - POSTURE_VIOLATION = 6; - - // Describes a group of security issues that, when the issues - // occur together, represent a greater risk than when the issues occur - // independently. A group of such issues is referred to as a toxic - // combination. - TOXIC_COMBINATION = 7; - - // Describes a potential security risk to data assets that contain sensitive - // data. - SENSITIVE_DATA_RISK = 8; - - // Describes a resource or resource group where high risk attack paths - // converge, based on attack path simulations (APS). - CHOKEPOINT = 9; - - // Describes a potential security risk due to the resource being exposed to - // the internet. - EXTERNAL_EXPOSURE = 10; - } - - // Mute information about the finding, including whether the finding has a - // static mute or any matching dynamic mute rules. - message MuteInfo { - // Information about the static mute state. A static mute state overrides - // any dynamic mute rules that apply to this finding. The static mute state - // can be set by a static mute rule or by muting the finding directly. - message StaticMute { - // The static mute state. If the value is `MUTED` or `UNMUTED`, then the - // finding's overall mute state will have the same value. - Mute state = 1; - - // When the static mute was applied. - google.protobuf.Timestamp apply_time = 2; - } - - // The record of a dynamic mute rule that matches the finding. - message DynamicMuteRecord { - // The relative resource name of the mute rule, represented by a mute - // config, that created this record, for example - // `organizations/123/muteConfigs/mymuteconfig` or - // `organizations/123/locations/global/muteConfigs/mymuteconfig`. - string mute_config = 1; - - // When the dynamic mute rule first matched the finding. - google.protobuf.Timestamp match_time = 2; - } - - // If set, the static mute applied to this finding. Static mutes override - // dynamic mutes. If unset, there is no static mute. - StaticMute static_mute = 1; - - // The list of dynamic mute rules that currently match the finding. - repeated DynamicMuteRecord dynamic_mute_records = 2; - } - - // The [relative resource - // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // of the finding. Example: - // "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; - - // 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 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-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. - 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 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 - // 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 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; - - // 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; - - // 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; - - // 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; - - // 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. For more information, see [Indicator of - // compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). - Indicator indicator = 18; - - // Represents vulnerability-specific fields like CVE and CVSS scores. - // 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]; - - // 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 with the finding, such as more information on the - // caller, which method was accessed, and from where. - Access access = 26; - - // Contains information about the IP connection associated with the finding. - repeated Connection connections = 31; - - // Records additional information about the mute operation, for example, the - // [mute configuration](/security-command-center/docs/how-to-mute-findings) - // that muted the finding and the user who muted the finding. - string mute_initiator = 28; - - // Output only. The mute information regarding this finding. - MuteInfo mute_info = 61 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Represents operating system processes associated with the Finding. - repeated Process processes = 30; - - // 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 - // - // { - // "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; - - // 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 details about the finding. - string description = 37; - - // Represents exfiltrations associated with the finding. - Exfiltration exfiltration = 38; - - // Represents IAM bindings associated with the finding. - repeated IamBinding iam_bindings = 39; - - // Steps to address the finding. - string next_steps = 40; - - // Unique identifier of the module which generated the finding. - // Example: - // folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885 - string module_name = 41; - - // Containers associated with the finding. This field provides information for - // both Kubernetes and non-Kubernetes containers. - repeated Container containers = 42; - - // Kubernetes resources associated with the finding. - Kubernetes kubernetes = 43; - - // Database associated with the finding. - Database database = 44; - - // The results of an attack path simulation relevant to this finding. - AttackExposure attack_exposure = 45; - - // File associated with the finding. - repeated File files = 46; - - // Cloud Data Loss Prevention (Cloud DLP) inspection results that are - // associated with the finding. - CloudDlpInspection cloud_dlp_inspection = 48; - - // Cloud DLP data profile that is associated with the finding. - CloudDlpDataProfile cloud_dlp_data_profile = 49; - - // Signature of the kernel rootkit. - KernelRootkit kernel_rootkit = 50; - - // Contains information about the org policies associated with the finding. - repeated OrgPolicy org_policies = 51; - - // Represents an application associated with the finding. - Application application = 53; - - // Fields related to Backup and DR findings. - BackupDisasterRecovery backup_disaster_recovery = 55; - - // The security posture associated with the finding. - SecurityPosture security_posture = 56; - - // Log entries that are relevant to the finding. - repeated LogEntry log_entries = 57; - - // The load balancers associated with the finding. - repeated LoadBalancer load_balancers = 58; - - // Fields related to Cloud Armor findings. - CloudArmor cloud_armor = 59; - - // Notebook associated with the finding. - Notebook notebook = 63; - - // Contains details about a group of security issues that, when the issues - // occur together, represent a greater risk than when the issues occur - // independently. A group of such issues is referred to as a toxic - // combination. - // This field cannot be updated. Its value is ignored in all update requests. - ToxicCombination toxic_combination = 64; - - // Contains details about groups of which this finding is a member. A group is - // a collection of findings that are related in some way. - // This field cannot be updated. Its value is ignored in all update requests. - repeated GroupMembership group_memberships = 65; - - // Contains details about a chokepoint, which is a resource or resource group - // where high-risk attack paths converge, based on [attack path simulations] - // (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). - // This field cannot be updated. Its value is ignored in all update requests. - Chokepoint chokepoint = 77; - - // External exposure associated with the finding. - ExternalExposure external_exposure = 84; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto deleted file mode 100644 index d816c9ed0b3..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto deleted file mode 100644 index 1625145ca45..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "GroupMembershipProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Contains details about groups of which this finding is a member. A group is a -// collection of findings that are related in some way. -message GroupMembership { - // Possible types of groups. - enum GroupType { - // Default value. - GROUP_TYPE_UNSPECIFIED = 0; - - // Group represents a toxic combination. - GROUP_TYPE_TOXIC_COMBINATION = 1; - - // Group represents a chokepoint. - GROUP_TYPE_CHOKEPOINT = 3; - } - - // Type of group. - GroupType group_type = 1; - - // ID of the group. - string group_id = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto deleted file mode 100644 index ad44b5e5128..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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, for - // example, "foo@google.com". - string member = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto deleted file mode 100644 index 00aefebd3ff..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "IndicatorProto"; -option java_package = "com.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. -// For more information, see [Indicator of -// compromise](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; - } - - // Possible resource types to be associated with a signature. - enum SignatureType { - // The default signature type. - SIGNATURE_TYPE_UNSPECIFIED = 0; - - // Used for signatures concerning processes. - SIGNATURE_TYPE_PROCESS = 1; - - // Used for signatures concerning disks. - SIGNATURE_TYPE_FILE = 2; - } - - 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; - } - - // Describes the type of resource associated with the signature. - SignatureType signature_type = 8; - } - - // The list of IP addresses that are associated with 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; - - // The list of URIs associated to the Findings. - repeated string uris = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto deleted file mode 100644 index 9042faaf1e4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "KernelRootkitProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Kernel mode rootkit signatures. -message KernelRootkit { - // Rootkit name, when available. - string name = 1; - - // True if unexpected modifications of kernel code memory are present. - bool unexpected_code_modification = 2; - - // True if unexpected modifications of kernel read-only data memory are - // present. - bool unexpected_read_only_data_modification = 3; - - // True if `ftrace` points are present with callbacks pointing to regions - // that are not in the expected kernel or module code range. - bool unexpected_ftrace_handler = 4; - - // True if `kprobe` points are present with callbacks pointing to regions - // that are not in the expected kernel or module code range. - bool unexpected_kprobe_handler = 5; - - // True if kernel code pages that are not in the expected kernel or module - // code regions are present. - bool unexpected_kernel_code_pages = 6; - - // True if system call handlers that are are not in the expected kernel or - // module code regions are present. - bool unexpected_system_call_handler = 7; - - // True if interrupt handlers that are are not in the expected kernel or - // module code regions are present. - bool unexpected_interrupt_handler = 8; - - // True if unexpected processes in the scheduler run queue are present. Such - // processes are in the run queue, but not in the process task list. - bool unexpected_processes_in_runqueue = 9; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto deleted file mode 100644 index 5d252b7bd11..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 { - // A 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](https://google.aip.dev/122#full-resource-names) 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 the binding. - string ns = 1; - - // Name for the binding. - string name = 2; - - // The Role or ClusterRole referenced by the binding. - Role role = 3; - - // Represents one or more subjects that are 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 the 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 the subject. - AuthType kind = 1; - - // Namespace for the subject. - string ns = 2; - - // Name for the subject. - string name = 3; - } - - // Conveys information about a Kubernetes access review (such as one returned - // by a [`kubectl auth - // can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) - // command) that was involved in a finding. - message AccessReview { - // 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; - - // The name of the resource being requested. Empty means all. - string name = 3; - - // The optional resource type requested. "*" means all. - string resource = 4; - - // The optional subresource type. - string subresource = 5; - - // A Kubernetes resource API verb, like get, list, watch, create, update, - // delete, proxy. "*" means all. - string verb = 6; - - // The API version of the resource. "*" means all. - string version = 7; - } - - // Kubernetes object related to the finding, uniquely identified by GKNN. - // Used if the object Kind is not one of Pod, Node, NodePool, Binding, or - // AccessReview. - message Object { - // Kubernetes object group, such as "policy.k8s.io/v1". - string group = 1; - - // Kubernetes object kind, such as "Namespace". - string kind = 2; - - // Kubernetes object namespace. Must be a valid DNS label. Named - // "ns" to avoid collision with C++ namespace keyword. For details see - // https://kubernetes.io/docs/tasks/administer-cluster/namespaces/. - string ns = 3; - - // Kubernetes object name. For details see - // https://kubernetes.io/docs/concepts/overview/working-with-objects/names/. - string name = 4; - - // Pod containers associated with this finding, if any. - repeated Container containers = 5; - } - - // Kubernetes - // [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) - // associated with the finding. This field contains Pod records for each - // container that is owned by a Pod. - repeated Pod pods = 1; - - // Provides Kubernetes - // [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) - // information. - repeated Node nodes = 2; - - // GKE [node - // pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) - // associated with the finding. This field contains node pool information for - // each node, when it is available. - repeated NodePool node_pools = 3; - - // Provides Kubernetes role information for findings that involve [Roles or - // ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). - repeated Role roles = 4; - - // Provides Kubernetes role binding information for findings that involve - // [RoleBindings or - // ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). - repeated Binding bindings = 5; - - // Provides information on any Kubernetes access reviews (privilege checks) - // relevant to the finding. - repeated AccessReview access_reviews = 6; - - // Kubernetes objects related to the finding. - repeated Object objects = 7; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto deleted file mode 100644 index b08bbfd0529..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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"; - -// Represents a generic name-value label. A label has separate name and value -// fields to support filtering with the `contains()` function. For more -// information, see [Filtering on array-type -// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). -message Label { - // Name of the label. - string name = 1; - - // Value that corresponds to the label's name. - string value = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/load_balancer.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/load_balancer.proto deleted file mode 100644 index 9053fad15f1..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/load_balancer.proto +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "LoadBalancerProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Contains information related to the load balancer associated with the -// finding. -message LoadBalancer { - // The name of the load balancer associated with the finding. - string name = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/log_entry.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/log_entry.proto deleted file mode 100644 index 93c8df2df27..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/log_entry.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "LogEntryProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// An individual entry in a log. -message LogEntry { - oneof log_entry { - // An individual entry in a log stored in Cloud Logging. - CloudLoggingEntry cloud_logging_entry = 1; - } -} - -// Metadata taken from a [Cloud Logging -// LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) -message CloudLoggingEntry { - // A unique identifier for the log entry. - string insert_id = 1; - - // The type of the log (part of `log_name`. `log_name` is the resource name of - // the log to which this log entry belongs). For example: - // `cloudresourcemanager.googleapis.com/activity`. Note that this field is not - // URL-encoded, unlike the `LOG_ID` field in `LogEntry`. - string log_id = 2; - - // The organization, folder, or project of the monitored resource that - // produced this log entry. - string resource_container = 3; - - // The time the event described by the log entry occurred. - google.protobuf.Timestamp timestamp = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto deleted file mode 100644 index c820cc50a95..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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/ - // Next ID: 65 - enum Technique { - // Unspecified value. - TECHNIQUE_UNSPECIFIED = 0; - - // T1036 - MASQUERADING = 49; - - // T1036.005 - MATCH_LEGITIMATE_NAME_OR_LOCATION = 50; - - // T1037 - BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37; - - // T1037.005 - STARTUP_ITEMS = 38; - - // T1046 - NETWORK_SERVICE_DISCOVERY = 32; - - // T1057 - PROCESS_DISCOVERY = 56; - - // T1059 - COMMAND_AND_SCRIPTING_INTERPRETER = 6; - - // T1059.004 - UNIX_SHELL = 7; - - // T1059.006 - PYTHON = 59; - - // T1068 - EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63; - - // T1069 - PERMISSION_GROUPS_DISCOVERY = 18; - - // T1069.003 - CLOUD_GROUPS = 19; - - // T1070.004 - INDICATOR_REMOVAL_FILE_DELETION = 64; - - // T1071 - APPLICATION_LAYER_PROTOCOL = 45; - - // T1071.004 - DNS = 46; - - // T1072 - SOFTWARE_DEPLOYMENT_TOOLS = 47; - - // T1078 - VALID_ACCOUNTS = 14; - - // T1078.001 - DEFAULT_ACCOUNTS = 35; - - // T1078.003 - LOCAL_ACCOUNTS = 15; - - // T1078.004 - CLOUD_ACCOUNTS = 16; - - // T1090 - PROXY = 9; - - // T1090.002 - EXTERNAL_PROXY = 10; - - // T1090.003 - MULTI_HOP_PROXY = 11; - - // T1098 - ACCOUNT_MANIPULATION = 22; - - // T1098.001 - ADDITIONAL_CLOUD_CREDENTIALS = 40; - - // T1098.004 - SSH_AUTHORIZED_KEYS = 23; - - // T1098.006 - ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58; - - // T1105 - INGRESS_TOOL_TRANSFER = 3; - - // T1106 - NATIVE_API = 4; - - // T1110 - BRUTE_FORCE = 44; - - // T1129 - SHARED_MODULES = 5; - - // T1134 - ACCESS_TOKEN_MANIPULATION = 33; - - // T1134.001 - TOKEN_IMPERSONATION_OR_THEFT = 39; - - // T1190 - EXPLOIT_PUBLIC_FACING_APPLICATION = 27; - - // T1484 - DOMAIN_POLICY_MODIFICATION = 30; - - // T1485 - DATA_DESTRUCTION = 29; - - // T1489 - SERVICE_STOP = 52; - - // T1490 - INHIBIT_SYSTEM_RECOVERY = 36; - - // T1496 - RESOURCE_HIJACKING = 8; - - // T1498 - NETWORK_DENIAL_OF_SERVICE = 17; - - // T1526 - CLOUD_SERVICE_DISCOVERY = 48; - - // T1528 - STEAL_APPLICATION_ACCESS_TOKEN = 42; - - // T1531 - ACCOUNT_ACCESS_REMOVAL = 51; - - // T1539 - STEAL_WEB_SESSION_COOKIE = 25; - - // T1543 - CREATE_OR_MODIFY_SYSTEM_PROCESS = 24; - - // T1548 - ABUSE_ELEVATION_CONTROL_MECHANISM = 34; - - // T1552 - UNSECURED_CREDENTIALS = 13; - - // T1556 - MODIFY_AUTHENTICATION_PROCESS = 28; - - // T1562 - IMPAIR_DEFENSES = 31; - - // T1562.001 - DISABLE_OR_MODIFY_TOOLS = 55; - - // T1567 - EXFILTRATION_OVER_WEB_SERVICE = 20; - - // T1567.002 - EXFILTRATION_TO_CLOUD_STORAGE = 21; - - // T1568 - DYNAMIC_RESOLUTION = 12; - - // T1570 - LATERAL_TOOL_TRANSFER = 41; - - // T1578 - MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26; - - // T1578.001 - CREATE_SNAPSHOT = 54; - - // T1580 - CLOUD_INFRASTRUCTURE_DISCOVERY = 53; - - // T1588 - OBTAIN_CAPABILITIES = 43; - - // T1595 - ACTIVE_SCANNING = 1; - - // T1595.001 - SCANNING_IP_BLOCKS = 2; - - // T1609 - CONTAINER_ADMINISTRATION_COMMAND = 60; - - // T1611 - ESCAPE_TO_HOST = 61; - - // T1613 - CONTAINER_AND_RESOURCE_DISCOVERY = 57; - - // T1649 - STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62; - } - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto deleted file mode 100644 index bef411206b0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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}" - pattern: "organizations/{organization}/locations/{location}/muteConfigs/{mute_config}" - pattern: "folders/{folder}/locations/{location}/muteConfigs/{mute_config}" - pattern: "projects/{project}/locations/{location}/muteConfigs/{mute_config}" - plural: "muteConfigs" - singular: "muteConfig" - }; - - // The type of MuteConfig. - enum MuteConfigType { - // Unused. - MUTE_CONFIG_TYPE_UNSPECIFIED = 0; - - // A static mute config, which sets the static mute state of future matching - // findings to muted. Once the static mute state has been set, finding or - // config modifications will not affect the state. - STATIC = 1; - - // A dynamic mute config, which is applied to existing and future matching - // findings, setting their dynamic mute state to "muted". If the config is - // updated or deleted, or a matching finding is updated, such that the - // finding doesn't match the config, the config will be removed from the - // finding, and the finding's dynamic mute state may become "unmuted" - // (unless other configs still match). - DYNAMIC = 2; - } - - // 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}` - // `organizations/{organization}/locations/global/muteConfigs/{mute_config}` - // `folders/{folder}/locations/global/muteConfigs/{mute_config}` - // `projects/{project}/locations/global/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]; - - // Optional. The type of the mute config, which determines what type of mute - // state the config affects. The static mute state takes precedence over the - // dynamic mute state. Immutable after creation. STATIC by default if not set - // during creation. - MuteConfigType type = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The expiry of the mute config. Only applicable for dynamic - // configs. If the expiry is set, when the config expires, it is removed from - // all findings. - google.protobuf.Timestamp expiry_time = 9 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notebook.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notebook.proto deleted file mode 100644 index 38e7af770d7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notebook.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "NotebookProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise -// notebook](https://cloud.google.com/colab/docs/introduction) file, that is -// associated with a finding. -message Notebook { - // The name of the notebook. - string name = 1; - - // The source notebook service, for example, "Colab Enterprise". - string service = 2; - - // The user ID of the latest author to modify the notebook. - string last_author = 3; - - // The most recent time the notebook was updated. - google.protobuf.Timestamp notebook_update_time = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto deleted file mode 100644 index 374e6167c8d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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}" - pattern: "folders/{folder}/notificationConfigs/{notification_config}" - pattern: "projects/{project}/notificationConfigs/{notification_config}" - plural: "notificationConfigs" - singular: "notificationConfig" - }; - - // 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", - // "folders/{folder_id}/notificationConfigs/notify_public_bucket", - // or "projects/{project_id}/notificationConfigs/notify_public_bucket". - string name = 1; - - // The description of the notification config (max of 1024 characters). - string description = 2; - - // 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" } - ]; - - // Output only. The service account that needs "pubsub.topics.publish" - // permission to publish to the Pub/Sub 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto deleted file mode 100644 index 08ed4dab91f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/finding.proto"; -import "google/cloud/securitycenter/v1/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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; - } - - // The Cloud resource tied to this notification's Finding. - Resource resource = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/org_policy.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/org_policy.proto deleted file mode 100644 index fb5119dbd5a..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/org_policy.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "OrgPolicyProto"; -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 org policies associated with the finding. -message OrgPolicy { - option (google.api.resource) = { - type: "orgpolicy.googleapis.com/Policy" - pattern: "organizations/{organization}/policies/{constraint_name}" - pattern: "folders/{folder}/policies/{constraint_name}" - pattern: "projects/{project}/policies/{constraint_name}" - }; - - // The resource name of the org policy. - // Example: - // "organizations/{organization_id}/policies/{constraint_name}" - string name = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto deleted file mode 100644 index 8b62e150386..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 Security Command -// Center organization. -message OrganizationSettings { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/OrganizationSettings" - pattern: "organizations/{organization}/organizationSettings" - plural: "organizationSettings" - singular: "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 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: - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto deleted file mode 100644 index 0c86ac775cd..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 { - // The process name, as displayed in utilities like `top` and `ps`. This name - // can be accessed through `/proc/[pid]/comm` and changed with - // `prctl(PR_SET_NAME)`. - string name = 12; - - // 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; -} - -// A name-value pair representing an environment variable used in an operating -// system 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto deleted file mode 100644 index 1e0c850a140..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/folder.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 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. - 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; - - // 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]; - - // Indicates which cloud provider the resource resides in. - CloudProvider cloud_provider = 9; - - // Indicates which organization or tenant in the cloud provider the finding - // applies to. - string organization = 10; - - // The parent service or product from which the resource is provided, for - // example, GKE or SNS. - string service = 11; - - // The region or location of the service (if applicable). - string location = 12; - - oneof cloud_provider_metadata { - // The AWS metadata associated with the finding. - AwsMetadata aws_metadata = 16; - - // The Azure metadata associated with the finding. - AzureMetadata azure_metadata = 17; - } - - // Provides the path to the resource within the resource hierarchy. - ResourcePath resource_path = 18; - - // A string representation of the resource path. - // For Google Cloud, it has the format of - // `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` - // where there can be any number of folders. - // For AWS, it has the format of - // `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` - // where there can be any number of organizational units. - // For Azure, it has the format of - // `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` - // where there can be any number of management groups. - string resource_path_string = 19; -} - -// Enumeration representing the various cloud providers a finding's resource -// could reside in. -enum CloudProvider { - // The cloud provider is unspecified. - CLOUD_PROVIDER_UNSPECIFIED = 0; - - // The cloud provider is Google Cloud Platform. - GOOGLE_CLOUD_PLATFORM = 1; - - // The cloud provider is Amazon Web Services. - AMAZON_WEB_SERVICES = 2; - - // The cloud provider is Microsoft Azure. - MICROSOFT_AZURE = 3; -} - -// AWS metadata associated with the resource, only applicable if the finding's -// cloud provider is Amazon Web Services. -message AwsMetadata { - // An organization is a collection of accounts that are centrally managed - // together using consolidated billing, organized hierarchically with - // organizational units (OUs), and controlled with policies. - message AwsOrganization { - // The unique identifier (ID) for the organization. The regex pattern for an - // organization ID string requires "o-" followed by from 10 to 32 lowercase - // letters or digits. - string id = 1; - } - - // An Organizational Unit (OU) is a container of AWS accounts within a root of - // an organization. Policies that are attached to an OU apply to all accounts - // contained in that OU and in any child OUs. - message AwsOrganizationalUnit { - // The unique identifier (ID) associated with this OU. The regex pattern for - // an organizational unit ID string requires "ou-" followed by from 4 to 32 - // lowercase letters or digits (the ID of the root that contains the OU). - // This string is followed by a second "-" dash and from 8 to 32 additional - // lowercase letters or digits. For example, "ou-ab12-cd34ef56". - string id = 1; - - // The friendly name of the OU. - string name = 2; - } - - // An AWS account that is a member of an organization. - message AwsAccount { - // The unique identifier (ID) of the account, containing exactly 12 digits. - string id = 1; - - // The friendly name of this account. - string name = 2; - } - - // The AWS organization associated with the resource. - AwsOrganization organization = 2; - - // A list of AWS organizational units associated with the resource, ordered - // from lowest level (closest to the account) to highest level. - repeated AwsOrganizationalUnit organizational_units = 3; - - // The AWS account associated with the resource. - AwsAccount account = 4; -} - -// Azure metadata associated with the resource, only applicable if the finding's -// cloud provider is Microsoft Azure. -message AzureMetadata { - // Represents an Azure management group. - message AzureManagementGroup { - // The UUID of the Azure management group, for example, - // `20000000-0001-0000-0000-000000000000`. - string id = 1; - - // The display name of the Azure management group. - string display_name = 2; - } - - // Represents an Azure subscription. - message AzureSubscription { - // The UUID of the Azure subscription, for example, - // `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`. - string id = 1; - - // The display name of the Azure subscription. - string display_name = 2; - } - - // Represents an Azure resource group. - message AzureResourceGroup { - // The name of the Azure resource group. This is not a UUID. - string name = 1; - } - - // A list of Azure management groups associated with the resource, ordered - // from lowest level (closest to the subscription) to highest level. - repeated AzureManagementGroup management_groups = 4; - - // The Azure subscription associated with the resource. - AzureSubscription subscription = 5; - - // The Azure resource group associated with the resource. - AzureResourceGroup resource_group = 6; -} - -// Represents the path of resources leading up to the resource this finding is -// about. -message ResourcePath { - // The type of resource the node represents. - enum ResourcePathNodeType { - // Node type is unspecified. - RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0; - - // The node represents a Google Cloud organization. - GCP_ORGANIZATION = 1; - - // The node represents a Google Cloud folder. - GCP_FOLDER = 2; - - // The node represents a Google Cloud project. - GCP_PROJECT = 3; - - // The node represents an AWS organization. - AWS_ORGANIZATION = 4; - - // The node represents an AWS organizational unit. - AWS_ORGANIZATIONAL_UNIT = 5; - - // The node represents an AWS account. - AWS_ACCOUNT = 6; - - // The node represents an Azure management group. - AZURE_MANAGEMENT_GROUP = 7; - - // The node represents an Azure subscription. - AZURE_SUBSCRIPTION = 8; - - // The node represents an Azure resource group. - AZURE_RESOURCE_GROUP = 9; - } - - // A node within the resource path. Each node represents a resource within the - // resource hierarchy. - message ResourcePathNode { - // The type of resource this node represents. - ResourcePathNodeType node_type = 1; - - // The ID of the resource this node represents. - string id = 2; - - // The display name of the resource this node represents. - string display_name = 3; - } - - // The list of nodes that make the up resource path, ordered from lowest - // level to highest level. - repeated ResourcePathNode nodes = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource_value_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource_value_config.proto deleted file mode 100644 index 4416608d9e4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource_value_config.proto +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ResourceValueConfigProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// A resource value configuration (RVC) is a mapping configuration of user's -// resources to resource values. Used in Attack path simulations. -message ResourceValueConfig { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/ResourceValueConfig" - pattern: "organizations/{organization}/resourceValueConfigs/{resource_value_config}" - plural: "resourceValueConfigs" - singular: "resourceValueConfig" - }; - - // Resource value mapping for Sensitive Data Protection findings. - // If any of these mappings have a resource value that is not unspecified, - // the resource_value field will be ignored when reading this configuration. - message SensitiveDataProtectionMapping { - // Resource value mapping for high-sensitivity Sensitive Data Protection - // findings - ResourceValue high_sensitivity_mapping = 1; - - // Resource value mapping for medium-sensitivity Sensitive Data Protection - // findings - ResourceValue medium_sensitivity_mapping = 2; - } - - // Name for the resource value configuration - string name = 1; - - // Required. Resource value level this expression represents - ResourceValue resource_value = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Tag values combined with `AND` to check against. - // Values in the form "tagValues/123" - // Example: `[ "tagValues/123", "tagValues/456", "tagValues/789" ]` - // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing - repeated string tag_values = 3 [(google.api.field_behavior) = REQUIRED]; - - // Apply resource_value only to resources that match resource_type. - // resource_type will be checked with `AND` of other resources. - // For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" - // will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. - string resource_type = 4; - - // Project or folder to scope this configuration to. - // For example, "project/456" would apply this configuration only to resources - // in "project/456" scope will be checked with `AND` of other - // resources. - string scope = 5; - - // List of resource labels to search for, evaluated with `AND`. - // For example, `"resource_labels_selector": {"key": "value", "env": "prod"}` - // will match resources with labels "key": "value" `AND` "env": - // "prod" - // https://cloud.google.com/resource-manager/docs/creating-managing-labels - map resource_labels_selector = 6; - - // Description of the resource value configuration. - string description = 7; - - // Output only. Timestamp this resource value configuration was created. - google.protobuf.Timestamp create_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp this resource value configuration was last updated. - google.protobuf.Timestamp update_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cloud provider this configuration applies to - CloudProvider cloud_provider = 10; - - // A mapping of the sensitivity on Sensitive Data Protection finding to - // resource values. This mapping can only be used in combination with a - // resource_type that is related to BigQuery, e.g. - // "bigquery.googleapis.com/Dataset". - SensitiveDataProtectionMapping sensitive_data_protection_mapping = 11; -} - -// Value enum to map to a resource -enum ResourceValue { - // Unspecific value - RESOURCE_VALUE_UNSPECIFIED = 0; - - // High resource value - HIGH = 1; - - // Medium resource value - MEDIUM = 2; - - // Low resource value - LOW = 3; - - // No resource value, e.g. ignore these resources - NONE = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto deleted file mode 100644 index 997444a34d7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto deleted file mode 100644 index 01209533de4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/type/expr.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SecurityHealthAnalyticsCustomConfigProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Defines the properties in a custom module configuration for Security -// Health Analytics. Use the custom module configuration to create custom -// detectors that generate custom findings for resources that you specify. -message CustomConfig { - // A set of optional name-value pairs that define custom source properties to - // return with each finding that is generated by the custom module. The custom - // source properties that are defined here are included in the finding JSON - // under `sourceProperties`. - message CustomOutputSpec { - // An individual name-value pair that defines a custom source property. - message Property { - // Name of the property for the custom output. - string name = 1; - - // The CEL expression for the custom output. A resource property can be - // specified to return the value of the property or a text string enclosed - // in quotation marks. - google.type.Expr value_expression = 2; - } - - // A list of custom output properties to add to the finding. - repeated Property properties = 1; - } - - // Resource for selecting resource type. - message ResourceSelector { - // The resource types to run the detector on. - repeated string resource_types = 1; - } - - // Defines the valid value options for the severity of a finding. - enum Severity { - // Unspecified severity. - SEVERITY_UNSPECIFIED = 0; - - // Critical severity. - CRITICAL = 1; - - // High severity. - HIGH = 2; - - // Medium severity. - MEDIUM = 3; - - // Low severity. - LOW = 4; - } - - // The CEL expression to evaluate to produce findings. When the expression - // evaluates to true against a resource, a finding is generated. - google.type.Expr predicate = 1; - - // Custom output properties. - CustomOutputSpec custom_output = 2; - - // The resource types that the custom module operates on. Each custom module - // can specify up to 5 resource types. - ResourceSelector resource_selector = 3; - - // The severity to assign to findings generated by the module. - Severity severity = 4; - - // Text that describes the vulnerability or misconfiguration that the custom - // module detects. This explanation is returned with each finding instance to - // help investigators understand the detected issue. The text must be enclosed - // in quotation marks. - string description = 5; - - // An explanation of the recommended steps that security teams can take to - // resolve the detected issue. This explanation is returned with each finding - // generated by this module in the `nextSteps` property of the finding JSON. - string recommendation = 6; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto deleted file mode 100644 index deeba1d9034..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/security_health_analytics_custom_config.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SecurityHealthAnalyticsCustomModuleProto"; -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: "securitycenter.googleapis.com/SecurityHealthAnalyticsSettings" - pattern: "organizations/{organization}/securityHealthAnalyticsSettings" - pattern: "folders/{folder}/securityHealthAnalyticsSettings" - pattern: "projects/{project}/securityHealthAnalyticsSettings" -}; - -// Represents an instance of a Security Health Analytics custom module, -// including its full module name, display name, enablement state, and last -// updated time. You can create a custom module at the organization, folder, or -// project level. Custom modules that you create at the organization or folder -// level are inherited by the child folders and projects. -message SecurityHealthAnalyticsCustomModule { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - pattern: "organizations/{organization}/securityHealthAnalyticsSettings/customModules/{custom_module}" - pattern: "folders/{folder}/securityHealthAnalyticsSettings/customModules/{custom_module}" - pattern: "projects/{project}/securityHealthAnalyticsSettings/customModules/{custom_module}" - }; - - // Possible enablement states of a custom module. - enum EnablementState { - // Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0; - - // The module is enabled at the given CRM resource. - ENABLED = 1; - - // The module is disabled at the given CRM resource. - DISABLED = 2; - - // State is inherited from an ancestor module. The module will either - // be effectively ENABLED or DISABLED based on its closest non-inherited - // ancestor module in the CRM hierarchy. - INHERITED = 3; - } - - // Immutable. The resource name of the custom module. - // Its format is - // "organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}", - // or - // "folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}", - // or - // "projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}" - // - // The id {customModule} is server-generated and is not user settable. - // It will be a numeric id containing 1-20 digits. - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // The display name of the Security Health Analytics custom module. This - // display name becomes the finding category for all findings that are - // returned by this custom module. The display name must be between 1 and - // 128 characters, start with a lowercase letter, and contain alphanumeric - // characters or underscores only. - string display_name = 2; - - // The enablement state of the custom module. - EnablementState enablement_state = 4; - - // Output only. The time at which the custom module was last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The editor that last updated the custom module. - string last_editor = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If empty, indicates that the custom module was created in the - // organization, folder, or project in which you are viewing the custom - // module. Otherwise, `ancestor_module` specifies the organization or folder - // from which the custom module is inherited. - string ancestor_module = 7 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - ]; - - // The user specified custom configuration for the module. - CustomConfig custom_config = 8; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto deleted file mode 100644 index 5b9dfaf8381..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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 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) = { - 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: - // 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; - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_posture.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_posture.proto deleted file mode 100644 index 6ec23c86137..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_posture.proto +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SecurityPostureProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Represents a posture that is deployed on Google Cloud by the -// Security Command Center Posture Management service. -// A posture contains one or more policy sets. A policy set is a -// group of policies that enforce a set of security rules on Google -// Cloud. -message SecurityPosture { - // The policy field that violates the deployed posture and its expected and - // detected values. - message PolicyDriftDetails { - // The name of the updated field, for example - // constraint.implementation.policy_rules[0].enforce - string field = 1; - - // The value of this field that was configured in a posture, for example, - // `true` or `allowed_values={"projects/29831892"}`. - string expected_value = 2; - - // The detected value that violates the deployed posture, for example, - // `false` or `allowed_values={"projects/22831892"}`. - string detected_value = 3; - } - - // Name of the posture, for example, `CIS-Posture`. - string name = 1; - - // The version of the posture, for example, `c7cfa2a8`. - string revision_id = 2; - - // The project, folder, or organization on which the posture is deployed, - // for example, `projects/{project_number}`. - string posture_deployment_resource = 3; - - // The name of the posture deployment, for example, - // `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. - string posture_deployment = 4; - - // The name of the updated policy, for example, - // `projects/{project_id}/policies/{constraint_name}`. - string changed_policy = 5; - - // The name of the updated policyset, for example, `cis-policyset`. - string policy_set = 6; - - // The ID of the updated policy, for example, `compute-policy-1`. - string policy = 7; - - // The details about a change in an updated policy that violates the deployed - // posture. - repeated PolicyDriftDetails policy_drift_details = 8; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto deleted file mode 100644 index 8472bf367be..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ /dev/null @@ -1,3188 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/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/attack_path.proto"; -import "google/cloud/securitycenter/v1/bigquery_export.proto"; -import "google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto"; -import "google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto"; -import "google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto"; -import "google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.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 "google/cloud/securitycenter/v1/resource.proto"; -import "google/cloud/securitycenter/v1/resource_value_config.proto"; -import "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; -import "google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto"; -import "google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto"; -import "google/cloud/securitycenter/v1/security_marks.proto"; -import "google/cloud/securitycenter/v1/simulation.proto"; -import "google/cloud/securitycenter/v1/source.proto"; -import "google/cloud/securitycenter/v1/valued_resource.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"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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"; -option (google.api.resource_definition) = { - type: "securitycenter.googleapis.com/OrganizationLocation" - pattern: "organizations/{organization}/locations/{location}" -}; -option (google.api.resource_definition) = { - type: "securitycenter.googleapis.com/FolderLocation" - pattern: "folders/{folder}/locations/{location}" -}; -option (google.api.resource_definition) = { - type: "securitycenter.googleapis.com/OrganizationSimulation" - pattern: "organizations/{organization}/simulations/{simulation}" -}; -option (google.api.resource_definition) = { - type: "securitycenter.googleapis.com/EventThreatDetectionSettings" - pattern: "organizations/{organization}/eventThreatDetectionSettings" - pattern: "folders/{folder}/eventThreatDetectionSettings" - pattern: "projects/{project}/eventThreatDetectionSettings" -}; - -// 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"; - - // 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 resident SecurityHealthAnalyticsCustomModule at the scope of the - // given CRM parent, and also creates inherited - // SecurityHealthAnalyticsCustomModules for all CRM descendants of the given - // parent. These modules are enabled by default. - rpc CreateSecurityHealthAnalyticsCustomModule( - CreateSecurityHealthAnalyticsCustomModuleRequest) - returns (SecurityHealthAnalyticsCustomModule) { - option (google.api.http) = { - post: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules" - body: "security_health_analytics_custom_module" - additional_bindings { - post: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules" - body: "security_health_analytics_custom_module" - } - additional_bindings { - post: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules" - body: "security_health_analytics_custom_module" - } - }; - option (google.api.method_signature) = - "parent,security_health_analytics_custom_module"; - } - - // 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 - // to succeed. - rpc CreateFinding(CreateFindingRequest) returns (Finding) { - option (google.api.http) = { - post: "/v1/{parent=organizations/*/sources/*}/findings" - body: "finding" - }; - 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=organizations/*/locations/*}/muteConfigs" - body: "mute_config" - } - additional_bindings { - post: "/v1/{parent=folders/*}/muteConfigs" - body: "mute_config" - } - additional_bindings { - post: "/v1/{parent=folders/*/locations/*}/muteConfigs" - body: "mute_config" - } - additional_bindings { - post: "/v1/{parent=projects/*}/muteConfigs" - body: "mute_config" - } - additional_bindings { - post: "/v1/{parent=projects/*/locations/*}/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) = { - 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,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/*}" } - additional_bindings { - delete: "/v1/{name=organizations/*/locations/*/muteConfigs/*}" - } - additional_bindings { - delete: "/v1/{name=folders/*/locations/*/muteConfigs/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/locations/*/muteConfigs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a notification config. - 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"; - } - - // Deletes the specified SecurityHealthAnalyticsCustomModule and all of its - // descendants in the CRM hierarchy. This method is only supported for - // resident custom modules. - rpc DeleteSecurityHealthAnalyticsCustomModule( - DeleteSecurityHealthAnalyticsCustomModuleRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}" - additional_bindings { - delete: "/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Get the simulation by name or the latest simulation for the given - // organization. - rpc GetSimulation(GetSimulationRequest) returns (Simulation) { - option (google.api.http) = { - get: "/v1/{name=organizations/*/simulations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Get the valued resource by name - rpc GetValuedResource(GetValuedResourceRequest) returns (ValuedResource) { - option (google.api.http) = { - get: "/v1/{name=organizations/*/simulations/*/valuedResources/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets a BigQuery 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) { - option (google.api.http) = { - post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" - body: "*" - }; - 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/*}" } - additional_bindings { - get: "/v1/{name=organizations/*/locations/*/muteConfigs/*}" - } - additional_bindings { - get: "/v1/{name=folders/*/locations/*/muteConfigs/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/locations/*/muteConfigs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Gets a notification config. - 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) { - option (google.api.http) = { - get: "/v1/{name=organizations/*/organizationSettings}" - }; - option (google.api.method_signature) = "name"; - } - - // Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. - rpc GetEffectiveSecurityHealthAnalyticsCustomModule( - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest) - returns (EffectiveSecurityHealthAnalyticsCustomModule) { - option (google.api.http) = { - get: "/v1/{name=organizations/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" - additional_bindings { - get: "/v1/{name=folders/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Retrieves a SecurityHealthAnalyticsCustomModule. - rpc GetSecurityHealthAnalyticsCustomModule( - GetSecurityHealthAnalyticsCustomModuleRequest) - returns (SecurityHealthAnalyticsCustomModule) { - option (google.api.http) = { - get: "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}" - additional_bindings { - get: "/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Gets a source. - rpc GetSource(GetSourceRequest) returns (Source) { - 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 - // properties. - rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { - option deprecated = true; - 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: "*" - } - }; - } - - // 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 - 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"; - } - - // Lists an organization's assets. - rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { - option deprecated = true; - option (google.api.http) = { - get: "/v1/{parent=organizations/*}/assets" - additional_bindings { get: "/v1/{parent=folders/*}/assets" } - additional_bindings { get: "/v1/{parent=projects/*}/assets" } - }; - } - - // Returns a list of all resident SecurityHealthAnalyticsCustomModules under - // the given CRM parent and all of the parent’s CRM descendants. - rpc ListDescendantSecurityHealthAnalyticsCustomModules( - ListDescendantSecurityHealthAnalyticsCustomModulesRequest) - returns (ListDescendantSecurityHealthAnalyticsCustomModulesResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:listDescendant" - additional_bindings { - get: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:listDescendant" - } - additional_bindings { - get: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:listDescendant" - } - }; - 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: /v1/organizations/{organization_id}/sources/-/findings - 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" } - }; - } - - // 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" } - additional_bindings { - get: "/v1/{parent=organizations/*/locations/*/muteConfigs}" - } - additional_bindings { - get: "/v1/{parent=folders/*/locations/*/muteConfigs}" - } - additional_bindings { - get: "/v1/{parent=projects/*/locations/*/muteConfigs}" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists notification configs. - 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"; - } - - // Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the - // given parent. This includes resident modules defined at the scope of the - // parent, and inherited modules, inherited from CRM ancestors. - rpc ListEffectiveSecurityHealthAnalyticsCustomModules( - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest) - returns (ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/effectiveCustomModules" - additional_bindings { - get: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/effectiveCustomModules" - } - additional_bindings { - get: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/effectiveCustomModules" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Returns a list of all SecurityHealthAnalyticsCustomModules for the given - // parent. This includes resident modules defined at the scope of the parent, - // and inherited modules, inherited from CRM ancestors. - rpc ListSecurityHealthAnalyticsCustomModules( - ListSecurityHealthAnalyticsCustomModulesRequest) - returns (ListSecurityHealthAnalyticsCustomModulesResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules" - additional_bindings { - get: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules" - } - additional_bindings { - get: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all sources belonging to an organization. - 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"; - } - - // 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 deprecated = true; - 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. - rpc SetFindingState(SetFindingStateRequest) returns (Finding) { - 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"; - } - - // 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) = { - 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) { - option (google.api.http) = { - post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" - body: "*" - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Simulates a given SecurityHealthAnalyticsCustomModule and Resource. - rpc SimulateSecurityHealthAnalyticsCustomModule( - SimulateSecurityHealthAnalyticsCustomModuleRequest) - returns (SimulateSecurityHealthAnalyticsCustomModuleResponse) { - option (google.api.http) = { - post: "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:simulate" - body: "*" - additional_bindings { - post: "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:simulate" - body: "*" - } - additional_bindings { - post: "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:simulate" - body: "*" - } - }; - option (google.api.method_signature) = "parent,custom_config,resource"; - } - - // 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) { - 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 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" - } - additional_bindings { - patch: "/v1/{mute_config.name=organizations/*/locations/*/muteConfigs/*}" - body: "mute_config" - } - additional_bindings { - patch: "/v1/{mute_config.name=folders/*/locations/*/muteConfigs/*}" - body: "mute_config" - } - additional_bindings { - patch: "/v1/{mute_config.name=projects/*/locations/*/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 - 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) { - option (google.api.http) = { - patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" - body: "organization_settings" - }; - option (google.api.method_signature) = "organization_settings"; - } - - // Updates the SecurityHealthAnalyticsCustomModule under the given name based - // on the given update mask. Updating the enablement state is supported on - // both resident and inherited modules (though resident modules cannot have an - // enablement state of "inherited"). Updating the display name and custom - // config of a module is supported on resident modules only. - rpc UpdateSecurityHealthAnalyticsCustomModule( - UpdateSecurityHealthAnalyticsCustomModuleRequest) - returns (SecurityHealthAnalyticsCustomModule) { - option (google.api.http) = { - patch: "/v1/{security_health_analytics_custom_module.name=organizations/*/securityHealthAnalyticsSettings/customModules/*}" - body: "security_health_analytics_custom_module" - additional_bindings { - patch: "/v1/{security_health_analytics_custom_module.name=folders/*/securityHealthAnalyticsSettings/customModules/*}" - body: "security_health_analytics_custom_module" - } - additional_bindings { - patch: "/v1/{security_health_analytics_custom_module.name=projects/*/securityHealthAnalyticsSettings/customModules/*}" - body: "security_health_analytics_custom_module" - } - }; - option (google.api.method_signature) = - "security_health_analytics_custom_module,update_mask"; - } - - // Updates a source. - rpc UpdateSource(UpdateSourceRequest) returns (Source) { - option (google.api.http) = { - patch: "/v1/{source.name=organizations/*/sources/*}" - body: "source" - }; - option (google.api.method_signature) = "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=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"; - } - - // Creates a BigQuery 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 BigQuery 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"; - } - - // Creates a resident Event Threat Detection custom module at the scope of the - // given Resource Manager parent, and also creates inherited custom modules - // for all descendants of the given parent. These modules are enabled by - // default. - rpc CreateEventThreatDetectionCustomModule( - CreateEventThreatDetectionCustomModuleRequest) - returns (EventThreatDetectionCustomModule) { - option (google.api.http) = { - post: "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules" - body: "event_threat_detection_custom_module" - additional_bindings { - post: "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules" - body: "event_threat_detection_custom_module" - } - additional_bindings { - post: "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules" - body: "event_threat_detection_custom_module" - } - }; - option (google.api.method_signature) = - "parent,event_threat_detection_custom_module"; - } - - // Deletes the specified Event Threat Detection custom module and all of its - // descendants in the Resource Manager hierarchy. This method is only - // supported for resident custom modules. - rpc DeleteEventThreatDetectionCustomModule( - DeleteEventThreatDetectionCustomModuleRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}" - additional_bindings { - delete: "/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Gets an Event Threat Detection custom module. - rpc GetEventThreatDetectionCustomModule( - GetEventThreatDetectionCustomModuleRequest) - returns (EventThreatDetectionCustomModule) { - option (google.api.http) = { - get: "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}" - additional_bindings { - get: "/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists all resident Event Threat Detection custom modules under the - // given Resource Manager parent and its descendants. - rpc ListDescendantEventThreatDetectionCustomModules( - ListDescendantEventThreatDetectionCustomModulesRequest) - returns (ListDescendantEventThreatDetectionCustomModulesResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:listDescendant" - additional_bindings { - get: "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules:listDescendant" - } - additional_bindings { - get: "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:listDescendant" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all Event Threat Detection custom modules for the given - // Resource Manager parent. This includes resident modules defined at the - // scope of the parent along with modules inherited from ancestors. - rpc ListEventThreatDetectionCustomModules( - ListEventThreatDetectionCustomModulesRequest) - returns (ListEventThreatDetectionCustomModulesResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules" - additional_bindings { - get: "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules" - } - additional_bindings { - get: "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the Event Threat Detection custom module with the given name based - // on the given update mask. Updating the enablement state is supported for - // both resident and inherited modules (though resident modules cannot have an - // enablement state of "inherited"). Updating the display name or - // configuration of a module is supported for resident modules only. The type - // of a module cannot be changed. - rpc UpdateEventThreatDetectionCustomModule( - UpdateEventThreatDetectionCustomModuleRequest) - returns (EventThreatDetectionCustomModule) { - option (google.api.http) = { - patch: "/v1/{event_threat_detection_custom_module.name=organizations/*/eventThreatDetectionSettings/customModules/*}" - body: "event_threat_detection_custom_module" - additional_bindings { - patch: "/v1/{event_threat_detection_custom_module.name=folders/*/eventThreatDetectionSettings/customModules/*}" - body: "event_threat_detection_custom_module" - } - additional_bindings { - patch: "/v1/{event_threat_detection_custom_module.name=projects/*/eventThreatDetectionSettings/customModules/*}" - body: "event_threat_detection_custom_module" - } - }; - option (google.api.method_signature) = - "event_threat_detection_custom_module,update_mask"; - } - - // Validates the given Event Threat Detection custom module. - rpc ValidateEventThreatDetectionCustomModule( - ValidateEventThreatDetectionCustomModuleRequest) - returns (ValidateEventThreatDetectionCustomModuleResponse) { - option (google.api.http) = { - post: "/v1/{parent=organizations/*/eventThreatDetectionSettings}:validateCustomModule" - body: "*" - additional_bindings { - post: "/v1/{parent=folders/*/eventThreatDetectionSettings}:validateCustomModule" - body: "*" - } - additional_bindings { - post: "/v1/{parent=projects/*/eventThreatDetectionSettings}:validateCustomModule" - body: "*" - } - }; - } - - // Gets an effective Event Threat Detection custom module at the given level. - rpc GetEffectiveEventThreatDetectionCustomModule( - GetEffectiveEventThreatDetectionCustomModuleRequest) - returns (EffectiveEventThreatDetectionCustomModule) { - option (google.api.http) = { - get: "/v1/{name=organizations/*/eventThreatDetectionSettings/effectiveCustomModules/*}" - additional_bindings { - get: "/v1/{name=folders/*/eventThreatDetectionSettings/effectiveCustomModules/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/eventThreatDetectionSettings/effectiveCustomModules/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists all effective Event Threat Detection custom modules for the - // given parent. This includes resident modules defined at the scope of the - // parent along with modules inherited from its ancestors. - rpc ListEffectiveEventThreatDetectionCustomModules( - ListEffectiveEventThreatDetectionCustomModulesRequest) - returns (ListEffectiveEventThreatDetectionCustomModulesResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*/eventThreatDetectionSettings}/effectiveCustomModules" - additional_bindings { - get: "/v1/{parent=folders/*/eventThreatDetectionSettings}/effectiveCustomModules" - } - additional_bindings { - get: "/v1/{parent=projects/*/eventThreatDetectionSettings}/effectiveCustomModules" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a ResourceValueConfig for an organization. Maps user's tags to - // difference resource values for use by the attack path simulation. - rpc BatchCreateResourceValueConfigs(BatchCreateResourceValueConfigsRequest) - returns (BatchCreateResourceValueConfigsResponse) { - option (google.api.http) = { - post: "/v1/{parent=organizations/*}/resourceValueConfigs:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,requests"; - } - - // Deletes a ResourceValueConfig. - rpc DeleteResourceValueConfig(DeleteResourceValueConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=organizations/*/resourceValueConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets a ResourceValueConfig. - rpc GetResourceValueConfig(GetResourceValueConfigRequest) - returns (ResourceValueConfig) { - option (google.api.http) = { - get: "/v1/{name=organizations/*/resourceValueConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all ResourceValueConfigs. - rpc ListResourceValueConfigs(ListResourceValueConfigsRequest) - returns (ListResourceValueConfigsResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*}/resourceValueConfigs" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an existing ResourceValueConfigs with new rules. - rpc UpdateResourceValueConfig(UpdateResourceValueConfigRequest) - returns (ResourceValueConfig) { - option (google.api.http) = { - patch: "/v1/{resource_value_config.name=organizations/*/resourceValueConfigs/*}" - body: "resource_value_config" - }; - option (google.api.method_signature) = "resource_value_config,update_mask"; - } - - // Lists the valued resources for a set of simulation results and filter. - rpc ListValuedResources(ListValuedResourcesRequest) - returns (ListValuedResourcesResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*/simulations/*}/valuedResources" - additional_bindings { - get: "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists the attack paths for a set of simulation results or valued resources - // and filter. - rpc ListAttackPaths(ListAttackPathsRequest) - returns (ListAttackPathsResponse) { - option (google.api.http) = { - get: "/v1/{parent=organizations/*/simulations/*}/attackPaths" - additional_bindings { - get: "/v1/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" - } - additional_bindings { - get: "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" - } - }; - option (google.api.method_signature) = "parent"; - } -} - -// 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 { - // The mute state. - enum MuteState { - // Unused. - MUTE_STATE_UNSPECIFIED = 0; - - // Matching findings will be muted (default). - MUTED = 1; - - // Matching findings will have their mute state cleared. - UNDEFINED = 2; - } - - // 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]; - - // Optional. All findings matching the given filter will have their mute state - // set to this value. The default value is `MUTED`. Setting this to - // `UNDEFINED` will clear the mute state on all matching findings. - MuteState mute_state = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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 - // `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 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 only lowercase letters, numbers, and hyphens, must start - // with a letter, must end with either a letter or a number, and must be 63 - // characters or less. - string mute_config_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message to create single resource value config -message CreateResourceValueConfigRequest { - // Required. Resource name of the new ResourceValueConfig's parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; - - // Required. The resource value config being created. - ResourceValueConfig resource_value_config = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message to create multiple resource value configs -message BatchCreateResourceValueConfigsRequest { - // Required. Resource name of the new ResourceValueConfig's parent. - // The parent field in the CreateResourceValueConfigRequest - // messages must either be empty or match this field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; - - // Required. The resource value configs to be created. - repeated CreateResourceValueConfigRequest requests = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for BatchCreateResourceValueConfigs -message BatchCreateResourceValueConfigsResponse { - // The resource value configs created - repeated ResourceValueConfig resource_value_configs = 1; -} - -// Request message to delete resource value config -message DeleteResourceValueConfigRequest { - // Required. Name of the ResourceValueConfig to delete - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; -} - -// Request message to get resource value config -message GetResourceValueConfigRequest { - // Required. Name of the resource value config to retrieve. Its format is - // `organizations/{organization}/resourceValueConfigs/{config_id}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; -} - -// Request message to list resource value configs of a parent -message ListResourceValueConfigsRequest { - // Required. The parent, which owns the collection of resource value configs. - // Its format is - // `organizations/[organization_id]` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; - - // The number of results 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 `ListResourceValueConfigs` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListResourceValueConfigs` must match the call that provided the - // page token. - // - // page_size can be specified, and the new page_size will be used. - string page_token = 3; -} - -// Response message to list resource value configs -message ListResourceValueConfigsResponse { - // The resource value configs from the specified parent. - repeated ResourceValueConfig resource_value_configs = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is empty, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message to update resource value config -message UpdateResourceValueConfigRequest { - // Required. The resource value config being updated. - ResourceValueConfig resource_value_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 creating a notification config. -message CreateNotificationConfigRequest { - // 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) = { - child_type: "securitycenter.googleapis.com/NotificationConfig" - } - ]; - - // Required. - // Unique identifier provided by the client within the parent scope. - // It must be between 1 and 128 characters and contain 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 Security Health Analytics custom modules. -message CreateSecurityHealthAnalyticsCustomModuleRequest { - // Required. Resource name of the new custom module's parent. Its format is - // `organizations/{organization}/securityHealthAnalyticsSettings`, - // `folders/{folder}/securityHealthAnalyticsSettings`, or - // `projects/{project}/securityHealthAnalyticsSettings` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - ]; - - // Required. SecurityHealthAnalytics custom module to create. The provided - // name is ignored and reset with provided parent information and - // server-generated ID. - SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = - 2 [(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 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}`, - // `projects/{project}/muteConfigs/{config_id}`, - // `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - // `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - // `projects/{project}/locations/global/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 - // `organizations/[organization_id]/notificationConfigs/[config_id]`, - // `folders/[folder_id]/notificationConfigs/[config_id]`, - // or `projects/[project_id]/notificationConfigs/[config_id]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/NotificationConfig" - } - ]; -} - -// Request message for deleting Security Health Analytics custom modules. -message DeleteSecurityHealthAnalyticsCustomModuleRequest { - // Required. Name of the custom module to delete. Its format is - // `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - // `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - // or - // `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - ]; -} - -// Request message for retrieving a BigQuery export. -message GetBigQueryExportRequest { - // Required. Name of the BigQuery 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 - // `organizations/{organization}/muteConfigs/{config_id}`, - // `folders/{folder}/muteConfigs/{config_id}`, - // `projects/{project}/muteConfigs/{config_id}`, - // `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - // `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - // `projects/{project}/locations/global/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 - // `organizations/[organization_id]/notificationConfigs/[config_id]`, - // `folders/[folder_id]/notificationConfigs/[config_id]`, - // or `projects/[project_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 effective Security Health Analytics custom -// modules. -message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest { - // Required. Name of the effective custom module to get. Its format is - // `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - // `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - // or - // `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule" - } - ]; -} - -// Request message for getting Security Health Analytics custom modules. -message GetSecurityHealthAnalyticsCustomModuleRequest { - // Required. Name of the custom module to get. Its format is - // `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - // `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - // or - // `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - ]; -} - -// 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. The name of the parent to group the assets by. 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/Asset" - } - ]; - - // 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 : ""` - 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; - - // 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]`, - // `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) = { - 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` - // - // * 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: `=`, `:` - 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 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 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`. - google.protobuf.Duration compare_duration = 5; - - // 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 descendant Security Health Analytics custom -// modules. -message ListDescendantSecurityHealthAnalyticsCustomModulesRequest { - // Required. Name of parent to list descendant custom modules. Its format is - // `organizations/{organization}/securityHealthAnalyticsSettings`, - // `folders/{folder}/securityHealthAnalyticsSettings`, or - // `projects/{project}/securityHealthAnalyticsSettings` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - ]; - - // The maximum number of results to return in a single response. Default is - // 10, minimum is 1, maximum is 1000. - int32 page_size = 2; - - // The value returned by the last call indicating a continuation - string page_token = 3; -} - -// Response message for listing descendant Security Health Analytics custom -// modules. -message ListDescendantSecurityHealthAnalyticsCustomModulesResponse { - // Custom modules belonging to the requested parent and its descendants. - repeated SecurityHealthAnalyticsCustomModule - security_health_analytics_custom_modules = 1; - - // If not empty, indicates that there may be more custom modules to be - // returned. - string next_page_token = 2; -} - -// Request message for listing the valued resources for a given simulation. -message ListValuedResourcesRequest { - // Required. Name of parent to list valued resources. - // - // Valid formats: - // `organizations/{organization}`, - // `organizations/{organization}/simulations/{simulation}` - // `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/ValuedResource" - } - ]; - - // The filter expression that filters the valued resources in the response. - // Supported fields: - // - // * `resource_value` supports = - // * `resource_type` supports = - string filter = 2; - - // The value returned by the last `ListValuedResourcesResponse`; indicates - // that this is a continuation of a prior `ListValuedResources` call, and - // that the system should return the next page of data. - string page_token = 3; - - // The maximum number of results to return in a single response. Default is - // 10, minimum is 1, maximum is 1000. - int32 page_size = 4; - - // Optional. The fields by which to order the valued resources response. - // - // Supported fields: - // - // * `exposed_score` - // - // * `resource_value` - // - // * `resource_type` - // - // * `resource` - // - // * `display_name` - // - // Values should be a comma separated list of fields. For example: - // `exposed_score,resource_value`. - // - // The default sorting order is descending. To specify ascending or descending - // order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for - // example: `exposed_score DESC`. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for listing the valued resources for a given simulation. -message ListValuedResourcesResponse { - // The valued resources that the attack path simulation identified. - repeated ValuedResource valued_resources = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results. - string next_page_token = 2; - - // The estimated total number of results matching the query. - int32 total_size = 3; -} - -// Request message for listing the attack paths for a given simulation or valued -// resource. -message ListAttackPathsRequest { - // Required. Name of parent to list attack paths. - // - // Valid formats: - // `organizations/{organization}`, - // `organizations/{organization}/simulations/{simulation}` - // `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - // `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/AttackPath" - } - ]; - - // The filter expression that filters the attack path in the response. - // Supported fields: - // - // * `valued_resources` supports = - string filter = 2; - - // The value returned by the last `ListAttackPathsResponse`; indicates - // that this is a continuation of a prior `ListAttackPaths` call, and - // that the system should return the next page of data. - string page_token = 3; - - // The maximum number of results to return in a single response. Default is - // 10, minimum is 1, maximum is 1000. - int32 page_size = 4; -} - -// Response message for listing the attack paths for a given simulation or -// valued resource. -message ListAttackPathsResponse { - // The attack paths that the attack path simulation identified. - repeated AttackPath attack_paths = 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 getting simulation. -// Simulation name can include "latest" to retrieve the latest simulation -// For example, "organizations/123/simulations/latest" -message GetSimulationRequest { - // Required. The organization name or simulation name of this simulation - // - // Valid format: - // `organizations/{organization}/simulations/latest` - // `organizations/{organization}/simulations/{simulation}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/Simulation" - } - ]; -} - -// Request message for getting a valued resource. -message GetValuedResourceRequest { - // Required. The name of this valued resource - // - // Valid format: - // `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/ValuedResource" - } - ]; -} - -// 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. The name of the parent in which to list the notification - // configurations. 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/NotificationConfig" - } - ]; - - // 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 effective Security Health Analytics custom -// modules. -message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest { - // Required. Name of parent to list effective custom modules. Its format is - // `organizations/{organization}/securityHealthAnalyticsSettings`, - // `folders/{folder}/securityHealthAnalyticsSettings`, or - // `projects/{project}/securityHealthAnalyticsSettings` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - ]; - - // The maximum number of results to return in a single response. Default is - // 10, minimum is 1, maximum is 1000. - int32 page_size = 2; - - // The value returned by the last call indicating a continuation - string page_token = 3; -} - -// Response message for listing effective Security Health Analytics custom -// modules. -message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse { - // Effective custom modules belonging to the requested parent. - repeated EffectiveSecurityHealthAnalyticsCustomModule - effective_security_health_analytics_custom_modules = 1; - - // If not empty, indicates that there may be more effective custom modules to - // be returned. - string next_page_token = 2; -} - -// Request message for listing Security Health Analytics custom modules. -message ListSecurityHealthAnalyticsCustomModulesRequest { - // Required. Name of parent to list custom modules. Its format is - // `organizations/{organization}/securityHealthAnalyticsSettings`, - // `folders/{folder}/securityHealthAnalyticsSettings`, or - // `projects/{project}/securityHealthAnalyticsSettings` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - ]; - - // The maximum number of results to return in a single response. Default is - // 10, minimum is 1, maximum is 1000. - int32 page_size = 2; - - // The value returned by the last call indicating a continuation - string page_token = 3; -} - -// Response message for listing Security Health Analytics custom modules. -message ListSecurityHealthAnalyticsCustomModulesResponse { - // Custom modules belonging to the requested parent. - repeated SecurityHealthAnalyticsCustomModule - security_health_analytics_custom_modules = 1; - - // If not empty, indicates that there may be more custom modules to be - // returned. - 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]`, `folders/[folder_id]`, or - // `projects/[project_id]`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/Source" - } - ]; - - // 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. The name of the parent resource that contains the assets. The - // value that you can specify on parent depends on the method in which you - // specify parent. You can specify one of the following values: - // `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/Asset" - } - ]; - - // 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 : ""` - 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; - - // 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 { - // 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/-` - 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` - // - // * 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: `=`, `:` - // * resource.display_name: `=`, `:` - 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 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; - - // 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; - } - - // Information related to the Google Cloud 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 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. - 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; - - // 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; - - // Indicates which cloud provider the finding is from. - CloudProvider cloud_provider = 9; - - // Indicates which organization / tenant the finding is for. - string organization = 10; - - // The service or resource provider associated with the resource. - string service = 11; - - // The region or location of the service (if applicable). - string location = 12; - - oneof cloud_provider_metadata { - // The AWS metadata associated with the finding. - AwsMetadata aws_metadata = 16; - - // The Azure metadata associated with the finding. - AzureMetadata azure_metadata = 17; - } - - // Provides the path to the resource within the resource hierarchy. - ResourcePath resource_path = 18; - - // A string representation of the resource path. - // For Google Cloud, it has the format of - // `org/{organization_id}/folder/{folder_id}/folder/{folder_id}/project/{project_id}` - // where there can be any number of folders. - // For AWS, it has the format of - // `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` - // where there can be any number of organizational units. - // For Azure, it has the format of - // `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` - // where there can be any number of management groups. - string resource_path_string = 19; - } - - // 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 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // 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](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // of the finding. Example: - // `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) = { - 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 updating a finding's mute status. -message SetMuteRequest { - // Required. The [relative resource - // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // of the finding. Example: - // `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) = { - 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 `organizations/[organization_id]`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" - } - ]; -} - -// Request message to simulate a CustomConfig against a given test resource. -// Maximum size of the request is 4 MB by default. -message SimulateSecurityHealthAnalyticsCustomModuleRequest { - // Manually constructed resource name. If the custom module evaluates against - // only the resource data, you can omit the `iam_policy_data` field. If it - // evaluates only the `iam_policy_data` field, you can omit the resource data. - message SimulatedResource { - // Required. The type of the resource, for example, - // `compute.googleapis.com/Disk`. - string resource_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A representation of the Google Cloud resource. Should match the - // Google Cloud resource JSON format. - google.protobuf.Struct resource_data = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A representation of the IAM policy. - google.iam.v1.Policy iam_policy_data = 3 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The relative resource name of the organization, project, or - // folder. For more information about relative resource names, see [Relative - // Resource - // Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // Example: `organizations/{organization_id}` - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The custom configuration that you need to test. - CustomConfig custom_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Resource data to simulate custom module against. - SimulatedResource resource = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for simulating a `SecurityHealthAnalyticsCustomModule` -// against a given resource. -message SimulateSecurityHealthAnalyticsCustomModuleResponse { - // Possible test result. - message SimulatedResult { - oneof result { - // Finding that would be published for the test case, - // if a violation is detected. - Finding finding = 1; - - // Indicates that the test case does not trigger any violation. - google.protobuf.Empty no_violation = 2; - - // Error encountered during the test. - google.rpc.Status error = 3; - } - } - - // Result for test case in the corresponding request. - SimulatedResult result = 1; -} - -// 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. 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 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. - 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 Security Health Analytics custom modules. -message UpdateSecurityHealthAnalyticsCustomModuleRequest { - // Required. The SecurityHealthAnalytics custom module to update. - SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = - 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. The only fields that can be updated are - // `enablement_state` and `custom_config`. If empty or set to the wildcard - // value `*`, both `enablement_state` and `custom_config` are 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. Must be - // earlier or equal to the server time. - google.protobuf.Timestamp start_time = 3; -} - -// Request message for creating a BigQuery export. -message CreateBigQueryExportRequest { - // Required. The name of the parent resource of the new BigQuery export. 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 BigQuery 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 only lowercase letters, numbers, and hyphens, must start - // with a letter, must end with either a letter or a number, and must be 63 - // characters or less. - 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 BigQuery export. -message DeleteBigQueryExportRequest { - // Required. The name of the BigQuery 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" - } - ]; -} - -// Request to create an Event Threat Detection custom module. -message CreateEventThreatDetectionCustomModuleRequest { - // Required. The new custom module's parent. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings`. - // * `folders/{folder}/eventThreatDetectionSettings`. - // * `projects/{project}/eventThreatDetectionSettings`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - ]; - - // Required. The module to create. The - // event_threat_detection_custom_module.name will be ignored and server - // generated. - EventThreatDetectionCustomModule event_threat_detection_custom_module = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request to validate an Event Threat Detection custom module. -message ValidateEventThreatDetectionCustomModuleRequest { - // Required. Resource name of the parent to validate the Custom Module under. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings`. - // * `folders/{folder}/eventThreatDetectionSettings`. - // * `projects/{project}/eventThreatDetectionSettings`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - ]; - - // Required. The raw text of the module's contents. Used to generate error - // messages. - string raw_text = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). - string type = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response to validating an Event Threat Detection custom module. -message ValidateEventThreatDetectionCustomModuleResponse { - // A list of errors returned by the validator. If the list is empty, there - // were no errors. - CustomModuleValidationErrors errors = 2; -} - -// Request to delete an Event Threat Detection custom module. -message DeleteEventThreatDetectionCustomModuleRequest { - // Required. Name of the custom module to delete. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - // * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - // * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - ]; -} - -// Request to get an Event Threat Detection custom module. -message GetEventThreatDetectionCustomModuleRequest { - // Required. Name of the custom module to get. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - // * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - // * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - ]; -} - -// Request to list current and descendant resident Event Threat Detection custom -// modules. -message ListDescendantEventThreatDetectionCustomModulesRequest { - // Required. Name of the parent to list custom modules under. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings`. - // * `folders/{folder}/eventThreatDetectionSettings`. - // * `projects/{project}/eventThreatDetectionSettings`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - ]; - - // A page token, received from a previous - // `ListDescendantEventThreatDetectionCustomModules` call. Provide this to - // retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListDescendantEventThreatDetectionCustomModules` must match the call that - // provided the page token. - string page_token = 2; - - // The maximum number of modules 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 = 3; -} - -// Response for listing current and descendant resident -// Event Threat Detection custom modules. -message ListDescendantEventThreatDetectionCustomModulesResponse { - // Custom modules belonging to the requested parent. - repeated EventThreatDetectionCustomModule - event_threat_detection_custom_modules = 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 to list Event Threat Detection custom modules. -message ListEventThreatDetectionCustomModulesRequest { - // Required. Name of the parent to list custom modules under. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings`. - // * `folders/{folder}/eventThreatDetectionSettings`. - // * `projects/{project}/eventThreatDetectionSettings`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - ]; - - // A page token, received from a previous - // `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - // subsequent page. - // - // When paginating, all other parameters provided to - // `ListEventThreatDetectionCustomModules` must match the call that provided - // the page token. - string page_token = 2; - - // The maximum number of modules 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 = 3; -} - -// Response for listing Event Threat Detection custom modules. -message ListEventThreatDetectionCustomModulesResponse { - // Custom modules belonging to the requested parent. - repeated EventThreatDetectionCustomModule - event_threat_detection_custom_modules = 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 to update an Event Threat Detection custom module. -message UpdateEventThreatDetectionCustomModuleRequest { - // Required. The module being updated. - EventThreatDetectionCustomModule event_threat_detection_custom_module = 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 to get an EffectiveEventThreatDetectionCustomModule. -message GetEffectiveEventThreatDetectionCustomModuleRequest { - // Required. The resource name of the effective Event Threat Detection custom - // module. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - // * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - // * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" - } - ]; -} - -// Request to list effective Event Threat Detection custom modules. -message ListEffectiveEventThreatDetectionCustomModulesRequest { - // Required. Name of the parent to list custom modules for. - // - // Its format is: - // - // * `organizations/{organization}/eventThreatDetectionSettings`. - // * `folders/{folder}/eventThreatDetectionSettings`. - // * `projects/{project}/eventThreatDetectionSettings`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" - } - ]; - - // A page token, received from a previous - // `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to - // retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListEffectiveEventThreatDetectionCustomModules` must match the call that - // provided the page token. - string page_token = 2; - - // The maximum number of modules 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 = 3; -} - -// Response for listing EffectiveEventThreatDetectionCustomModules. -message ListEffectiveEventThreatDetectionCustomModulesResponse { - // Effective custom modules belonging to the requested parent. - repeated EffectiveEventThreatDetectionCustomModule - effective_event_threat_detection_custom_modules = 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; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/simulation.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/simulation.proto deleted file mode 100644 index c110fd9993e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/simulation.proto +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1/resource.proto"; -import "google/cloud/securitycenter/v1/valued_resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SimulationProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Attack path simulation -message Simulation { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/Simulation" - pattern: "organizations/{organization}/simulations/{simulation}" - plural: "simulations" - singular: "simulation" - }; - - // Full resource name of the Simulation: - // `organizations/123/simulations/456` - string name = 1; - - // Output only. Time simulation was created - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Resource value configurations' metadata used in this simulation. Maximum of - // 100. - repeated ResourceValueConfigMetadata resource_value_configs_metadata = 3; - - // Indicates which cloud provider was used in this simulation. - CloudProvider cloud_provider = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto deleted file mode 100644 index bb4c0586921..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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"; - -// 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. -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: - // 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: - // "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." - string description = 3; - - // The canonical name of the finding source. 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto deleted file mode 100644 index 37c9954f824..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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 = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ToxicCombinationProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// Contains details about a group of security issues that, when the issues -// occur together, represent a greater risk than when the issues occur -// independently. A group of such issues is referred to as a toxic combination. -message ToxicCombination { - // The - // [Attack exposure - // score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) - // of this toxic combination. The score is a measure of how much this toxic - // combination exposes one or more high-value resources to potential attack. - double attack_exposure_score = 1; - - // List of resource names of findings associated with this toxic combination. - // For example, `organizations/123/sources/456/findings/789`. - repeated string related_findings = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/valued_resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/valued_resource.proto deleted file mode 100644 index 2051b389559..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/valued_resource.proto +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ValuedResourceProto"; -option java_package = "com.google.cloud.securitycenter.v1"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1"; - -// A resource that is determined to have value to a user's system -message ValuedResource { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/ValuedResource" - pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}" - plural: "valuedResources" - singular: "valuedResource" - }; - - // How valuable the resource is. - enum ResourceValue { - // The resource value isn't specified. - RESOURCE_VALUE_UNSPECIFIED = 0; - - // This is a low-value resource. - RESOURCE_VALUE_LOW = 1; - - // This is a medium-value resource. - RESOURCE_VALUE_MEDIUM = 2; - - // This is a high-value resource. - RESOURCE_VALUE_HIGH = 3; - } - - // Valued resource name, for example, - // e.g.: - // `organizations/123/simulations/456/valuedResources/789` - string name = 1; - - // The - // [full resource - // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // of the valued resource. - string resource = 2; - - // The [resource - // type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - // of the valued resource. - string resource_type = 3; - - // Human-readable name of the valued resource. - string display_name = 4; - - // How valuable this resource is. - ResourceValue resource_value = 5; - - // Exposed score for this valued resource. A value of 0 means no exposure was - // detected exposure. - double exposed_score = 6; - - // List of resource value configurations' metadata used to determine the value - // of this resource. Maximum of 100. - repeated ResourceValueConfigMetadata resource_value_configs_used = 7; -} - -// Metadata about a ResourceValueConfig. For example, id and name. -message ResourceValueConfigMetadata { - // Resource value config name - string name = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto deleted file mode 100644 index b531f793a16..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; -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; - - // The offending package is relevant to the finding. - Package offending_package = 2; - - // The fixed package is relevant to the finding. - Package fixed_package = 3; - - // The security bulletin is relevant to this finding. - SecurityBulletin security_bulletin = 4; -} - -// CVE stands for Common Vulnerabilities and Exposures. -// Information from the [CVE -// record](https://www.cve.org/ResourcesSupport/Glossary) that describes this -// vulnerability. -message Cve { - // The possible values of impact of the vulnerability if it was to be - // exploited. - enum RiskRating { - // Invalid or empty value. - RISK_RATING_UNSPECIFIED = 0; - - // Exploitation would have little to no security impact. - LOW = 1; - - // Exploitation would enable attackers to perform activities, or could allow - // attackers to have a direct impact, but would require additional steps. - MEDIUM = 2; - - // Exploitation would enable attackers to have a notable direct impact - // without needing to overcome any major mitigating factors. - HIGH = 3; - - // Exploitation would fundamentally undermine the security of affected - // systems, enable actors to perform significant attacks with minimal - // effort, with little to no mitigating factors to overcome. - CRITICAL = 4; - } - - // The possible values of exploitation activity of the vulnerability in the - // wild. - enum ExploitationActivity { - // Invalid or empty value. - EXPLOITATION_ACTIVITY_UNSPECIFIED = 0; - - // Exploitation has been reported or confirmed to widely occur. - WIDE = 1; - - // Limited reported or confirmed exploitation activities. - CONFIRMED = 2; - - // Exploit is publicly available. - AVAILABLE = 3; - - // No known exploitation activity, but has a high potential for - // exploitation. - ANTICIPATED = 4; - - // No known exploitation activity. - NO_KNOWN = 5; - } - - // 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; - - // Whether upstream fix is available for the CVE. - bool upstream_fix_available = 4; - - // The potential impact of the vulnerability if it was to be exploited. - RiskRating impact = 5; - - // The exploitation activity of the vulnerability in the wild. - ExploitationActivity exploitation_activity = 6; - - // Whether or not the vulnerability has been observed in the wild. - bool observed_in_the_wild = 7; - - // Whether or not the vulnerability was zero day when the finding was - // published. - bool zero_day = 8; - - // Date the first publicly available exploit or PoC was released. - google.protobuf.Timestamp exploit_release_date = 9; -} - -// 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; -} - -// Package is a generic definition of a package. -message Package { - // The name of the package where the vulnerability was detected. - string package_name = 1; - - // The CPE URI where the vulnerability was detected. - string cpe_uri = 2; - - // Type of package, for example, os, maven, or go. - string package_type = 3; - - // The version of the package. - string package_version = 4; -} - -// SecurityBulletin are notifications of vulnerabilities of Google products. -message SecurityBulletin { - // ID of the bulletin corresponding to the vulnerability. - string bulletin_id = 1; - - // Submission time of this Security Bulletin. - google.protobuf.Timestamp submission_time = 2; - - // This represents a version that the cluster receiving this notification - // should be upgraded to, based on its current version. For example, 1.15.0 - string suggested_upgrade_version = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto deleted file mode 100644 index a78034d669f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/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"; - -option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_package = "com.google.cloud.securitycenter.v1beta1"; - -// Security Command Center representation of a Google Cloud -// 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}" - }; - - // 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 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 Google Cloud resource. Examples include: APPLICATION, - // PROJECT, and ORGANIZATION. This is a case insensitive field defined by - // 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: - // 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/{organization_id}/assets/{asset_id}". - string name = 1; - - // 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 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 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. - google.protobuf.Timestamp update_time = 10; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto deleted file mode 100644 index 60dc5e5e34a..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/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"; - -option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_package = "com.google.cloud.securitycenter.v1beta1"; - -// Security Command Center finding. -// -// A finding is a record of assessment data (security, risk, health or privacy) -// 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" - 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; - - // 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}" - string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // 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-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. - 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 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 - // 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, 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. - google.protobuf.Timestamp create_time = 10; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto deleted file mode 100644 index 00b5d93f78a..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/resource.proto"; - -option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_package = "com.google.cloud.securitycenter.v1beta1"; - -// User specified settings that are attached to the Security Command -// Center 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto deleted file mode 100644 index b93cea3ecc5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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"; - -option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; -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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto deleted file mode 100644 index 656df689fdc..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/resource.proto"; - -option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_package = "com.google.cloud.securitycenter.v1beta1"; - -// 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) = { - 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto deleted file mode 100644 index 8270869b8ae..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto +++ /dev/null @@ -1,823 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/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"; -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/field_mask.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -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 - // to succeed. - rpc CreateFinding(CreateFindingRequest) returns (Finding) { - option (google.api.http) = { - 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) { - 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) { - option (google.api.http) = { - get: "/v1beta1/{name=organizations/*/organizationSettings}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets a source. - rpc GetSource(GetSourceRequest) returns (Source) { - 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 - // 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/{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. - rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=organizations/*}/assets" - }; - } - - // 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 - 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" - }; - 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: "/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. - rpc SetFindingState(SetFindingStateRequest) returns (Finding) { - option (google.api.http) = { - 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) { - 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) { - 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 - // finding creation to succeed. - rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { - option (google.api.http) = { - 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) { - option (google.api.http) = { - patch: "/v1beta1/{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: "/v1beta1/{source.name=organizations/*/sources/*}" - body: "source" - }; - option (google.api.method_signature) = "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" - } - }; - option (google.api.method_signature) = "security_marks"; - } -} - -// 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 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 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 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; - - // 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 - 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 - // 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`. - 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 { - // 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 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; - - // 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 - 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; - - // 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 { - // 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 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 [(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 { - // 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 { - // 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 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 [(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 = 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 { - // 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 - // 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. - 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. - 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. - 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. - google.protobuf.FieldMask update_mask = 2; - - // The time at which the updated SecurityMarks take effect. - google.protobuf.Timestamp start_time = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto deleted file mode 100644 index 196f4c58a1c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/resource.proto"; - -option go_package = "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_package = "com.google.cloud.securitycenter.v1beta1"; - -// 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 { - 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: - // "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." - string description = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto deleted file mode 100644 index 367b32fac0c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/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"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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"; - -// Security Command Center representation of a Google Cloud -// 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}" - pattern: "folders/{folder}/assets/{asset}" - pattern: "projects/{project}/assets/{asset}" - }; - - // 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 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 Google Cloud resource. Examples include: APPLICATION, - // PROJECT, and ORGANIZATION. This is a case insensitive field defined by - // 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: - // 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; - - // 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 - // 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/docs/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/{organization_id}/assets/{asset_id}". - string name = 1; - - // 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 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 Security Command Center. - google.protobuf.Timestamp create_time = 9; - - // 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 - // 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; - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto deleted file mode 100644 index a3c6163a6ea..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/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 = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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"; - -// Security Command Center finding. -// -// A finding is a record of assessment data (security, risk, health or privacy) -// 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" - 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. - 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 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; - - // 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: - // "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 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-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. - 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 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 - // 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, 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 - // 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. - google.protobuf.Timestamp create_time = 10; - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto deleted file mode 100644 index a393f3d3038..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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; - - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto deleted file mode 100644 index 8b2e77788bd..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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 (google.api.resource_definition) = { - type: "pubsub.googleapis.com/Topic" - pattern: "projects/{project}/topics/{topic}" -}; - -// Security Command Center notification configs. -// -// 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" - 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 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 Pub/Sub 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto deleted file mode 100644 index dcb3de9ab51..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/cloud/securitycenter/v1p1beta1/finding.proto"; -import "google/cloud/securitycenter/v1p1beta1/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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"; - -// Security Command Center'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; - } - - // The Cloud resource tied to the notification. - Resource resource = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto deleted file mode 100644 index a68c86e3a74..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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 Security Command -// Center 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 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: - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto deleted file mode 100644 index b4062d3bedb..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/field_behavior.proto"; -import "google/cloud/securitycenter/v1p1beta1/folder.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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; - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto deleted file mode 100644 index 3767640931c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/protobuf/duration.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto deleted file mode 100644 index 70f43a12017..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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 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) = { - 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: - // 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; - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto deleted file mode 100644 index daaec44c28b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto +++ /dev/null @@ -1,1351 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/notification_message.proto"; -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/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"; -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 = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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: "*" - additional_bindings { - post: "/v1p1beta1/{parent=folders/*}/assets:group" - body: "*" - } - additional_bindings { - post: "/v1p1beta1/{parent=projects/*}/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/{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"; - } - - // Lists an organization's assets. - 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"; - } - - // 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" - additional_bindings { - get: "/v1p1beta1/{parent=folders/*/sources/*}/findings" - } - additional_bindings { - get: "/v1p1beta1/{parent=projects/*/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" - additional_bindings { - get: "/v1p1beta1/{parent=folders/*}/sources" - } - additional_bindings { - get: "/v1p1beta1/{parent=projects/*}/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: "*" - 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"; - } - - // 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" - 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"; - } - - // 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) = { - 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=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"; - } -} - -// 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. - 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], folders/[folder_id], or - // projects/[project_id]". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/Asset" - } - ]; - - // 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 : ""` - 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; - - // 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]", - // 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) = { - 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: `=`, `>`, `<`, `>=`, `<=` - // * 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 : ""` - 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 - // * severity - // - // 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 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`. - google.protobuf.Duration compare_duration = 5; - - // 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], folders/[folder_id], or - // projects/[project_id]". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/Source" - } - ]; - - // 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], folders/[folder_id], or - // projects/[project_id]". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/Asset" - } - ]; - - // 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 : ""` - 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; - - // 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 { - // 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/- - 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: `=`, `>`, `<`, `>=`, `<=` - // * 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 : ""` - 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 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; - - // 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 { - // Information related to the Google Cloud 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; - - // 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. - // - // 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 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto deleted file mode 100644 index 5f4e5aad026..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; -option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; -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"; - -// 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 { - 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: - // 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: - // "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." - 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/access.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/access.proto deleted file mode 100644 index 2192ea2a4bb..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/access.proto +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "AccessProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Represents an access event. -message Access { - // Associated email, such as "foo@google.com". - // - // The email address of the authenticated user or a service account acting on - // behalf of a 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". - string caller_ip = 2; - - // The caller IP's geolocation, which identifies where the call came from. - Geolocation caller_ip_geo = 3; - - // Type of user agent associated with the finding. For example, an operating - // system shell or an embedded or standalone application. - string user_agent_family = 4; - - // The caller's user agent string associated with the finding. - string user_agent = 5; - - // This is the API service that the service account made a call to, e.g. - // "iam.googleapis.com" - string service_name = 6; - - // The method that the service account called, e.g. "SetIamPolicy". - string method_name = 7; - - // A string that represents the principal_subject that is associated with the - // identity. Unlike `principal_email`, `principal_subject` supports principals - // that aren't associated with email addresses, such as third party - // principals. For most identities, the format is - // `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`. - // Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, - // still use the legacy format `serviceAccount:{identity pool - // name}[{subject}]`. - string principal_subject = 8; - - // The name of the service account key that was used to create or exchange - // credentials when authenticating the service account that made 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 = 9; - - // The identity delegation history of an authenticated service account that - // made the request. The `serviceAccountDelegationInfo[]` object contains - // information about the real authorities that try to access Google Cloud - // 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 = 10; - - // A string that represents a username. The username provided depends on the - // type of the finding and is likely not an IAM principal. For example, this - // can be a system username if the finding is related to a virtual machine, or - // it can be an application login username. - string user_name = 11; -} - -// 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. -message Geolocation { - // A CLDR. - string region_code = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/affected_resources.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/affected_resources.proto deleted file mode 100644 index 030c229ce90..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/affected_resources.proto +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "AffectedResourcesProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Details about resources affected by this finding. -message AffectedResources { - // The count of resources affected by the finding. - int64 count = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ai_model.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ai_model.proto deleted file mode 100644 index f293ae692cb..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ai_model.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "AiModelProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains information about the AI model associated with the finding. -message AiModel { - // The platform on which the model is deployed. - enum DeploymentPlatform { - // Unspecified deployment platform. - DEPLOYMENT_PLATFORM_UNSPECIFIED = 0; - - // Vertex AI. - VERTEX_AI = 1; - - // Google Kubernetes Engine. - GKE = 2; - - // Google Compute Engine. - GCE = 3; - - // Fine tuned model. - FINE_TUNED_MODEL = 4; - } - - // The name of the AI model, for example, "gemini:1.0.0". - string name = 1; - - // The domain of the model, for example, “image-classification”. - string domain = 2; - - // The name of the model library, for example, “transformers”. - string library = 3; - - // The region in which the model is used, for example, “us-central1”. - string location = 4; - - // The publisher of the model, for example, “google” or “nvidia”. - string publisher = 5; - - // The platform on which the model is deployed. - DeploymentPlatform deployment_platform = 6; - - // The user defined display name of model. Ex. baseline-classification-model - string display_name = 7; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/application.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/application.proto deleted file mode 100644 index 6e0c2a3f87b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/application.proto +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ApplicationProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Represents an application associated with a finding. -message Application { - // The base URI that identifies the network location of the application in - // which the vulnerability was detected. For example, `http://example.com`. - string base_uri = 1; - - // The full URI with payload that could be used to reproduce the - // vulnerability. For example, `http://example.com?p=aMmYgI6H`. - string full_uri = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_exposure.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_exposure.proto deleted file mode 100644 index 66e44d44372..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_exposure.proto +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "AttackExposureProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// An attack exposure contains the results of an attack path simulation run. -message AttackExposure { - // This enum defines the various states an AttackExposure can be in. - enum State { - // The state is not specified. - STATE_UNSPECIFIED = 0; - - // The attack exposure has been calculated. - CALCULATED = 1; - - // The attack exposure has not been calculated. - NOT_CALCULATED = 2; - } - - // A number between 0 (inclusive) and infinity that represents how important - // this finding is to remediate. The higher the score, the more important it - // is to remediate. - double score = 1; - - // The most recent time the attack exposure was updated on this finding. - google.protobuf.Timestamp latest_calculation_time = 2; - - // The resource name of the attack path simulation result that contains the - // details regarding this attack exposure score. - // Example: `organizations/123/simulations/456/attackExposureResults/789` - string attack_exposure_result = 3; - - // Output only. What state this AttackExposure is in. This captures whether or - // not an attack exposure has been calculated or not. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The number of high value resources that are exposed as a result of this - // finding. - int32 exposed_high_value_resources_count = 5; - - // The number of medium value resources that are exposed as a result of this - // finding. - int32 exposed_medium_value_resources_count = 6; - - // The number of high value resources that are exposed as a result of this - // finding. - int32 exposed_low_value_resources_count = 7; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_path.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_path.proto deleted file mode 100644 index 8ad845b7806..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/attack_path.proto +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "AttackPathProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// A path that an attacker could take to reach an exposed resource. -message AttackPath { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/AttackPath" - pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}" - pattern: "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}" - plural: "attackPaths" - singular: "attackPath" - }; - - // Represents one point that an attacker passes through in this attack path. - message AttackPathNode { - // A finding that is associated with this node in the attack path. - message PathNodeAssociatedFinding { - // Canonical name of the associated findings. Example: - // `organizations/123/sources/456/findings/789` - string canonical_finding = 1; - - // The additional taxonomy group within findings from a given source. - string finding_category = 2; - - // Full resource name of the finding. - string name = 3; - } - - // The type of the incoming attack step node. - enum NodeType { - // Type not specified - NODE_TYPE_UNSPECIFIED = 0; - - // Incoming edge joined with AND - NODE_TYPE_AND = 1; - - // Incoming edge joined with OR - NODE_TYPE_OR = 2; - - // Incoming edge is defense - NODE_TYPE_DEFENSE = 3; - - // Incoming edge is attacker - NODE_TYPE_ATTACKER = 4; - } - - // Detailed steps the attack can take between path nodes. - message AttackStepNode { - // Unique ID for one Node - string uuid = 1; - - // Attack step type. Can be either AND, OR or DEFENSE - NodeType type = 2; - - // User friendly name of the attack step - string display_name = 3; - - // Attack step labels for metadata - map labels = 4; - - // Attack step description - string description = 5; - } - - // The name of the resource at this point in the attack path. - // The format of the name follows the Cloud Asset Inventory [resource - // name - // format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - string resource = 1; - - // The [supported resource - // type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - string resource_type = 2; - - // Human-readable name of this resource. - string display_name = 3; - - // The findings associated with this node in the attack path. - repeated PathNodeAssociatedFinding associated_findings = 4; - - // Unique id of the attack path node. - string uuid = 5; - - // A list of attack step nodes that exist in this attack path node. - repeated AttackStepNode attack_steps = 6; - } - - // Represents a connection between a source node and a destination node in - // this attack path. - message AttackPathEdge { - // The attack node uuid of the source node. - string source = 1; - - // The attack node uuid of the destination node. - string destination = 2; - } - - // The attack path name, for example, - // `organizations/12/simulations/34/valuedResources/56/attackPaths/78` - string name = 1; - - // A list of nodes that exist in this attack path. - repeated AttackPathNode path_nodes = 2; - - // A list of the edges between nodes in this attack path. - repeated AttackPathEdge edges = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto deleted file mode 100644 index 0b74672a72a..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupDisasterRecoveryProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Information related to Google Cloud Backup and DR Service findings. -message BackupDisasterRecovery { - // The name of a Backup and DR template which comprises one or more backup - // policies. See the [Backup and DR - // documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp) - // for more information. For example, `snap-ov`. - string backup_template = 1; - - // The names of Backup and DR policies that are associated with a template - // and that define when to run a backup, how frequently to run a backup, and - // how long to retain the backup image. For example, `onvaults`. - repeated string policies = 2; - - // The name of a Backup and DR host, which is managed by the backup and - // recovery appliance and known to the management console. The host can be of - // type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file - // system, etc.), vCenter, or an ESX server. See the [Backup and DR - // documentation on - // hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications) - // for more information. For example, `centos7-01`. - string host = 3; - - // The names of Backup and DR applications. An application is a VM, database, - // or file system on a managed host monitored by a backup and recovery - // appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`, - // `centos7-01-vol02`. - repeated string applications = 4; - - // The name of the Backup and DR storage pool that the backup and recovery - // appliance is storing data in. The storage pool could be of type Cloud, - // Primary, Snapshot, or OnVault. See the [Backup and DR documentation on - // storage - // pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools). - // For example, `DiskPoolOne`. - string storage_pool = 5; - - // The names of Backup and DR advanced policy options of a policy applying to - // an application. See the [Backup and DR documentation on policy - // options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings). - // For example, `skipofflineappsincongrp, nounmap`. - repeated string policy_options = 6; - - // The name of the Backup and DR resource profile that specifies the storage - // media for backups of application and VM data. See the [Backup and DR - // documentation on - // profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile). - // For example, `GCP`. - string profile = 7; - - // The name of the Backup and DR appliance that captures, moves, and manages - // the lifecycle of backup data. For example, `backup-server-57137`. - string appliance = 8; - - // The backup type of the Backup and DR image. - // For example, `Snapshot`, `Remote Snapshot`, `OnVault`. - string backup_type = 9; - - // The timestamp at which the Backup and DR backup was created. - google.protobuf.Timestamp backup_create_time = 10; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/bigquery_export.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/bigquery_export.proto deleted file mode 100644 index 68325fcd69e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/bigquery_export.proto +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "BigQueryExportProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Configures how to deliver Findings to BigQuery Instance. -message BigQueryExport { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/BigQueryExport" - pattern: "organizations/{organization}/locations/{location}/bigQueryExports/{export}" - pattern: "folders/{folder}/locations/{location}/bigQueryExports/{export}" - pattern: "projects/{project}/locations/{location}/bigQueryExports/{export}" - plural: "bigQueryExports" - singular: "bigQueryExport" - }; - - // Identifier. The relative resource name of this export. See: - // https://cloud.google.com/apis/design/resource_names#relative_resource_name. - // The following list shows some examples: - // - // + - // `organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}` - // + `folders/{folder_id}/locations/{location_id}/bigQueryExports/{export_id}` - // + - // `projects/{project_id}/locations/{location_id}/bigQueryExports/{export_id}` - // - // This field is provided in responses, and is ignored when provided in create - // requests. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // 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 BigQuery 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 BigQuery 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 BigQuery 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 and - // upload data to the BigQuery dataset. - string principal = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/chokepoint.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/chokepoint.proto deleted file mode 100644 index 4018fb214e2..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/chokepoint.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ChokepointProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains details about a chokepoint, which is a resource or resource group -// where high-risk attack paths converge, based on [attack path simulations] -// (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). -message Chokepoint { - // List of resource names of findings associated with this chokepoint. - // For example, organizations/123/sources/456/findings/789. - // This list will have at most 100 findings. - repeated string related_findings = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_armor.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_armor.proto deleted file mode 100644 index bc8985e6573..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_armor.proto +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/protobuf/duration.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "CloudArmorProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Fields related to Google Cloud Armor findings. -message CloudArmor { - // Information about the [Google Cloud Armor security - // policy](https://cloud.google.com/armor/docs/security-policy-overview) - // relevant to the finding. - SecurityPolicy security_policy = 1; - - // Information about incoming requests evaluated by [Google Cloud Armor - // security - // policies](https://cloud.google.com/armor/docs/security-policy-overview). - Requests requests = 2; - - // Information about potential Layer 7 DDoS attacks identified by [Google - // Cloud Armor Adaptive - // Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). - AdaptiveProtection adaptive_protection = 3; - - // Information about DDoS attack volume and classification. - Attack attack = 4; - - // Distinguish between volumetric & protocol DDoS attack and - // application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS - // attacks, or "L_7" for Layer 7 DDoS attacks. - string threat_vector = 5; - - // Duration of attack from the start until the current moment (updated every 5 - // minutes). - google.protobuf.Duration duration = 6; -} - -// Information about the [Google Cloud Armor security -// policy](https://cloud.google.com/armor/docs/security-policy-overview) -// relevant to the finding. -message SecurityPolicy { - // The name of the Google Cloud Armor security policy, for example, - // "my-security-policy". - string name = 1; - - // The type of Google Cloud Armor security policy for example, 'backend - // security policy', 'edge security policy', 'network edge security policy', - // or 'always-on DDoS protection'. - string type = 2; - - // Whether or not the associated rule or policy is in preview mode. - bool preview = 3; -} - -// Information about the requests relevant to the finding. -message Requests { - // For 'Increasing deny ratio', the ratio is the denied traffic divided by the - // allowed traffic. For 'Allowed traffic spike', the ratio is the allowed - // traffic in the short term divided by allowed traffic in the long term. - double ratio = 1; - - // Allowed RPS (requests per second) in the short term. - int32 short_term_allowed = 2; - - // Allowed RPS (requests per second) over the long term. - int32 long_term_allowed = 3; - - // Denied RPS (requests per second) over the long term. - int32 long_term_denied = 4; -} - -// Information about [Google Cloud Armor Adaptive -// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). -message AdaptiveProtection { - // A score of 0 means that there is low confidence that the detected event is - // an actual attack. A score of 1 means that there is high confidence that the - // detected event is an attack. See the [Adaptive Protection - // documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) - // for further explanation. - double confidence = 1; -} - -// Information about DDoS attack volume and classification. -message Attack { - // Total PPS (packets per second) volume of attack. - int64 volume_pps_long = 4; - - // Total BPS (bytes per second) volume of attack. - int64 volume_bps_long = 5; - - // Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. - string classification = 3; - - // Total PPS (packets per second) volume of attack. Deprecated - refer to - // volume_pps_long instead. - int32 volume_pps = 1 [deprecated = true]; - - // Total BPS (bytes per second) volume of attack. Deprecated - refer to - // volume_bps_long instead. - int32 volume_bps = 2 [deprecated = true]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto deleted file mode 100644 index 763cd32e649..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "CloudDlpDataProfileProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; -option (google.api.resource_definition) = { - type: "dlp.googleapis.com/TableDataProfile" - pattern: "projects/{project}/tableProfiles/{table_profile}" - pattern: "projects/{project}/locations/{location}/tableProfiles/{table_profile}" -}; - -// The [data profile](https://cloud.google.com/dlp/docs/data-profiles) -// associated with the finding. -message CloudDlpDataProfile { - // Parents for configurations that produce data profile findings. - enum ParentType { - // Unspecified parent type. - PARENT_TYPE_UNSPECIFIED = 0; - - // Organization-level configurations. - ORGANIZATION = 1; - - // Project-level configurations. - PROJECT = 2; - } - - // Name of the data profile, for example, - // `projects/123/locations/europe/tableProfiles/8383929`. - string data_profile = 1 [(google.api.resource_reference) = { - type: "dlp.googleapis.com/TableDataProfile" - }]; - - // The resource hierarchy level at which the data profile was generated. - ParentType parent_type = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto deleted file mode 100644 index 0abe898cd8d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "CloudDlpInspectionProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; -option (google.api.resource_definition) = { - type: "dlp.googleapis.com/DlpJob" - pattern: "projects/{project}/dlpJobs/{dlp_job}" - pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}" -}; - -// Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection -// job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced -// the finding. -message CloudDlpInspection { - // Name of the inspection job, for example, - // `projects/123/locations/europe/dlpJobs/i-8383929`. - string inspect_job = 1 - [(google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" }]; - - // The type of information (or - // *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, - // for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. - string info_type = 2; - - // The number of times Cloud DLP found this infoType within this job - // and resource. - int64 info_type_count = 3; - - // Whether Cloud DLP scanned the complete resource or a sampled subset. - bool full_scan = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/compliance.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/compliance.proto deleted file mode 100644 index e17f87f0321..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/compliance.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ComplianceProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains compliance information about a security standard indicating unmet -// recommendations. -message Compliance { - // Industry-wide compliance standards or benchmarks, such as CIS, PCI, and - // OWASP. - string standard = 1; - - // Version of the standard or benchmark, for example, 1.1 - string version = 2; - - // Policies within the standard or benchmark, for example, A.12.4.1 - repeated string ids = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/connection.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/connection.proto deleted file mode 100644 index 0c12251428d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/connection.proto +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ConnectionProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/contact_details.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/contact_details.proto deleted file mode 100644 index fa748294a34..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/contact_details.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ContactDetailsProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Details about specific contacts -message ContactDetails { - // A list of contacts - repeated Contact contacts = 1; -} - -// The email address of a contact. -message Contact { - // An email address. For example, "`person123@company.com`". - string email = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/container.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/container.proto deleted file mode 100644 index 9e0399d9161..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/container.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/cloud/securitycenter/v2/label.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ContainerProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Container associated with the finding. -message Container { - // Name of the container. - string name = 1; - - // Container image URI provided when configuring a pod or container. This - // string can identify a container image version using mutable tags. - string uri = 2; - - // Optional container image ID, if 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; - - // The time that the container was created. - google.protobuf.Timestamp create_time = 5; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_access_event.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_access_event.proto deleted file mode 100644 index 8f1fe962728..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_access_event.proto +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "DataAccessEventProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Details about a data access attempt made by a principal not authorized under -// applicable data security policy. -message DataAccessEvent { - // The operation of a data access event. - enum Operation { - // The operation is unspecified. - OPERATION_UNSPECIFIED = 0; - - // Represents a read operation. - READ = 1; - - // Represents a move operation. - MOVE = 2; - - // Represents a copy operation. - COPY = 3; - } - - // Unique identifier for data access event. - string event_id = 1; - - // The email address of the principal that accessed the data. The principal - // could be a user account, service account, Google group, or other. - string principal_email = 2; - - // The operation performed by the principal to access the data. - Operation operation = 3; - - // Timestamp of data access event. - google.protobuf.Timestamp event_time = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_flow_event.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_flow_event.proto deleted file mode 100644 index 2f6bb802cf2..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_flow_event.proto +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "DataFlowEventProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Details about a data flow event, in which either the data is moved to or is -// accessed from a non-compliant geo-location, as defined in the applicable data -// security policy. -message DataFlowEvent { - // The operation of a data flow event. - enum Operation { - // The operation is unspecified. - OPERATION_UNSPECIFIED = 0; - - // Represents a read operation. - READ = 1; - - // Represents a move operation. - MOVE = 2; - - // Represents a copy operation. - COPY = 3; - } - - // Unique identifier for data flow event. - string event_id = 1; - - // The email address of the principal that initiated the data flow event. The - // principal could be a user account, service account, Google group, or other. - string principal_email = 2; - - // The operation performed by the principal for the data flow event. - Operation operation = 3; - - // Non-compliant location of the principal or the data destination. - string violated_location = 4; - - // Timestamp of data flow event. - google.protobuf.Timestamp event_time = 5; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto deleted file mode 100644 index 7f781ea5894..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "DataRetentionDeletionEventProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Details about data retention deletion violations, in which the data is -// non-compliant based on their retention or deletion time, as defined in the -// applicable data security policy. The Data Retention Deletion (DRD) control is -// a control of the DSPM (Data Security Posture Management) suite that enables -// organizations to manage data retention and deletion policies in compliance -// with regulations, such as GDPR and CRPA. DRD supports two primary policy -// types: maximum storage length (max TTL) and minimum storage length (min TTL). -// Both are aimed at helping organizations meet regulatory and data management -// commitments. -message DataRetentionDeletionEvent { - // Type of the DRD event. - enum EventType { - // Unspecified event type. - EVENT_TYPE_UNSPECIFIED = 0; - - // The maximum retention time has been exceeded. - EVENT_TYPE_MAX_TTL_EXCEEDED = 1; - } - - // Timestamp indicating when the event was detected. - google.protobuf.Timestamp event_detection_time = 2; - - // Number of objects that violated the policy for this resource. If the number - // is less than 1,000, then the value of this field is the exact number. If - // the number of objects that violated the policy is greater than or equal to - // 1,000, then the value of this field is 1000. - int64 data_object_count = 3; - - // Maximum duration of retention allowed from the DRD control. This comes - // from the DRD control where users set a max TTL for their data. For example, - // suppose that a user sets the max TTL for a Cloud Storage bucket to 90 days. - // However, an object in that bucket is 100 days old. In this case, a - // DataRetentionDeletionEvent will be generated for that Cloud Storage bucket, - // and the max_retention_allowed is 90 days. - google.protobuf.Duration max_retention_allowed = 4; - - // Type of the DRD event. - EventType event_type = 5; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/database.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/database.proto deleted file mode 100644 index c8df5484f6e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/database.proto +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "DatabaseProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Represents database access information, such as queries. A database may be a -// sub-resource of an instance (as in the case of Cloud SQL instances or Cloud -// Spanner instances), or the database instance itself. Some database resources -// might not have the [full resource -// name](https://google.aip.dev/122#full-resource-names) populated because these -// resource types, such as Cloud SQL databases, are not yet supported by Cloud -// Asset Inventory. In these cases only the display name is provided. -message Database { - // Some database resources may not have the [full resource - // name](https://google.aip.dev/122#full-resource-names) populated because - // these resource types are not yet supported by Cloud Asset Inventory (e.g. - // Cloud SQL databases). In these cases only the display name will be - // provided. - // The [full resource name](https://google.aip.dev/122#full-resource-names) of - // the database that the user connected to, if it is supported by Cloud Asset - // Inventory. - string name = 1; - - // The human-readable name of the database that the user connected to. - string display_name = 2; - - // The username used to connect to the database. The username might not be an - // IAM principal and does not have a set format. - string user_name = 3; - - // The SQL statement that is associated with the database access. - string query = 4; - - // The target usernames, roles, or groups of an SQL privilege grant, which is - // not an IAM policy change. - repeated string grantees = 5; - - // The version of the database, for example, POSTGRES_14. - // See [the complete - // list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). - string version = 6; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/disk.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/disk.proto deleted file mode 100644 index 304f1ace585..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/disk.proto +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "DiskProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains information about the disk associated with the finding. -message Disk { - // The name of the disk, for example, - // "https://www.googleapis.com/compute/v1/projects/{project-id}/zones/{zone-id}/disks/{disk-id}". - string name = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/exfiltration.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/exfiltration.proto deleted file mode 100644 index ed18353cb9b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/exfiltration.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ExfiltrationProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Exfiltration represents a data exfiltration attempt from one or more sources -// to one or more targets. The `sources` attribute lists the sources of the -// exfiltrated data. The `targets` attribute lists the destinations 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; - - // Total exfiltrated bytes processed for the entire job. - int64 total_exfiltrated_bytes = 3; -} - -// Resource where data was exfiltrated from or exfiltrated to. -message ExfilResource { - // The resource's [full resource - // name](https://cloud.google.com/apis/design/resource_names#full_resource_name). - string name = 1; - - // Subcomponents of the asset that was exfiltrated, like URIs used during - // exfiltration, table names, databases, and filenames. For example, multiple - // tables might have been exfiltrated from the same Cloud SQL instance, or - // multiple files might have been exfiltrated from the same Cloud Storage - // bucket. - repeated string components = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/external_system.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/external_system.proto deleted file mode 100644 index ac5b94470e4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/external_system.proto +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ExternalSystemProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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: "organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}" - pattern: "folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" - pattern: "folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}" - pattern: "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" - pattern: "projects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}" - }; - - // Information about the ticket, if any, that is being used to track the - // resolution of the issue that is identified by this finding. - message TicketInfo { - // The identifier of the ticket in the ticket system. - string id = 1; - - // The assignee of the ticket in the ticket system. - string assignee = 2; - - // The description of the ticket in the ticket system. - string description = 3; - - // The link to the ticket in the ticket system. - string uri = 4; - - // The latest status of the ticket, as reported by the ticket system. - string status = 5; - - // The time when the ticket was last updated, as reported by the ticket - // system. - google.protobuf.Timestamp update_time = 6; - } - - // Full resource name of the external system. The following list - // shows some examples: - // - // + `organizations/1234/sources/5678/findings/123456/externalSystems/jira` - // + - // `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` - // + `folders/1234/sources/5678/findings/123456/externalSystems/jira` - // + - // `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` - // + `projects/1234/sources/5678/findings/123456/externalSystems/jira` - // + - // `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` - string name = 1; - - // References primary/secondary etc assignees in the external system. - repeated string assignees = 2; - - // The identifier that's used to track the finding's corresponding case in the - // external system. - string external_uid = 3; - - // The most recent status of the finding's corresponding case, as reported by - // the external system. - string status = 4; - - // The time when the case was last updated, as reported by the external - // system. - google.protobuf.Timestamp external_system_update_time = 5; - - // The link to the finding's corresponding case in the external system. - string case_uri = 6; - - // The priority of the finding's corresponding case in the external system. - string case_priority = 7; - - // The SLA of the finding's corresponding case in the external system. - google.protobuf.Timestamp case_sla = 9; - - // The time when the case was created, as reported by the external system. - google.protobuf.Timestamp case_create_time = 10; - - // The time when the case was closed, as reported by the external system. - google.protobuf.Timestamp case_close_time = 11; - - // Information about the ticket, if any, that is being used to track the - // resolution of the issue that is identified by this finding. - TicketInfo ticket_info = 8; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/file.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/file.proto deleted file mode 100644 index 7a6ccf410d7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/file.proto +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "FileProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// File information about the related binary/library used by an executable, or -// the script used by a script interpreter -message File { - // Path of the file in terms of underlying disk/partition identifiers. - message DiskPath { - // UUID of the partition (format - // https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid) - string partition_uuid = 1; - - // Relative path of the file in the partition as a JSON encoded string. - // Example: /home/user1/executable_file.sh - string relative_path = 2; - } - - // Operation(s) performed on a file. - message FileOperation { - // The type of the operation - enum OperationType { - // The operation is unspecified. - OPERATION_TYPE_UNSPECIFIED = 0; - - // Represents an open operation. - OPEN = 1; - - // Represents a read operation. - READ = 2; - - // Represents a rename operation. - RENAME = 3; - - // Represents a write operation. - WRITE = 4; - - // Represents an execute operation. - EXECUTE = 5; - } - - // The type of the operation - OperationType type = 1; - } - - // 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, 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. - string contents = 6; - - // Path of the file in terms of underlying disk/partition identifiers. - DiskPath disk_path = 7; - - // Operation(s) performed on a file. - repeated FileOperation operations = 8; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto deleted file mode 100644 index 73be5a01836..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto +++ /dev/null @@ -1,546 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/securitycenter/v2/access.proto"; -import "google/cloud/securitycenter/v2/affected_resources.proto"; -import "google/cloud/securitycenter/v2/ai_model.proto"; -import "google/cloud/securitycenter/v2/application.proto"; -import "google/cloud/securitycenter/v2/attack_exposure.proto"; -import "google/cloud/securitycenter/v2/backup_disaster_recovery.proto"; -import "google/cloud/securitycenter/v2/chokepoint.proto"; -import "google/cloud/securitycenter/v2/cloud_armor.proto"; -import "google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto"; -import "google/cloud/securitycenter/v2/cloud_dlp_inspection.proto"; -import "google/cloud/securitycenter/v2/compliance.proto"; -import "google/cloud/securitycenter/v2/connection.proto"; -import "google/cloud/securitycenter/v2/contact_details.proto"; -import "google/cloud/securitycenter/v2/container.proto"; -import "google/cloud/securitycenter/v2/data_access_event.proto"; -import "google/cloud/securitycenter/v2/data_flow_event.proto"; -import "google/cloud/securitycenter/v2/data_retention_deletion_event.proto"; -import "google/cloud/securitycenter/v2/database.proto"; -import "google/cloud/securitycenter/v2/disk.proto"; -import "google/cloud/securitycenter/v2/exfiltration.proto"; -import "google/cloud/securitycenter/v2/external_system.proto"; -import "google/cloud/securitycenter/v2/file.proto"; -import "google/cloud/securitycenter/v2/group_membership.proto"; -import "google/cloud/securitycenter/v2/iam_binding.proto"; -import "google/cloud/securitycenter/v2/indicator.proto"; -import "google/cloud/securitycenter/v2/ip_rules.proto"; -import "google/cloud/securitycenter/v2/job.proto"; -import "google/cloud/securitycenter/v2/kernel_rootkit.proto"; -import "google/cloud/securitycenter/v2/kubernetes.proto"; -import "google/cloud/securitycenter/v2/load_balancer.proto"; -import "google/cloud/securitycenter/v2/log_entry.proto"; -import "google/cloud/securitycenter/v2/mitre_attack.proto"; -import "google/cloud/securitycenter/v2/network.proto"; -import "google/cloud/securitycenter/v2/notebook.proto"; -import "google/cloud/securitycenter/v2/org_policy.proto"; -import "google/cloud/securitycenter/v2/process.proto"; -import "google/cloud/securitycenter/v2/security_marks.proto"; -import "google/cloud/securitycenter/v2/security_posture.proto"; -import "google/cloud/securitycenter/v2/toxic_combination.proto"; -import "google/cloud/securitycenter/v2/vertex_ai.proto"; -import "google/cloud/securitycenter/v2/vulnerability.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "FindingProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Security Command Center finding. -// -// A finding is a record of assessment data like security, risk, health, or -// 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 { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/Finding" - pattern: "organizations/{organization}/sources/{source}/findings/{finding}" - pattern: "organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}" - pattern: "folders/{folder}/sources/{source}/findings/{finding}" - pattern: "folders/{folder}/sources/{source}/locations/{location}/findings/{finding}" - pattern: "projects/{project}/sources/{source}/findings/{finding}" - pattern: "projects/{project}/sources/{source}/locations/{location}/findings/{finding}" - plural: "findings" - singular: "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 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 and public SSH access with weak or no - // passwords. - // - // 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; - } - - // 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 = 3; - } - - // Mute information about the finding, including whether the finding has a - // static mute or any matching dynamic mute rules. - message MuteInfo { - // Information about the static mute state. A static mute state overrides - // any dynamic mute rules that apply to this finding. The static mute state - // can be set by a static mute rule or by muting the finding directly. - message StaticMute { - // The static mute state. If the value is `MUTED` or `UNMUTED`, then the - // finding's overall mute state will have the same value. - Mute state = 1; - - // When the static mute was applied. - google.protobuf.Timestamp apply_time = 2; - } - - // The record of a dynamic mute rule that matches the finding. - message DynamicMuteRecord { - // The relative resource name of the mute rule, represented by a mute - // config, that created this record, for example - // `organizations/123/muteConfigs/mymuteconfig` or - // `organizations/123/locations/global/muteConfigs/mymuteconfig`. - string mute_config = 1; - - // When the dynamic mute rule first matched the finding. - google.protobuf.Timestamp match_time = 2; - } - - // If set, the static mute applied to this finding. Static mutes override - // dynamic mutes. If unset, there is no static mute. - StaticMute static_mute = 1; - - // The list of dynamic mute rules that currently match the finding. - repeated DynamicMuteRecord dynamic_mute_records = 2; - } - - // 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; - - // Describes an error that prevents some SCC functionality. - SCC_ERROR = 5; - - // Describes a potential security risk due to a change in the security - // posture. - POSTURE_VIOLATION = 6; - - // Describes a combination of security issues that represent a more severe - // security problem when taken together. - TOXIC_COMBINATION = 7; - - // Describes a potential security risk to data assets that contain sensitive - // data. - SENSITIVE_DATA_RISK = 8; - - // Describes a resource or resource group where high risk attack paths - // converge, based on attack path simulations (APS). - CHOKEPOINT = 9; - } - - // Identifier. The [relative resource - // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // of the finding. The following list shows some examples: - // - // + - // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - // + - // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - // + - // `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - // + - // `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The canonical name of the finding. The following list shows - // some examples: - // - // + - // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - // + - // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - // + - // `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - // + - // `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // - // The prefix is the closest CRM ancestor of the resource associated with the - // finding. - string canonical_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The relative resource name of the source and location the finding belongs - // to. See: - // https://cloud.google.com/apis/design/resource_names#relative_resource_name - // This field is immutable after creation time. The following list shows some - // examples: - // - // + `organizations/{organization_id}/sources/{source_id}` - // + `folders/{folders_id}/sources/{source_id}` - // + `projects/{projects_id}/sources/{source_id}` - // + - // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}` - // + `folders/{folders_id}/sources/{source_id}/locations/{location_id}` - // + `projects/{projects_id}/sources/{source_id}/locations/{location_id}` - string parent = 3; - - // Immutable. 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-Google Cloud resource, the resourceName can - // be a customer or partner defined string. - string resource_name = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The state of the finding. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The additional taxonomy group within findings from a given - // source. Example: "XSS_FLASH_INJECTION" - string category = 7 [(google.api.field_behavior) = IMMUTABLE]; - - // 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 = 8; - - // 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 = 9; - - // 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 = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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 = 11; - - // Output only. The time at which the finding was created in Security Command - // Center. - google.protobuf.Timestamp create_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The severity of the finding. This field is managed by the source that - // writes the finding. - Severity severity = 14; - - // 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; - - // Output only. The mute information regarding this finding. - MuteInfo mute_info = 53 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The class of the finding. - FindingClass finding_class = 16; - - // 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. For more information, see [Indicator of - // compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). - Indicator indicator = 17; - - // Represents vulnerability-specific fields like CVE and CVSS scores. - // CVE stands for Common Vulnerabilities and Exposures - // (https://cve.mitre.org/about/) - Vulnerability vulnerability = 18; - - // Output only. The most recent time this finding was muted or unmuted. - google.protobuf.Timestamp mute_update_time = 19 - [(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 = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // MITRE ATT&CK tactics and techniques related to this finding. - // See: https://attack.mitre.org - MitreAttack mitre_attack = 21; - - // Access details associated with the finding, such as more information on the - // caller, which method was accessed, and from where. - Access access = 22; - - // Contains information about the IP connection associated with the finding. - repeated Connection connections = 23; - - // Records additional information about the mute operation, for example, the - // [mute - // configuration](https://cloud.google.com/security-command-center/docs/how-to-mute-findings) - // that muted the finding and the user who muted the finding. - string mute_initiator = 24; - - // Represents operating system processes associated with the Finding. - repeated Process processes = 25; - - // 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 - // - // { - // "security": { - // "contacts": [ - // { - // "email": "person1@company.com" - // }, - // { - // "email": "person2@company.com" - // } - // ] - // } - // } - map contacts = 26 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Contains compliance information for security standards associated to the - // finding. - repeated Compliance compliances = 27; - - // Output only. The human readable display name of the finding source such as - // "Event Threat Detection" or "Security Health Analytics". - string parent_display_name = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Contains more details about the finding. - string description = 30; - - // Represents exfiltrations associated with the finding. - Exfiltration exfiltration = 31; - - // Represents IAM bindings associated with the finding. - repeated IamBinding iam_bindings = 32; - - // Steps to address the finding. - string next_steps = 33; - - // Unique identifier of the module which generated the finding. - // Example: - // folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885 - string module_name = 34; - - // Containers associated with the finding. This field provides information for - // both Kubernetes and non-Kubernetes containers. - repeated Container containers = 35; - - // Kubernetes resources associated with the finding. - Kubernetes kubernetes = 36; - - // Database associated with the finding. - Database database = 37; - - // The results of an attack path simulation relevant to this finding. - AttackExposure attack_exposure = 38; - - // File associated with the finding. - repeated File files = 39; - - // Cloud Data Loss Prevention (Cloud DLP) inspection results that are - // associated with the finding. - CloudDlpInspection cloud_dlp_inspection = 40; - - // Cloud DLP data profile that is associated with the finding. - CloudDlpDataProfile cloud_dlp_data_profile = 41; - - // Signature of the kernel rootkit. - KernelRootkit kernel_rootkit = 42; - - // Contains information about the org policies associated with the finding. - repeated OrgPolicy org_policies = 43; - - // Job associated with the finding. - Job job = 44; - - // Represents an application associated with the finding. - Application application = 45; - - // IP rules associated with the finding. - IpRules ip_rules = 46; - - // Fields related to Backup and DR findings. - BackupDisasterRecovery backup_disaster_recovery = 47; - - // The security posture associated with the finding. - SecurityPosture security_posture = 48; - - // Log entries that are relevant to the finding. - repeated LogEntry log_entries = 49; - - // The load balancers associated with the finding. - repeated LoadBalancer load_balancers = 50; - - // Fields related to Cloud Armor findings. - CloudArmor cloud_armor = 51; - - // Notebook associated with the finding. - Notebook notebook = 55; - - // Contains details about a group of security issues that, when the issues - // occur together, represent a greater risk than when the issues occur - // independently. A group of such issues is referred to as a toxic - // combination. - // This field cannot be updated. Its value is ignored in all update requests. - ToxicCombination toxic_combination = 56; - - // Contains details about groups of which this finding is a member. A group is - // a collection of findings that are related in some way. - // This field cannot be updated. Its value is ignored in all update requests. - repeated GroupMembership group_memberships = 57; - - // Disk associated with the finding. - Disk disk = 58; - - // Data access events associated with the finding. - repeated DataAccessEvent data_access_events = 61; - - // Data flow events associated with the finding. - repeated DataFlowEvent data_flow_events = 62; - - // Represents the VPC networks that the resource is attached to. - repeated Network networks = 63; - - // Data retention deletion events associated with the finding. - repeated DataRetentionDeletionEvent data_retention_deletion_events = 64; - - // AffectedResources associated with the finding. - AffectedResources affected_resources = 65; - - // The AI model associated with the finding. - AiModel ai_model = 66; - - // Contains details about a chokepoint, which is a resource or resource group - // where high-risk attack paths converge, based on [attack path simulations] - // (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). - // This field cannot be updated. Its value is ignored in all update requests. - Chokepoint chokepoint = 69; - - // VertexAi associated with the finding. - VertexAi vertex_ai = 72; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/folder.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/folder.proto deleted file mode 100644 index f2013b8f817..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/folder.proto +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "FolderProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto deleted file mode 100644 index 9a3e2bd4326..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "GroupMembershipProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains details about groups of which this finding is a member. A group is a -// collection of findings that are related in some way. -message GroupMembership { - // Possible types of groups. - enum GroupType { - // Default value. - GROUP_TYPE_UNSPECIFIED = 0; - - // Group represents a toxic combination. - GROUP_TYPE_TOXIC_COMBINATION = 1; - - // Group represents a chokepoint. - GROUP_TYPE_CHOKEPOINT = 3; - } - - // Type of group. - GroupType group_type = 1; - - // ID of the group. - string group_id = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/iam_binding.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/iam_binding.proto deleted file mode 100644 index 786b9df678e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/iam_binding.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "IamBindingProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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, for - // example, "foo@google.com". - string member = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/indicator.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/indicator.proto deleted file mode 100644 index 11f3adf3c07..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/indicator.proto +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "IndicatorProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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. -// For more information, see [Indicator of -// compromise](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; - } - - // Possible resource types to be associated with a signature. - enum SignatureType { - // The default signature type. - SIGNATURE_TYPE_UNSPECIFIED = 0; - - // Used for signatures concerning processes. - SIGNATURE_TYPE_PROCESS = 1; - - // Used for signatures concerning disks. - SIGNATURE_TYPE_FILE = 2; - } - - // The signature. - 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; - } - - // Describes the type of resource associated with the signature. - SignatureType signature_type = 8; - } - - // The list of IP addresses that are associated with 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; - - // The list of URIs associated to the Findings. - repeated string uris = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ip_rules.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ip_rules.proto deleted file mode 100644 index 8c70386f371..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/ip_rules.proto +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "IpRulesProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// IP rules associated with the finding. -message IpRules { - // The type of direction that the rule is applicable to, one of ingress or - // egress. Not applicable to OPEN_X_PORT findings. - enum Direction { - // Unspecified direction value. - DIRECTION_UNSPECIFIED = 0; - - // Ingress direction value. - INGRESS = 1; - - // Egress direction value. - EGRESS = 2; - } - - // The direction that the rule is applicable to, one of ingress or egress. - Direction direction = 1; - - // The list of allow rules specified by this firewall. Each rule specifies a - // protocol and port-range tuple that describes a permitted connection. - oneof rules { - // Tuple with allowed rules. - Allowed allowed = 2; - - // Tuple with denied rules. - Denied denied = 3; - } - - // If source IP ranges are specified, the firewall rule applies only to - // traffic that has a source IP address in these ranges. These ranges must be - // expressed in CIDR format. Only supports IPv4. - repeated string source_ip_ranges = 4; - - // If destination IP ranges are specified, the firewall rule applies only to - // traffic that has a destination IP address in these ranges. These ranges - // must be expressed in CIDR format. Only supports IPv4. - repeated string destination_ip_ranges = 5; - - // Name of the network protocol service, such as FTP, that is exposed by the - // open port. Follows the naming convention available at: - // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml. - repeated string exposed_services = 6; -} - -// IP rule information. -message IpRule { - // A port range which is inclusive of the min and max values. - // Values are between 0 and 2^16-1. The max can be equal / must be not smaller - // than the min value. If min and max are equal this indicates that it is a - // single port. - message PortRange { - // Minimum port value. - int64 min = 1; - - // Maximum port value. - int64 max = 2; - } - - // The IP protocol this rule applies to. This value can either be one of the - // following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP, - // SCTP) or a string representation of the integer value. - string protocol = 1; - - // Optional. An optional list of ports to which this rule applies. This field - // is only applicable for the UDP or (S)TCP protocols. Each entry must be - // either an integer or a range including a min and max port number. - repeated PortRange port_ranges = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Allowed IP rule. -message Allowed { - // Optional. Optional list of allowed IP rules. - repeated IpRule ip_rules = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Denied IP rule. -message Denied { - // Optional. Optional list of denied IP rules. - repeated IpRule ip_rules = 1 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/job.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/job.proto deleted file mode 100644 index bb7938543d7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/job.proto +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "JobProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Describes a job -message Job { - // The fully-qualified name for a job. - // e.g. `projects//jobs/` - string name = 1; - - // Output only. State of the job, such as `RUNNING` or `PENDING`. - JobState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. If the job did not complete successfully, this field describes - // why. - int32 error_code = 3; - - // Optional. Gives the location where the job ran, such as `US` or - // `europe-west1` - string location = 4; -} - -// JobState represents the state of the job. -enum JobState { - // Unspecified represents an unknown state and should not be used. - JOB_STATE_UNSPECIFIED = 0; - - // Job is scheduled and pending for run - PENDING = 1; - - // Job in progress - RUNNING = 2; - - // Job has completed with success - SUCCEEDED = 3; - - // Job has completed but with failure - FAILED = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kernel_rootkit.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kernel_rootkit.proto deleted file mode 100644 index 26ce3c78e1d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kernel_rootkit.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "KernelRootkitProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Kernel mode rootkit signatures. -message KernelRootkit { - // Rootkit name, when available. - string name = 1; - - // True if unexpected modifications of kernel code memory are present. - bool unexpected_code_modification = 2; - - // True if unexpected modifications of kernel read-only data memory are - // present. - bool unexpected_read_only_data_modification = 3; - - // True if `ftrace` points are present with callbacks pointing to regions - // that are not in the expected kernel or module code range. - bool unexpected_ftrace_handler = 4; - - // True if `kprobe` points are present with callbacks pointing to regions - // that are not in the expected kernel or module code range. - bool unexpected_kprobe_handler = 5; - - // True if kernel code pages that are not in the expected kernel or module - // code regions are present. - bool unexpected_kernel_code_pages = 6; - - // True if system call handlers that are are not in the expected kernel or - // module code regions are present. - bool unexpected_system_call_handler = 7; - - // True if interrupt handlers that are are not in the expected kernel or - // module code regions are present. - bool unexpected_interrupt_handler = 8; - - // True if unexpected processes in the scheduler run queue are present. Such - // processes are in the run queue, but not in the process task list. - bool unexpected_processes_in_runqueue = 9; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kubernetes.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kubernetes.proto deleted file mode 100644 index a180196eee8..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/kubernetes.proto +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/cloud/securitycenter/v2/container.proto"; -import "google/cloud/securitycenter/v2/label.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "KubernetesProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Kubernetes-related attributes. -message Kubernetes { - // A 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](https://google.aip.dev/122#full-resource-names) 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 the binding. - string ns = 1; - - // Name for the binding. - string name = 2; - - // The Role or ClusterRole referenced by the binding. - Role role = 3; - - // Represents one or more subjects that are 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 the 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 the subject. - AuthType kind = 1; - - // Namespace for the subject. - string ns = 2; - - // Name for the subject. - string name = 3; - } - - // Conveys information about a Kubernetes access review (such as one returned - // by a [`kubectl auth - // can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) - // command) that was involved in a finding. - message AccessReview { - // 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; - - // The name of the resource being requested. Empty means all. - string name = 3; - - // The optional resource type requested. "*" means all. - string resource = 4; - - // The optional subresource type. - string subresource = 5; - - // A Kubernetes resource API verb, like get, list, watch, create, update, - // delete, proxy. "*" means all. - string verb = 6; - - // The API version of the resource. "*" means all. - string version = 7; - } - - // Kubernetes object related to the finding, uniquely identified by GKNN. - // Used if the object Kind is not one of Pod, Node, NodePool, Binding, or - // AccessReview. - message Object { - // Kubernetes object group, such as "policy.k8s.io/v1". - string group = 1; - - // Kubernetes object kind, such as "Namespace". - string kind = 2; - - // Kubernetes object namespace. Must be a valid DNS label. Named - // "ns" to avoid collision with C++ namespace keyword. For details see - // https://kubernetes.io/docs/tasks/administer-cluster/namespaces/. - string ns = 3; - - // Kubernetes object name. For details see - // https://kubernetes.io/docs/concepts/overview/working-with-objects/names/. - string name = 4; - - // Pod containers associated with this finding, if any. - repeated Container containers = 5; - } - - // Kubernetes - // [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) - // associated with the finding. This field contains Pod records for each - // container that is owned by a Pod. - repeated Pod pods = 1; - - // Provides Kubernetes - // [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) - // information. - repeated Node nodes = 2; - - // GKE [node - // pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) - // associated with the finding. This field contains node pool information for - // each node, when it is available. - repeated NodePool node_pools = 3; - - // Provides Kubernetes role information for findings that involve [Roles or - // ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). - repeated Role roles = 4; - - // Provides Kubernetes role binding information for findings that involve - // [RoleBindings or - // ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). - repeated Binding bindings = 5; - - // Provides information on any Kubernetes access reviews (privilege checks) - // relevant to the finding. - repeated AccessReview access_reviews = 6; - - // Kubernetes objects related to the finding. - repeated Object objects = 7; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/label.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/label.proto deleted file mode 100644 index 4fb9664d073..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/label.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "LabelProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Represents a generic name-value label. A label has separate name and value -// fields to support filtering with the `contains()` function. For more -// information, see [Filtering on array-type -// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). -message Label { - // Name of the label. - string name = 1; - - // Value that corresponds to the label's name. - string value = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/load_balancer.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/load_balancer.proto deleted file mode 100644 index 310834b7ec7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/load_balancer.proto +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "LoadBalancerProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains information related to the load balancer associated with the -// finding. -message LoadBalancer { - // The name of the load balancer associated with the finding. - string name = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/log_entry.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/log_entry.proto deleted file mode 100644 index ac179a5bc47..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/log_entry.proto +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "LogEntryProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// An individual entry in a log. -message LogEntry { - // The log entry. - oneof log_entry { - // An individual entry in a log stored in Cloud Logging. - CloudLoggingEntry cloud_logging_entry = 1; - } -} - -// Metadata taken from a [Cloud Logging -// LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) -message CloudLoggingEntry { - // A unique identifier for the log entry. - string insert_id = 1; - - // The type of the log (part of `log_name`. `log_name` is the resource name of - // the log to which this log entry belongs). For example: - // `cloudresourcemanager.googleapis.com/activity` Note that this field is not - // URL-encoded, unlike in `LogEntry`. - string log_id = 2; - - // The organization, folder, or project of the monitored resource that - // produced this log entry. - string resource_container = 3; - - // The time the event described by the log entry occurred. - google.protobuf.Timestamp timestamp = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mitre_attack.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mitre_attack.proto deleted file mode 100644 index 5283d271b84..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mitre_attack.proto +++ /dev/null @@ -1,517 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "MitreAttackProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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 Security Command Center - // findings. See: https://attack.mitre.org/techniques/enterprise/ - enum Technique { - // Unspecified value. - TECHNIQUE_UNSPECIFIED = 0; - - // T1001 - DATA_OBFUSCATION = 70; - - // T1001.002 - DATA_OBFUSCATION_STEGANOGRAPHY = 71; - - // T1003 - OS_CREDENTIAL_DUMPING = 114; - - // T1003.007 - OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM = 115; - - // T1003.008 - OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW = 122; - - // T1005 - DATA_FROM_LOCAL_SYSTEM = 117; - - // T1020 - AUTOMATED_EXFILTRATION = 68; - - // T1027 - OBFUSCATED_FILES_OR_INFO = 72; - - // T1027.003 - STEGANOGRAPHY = 73; - - // T1027.004 - COMPILE_AFTER_DELIVERY = 74; - - // T1027.010 - COMMAND_OBFUSCATION = 75; - - // T1029 - SCHEDULED_TRANSFER = 120; - - // T1033 - SYSTEM_OWNER_USER_DISCOVERY = 118; - - // T1036 - MASQUERADING = 49; - - // T1036.005 - MATCH_LEGITIMATE_NAME_OR_LOCATION = 50; - - // T1037 - BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37; - - // T1037.005 - STARTUP_ITEMS = 38; - - // T1046 - NETWORK_SERVICE_DISCOVERY = 32; - - // T1053 - SCHEDULED_TASK_JOB = 89; - - // T1053.003 - SCHEDULED_TASK_JOB_CRON = 119; - - // T1053.007 - CONTAINER_ORCHESTRATION_JOB = 90; - - // T1055 - PROCESS_INJECTION = 93; - - // T1056 - INPUT_CAPTURE = 103; - - // T1056.001 - INPUT_CAPTURE_KEYLOGGING = 104; - - // T1057 - PROCESS_DISCOVERY = 56; - - // T1059 - COMMAND_AND_SCRIPTING_INTERPRETER = 6; - - // T1059.004 - UNIX_SHELL = 7; - - // T1059.006 - PYTHON = 59; - - // T1068 - EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63; - - // T1069 - PERMISSION_GROUPS_DISCOVERY = 18; - - // T1069.003 - CLOUD_GROUPS = 19; - - // T1070 - INDICATOR_REMOVAL = 123; - - // T1070.002 - INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS = 124; - - // T1070.003 - INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY = 125; - - // T1070.004 - INDICATOR_REMOVAL_FILE_DELETION = 64; - - // T1070.006 - INDICATOR_REMOVAL_TIMESTOMP = 128; - - // T1070.008 - INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA = 126; - - // T1071 - APPLICATION_LAYER_PROTOCOL = 45; - - // T1071.004 - DNS = 46; - - // T1072 - SOFTWARE_DEPLOYMENT_TOOLS = 47; - - // T1078 - VALID_ACCOUNTS = 14; - - // T1078.001 - DEFAULT_ACCOUNTS = 35; - - // T1078.003 - LOCAL_ACCOUNTS = 15; - - // T1078.004 - CLOUD_ACCOUNTS = 16; - - // T1083 - FILE_AND_DIRECTORY_DISCOVERY = 121; - - // T1087.001 - ACCOUNT_DISCOVERY_LOCAL_ACCOUNT = 116; - - // T1090 - PROXY = 9; - - // T1090.002 - EXTERNAL_PROXY = 10; - - // T1090.003 - MULTI_HOP_PROXY = 11; - - // T1098 - ACCOUNT_MANIPULATION = 22; - - // T1098.001 - ADDITIONAL_CLOUD_CREDENTIALS = 40; - - // T1098.003 - ADDITIONAL_CLOUD_ROLES = 67; - - // T1098.004 - SSH_AUTHORIZED_KEYS = 23; - - // T1098.006 - ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58; - - // T1104 - MULTI_STAGE_CHANNELS = 76; - - // T1105 - INGRESS_TOOL_TRANSFER = 3; - - // T1106 - NATIVE_API = 4; - - // T1110 - BRUTE_FORCE = 44; - - // T1119 - AUTOMATED_COLLECTION = 94; - - // T1129 - SHARED_MODULES = 5; - - // T1132 - DATA_ENCODING = 77; - - // T1132.001 - STANDARD_ENCODING = 78; - - // T1134 - ACCESS_TOKEN_MANIPULATION = 33; - - // T1134.001 - TOKEN_IMPERSONATION_OR_THEFT = 39; - - // T1136 - CREATE_ACCOUNT = 79; - - // T1136.001 - LOCAL_ACCOUNT = 80; - - // T1140 - DEOBFUSCATE_DECODE_FILES_OR_INFO = 95; - - // T1190 - EXPLOIT_PUBLIC_FACING_APPLICATION = 27; - - // T1195 - SUPPLY_CHAIN_COMPROMISE = 129; - - // T1195.001 - COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS = 130; - - // T1203 - EXPLOITATION_FOR_CLIENT_EXECUTION = 134; - - // T1204 - USER_EXECUTION = 69; - - // T1222.002 - LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = 135; - - // T1484 - DOMAIN_POLICY_MODIFICATION = 30; - - // T1485 - DATA_DESTRUCTION = 29; - - // T1486 - DATA_ENCRYPTED_FOR_IMPACT = 132; - - // T1489 - SERVICE_STOP = 52; - - // T1490 - INHIBIT_SYSTEM_RECOVERY = 36; - - // T1495 - FIRMWARE_CORRUPTION = 81; - - // T1496 - RESOURCE_HIJACKING = 8; - - // T1498 - NETWORK_DENIAL_OF_SERVICE = 17; - - // T1526 - CLOUD_SERVICE_DISCOVERY = 48; - - // T1528 - STEAL_APPLICATION_ACCESS_TOKEN = 42; - - // T1531 - ACCOUNT_ACCESS_REMOVAL = 51; - - // T1537 - TRANSFER_DATA_TO_CLOUD_ACCOUNT = 91; - - // T1539 - STEAL_WEB_SESSION_COOKIE = 25; - - // T1543 - CREATE_OR_MODIFY_SYSTEM_PROCESS = 24; - - // T1546 - EVENT_TRIGGERED_EXECUTION = 65; - - // T1547 - BOOT_OR_LOGON_AUTOSTART_EXECUTION = 82; - - // T1547.006 - KERNEL_MODULES_AND_EXTENSIONS = 83; - - // T1547.009 - SHORTCUT_MODIFICATION = 127; - - // T1548 - ABUSE_ELEVATION_CONTROL_MECHANISM = 34; - - // T1548.001 - ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID = 136; - - // T1548.003 - ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING = 109; - - // T1552 - UNSECURED_CREDENTIALS = 13; - - // T1552.001 - CREDENTIALS_IN_FILES = 105; - - // T1552.003 - BASH_HISTORY = 96; - - // T1552.004 - PRIVATE_KEYS = 97; - - // T1553 - SUBVERT_TRUST_CONTROL = 106; - - // T1553.004 - INSTALL_ROOT_CERTIFICATE = 107; - - // T1554 - COMPROMISE_HOST_SOFTWARE_BINARY = 84; - - // T1555 - CREDENTIALS_FROM_PASSWORD_STORES = 98; - - // T1556 - MODIFY_AUTHENTICATION_PROCESS = 28; - - // T1556.003 - PLUGGABLE_AUTHENTICATION_MODULES = 108; - - // T1556.006 - MULTI_FACTOR_AUTHENTICATION = 137; - - // T1562 - IMPAIR_DEFENSES = 31; - - // T1562.001 - DISABLE_OR_MODIFY_TOOLS = 55; - - // T1562.006 - INDICATOR_BLOCKING = 110; - - // T1562.012 - DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM = 111; - - // T1564 - HIDE_ARTIFACTS = 85; - - // T1564.001 - HIDDEN_FILES_AND_DIRECTORIES = 86; - - // T1564.002 - HIDDEN_USERS = 87; - - // T1567 - EXFILTRATION_OVER_WEB_SERVICE = 20; - - // T1567.002 - EXFILTRATION_TO_CLOUD_STORAGE = 21; - - // T1568 - DYNAMIC_RESOLUTION = 12; - - // T1570 - LATERAL_TOOL_TRANSFER = 41; - - // T1574 - HIJACK_EXECUTION_FLOW = 112; - - // T1574.006 - HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING = 113; - - // T1578 - MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26; - - // T1578.001 - CREATE_SNAPSHOT = 54; - - // T1580 - CLOUD_INFRASTRUCTURE_DISCOVERY = 53; - - // T1587 - DEVELOP_CAPABILITIES = 99; - - // T1587.001 - DEVELOP_CAPABILITIES_MALWARE = 100; - - // T1588 - OBTAIN_CAPABILITIES = 43; - - // T1588.001 - OBTAIN_CAPABILITIES_MALWARE = 101; - - // T1588.006 - OBTAIN_CAPABILITIES_VULNERABILITIES = 133; - - // T1595 - ACTIVE_SCANNING = 1; - - // T1595.001 - SCANNING_IP_BLOCKS = 2; - - // T1608 - STAGE_CAPABILITIES = 88; - - // T1608.001 - UPLOAD_MALWARE = 102; - - // T1609 - CONTAINER_ADMINISTRATION_COMMAND = 60; - - // T1610 - DEPLOY_CONTAINER = 66; - - // T1611 - ESCAPE_TO_HOST = 61; - - // T1613 - CONTAINER_AND_RESOURCE_DISCOVERY = 57; - - // T1620 - REFLECTIVE_CODE_LOADING = 92; - - // T1649 - STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62; - - // T1657 - FINANCIAL_THEFT = 131; - } - - // 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mute_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mute_config.proto deleted file mode 100644 index 1fb53768c79..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/mute_config.proto +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "MuteConfigProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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: "organizations/{organization}/locations/{location}/muteConfigs/{mute_config}" - pattern: "folders/{folder}/muteConfigs/{mute_config}" - pattern: "folders/{folder}/locations/{location}/muteConfigs/{mute_config}" - pattern: "projects/{project}/muteConfigs/{mute_config}" - pattern: "projects/{project}/locations/{location}/muteConfigs/{mute_config}" - plural: "muteConfigs" - singular: "muteConfig" - }; - - // The type of MuteConfig. - enum MuteConfigType { - // Unused. - MUTE_CONFIG_TYPE_UNSPECIFIED = 0; - - // A static mute config, which sets the static mute state of future matching - // findings to muted. Once the static mute state has been set, finding or - // config modifications will not affect the state. - STATIC = 1; - - // A dynamic mute config, which is applied to existing and future matching - // findings, setting their dynamic mute state to "muted". If the config is - // updated or deleted, or a matching finding is updated, such that the - // finding doesn't match the config, the config will be removed from the - // finding, and the finding's dynamic mute state may become "unmuted" - // (unless other configs still match). - DYNAMIC = 2; - } - - // Identifier. This field will be ignored if provided on config creation. The - // following list shows some examples of the format: - // - // + `organizations/{organization}/muteConfigs/{mute_config}` - // + - // `organizations/{organization}locations/{location}//muteConfigs/{mute_config}` - // + `folders/{folder}/muteConfigs/{mute_config}` - // + `folders/{folder}/locations/{location}/muteConfigs/{mute_config}` - // + `projects/{project}/muteConfigs/{mute_config}` - // + `projects/{project}/locations/{location}/muteConfigs/{mute_config}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // A description of the mute config. - string description = 2; - - // 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 = 3 [(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 = 4 - [(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 = 5 - [(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 = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The type of the mute config, which determines what type of mute - // state the config affects. Immutable after creation. - MuteConfigType type = 8 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The expiry of the mute config. Only applicable for dynamic - // configs. If the expiry is set, when the config expires, it is removed from - // all findings. - google.protobuf.Timestamp expiry_time = 9 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/network.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/network.proto deleted file mode 100644 index bff3c6eb520..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/network.proto +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "NetworkProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains information about a VPC network associated with the finding. -message Network { - // The name of the VPC network resource, for example, - // `//compute.googleapis.com/projects/my-project/global/networks/my-network`. - string name = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notebook.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notebook.proto deleted file mode 100644 index 9a1814d51c6..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notebook.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "NotebookProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise -// notebook](https://cloud.google.com/colab/docs/introduction) file, that is -// associated with a finding. -message Notebook { - // The name of the notebook. - string name = 1; - - // The source notebook service, for example, "Colab Enterprise". - string service = 2; - - // The user ID of the latest author to modify the notebook. - string last_author = 3; - - // The most recent time the notebook was updated. - google.protobuf.Timestamp notebook_update_time = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_config.proto deleted file mode 100644 index f83d79254b7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_config.proto +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "NotificationConfigProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; -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}/locations/{location}/notificationConfigs/{notification_config}" - pattern: "folders/{folder}/locations/{location}/notificationConfigs/{notification_config}" - pattern: "projects/{project}/locations/{location}/notificationConfigs/{notification_config}" - plural: "notificationConfigs" - singular: "notificationConfig" - }; - - // 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; - } - - // Identifier. The relative resource name of this notification config. See: - // https://cloud.google.com/apis/design/resource_names#relative_resource_name - // The following list shows some examples: - // + - // `organizations/{organization_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` - // + - // `folders/{folder_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` - // + - // `projects/{project_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // The description of the notification config (max of 1024 characters). - string description = 2; - - // 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" } - ]; - - // Output only. The service account that needs "pubsub.topics.publish" - // permission to publish to the Pub/Sub 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; - } - - // Output only. The timestamp of when the notification config was last - // updated. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_message.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_message.proto deleted file mode 100644 index 370d8bfd493..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/notification_message.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/cloud/securitycenter/v2/finding.proto"; -import "google/cloud/securitycenter/v2/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "NotificationMessageProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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; - } - - // The Cloud resource tied to this notification's Finding. - Resource resource = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/org_policy.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/org_policy.proto deleted file mode 100644 index 49800942cef..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/org_policy.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "OrgPolicyProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains information about the org policies associated with the finding. -message OrgPolicy { - option (google.api.resource) = { - type: "orgpolicy.googleapis.com/Policy" - pattern: "organizations/{organization}/policies/{constraint_name}" - pattern: "folders/{folder}/policies/{constraint_name}" - pattern: "projects/{project}/policies/{constraint_name}" - }; - - // Identifier. The resource name of the org policy. - // Example: - // "organizations/{organization_id}/policies/{constraint_name}" - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/process.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/process.proto deleted file mode 100644 index decd87b106f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/process.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/cloud/securitycenter/v2/file.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ProcessProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Represents an operating system process. -message Process { - // The process name, as displayed in utilities like `top` and `ps`. This name - // can be accessed through `/proc/[pid]/comm` and changed with - // `prctl(PR_SET_NAME)`. - string name = 1; - - // File information for the process executable. - File binary = 2; - - // File information for libraries loaded by the process. - repeated File libraries = 3; - - // 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 = 4; - - // Process arguments as JSON encoded strings. - repeated string args = 5; - - // True if `args` is incomplete. - bool arguments_truncated = 6; - - // Process environment variables. - repeated EnvironmentVariable env_variables = 7; - - // True if `env_variables` is incomplete. - bool env_variables_truncated = 8; - - // The process ID. - int64 pid = 9; - - // The parent process ID. - int64 parent_pid = 10; - - // The ID of the user that executed the process. E.g. If this is the root user - // this will always be 0. - int64 user_id = 11; -} - -// A name-value pair representing an environment variable used in an operating -// system 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/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource.proto deleted file mode 100644 index 8dcbb8b4d63..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource.proto +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/securitycenter/v2/folder.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ResourceProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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 human readable name of the resource. - string display_name = 2; - - // The full resource type of the resource. - string type = 3; - - // Indicates which cloud provider the finding is from. - CloudProvider cloud_provider = 4; - - // The service or resource provider associated with the resource. - string service = 5; - - // The region or location of the service (if applicable). - string location = 6; - - // The metadata associated with the cloud provider. - oneof cloud_provider_metadata { - // The GCP metadata associated with the finding. - GcpMetadata gcp_metadata = 7; - - // The AWS metadata associated with the finding. - AwsMetadata aws_metadata = 8; - - // The Azure metadata associated with the finding. - AzureMetadata azure_metadata = 9; - } - - // Provides the path to the resource within the resource hierarchy. - ResourcePath resource_path = 10; - - // A string representation of the resource path. - // For Google Cloud, it has the format of - // `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` - // where there can be any number of folders. - // For AWS, it has the format of - // `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` - // where there can be any number of organizational units. - // For Azure, it has the format of - // `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` - // where there can be any number of management groups. - string resource_path_string = 11; -} - -// The cloud provider the finding pertains to. -enum CloudProvider { - // The cloud provider is unspecified. - CLOUD_PROVIDER_UNSPECIFIED = 0; - - // The cloud provider is Google Cloud. - GOOGLE_CLOUD_PLATFORM = 1; - - // The cloud provider is Amazon Web Services. - AMAZON_WEB_SERVICES = 2; - - // The cloud provider is Microsoft Azure. - MICROSOFT_AZURE = 3; -} - -// Google Cloud metadata associated with the resource. Only applicable if the -// finding's cloud provider is Google Cloud. -message GcpMetadata { - // The full resource name of project that the resource belongs to. - string project = 1; - - // The project ID that the resource belongs to. - string project_display_name = 2; - - // The full resource name of resource's parent. - string parent = 3; - - // The human readable name of resource's parent. - string parent_display_name = 4; - - // 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 = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The name of the organization that the resource belongs to. - string organization = 6; -} - -// AWS metadata associated with the resource, only applicable if the finding's -// cloud provider is Amazon Web Services. -message AwsMetadata { - // An organization is a collection of accounts that are centrally managed - // together using consolidated billing, organized hierarchically with - // organizational units (OUs), and controlled with policies. - message AwsOrganization { - // The unique identifier (ID) for the organization. The regex pattern for an - // organization ID string requires "o-" followed by from 10 to 32 lowercase - // letters or digits. - string id = 1; - } - - // An Organizational Unit (OU) is a container of AWS accounts within a root of - // an organization. Policies that are attached to an OU apply to all accounts - // contained in that OU and in any child OUs. - message AwsOrganizationalUnit { - // The unique identifier (ID) associated with this OU. The regex pattern for - // an organizational unit ID string requires "ou-" followed by from 4 to 32 - // lowercase letters or digits (the ID of the root that contains the OU). - // This string is followed by a second "-" dash and from 8 to 32 additional - // lowercase letters or digits. For example, "ou-ab12-cd34ef56". - string id = 1; - - // The friendly name of the OU. - string name = 2; - } - - // An AWS account that is a member of an organization. - message AwsAccount { - // The unique identifier (ID) of the account, containing exactly 12 digits. - string id = 1; - - // The friendly name of this account. - string name = 2; - } - - // The AWS organization associated with the resource. - AwsOrganization organization = 1; - - // A list of AWS organizational units associated with the resource, ordered - // from lowest level (closest to the account) to highest level. - repeated AwsOrganizationalUnit organizational_units = 2; - - // The AWS account associated with the resource. - AwsAccount account = 3; -} - -// Azure metadata associated with the resource, only applicable if the finding's -// cloud provider is Microsoft Azure. -message AzureMetadata { - // Represents an Azure management group. - message AzureManagementGroup { - // The UUID of the Azure management group, for example, - // `20000000-0001-0000-0000-000000000000`. - string id = 1; - - // The display name of the Azure management group. - string display_name = 2; - } - - // Represents an Azure subscription. - message AzureSubscription { - // The UUID of the Azure subscription, for example, - // `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`. - string id = 1; - - // The display name of the Azure subscription. - string display_name = 2; - } - - // Represents an Azure resource group. - message AzureResourceGroup { - // The ID of the Azure resource group. - string id = 2; - - // The name of the Azure resource group. This is not a UUID. - string name = 1; - } - - // Represents a Microsoft Entra tenant. - message AzureTenant { - // The ID of the Microsoft Entra tenant, for example, - // "a11aaa11-aa11-1aa1-11aa-1aaa11a". - string id = 1; - - // The display name of the Azure tenant. - string display_name = 2; - } - - // A list of Azure management groups associated with the resource, ordered - // from lowest level (closest to the subscription) to highest level. - repeated AzureManagementGroup management_groups = 1; - - // The Azure subscription associated with the resource. - AzureSubscription subscription = 2; - - // The Azure resource group associated with the resource. - AzureResourceGroup resource_group = 3; - - // The Azure Entra tenant associated with the resource. - AzureTenant tenant = 7; -} - -// Represents the path of resources leading up to the resource this finding is -// about. -message ResourcePath { - // The type of resource the node represents. - enum ResourcePathNodeType { - // Node type is unspecified. - RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0; - - // The node represents a Google Cloud organization. - GCP_ORGANIZATION = 1; - - // The node represents a Google Cloud folder. - GCP_FOLDER = 2; - - // The node represents a Google Cloud project. - GCP_PROJECT = 3; - - // The node represents an AWS organization. - AWS_ORGANIZATION = 4; - - // The node represents an AWS organizational unit. - AWS_ORGANIZATIONAL_UNIT = 5; - - // The node represents an AWS account. - AWS_ACCOUNT = 6; - - // The node represents an Azure management group. - AZURE_MANAGEMENT_GROUP = 7; - - // The node represents an Azure subscription. - AZURE_SUBSCRIPTION = 8; - - // The node represents an Azure resource group. - AZURE_RESOURCE_GROUP = 9; - } - - // A node within the resource path. Each node represents a resource within the - // resource hierarchy. - message ResourcePathNode { - // The type of resource this node represents. - ResourcePathNodeType node_type = 1; - - // The ID of the resource this node represents. - string id = 2; - - // The display name of the resource this node represents. - string display_name = 3; - } - - // The list of nodes that make the up resource path, ordered from lowest - // level to highest level. - repeated ResourcePathNode nodes = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource_value_config.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource_value_config.proto deleted file mode 100644 index c65e3538190..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/resource_value_config.proto +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/securitycenter/v2/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ResourceValueConfigProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// A resource value configuration (RVC) is a mapping configuration of user's -// resources to resource values. Used in Attack path simulations. -message ResourceValueConfig { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/ResourceValueConfig" - pattern: "organizations/{organization}/resourceValueConfigs/{resource_value_config}" - pattern: "organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}" - plural: "resourceValueConfigs" - singular: "resourceValueConfig" - }; - - // Resource value mapping for Sensitive Data Protection findings - // If any of these mappings have a resource value that is not unspecified, - // the resource_value field will be ignored when reading this configuration. - message SensitiveDataProtectionMapping { - // Resource value mapping for high-sensitivity Sensitive Data Protection - // findings - ResourceValue high_sensitivity_mapping = 1; - - // Resource value mapping for medium-sensitivity Sensitive Data Protection - // findings - ResourceValue medium_sensitivity_mapping = 2; - } - - // Identifier. Name for the resource value configuration - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Resource value level this expression represents - // Only required when there is no Sensitive Data Protection mapping in the - // request - ResourceValue resource_value = 2; - - // Tag values combined with `AND` to check against. - // For Google Cloud resources, they are tag value IDs in the form of - // "tagValues/123". Example: `[ "tagValues/123", "tagValues/456", - // "tagValues/789" ]` - // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing - repeated string tag_values = 3; - - // Apply resource_value only to resources that match resource_type. - // resource_type will be checked with `AND` of other resources. - // For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" - // will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. - string resource_type = 4; - - // Project or folder to scope this configuration to. - // For example, "project/456" would apply this configuration only to resources - // in "project/456" scope and will be checked with `AND` of other resources. - string scope = 5; - - // List of resource labels to search for, evaluated with `AND`. - // For example, "resource_labels_selector": {"key": "value", "env": "prod"} - // will match resources with labels "key": "value" `AND` "env": - // "prod" - // https://cloud.google.com/resource-manager/docs/creating-managing-labels - map resource_labels_selector = 6; - - // Description of the resource value configuration. - string description = 7; - - // Output only. Timestamp this resource value configuration was created. - google.protobuf.Timestamp create_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp this resource value configuration was last updated. - google.protobuf.Timestamp update_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cloud provider this configuration applies to - CloudProvider cloud_provider = 10; - - // A mapping of the sensitivity on Sensitive Data Protection finding to - // resource values. This mapping can only be used in combination with a - // resource_type that is related to BigQuery, e.g. - // "bigquery.googleapis.com/Dataset". - SensitiveDataProtectionMapping sensitive_data_protection_mapping = 11; -} - -// Value enum to map to a resource -enum ResourceValue { - // Unspecific value - RESOURCE_VALUE_UNSPECIFIED = 0; - - // High resource value - HIGH = 1; - - // Medium resource value - MEDIUM = 2; - - // Low resource value - LOW = 3; - - // No resource value, e.g. ignore these resources - NONE = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_marks.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_marks.proto deleted file mode 100644 index c6d8b820d4a..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_marks.proto +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SecurityMarksProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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) = { - type: "securitycenter.googleapis.com/SecurityMarks" - pattern: "organizations/{organization}/assets/{asset}/securityMarks" - pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" - pattern: "organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks" - pattern: "folders/{folder}/assets/{asset}/securityMarks" - pattern: "folders/{folder}/sources/{source}/findings/{finding}/securityMarks" - pattern: "folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks" - pattern: "projects/{project}/assets/{asset}/securityMarks" - pattern: "projects/{project}/sources/{source}/findings/{finding}/securityMarks" - pattern: "projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks" - }; - - // The relative resource name of the SecurityMarks. See: - // https://cloud.google.com/apis/design/resource_names#relative_resource_name - // The following list shows some examples: - // - // + `organizations/{organization_id}/assets/{asset_id}/securityMarks` - // + - // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks` - // + - // `organizations/{organization_id}/sources/{source_id}/locations/{location}/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; - - // The canonical name of the marks. The following list shows some examples: - // - // + `organizations/{organization_id}/assets/{asset_id}/securityMarks` - // + - // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks` - // + - // `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` - // + `folders/{folder_id}/assets/{asset_id}/securityMarks` - // + - // `folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks` - // + - // `folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` - // + `projects/{project_number}/assets/{asset_id}/securityMarks` - // + - // `projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks` - // + - // `projects/{project_number}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` - string canonical_name = 3; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_posture.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_posture.proto deleted file mode 100644 index 8537663e54b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/security_posture.proto +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SecurityPostureProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Represents a posture that is deployed on Google Cloud by the -// Security Command Center Posture Management service. -// A posture contains one or more policy sets. A policy set is a -// group of policies that enforce a set of security rules on Google -// Cloud. -message SecurityPosture { - // The policy field that violates the deployed posture and its expected and - // detected values. - message PolicyDriftDetails { - // The name of the updated field, for example - // constraint.implementation.policy_rules[0].enforce - string field = 1; - - // The value of this field that was configured in a posture, for example, - // `true` or `allowed_values={"projects/29831892"}`. - string expected_value = 2; - - // The detected value that violates the deployed posture, for example, - // `false` or `allowed_values={"projects/22831892"}`. - string detected_value = 3; - } - - // Name of the posture, for example, `CIS-Posture`. - string name = 1; - - // The version of the posture, for example, `c7cfa2a8`. - string revision_id = 2; - - // The project, folder, or organization on which the posture is deployed, - // for example, `projects/{project_number}`. - string posture_deployment_resource = 3; - - // The name of the posture deployment, for example, - // `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. - string posture_deployment = 4; - - // The name of the updated policy, for example, - // `projects/{project_id}/policies/{constraint_name}`. - string changed_policy = 5; - - // The name of the updated policy set, for example, `cis-policyset`. - string policy_set = 6; - - // The ID of the updated policy, for example, `compute-policy-1`. - string policy = 7; - - // The details about a change in an updated policy that violates the deployed - // posture. - repeated PolicyDriftDetails policy_drift_details = 8; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/securitycenter_service.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/securitycenter_service.proto deleted file mode 100644 index fd9206aedb1..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/securitycenter_service.proto +++ /dev/null @@ -1,2076 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/securitycenter/v2/attack_path.proto"; -import "google/cloud/securitycenter/v2/bigquery_export.proto"; -import "google/cloud/securitycenter/v2/external_system.proto"; -import "google/cloud/securitycenter/v2/finding.proto"; -import "google/cloud/securitycenter/v2/mute_config.proto"; -import "google/cloud/securitycenter/v2/notification_config.proto"; -import "google/cloud/securitycenter/v2/resource.proto"; -import "google/cloud/securitycenter/v2/resource_value_config.proto"; -import "google/cloud/securitycenter/v2/security_marks.proto"; -import "google/cloud/securitycenter/v2/simulation.proto"; -import "google/cloud/securitycenter/v2/source.proto"; -import "google/cloud/securitycenter/v2/valued_resource.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.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.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SecuritycenterServiceProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; -option (google.api.resource_definition) = { - type: "securitycenter.googleapis.com/OrganizationLocation" - pattern: "organizations/{organization}/locations/{location}" -}; -option (google.api.resource_definition) = { - type: "securitycenter.googleapis.com/FolderLocation" - pattern: "folders/{folder}/locations/{location}" -}; -option (google.api.resource_definition) = { - type: "securitycenter.googleapis.com/OrganizationValuedResource" - pattern: "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}" -}; - -// V2 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 ResourceValueConfig for an organization. Maps user's tags to - // difference resource values for use by the attack path simulation. - rpc BatchCreateResourceValueConfigs(BatchCreateResourceValueConfigsRequest) - returns (BatchCreateResourceValueConfigsResponse) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate" - body: "*" - } - }; - option (google.api.method_signature) = "parent,requests"; - } - - // Kicks off an LRO to bulk mute findings for a parent based on a filter. If - // no location is specified, findings are muted in global. 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: "/v2/{parent=organizations/*}/findings:bulkMute" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*/locations/*}/findings:bulkMute" - body: "*" - } - additional_bindings { - post: "/v2/{parent=folders/*}/findings:bulkMute" - body: "*" - } - additional_bindings { - post: "/v2/{parent=folders/*/locations/*}/findings:bulkMute" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/findings:bulkMute" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/findings:bulkMute" - body: "*" - } - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.securitycenter.v2.BulkMuteFindingsResponse" - metadata_type: "google.protobuf.Empty" - }; - } - - // Creates a BigQuery export. - rpc CreateBigQueryExport(CreateBigQueryExportRequest) - returns (BigQueryExport) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*/locations/*}/bigQueryExports" - body: "big_query_export" - additional_bindings { - post: "/v2/{parent=folders/*/locations/*}/bigQueryExports" - body: "big_query_export" - } - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/bigQueryExports" - body: "big_query_export" - } - }; - option (google.api.method_signature) = - "parent,big_query_export,big_query_export_id"; - } - - // Creates a finding in a location. The corresponding source must exist for - // finding creation to succeed. - rpc CreateFinding(CreateFindingRequest) returns (Finding) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*/sources/*/locations/*}/findings" - body: "finding" - additional_bindings { - post: "/v2/{parent=organizations/*/sources/*}/findings" - body: "finding" - } - }; - option (google.api.method_signature) = "parent,finding,finding_id"; - } - - // Creates a mute config. - rpc CreateMuteConfig(CreateMuteConfigRequest) returns (MuteConfig) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*/locations/*}/muteConfigs" - body: "mute_config" - additional_bindings { - post: "/v2/{parent=folders/*/locations/*}/muteConfigs" - body: "mute_config" - } - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/muteConfigs" - body: "mute_config" - } - additional_bindings { - post: "/v2/{parent=organizations/*}/muteConfigs" - body: "mute_config" - } - additional_bindings { - post: "/v2/{parent=folders/*}/muteConfigs" - body: "mute_config" - } - additional_bindings { - post: "/v2/{parent=projects/*}/muteConfigs" - body: "mute_config" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - routing_parameters { - field: "parent" - path_template: "organizations/*/locations/{location=*}" - } - routing_parameters { - field: "parent" - path_template: "folders/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent,mute_config,mute_config_id"; - } - - // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) - returns (NotificationConfig) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*/locations/*}/notificationConfigs" - body: "notification_config" - additional_bindings { - post: "/v2/{parent=folders/*/locations/*}/notificationConfigs" - body: "notification_config" - } - additional_bindings { - post: "/v2/{parent=projects/*/locations/*}/notificationConfigs" - body: "notification_config" - } - }; - option (google.api.method_signature) = - "parent,notification_config,config_id"; - } - - // Creates a source. - rpc CreateSource(CreateSourceRequest) returns (Source) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*}/sources" - body: "source" - }; - option (google.api.method_signature) = "parent,source"; - } - - // Deletes an existing BigQuery export. - rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/locations/*/bigQueryExports/*}" - additional_bindings { - delete: "/v2/{name=folders/*/locations/*/bigQueryExports/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/bigQueryExports/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Deletes an existing mute config. If no location is specified, default is - // global. - rpc DeleteMuteConfig(DeleteMuteConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/muteConfigs/*}" - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/muteConfigs/*}" - } - additional_bindings { delete: "/v2/{name=folders/*/muteConfigs/*}" } - additional_bindings { - delete: "/v2/{name=folders/*/locations/*/muteConfigs/*}" - } - additional_bindings { delete: "/v2/{name=projects/*/muteConfigs/*}" } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/muteConfigs/*}" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/muteConfigs/*" - } - routing_parameters { - field: "name" - path_template: "organizations/*/locations/{location=*}/muteConfigs/*" - } - routing_parameters { - field: "name" - path_template: "folders/*/locations/{location=*}/muteConfigs/*" - } - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/locations/*/notificationConfigs/*}" - additional_bindings { - delete: "/v2/{name=folders/*/locations/*/notificationConfigs/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/notificationConfigs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a ResourceValueConfig. - rpc DeleteResourceValueConfig(DeleteResourceValueConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/resourceValueConfigs/*}" - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Gets a BigQuery export. - rpc GetBigQueryExport(GetBigQueryExportRequest) returns (BigQueryExport) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/locations/*/bigQueryExports/*}" - additional_bindings { - get: "/v2/{name=folders/*/locations/*/bigQueryExports/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/bigQueryExports/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Get the simulation by name or the latest simulation for the given - // organization. - rpc GetSimulation(GetSimulationRequest) returns (Simulation) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/simulations/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/simulations/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Get the valued resource by name - rpc GetValuedResource(GetValuedResourceRequest) returns (ValuedResource) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/simulations/*/valuedResources/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/simulations/*/valuedResources/*}" - } - }; - 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: "/v2/{resource=organizations/*/sources/*}:getIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource"; - } - - // Gets a mute config. If no location is specified, default is - // global. - rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/muteConfigs/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/muteConfigs/*}" - } - additional_bindings { get: "/v2/{name=folders/*/muteConfigs/*}" } - additional_bindings { - get: "/v2/{name=folders/*/locations/*/muteConfigs/*}" - } - additional_bindings { get: "/v2/{name=projects/*/muteConfigs/*}" } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/muteConfigs/*}" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/muteConfigs/*" - } - routing_parameters { - field: "name" - path_template: "organizations/*/locations/{location=*}/muteConfigs/*" - } - routing_parameters { - field: "name" - path_template: "folders/*/locations/{location=*}/muteConfigs/*" - } - }; - option (google.api.method_signature) = "name"; - } - - // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) - returns (NotificationConfig) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/locations/*/notificationConfigs/*}" - additional_bindings { - get: "/v2/{name=folders/*/locations/*/notificationConfigs/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/notificationConfigs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Gets a ResourceValueConfig. - rpc GetResourceValueConfig(GetResourceValueConfigRequest) - returns (ResourceValueConfig) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/resourceValueConfigs/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Gets a source. - rpc GetSource(GetSourceRequest) returns (Source) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/sources/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Filters an organization or source's findings and groups them by their - // specified properties in a location. If no location is specified, findings - // are assumed to be in global - // - // To group across all sources provide a `-` as the source id. - // The following list shows some examples: - // - // + `/v2/organizations/{organization_id}/sources/-/findings` - // + - // `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - // + `/v2/folders/{folder_id}/sources/-/findings` - // + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` - // + `/v2/projects/{project_id}/sources/-/findings` - // + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` - rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*/sources/*}/findings:group" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*/sources/*/locations/*}/findings:group" - body: "*" - } - additional_bindings { - post: "/v2/{parent=folders/*/sources/*}/findings:group" - body: "*" - } - additional_bindings { - post: "/v2/{parent=folders/*/sources/*/locations/*}/findings:group" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*/sources/*}/findings:group" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*/sources/*/locations/*}/findings:group" - body: "*" - } - }; - option (google.api.method_signature) = "parent,group_by"; - } - - // Lists the attack paths for a set of simulation results or valued resources - // and filter. - rpc ListAttackPaths(ListAttackPathsRequest) - returns (ListAttackPathsResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*/simulations/*}/attackPaths" - additional_bindings { get: "/v2/{parent=organizations/*}/attackPaths" } - additional_bindings { - get: "/v2/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" - } - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*/simulations/*/valuedResources/*}/attackPaths" - } - additional_bindings { - get: "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" - } - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*/simulations/*/attackExposureResults/*}/attackPaths" - } - }; - option (google.api.method_signature) = "parent"; - } - - // 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: "/v2/{parent=organizations/*/locations/*}/bigQueryExports" - additional_bindings { - get: "/v2/{parent=folders/*/locations/*}/bigQueryExports" - } - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/bigQueryExports" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists an organization or source's findings. - // - // To list across all sources for a given location provide a `-` as the source - // id. If no location is specified, finding are assumed to be in global. - // The following list shows some examples: - // - // + `/v2/organizations/{organization_id}/sources/-/findings` - // + - // `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*/sources/*}/findings" - additional_bindings { - get: "/v2/{parent=organizations/*/sources/*/locations/*}/findings" - } - additional_bindings { get: "/v2/{parent=folders/*/sources/*}/findings" } - additional_bindings { - get: "/v2/{parent=folders/*/sources/*/locations/*}/findings" - } - additional_bindings { get: "/v2/{parent=projects/*/sources/*}/findings" } - additional_bindings { - get: "/v2/{parent=projects/*/sources/*/locations/*}/findings" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists mute configs. If no location is specified, default is - // global. - rpc ListMuteConfigs(ListMuteConfigsRequest) - returns (ListMuteConfigsResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/muteConfigs" - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*}/muteConfigs" - } - additional_bindings { get: "/v2/{parent=folders/*}/muteConfigs" } - additional_bindings { - get: "/v2/{parent=folders/*/locations/*}/muteConfigs" - } - additional_bindings { get: "/v2/{parent=projects/*}/muteConfigs" } - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/muteConfigs" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}/muteConfigs" - } - routing_parameters { - field: "parent" - path_template: "organizations/*/locations/{location=*}/muteConfigs" - } - routing_parameters { - field: "parent" - path_template: "folders/*/locations/{location=*}/muteConfigs" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) - returns (ListNotificationConfigsResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*/locations/*}/notificationConfigs" - additional_bindings { - get: "/v2/{parent=folders/*/locations/*}/notificationConfigs" - } - additional_bindings { - get: "/v2/{parent=projects/*/locations/*}/notificationConfigs" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all ResourceValueConfigs. - rpc ListResourceValueConfigs(ListResourceValueConfigsRequest) - returns (ListResourceValueConfigsResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/resourceValueConfigs" - additional_bindings { - get: "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all sources belonging to an organization. - rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/sources" - additional_bindings { get: "/v2/{parent=folders/*}/sources" } - additional_bindings { get: "/v2/{parent=projects/*}/sources" } - }; - option (google.api.method_signature) = "parent"; - } - - // Lists the valued resources for a set of simulation results and filter. - rpc ListValuedResources(ListValuedResourcesRequest) - returns (ListValuedResourcesResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*/simulations/*}/valuedResources" - additional_bindings { - get: "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources" - } - additional_bindings { - get: "/v2/{parent=organizations/*}/valuedResources" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the state of a finding. If no location is specified, finding is - // assumed to be in global - rpc SetFindingState(SetFindingStateRequest) returns (Finding) { - option (google.api.http) = { - post: "/v2/{name=organizations/*/sources/*/findings/*}:setState" - body: "*" - additional_bindings { - post: "/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setState" - body: "*" - } - additional_bindings { - post: "/v2/{name=folders/*/sources/*/findings/*}:setState" - body: "*" - } - additional_bindings { - post: "/v2/{name=folders/*/sources/*/locations/*/findings/*}:setState" - body: "*" - } - additional_bindings { - post: "/v2/{name=projects/*/sources/*/findings/*}:setState" - body: "*" - } - additional_bindings { - post: "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setState" - body: "*" - } - }; - option (google.api.method_signature) = "name,state"; - } - - // 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: "/v2/{resource=organizations/*/sources/*}:setIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Updates the mute state of a finding. If no location is specified, finding - // is assumed to be in global - rpc SetMute(SetMuteRequest) returns (Finding) { - option (google.api.http) = { - post: "/v2/{name=organizations/*/sources/*/findings/*}:setMute" - body: "*" - additional_bindings { - post: "/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setMute" - body: "*" - } - additional_bindings { - post: "/v2/{name=folders/*/sources/*/findings/*}:setMute" - body: "*" - } - additional_bindings { - post: "/v2/{name=folders/*/sources/*/locations/*/findings/*}:setMute" - body: "*" - } - additional_bindings { - post: "/v2/{name=projects/*/sources/*/findings/*}:setMute" - body: "*" - } - additional_bindings { - post: "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setMute" - body: "*" - } - }; - option (google.api.method_signature) = "name,mute"; - } - - // 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: "/v2/{resource=organizations/*/sources/*}:testIamPermissions" - body: "*" - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Updates a BigQuery export. - rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) - returns (BigQueryExport) { - option (google.api.http) = { - patch: "/v2/{big_query_export.name=organizations/*/locations/*/bigQueryExports/*}" - body: "big_query_export" - additional_bindings { - patch: "/v2/{big_query_export.name=folders/*/locations/*/bigQueryExports/*}" - body: "big_query_export" - } - additional_bindings { - patch: "/v2/{big_query_export.name=projects/*/locations/*/bigQueryExports/*}" - body: "big_query_export" - } - }; - option (google.api.method_signature) = "big_query_export,update_mask"; - } - - // Updates external system. This is for a given finding. If no location is - // specified, finding is assumed to be in global - rpc UpdateExternalSystem(UpdateExternalSystemRequest) - returns (ExternalSystem) { - option (google.api.http) = { - patch: "/v2/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}" - body: "external_system" - additional_bindings { - patch: "/v2/{external_system.name=organizations/*/sources/*/locations/*/findings/*/externalSystems/*}" - body: "external_system" - } - additional_bindings { - patch: "/v2/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}" - body: "external_system" - } - additional_bindings { - patch: "/v2/{external_system.name=folders/*/sources/*/locations/*/findings/*/externalSystems/*}" - body: "external_system" - } - additional_bindings { - patch: "/v2/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}" - body: "external_system" - } - additional_bindings { - patch: "/v2/{external_system.name=projects/*/sources/*/locations/*/findings/*/externalSystems/*}" - body: "external_system" - } - }; - option (google.api.method_signature) = "external_system,update_mask"; - } - - // Creates or updates a finding. If no location is specified, finding is - // assumed to be in global. The corresponding source must exist for a finding - // creation to succeed. - rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { - option (google.api.http) = { - patch: "/v2/{finding.name=organizations/*/sources/*/findings/*}" - body: "finding" - additional_bindings { - patch: "/v2/{finding.name=organizations/*/sources/*/locations/*/findings/*}" - body: "finding" - } - additional_bindings { - patch: "/v2/{finding.name=folders/*/sources/*/findings/*}" - body: "finding" - } - additional_bindings { - patch: "/v2/{finding.name=folders/*/sources/*/locations/*/findings/*}" - body: "finding" - } - additional_bindings { - patch: "/v2/{finding.name=projects/*/sources/*/findings/*}" - body: "finding" - } - additional_bindings { - patch: "/v2/{finding.name=projects/*/sources/*/locations/*/findings/*}" - body: "finding" - } - }; - option (google.api.method_signature) = "finding,update_mask"; - } - - // Updates a mute config. If no location is specified, default is - // global. - rpc UpdateMuteConfig(UpdateMuteConfigRequest) returns (MuteConfig) { - option (google.api.http) = { - patch: "/v2/{mute_config.name=organizations/*/muteConfigs/*}" - body: "mute_config" - additional_bindings { - patch: "/v2/{mute_config.name=organizations/*/locations/*/muteConfigs/*}" - body: "mute_config" - } - additional_bindings { - patch: "/v2/{mute_config.name=folders/*/muteConfigs/*}" - body: "mute_config" - } - additional_bindings { - patch: "/v2/{mute_config.name=folders/*/locations/*/muteConfigs/*}" - body: "mute_config" - } - additional_bindings { - patch: "/v2/{mute_config.name=projects/*/muteConfigs/*}" - body: "mute_config" - } - additional_bindings { - patch: "/v2/{mute_config.name=projects/*/locations/*/muteConfigs/*}" - body: "mute_config" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "mute_config.name" - path_template: "projects/*/locations/{location=*}/muteConfigs/*" - } - routing_parameters { - field: "mute_config.name" - path_template: "organizations/*/locations/{location=*}/muteConfigs/*" - } - routing_parameters { - field: "mute_config.name" - path_template: "folders/*/locations/{location=*}/muteConfigs/*" - } - }; - 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 - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) - returns (NotificationConfig) { - option (google.api.http) = { - patch: "/v2/{notification_config.name=organizations/*/locations/*/notificationConfigs/*}" - body: "notification_config" - additional_bindings { - patch: "/v2/{notification_config.name=folders/*/locations/*/notificationConfigs/*}" - body: "notification_config" - } - additional_bindings { - patch: "/v2/{notification_config.name=projects/*/locations/*/notificationConfigs/*}" - body: "notification_config" - } - }; - option (google.api.method_signature) = "notification_config,update_mask"; - } - - // Updates an existing ResourceValueConfigs with new rules. - rpc UpdateResourceValueConfig(UpdateResourceValueConfigRequest) - returns (ResourceValueConfig) { - option (google.api.http) = { - patch: "/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}" - body: "resource_value_config" - additional_bindings { - patch: "/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}" - body: "resource_value_config" - } - }; - option (google.api.method_signature) = "resource_value_config,update_mask"; - } - - // Updates security marks. For Finding Security marks, if no location is - // specified, finding is assumed to be in global. Assets Security Marks can - // only be accessed through global endpoint. - rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { - option (google.api.http) = { - patch: "/v2/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" - body: "security_marks" - additional_bindings { - patch: "/v2/{security_marks.name=organizations/*/assets/*/securityMarks}" - body: "security_marks" - } - additional_bindings { - patch: "/v2/{security_marks.name=organizations/*/sources/*/locations/*/findings/*/securityMarks}" - body: "security_marks" - } - additional_bindings { - patch: "/v2/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}" - body: "security_marks" - } - additional_bindings { - patch: "/v2/{security_marks.name=folders/*/assets/*/securityMarks}" - body: "security_marks" - } - additional_bindings { - patch: "/v2/{security_marks.name=folders/*/sources/*/locations/*/findings/*/securityMarks}" - body: "security_marks" - } - additional_bindings { - patch: "/v2/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}" - body: "security_marks" - } - additional_bindings { - patch: "/v2/{security_marks.name=projects/*/assets/*/securityMarks}" - body: "security_marks" - } - additional_bindings { - patch: "/v2/{security_marks.name=projects/*/sources/*/locations/*/findings/*/securityMarks}" - body: "security_marks" - } - }; - option (google.api.method_signature) = "security_marks,update_mask"; - } - - // Updates a source. - rpc UpdateSource(UpdateSourceRequest) returns (Source) { - option (google.api.http) = { - patch: "/v2/{source.name=organizations/*/sources/*}" - body: "source" - }; - option (google.api.method_signature) = "source,update_mask"; - } -} - -// Request message to create multiple resource value configs -message BatchCreateResourceValueConfigsRequest { - // Required. Resource name of the new ResourceValueConfig's parent. - // The parent field in the CreateResourceValueConfigRequest - // messages must either be empty or match this field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; - - // Required. The resource value configs to be created. - repeated CreateResourceValueConfigRequest requests = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for BatchCreateResourceValueConfigs -message BatchCreateResourceValueConfigsResponse { - // The resource value configs created - repeated ResourceValueConfig resource_value_configs = 1; -} - -// 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 { - // The mute state. - enum MuteState { - // Unused. - MUTE_STATE_UNSPECIFIED = 0; - - // Matching findings will be muted (default). - MUTED = 1; - - // Matching findings will have their mute state cleared. - UNDEFINED = 2; - } - - // Required. The parent, at which bulk action needs to be applied. If no - // location is specified, findings are updated in global. The following list - // shows some examples: - // - // + `organizations/[organization_id]` - // + `organizations/[organization_id]/locations/[location_id]` - // + `folders/[folder_id]` - // + `folders/[folder_id]/locations/[location_id]` - // + `projects/[project_id]` - // + `projects/[project_id]/locations/[location_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; - - // Optional. All findings matching the given filter will have their mute state - // set to this value. The default value is `MUTED`. Setting this to - // `UNDEFINED` will clear the mute state on all matching findings. - MuteState mute_state = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response to a BulkMute request. Contains the LRO information. -message BulkMuteFindingsResponse {} - -// Request message for creating a BigQuery export. -message CreateBigQueryExportRequest { - // Required. The name of the parent resource of the new BigQuery export. Its - // format is `organizations/[organization_id]/locations/[location_id]`, - // `folders/[folder_id]/locations/[location_id]`, or - // `projects/[project_id]/locations/[location_id]`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/BigQueryExport" - } - ]; - - // Required. The BigQuery 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 only lowercase letters, numbers, and hyphens, must start - // with a letter, must end with either a letter or a number, and must be 63 - // characters or less. - string big_query_export_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for creating a finding. -message CreateFindingRequest { - // Required. Resource name of the new finding's parent. The following list - // shows some examples of the format: - // + - // `organizations/[organization_id]/sources/[source_id]` - // + - // `organizations/[organization_id]/sources/[source_id]/locations/[location_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 mute config. -message CreateMuteConfigRequest { - // Required. Resource name of the new mute configs's parent. Its format is - // `organizations/[organization_id]/locations/[location_id]`, - // `folders/[folder_id]/locations/[location_id]`, or - // `projects/[project_id]/locations/[location_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 only lowercase letters, numbers, and hyphens, must start - // with a letter, must end with either a letter or a number, and must be 63 - // characters or less. - 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 `organizations/[organization_id]/locations/[location_id]`, - // `folders/[folder_id]/locations/[location_id]`, or - // `projects/[project_id]/locations/[location_id]`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/NotificationConfig" - } - ]; - - // Required. - // Unique identifier provided by the client within the parent scope. - // It must be between 1 and 128 characters and contain 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 to create single resource value config -message CreateResourceValueConfigRequest { - // Required. Resource name of the new ResourceValueConfig's parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; - - // Required. The resource value config being created. - ResourceValueConfig resource_value_config = 2 - [(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 BigQuery export. -message DeleteBigQueryExportRequest { - // Required. The name of the BigQuery export to delete. The following list - // shows some examples of the format: - // - // + - // `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - // + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - // + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/BigQueryExport" - } - ]; -} - -// Request message for deleting a mute config. If no location is specified, -// default is global. -message DeleteMuteConfigRequest { - // Required. Name of the mute config to delete. The following list shows some - // examples of the format: - // - // + `organizations/{organization}/muteConfigs/{config_id}` - // + - // `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - // + `folders/{folder}/muteConfigs/{config_id}` - // + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - // + `projects/{project}/muteConfigs/{config_id}` - // + `projects/{project}/locations/{location}/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. The following list - // shows some examples of the format: - // - // + - // `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - // + - // `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` - // + - // `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/NotificationConfig" - } - ]; -} - -// Request message to delete resource value config -message DeleteResourceValueConfigRequest { - // Required. Name of the ResourceValueConfig to delete - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; -} - -// The destination big query dataset to export findings to. -message BigQueryDestination { - // Required. The relative resource name of the destination dataset, in the - // form projects/{projectId}/datasets/{datasetId}. - string dataset = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The LRO metadata for a ExportFindings request. -message ExportFindingsMetadata { - // Optional. Timestamp at which export was started - google.protobuf.Timestamp export_start_time = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // The destination to export findings to. - oneof destination { - // Required. The destination big query dataset to export findings to. - BigQueryDestination big_query_destination = 2 - [(google.api.field_behavior) = REQUIRED]; - } -} - -// The response to a ExportFindings request. Contains the LRO information. -message ExportFindingsResponse {} - -// Request message for retrieving a BigQuery export. -message GetBigQueryExportRequest { - // Required. Name of the BigQuery export to retrieve. The following list shows - // some examples of the format: - // - // + - // `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - // + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - // + `projects/{project}locations/{location}//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. If no location is specified, -// default is global. -message GetMuteConfigRequest { - // Required. Name of the mute config to retrieve. The following list shows - // some examples of the format: - // - // + `organizations/{organization}/muteConfigs/{config_id}` - // + - // `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - // + `folders/{folder}/muteConfigs/{config_id}` - // + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - // + `projects/{project}/muteConfigs/{config_id}` - // + `projects/{project}/locations/{location}/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. The following list shows - // some examples of the format: - // - // + - // `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - // + - // `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` - // + - // `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/NotificationConfig" - } - ]; -} - -// Request message to get resource value config -message GetResourceValueConfigRequest { - // Required. Name of the resource value config to retrieve. Its format is - // organizations/{organization}/resourceValueConfigs/{config_id}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; -} - -// 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 findings. -message GroupFindingsRequest { - // Required. Name of the source to groupBy. If no location is specified, - // finding is assumed to be in global. - // The following list shows some examples: - // - // + `organizations/[organization_id]/sources/[source_id]` - // + - // `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - // + `folders/[folder_id]/sources/[source_id]` - // + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - // + `projects/[project_id]/sources/[source_id]` - // + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - // - // To groupBy across all sources provide a source_id of `-`. The following - // list shows some examples: - // - // + `organizations/{organization_id}/sources/-` - // + `organizations/{organization_id}/sources/-/locations/[location_id]` - // + `folders/{folder_id}/sources/-` - // + `folders/{folder_id}/sources/-/locations/[location_id]` - // + `projects/{project_id}/sources/-` - // + `projects/{project_id}/sources/-/locations/[location_id]` - 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 - // * 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: `=`, `:` - // * security_marks.marks: `=`, `:` - // * 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. - // The string value should follow SQL syntax: comma separated list of fields. - // For example: "parent,resource_name". - string group_by = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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; - - // 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 the attack paths for a given simulation or valued -// resource. -message ListAttackPathsRequest { - // Required. Name of parent to list attack paths. - // - // Valid formats: - // `organizations/{organization}`, - // `organizations/{organization}/simulations/{simulation}` - // `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - // `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/AttackPath" - } - ]; - - // The filter expression that filters the attack path in the response. - // Supported fields: - // - // * `valued_resources` supports = - string filter = 2; - - // The value returned by the last `ListAttackPathsResponse`; indicates - // that this is a continuation of a prior `ListAttackPaths` call, and - // that the system should return the next page of data. - string page_token = 3; - - // The maximum number of results to return in a single response. Default is - // 10, minimum is 1, maximum is 1000. - int32 page_size = 4; -} - -// Response message for listing the attack paths for a given simulation or -// valued resource. -message ListAttackPathsResponse { - // The attack paths that the attack path simulation identified. - repeated AttackPath attack_paths = 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 getting simulation. -// Simulation name can include "latest" to retrieve the latest simulation -// For example, "organizations/123/simulations/latest" -message GetSimulationRequest { - // Required. The organization name or simulation name of this simulation - // - // Valid format: - // `organizations/{organization}/simulations/latest` - // `organizations/{organization}/simulations/{simulation}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/Simulation" - } - ]; -} - -// Request message for getting a valued resource. -message GetValuedResourceRequest { - // Required. The name of this valued resource - // - // Valid format: - // `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "securitycenter.googleapis.com/ValuedResource" - } - ]; -} - -// 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]/locations/[location_id]`, - // `folders/[folder_id]/locations/[location_id]`, or - // `projects/[project_id]/locations/[location_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 listing findings. -message ListFindingsRequest { - // Required. Name of the source the findings belong to. If no location is - // specified, the default is global. The following list shows some examples: - // - // + `organizations/[organization_id]/sources/[source_id]` - // + - // `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - // + `folders/[folder_id]/sources/[source_id]` - // + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - // + `projects/[project_id]/sources/[source_id]` - // + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - // - // To list across all sources provide a source_id of `-`. The following - // list shows some examples: - // - // + `organizations/{organization_id}/sources/-` - // + `organizations/{organization_id}/sources/-/locations/{location_id}` - // + `folders/{folder_id}/sources/-` - // + `folders/{folder_id}/sources/-locations/{location_id}` - // + `projects/{projects_id}/sources/-` - // + `projects/{projects_id}/sources/-/locations/{location_id}` - 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 - // * 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: `=`, `:` - // * security_marks.marks: `=`, `:` - // * resource: - // * resource.name: `=`, `:` - // * resource.parent_name: `=`, `:` - // * resource.parent_display_name: `=`, `:` - // * resource.project_name: `=`, `:` - // * 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 - // string value should follow SQL syntax: comma separated list of fields. For - // example: "name,parent". 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,parent". Redundant space characters in the - // syntax are insignificant. "name desc,parent" and " - // name desc , parent " are equivalent. - // - // The following fields are supported: - // name - // parent - // state - // category - // resource_name - // event_time - // security_marks.marks - string order_by = 3; - - // 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. - message ListFindingsResult { - // Information related to the Google Cloud 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 human readable name of the resource. - string display_name = 2; - - // The full resource type of the resource. - string type = 3; - - // Indicates which cloud provider the finding is from. - CloudProvider cloud_provider = 4; - - // The service or resource provider associated with the resource. - string service = 5; - - // The region or location of the service (if applicable). - string location = 6; - - // The metadata associated with the cloud provider. - oneof cloud_provider_metadata { - // The GCP metadata associated with the finding. - GcpMetadata gcp_metadata = 7; - - // The AWS metadata associated with the finding. - AwsMetadata aws_metadata = 8; - - // The Azure metadata associated with the finding. - AzureMetadata azure_metadata = 9; - } - - // Provides the path to the resource within the resource hierarchy. - ResourcePath resource_path = 10; - - // A string representation of the resource path. - // For Google Cloud, it has the format of - // `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` - // where there can be any number of folders. - // For AWS, it has the format of - // `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` - // where there can be any number of organizational units. - // For Azure, it has the format of - // `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` - // where there can be any number of management groups. - string resource_path_string = 11; - } - - // Finding matching the search request. - Finding finding = 1; - - // Output only. Resource that is associated with this finding. - Resource resource = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Findings matching the list request. - repeated ListFindingsResult list_findings_results = 1; - - // 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 listing mute configs at a given scope e.g. organization, -// folder or project. If no location is specified, default is -// global. -message ListMuteConfigsRequest { - // Required. The parent, which owns the collection of mute configs. Its format - // is `organizations/[organization_id]", "folders/[folder_id]`, - // `projects/[project_id]`, - // `organizations/[organization_id]/locations/[location_id]`, - // `folders/[folder_id]/locations/[location_id]`, - // `projects/[project_id]/locations/[location_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. The name of the parent in which to list the notification - // configurations. Its format is - // "organizations/[organization_id]/locations/[location_id]", - // "folders/[folder_id]/locations/[location_id]", or - // "projects/[project_id]/locations/[location_id]". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/NotificationConfig" - } - ]; - - // 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 to list resource value configs of a parent -message ListResourceValueConfigsRequest { - // Required. The parent, which owns the collection of resource value configs. - // Its format is - // `organizations/[organization_id]` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/ResourceValueConfig" - } - ]; - - // 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 `ListResourceValueConfigs` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListResourceValueConfigs` must match the call that provided the - // page token. - // - // page_size can be specified, and the new page_size will be used. - string page_token = 3; -} - -// Response message to list resource value configs -message ListResourceValueConfigsResponse { - // The resource value configs from the specified parent. - repeated ResourceValueConfig resource_value_configs = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is empty, there are no subsequent pages. - 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]`, `folders/[folder_id]`, or - // `projects/[project_id]`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/Source" - } - ]; - - // 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 the valued resources for a given simulation. -message ListValuedResourcesRequest { - // Required. Name of parent to list exposed resources. - // - // Valid formats: - // `organizations/{organization}`, - // `organizations/{organization}/simulations/{simulation}` - // `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "securitycenter.googleapis.com/ValuedResource" - } - ]; - - // The filter expression that filters the valued resources in the response. - // Supported fields: - // - // * `resource_value` supports = - // * `resource_type` supports = - string filter = 2; - - // The value returned by the last `ListValuedResourcesResponse`; indicates - // that this is a continuation of a prior `ListValuedResources` call, and - // that the system should return the next page of data. - string page_token = 3; - - // The maximum number of results to return in a single response. Default is - // 10, minimum is 1, maximum is 1000. - int32 page_size = 4; - - // Optional. The fields by which to order the valued resources response. - // - // Supported fields: - // - // * `exposed_score` - // - // * `resource_value` - // - // * `resource_type` - // - // Values should be a comma separated list of fields. For example: - // `exposed_score,resource_value`. - // - // The default sorting order is descending. To specify ascending or descending - // order for a field, append a " ASC" or a " DESC" suffix, respectively; for - // example: `exposed_score DESC`. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for listing the valued resources for a given simulation. -message ListValuedResourcesResponse { - // The valued resources that the attack path simulation identified. - repeated ValuedResource valued_resources = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results. - string next_page_token = 2; - - // The estimated total number of results matching the query. - int32 total_size = 3; -} - -// Request message for updating a finding's state. -message SetFindingStateRequest { - // Required. The [relative resource - // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // of the finding. If no location is specified, finding is assumed to be in - // global. The following list shows some examples: - // - // + - // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - // + - // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - // + - // `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - // + - // `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{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]; -} - -// Request message for updating a finding's mute status. -message SetMuteRequest { - // Required. The [relative resource - // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // of the finding. If no location is specified, finding is assumed to be in - // global. The following list shows some examples: - // - // + - // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - // + - // `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - // + - // `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - // + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - // + - // `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{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 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 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. 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 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. - 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 to update resource value config -message UpdateResourceValueConfigRequest { - // Required. The resource value config being updated. - ResourceValueConfig resource_value_config = 1 - [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - // If empty all mutable fields will be updated. - // - // To update nested fields, include the top level field in the mask - // For example, to update gcp_metadata.resource_type, include the - // "gcp_metadata" field mask - 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; -} - -// 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; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/simulation.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/simulation.proto deleted file mode 100644 index 41112bfc882..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/simulation.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/securitycenter/v2/resource.proto"; -import "google/cloud/securitycenter/v2/valued_resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SimulationProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Attack path simulation -message Simulation { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/Simulation" - pattern: "organizations/{organization}/simulations/{simulation}" - pattern: "organizations/{organization}/locations/{location}/simulations/{simluation}" - plural: "simulations" - singular: "simulation" - }; - - // Full resource name of the Simulation: - // `organizations/123/simulations/456` - string name = 1; - - // Output only. Time simulation was created - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Resource value configurations' metadata used in this simulation. Maximum of - // 100. - repeated ResourceValueConfigMetadata resource_value_configs_metadata = 3; - - // Indicates which cloud provider was used in this simulation. - CloudProvider cloud_provider = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/source.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/source.proto deleted file mode 100644 index d1d0230b795..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/source.proto +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "SourceProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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. -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: - // 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: - // "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." - string description = 3; - - // The canonical name of the finding source. 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 = 4; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto deleted file mode 100644 index d5455f05012..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ToxicCombinationProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Contains details about a group of security issues that, when the issues -// occur together, represent a greater risk than when the issues occur -// independently. A group of such issues is referred to as a toxic -// combination. -message ToxicCombination { - // The - // [Attack exposure - // score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) - // of this toxic combination. The score is a measure of how much this toxic - // combination exposes one or more high-value resources to potential attack. - double attack_exposure_score = 1; - - // List of resource names of findings associated with this toxic combination. - // For example, `organizations/123/sources/456/findings/789`. - repeated string related_findings = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/valued_resource.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/valued_resource.proto deleted file mode 100644 index efa14bbbf78..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/valued_resource.proto +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "ValuedResourceProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// A resource that is determined to have value to a user's system -message ValuedResource { - option (google.api.resource) = { - type: "securitycenter.googleapis.com/ValuedResource" - pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}" - pattern: "organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}" - plural: "valuedResources" - singular: "valuedResource" - }; - - // How valuable the resource is. - enum ResourceValue { - // The resource value isn't specified. - RESOURCE_VALUE_UNSPECIFIED = 0; - - // This is a low-value resource. - RESOURCE_VALUE_LOW = 1; - - // This is a medium-value resource. - RESOURCE_VALUE_MEDIUM = 2; - - // This is a high-value resource. - RESOURCE_VALUE_HIGH = 3; - } - - // Valued resource name, for example, - // e.g.: - // `organizations/123/simulations/456/valuedResources/789` - string name = 1; - - // The - // [full resource - // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // of the valued resource. - string resource = 2; - - // The [resource - // type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - // of the valued resource. - string resource_type = 3; - - // Human-readable name of the valued resource. - string display_name = 4; - - // How valuable this resource is. - ResourceValue resource_value = 5; - - // Exposed score for this valued resource. A value of 0 means no exposure was - // detected exposure. - double exposed_score = 6; - - // List of resource value configurations' metadata used to determine the value - // of this resource. Maximum of 100. - repeated ResourceValueConfigMetadata resource_value_configs_used = 7; -} - -// Metadata about a ResourceValueConfig. For example, id and name. -message ResourceValueConfigMetadata { - // Resource value config name - string name = 1; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vertex_ai.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vertex_ai.proto deleted file mode 100644 index 93628aaee43..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vertex_ai.proto +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "VertexAiProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// Vertex AI-related information associated with the finding. -message VertexAi { - // Vertex AI dataset associated with the finding. - message Dataset { - // Resource name of the dataset, e.g. - // projects/{project}/locations/{location}/datasets/2094040236064505856 - string name = 1; - - // The user defined display name of dataset, e.g. plants-dataset - string display_name = 2; - - // Data source, such as a BigQuery source URI, e.g. - // bq://scc-nexus-test.AIPPtest.gsod - string source = 3; - } - - // Vertex AI training pipeline associated with the finding. - message Pipeline { - // Resource name of the pipeline, e.g. - // projects/{project}/locations/{location}/trainingPipelines/5253428229225578496 - string name = 1; - - // The user-defined display name of pipeline, e.g. plants-classification - string display_name = 2; - } - - // Datasets associated with the finding. - repeated Dataset datasets = 1; - - // Pipelines associated with the finding. - repeated Pipeline pipelines = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vulnerability.proto b/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vulnerability.proto deleted file mode 100644 index ffb3d390c13..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/vulnerability.proto +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.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.v2; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; -option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; -option java_multiple_files = true; -option java_outer_classname = "VulnerabilityProto"; -option java_package = "com.google.cloud.securitycenter.v2"; -option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; -option ruby_package = "Google::Cloud::SecurityCenter::V2"; - -// 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; - - // The offending package is relevant to the finding. - Package offending_package = 2; - - // The fixed package is relevant to the finding. - Package fixed_package = 3; - - // The security bulletin is relevant to this finding. - SecurityBulletin security_bulletin = 4; - - // Provider provided risk_score based on multiple factors. The higher the risk - // score, the more risky the vulnerability is. - int64 provider_risk_score = 5; - - // Represents whether the vulnerability is reachable (detected via static - // analysis) - bool reachable = 6; - - // Represents one or more Common Weakness Enumeration (CWE) information on - // this vulnerability. - repeated Cwe cwes = 7; -} - -// CVE stands for Common Vulnerabilities and Exposures. -// Information from the [CVE -// record](https://www.cve.org/ResourcesSupport/Glossary) that describes this -// vulnerability. -message Cve { - // The possible values of impact of the vulnerability if it was to be - // exploited. - enum RiskRating { - // Invalid or empty value. - RISK_RATING_UNSPECIFIED = 0; - - // Exploitation would have little to no security impact. - LOW = 1; - - // Exploitation would enable attackers to perform activities, or could allow - // attackers to have a direct impact, but would require additional steps. - MEDIUM = 2; - - // Exploitation would enable attackers to have a notable direct impact - // without needing to overcome any major mitigating factors. - HIGH = 3; - - // Exploitation would fundamentally undermine the security of affected - // systems, enable actors to perform significant attacks with minimal - // effort, with little to no mitigating factors to overcome. - CRITICAL = 4; - } - - // The possible values of exploitation activity of the vulnerability in the - // wild. - enum ExploitationActivity { - // Invalid or empty value. - EXPLOITATION_ACTIVITY_UNSPECIFIED = 0; - - // Exploitation has been reported or confirmed to widely occur. - WIDE = 1; - - // Limited reported or confirmed exploitation activities. - CONFIRMED = 2; - - // Exploit is publicly available. - AVAILABLE = 3; - - // No known exploitation activity, but has a high potential for - // exploitation. - ANTICIPATED = 4; - - // No known exploitation activity. - NO_KNOWN = 5; - } - - // 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; - - // Whether upstream fix is available for the CVE. - bool upstream_fix_available = 4; - - // The potential impact of the vulnerability if it was to be exploited. - RiskRating impact = 5; - - // The exploitation activity of the vulnerability in the wild. - ExploitationActivity exploitation_activity = 6; - - // Whether or not the vulnerability has been observed in the wild. - bool observed_in_the_wild = 7; - - // Whether or not the vulnerability was zero day when the finding was - // published. - bool zero_day = 8; - - // Date the first publicly available exploit or PoC was released. - google.protobuf.Timestamp exploit_release_date = 9; - - // Date of the earliest known exploitation. - google.protobuf.Timestamp first_exploitation_date = 10; -} - -// 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 = 2; - - // This metric describes the conditions beyond the attacker's control that - // must exist in order to exploit the vulnerability. - AttackComplexity attack_complexity = 3; - - // This metric describes the level of privileges an attacker must possess - // before successfully exploiting the vulnerability. - PrivilegesRequired privileges_required = 4; - - // 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 = 5; - - // The Scope metric captures whether a vulnerability in one vulnerable - // component impacts resources in components beyond its security scope. - Scope scope = 6; - - // 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 = 7; - - // This metric measures the impact to integrity of a successfully exploited - // vulnerability. - Impact integrity_impact = 8; - - // This metric measures the impact to the availability of the impacted - // component resulting from a successfully exploited vulnerability. - Impact availability_impact = 9; -} - -// Package is a generic definition of a package. -message Package { - // The name of the package where the vulnerability was detected. - string package_name = 1; - - // The CPE URI where the vulnerability was detected. - string cpe_uri = 2; - - // Type of package, for example, os, maven, or go. - string package_type = 3; - - // The version of the package. - string package_version = 4; -} - -// SecurityBulletin are notifications of vulnerabilities of Google products. -message SecurityBulletin { - // ID of the bulletin corresponding to the vulnerability. - string bulletin_id = 1; - - // Submission time of this Security Bulletin. - google.protobuf.Timestamp submission_time = 2; - - // This represents a version that the cluster receiving this notification - // should be upgraded to, based on its current version. For example, 1.15.0 - string suggested_upgrade_version = 3; -} - -// CWE stands for Common Weakness Enumeration. Information about this weakness, -// as described by [CWE](https://cwe.mitre.org/). -message Cwe { - // The CWE identifier, e.g. CWE-94 - string id = 1; - - // Any reference to the details on the CWE, for example, - // https://cwe.mitre.org/data/definitions/94.html - repeated Reference references = 2; -} diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/protos.d.ts b/owl-bot-staging/google-cloud-securitycenter/protos/protos.d.ts deleted file mode 100644 index bbdfb0c6859..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/protos.d.ts +++ /dev/null @@ -1,64568 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace securitycenter. */ - namespace securitycenter { - - /** 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 userAgent */ - userAgent?: (string|null); - - /** Access serviceName */ - serviceName?: (string|null); - - /** Access methodName */ - methodName?: (string|null); - - /** Access principalSubject */ - principalSubject?: (string|null); - - /** Access serviceAccountKeyName */ - serviceAccountKeyName?: (string|null); - - /** Access serviceAccountDelegationInfo */ - serviceAccountDelegationInfo?: (google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]|null); - - /** Access userName */ - userName?: (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 userAgent. */ - public userAgent: string; - - /** Access serviceName. */ - public serviceName: string; - - /** Access methodName. */ - public methodName: string; - - /** Access principalSubject. */ - public principalSubject: string; - - /** Access serviceAccountKeyName. */ - public serviceAccountKeyName: string; - - /** Access serviceAccountDelegationInfo. */ - public serviceAccountDelegationInfo: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]; - - /** Access userName. */ - public userName: 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 }; - - /** - * 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 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 { - - /** 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 }; - - /** - * 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 Application. */ - interface IApplication { - - /** Application baseUri */ - baseUri?: (string|null); - - /** Application fullUri */ - fullUri?: (string|null); - } - - /** Represents an Application. */ - class Application implements IApplication { - - /** - * Constructs a new Application. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IApplication); - - /** Application baseUri. */ - public baseUri: string; - - /** Application fullUri. */ - public fullUri: string; - - /** - * Creates a new Application instance using the specified properties. - * @param [properties] Properties to set - * @returns Application instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IApplication): google.cloud.securitycenter.v1.Application; - - /** - * Encodes the specified Application message. Does not implicitly {@link google.cloud.securitycenter.v1.Application.verify|verify} messages. - * @param message Application message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Application.verify|verify} messages. - * @param message Application message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Application message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Application - * @throws {Error} If the payload is not a reader 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.Application; - - /** - * Decodes an Application message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Application - * @throws {Error} If the payload is not 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.Application; - - /** - * Verifies an Application message. - * @param message Plain 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 Application message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Application - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Application; - - /** - * Creates a plain object from an Application message. Also converts values to other types if specified. - * @param message Application - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Application, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Application to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Application - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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); - - /** Asset canonicalName */ - canonicalName?: (string|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); - - /** Asset canonicalName. */ - public canonicalName: string; - - /** - * 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 }; - - /** - * 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 { - - /** 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); - - /** SecurityCenterProperties folders */ - folders?: (google.cloud.securitycenter.v1.IFolder[]|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[]; - - /** SecurityCenterProperties resourceDisplayName. */ - public resourceDisplayName: string; - - /** SecurityCenterProperties resourceParentDisplayName. */ - public resourceParentDisplayName: string; - - /** 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 - * @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 }; - - /** - * 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. */ - 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 }; - - /** - * 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; - } - } - - /** 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 }; - - /** - * 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. */ - interface ISecurityMarks { - - /** SecurityMarks name */ - name?: (string|null); - - /** SecurityMarks marks */ - marks?: ({ [k: string]: string }|null); - - /** SecurityMarks canonicalName */ - canonicalName?: (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 }; - - /** SecurityMarks canonicalName. */ - public canonicalName: 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 }; - - /** - * 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 an AttackExposure. */ - interface IAttackExposure { - - /** AttackExposure score */ - score?: (number|null); - - /** AttackExposure latestCalculationTime */ - latestCalculationTime?: (google.protobuf.ITimestamp|null); - - /** AttackExposure attackExposureResult */ - attackExposureResult?: (string|null); - - /** AttackExposure state */ - state?: (google.cloud.securitycenter.v1.AttackExposure.State|keyof typeof google.cloud.securitycenter.v1.AttackExposure.State|null); - - /** AttackExposure exposedHighValueResourcesCount */ - exposedHighValueResourcesCount?: (number|null); - - /** AttackExposure exposedMediumValueResourcesCount */ - exposedMediumValueResourcesCount?: (number|null); - - /** AttackExposure exposedLowValueResourcesCount */ - exposedLowValueResourcesCount?: (number|null); - } - - /** Represents an AttackExposure. */ - class AttackExposure implements IAttackExposure { - - /** - * Constructs a new AttackExposure. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IAttackExposure); - - /** AttackExposure score. */ - public score: number; - - /** AttackExposure latestCalculationTime. */ - public latestCalculationTime?: (google.protobuf.ITimestamp|null); - - /** AttackExposure attackExposureResult. */ - public attackExposureResult: string; - - /** AttackExposure state. */ - public state: (google.cloud.securitycenter.v1.AttackExposure.State|keyof typeof google.cloud.securitycenter.v1.AttackExposure.State); - - /** AttackExposure exposedHighValueResourcesCount. */ - public exposedHighValueResourcesCount: number; - - /** AttackExposure exposedMediumValueResourcesCount. */ - public exposedMediumValueResourcesCount: number; - - /** AttackExposure exposedLowValueResourcesCount. */ - public exposedLowValueResourcesCount: number; - - /** - * Creates a new AttackExposure instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackExposure instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IAttackExposure): google.cloud.securitycenter.v1.AttackExposure; - - /** - * Encodes the specified AttackExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackExposure.verify|verify} messages. - * @param message AttackExposure message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IAttackExposure, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackExposure.verify|verify} messages. - * @param message AttackExposure message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IAttackExposure, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackExposure message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackExposure - * @throws {Error} If the payload is not a reader 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.AttackExposure; - - /** - * Decodes an AttackExposure message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackExposure - * @throws {Error} If the payload is not 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.AttackExposure; - - /** - * Verifies an AttackExposure message. - * @param message Plain 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 AttackExposure message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackExposure - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackExposure; - - /** - * Creates a plain object from an AttackExposure message. Also converts values to other types if specified. - * @param message AttackExposure - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AttackExposure, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackExposure to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackExposure - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AttackExposure { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CALCULATED = 1, - NOT_CALCULATED = 2 - } - } - - /** Properties of an AttackPath. */ - interface IAttackPath { - - /** AttackPath name */ - name?: (string|null); - - /** AttackPath pathNodes */ - pathNodes?: (google.cloud.securitycenter.v1.AttackPath.IAttackPathNode[]|null); - - /** AttackPath edges */ - edges?: (google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge[]|null); - } - - /** Represents an AttackPath. */ - class AttackPath implements IAttackPath { - - /** - * Constructs a new AttackPath. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IAttackPath); - - /** AttackPath name. */ - public name: string; - - /** AttackPath pathNodes. */ - public pathNodes: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode[]; - - /** AttackPath edges. */ - public edges: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge[]; - - /** - * Creates a new AttackPath instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackPath instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IAttackPath): google.cloud.securitycenter.v1.AttackPath; - - /** - * Encodes the specified AttackPath message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.verify|verify} messages. - * @param message AttackPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IAttackPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.verify|verify} messages. - * @param message AttackPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IAttackPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackPath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackPath - * @throws {Error} If the payload is not a reader 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.AttackPath; - - /** - * Decodes an AttackPath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackPath - * @throws {Error} If the payload is not 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.AttackPath; - - /** - * Verifies an AttackPath message. - * @param message Plain 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 AttackPath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackPath - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath; - - /** - * Creates a plain object from an AttackPath message. Also converts values to other types if specified. - * @param message AttackPath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AttackPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackPath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackPath - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AttackPath { - - /** Properties of an AttackPathNode. */ - interface IAttackPathNode { - - /** AttackPathNode resource */ - resource?: (string|null); - - /** AttackPathNode resourceType */ - resourceType?: (string|null); - - /** AttackPathNode displayName */ - displayName?: (string|null); - - /** AttackPathNode associatedFindings */ - associatedFindings?: (google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding[]|null); - - /** AttackPathNode uuid */ - uuid?: (string|null); - - /** AttackPathNode attackSteps */ - attackSteps?: (google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode[]|null); - } - - /** Represents an AttackPathNode. */ - class AttackPathNode implements IAttackPathNode { - - /** - * Constructs a new AttackPathNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode); - - /** AttackPathNode resource. */ - public resource: string; - - /** AttackPathNode resourceType. */ - public resourceType: string; - - /** AttackPathNode displayName. */ - public displayName: string; - - /** AttackPathNode associatedFindings. */ - public associatedFindings: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding[]; - - /** AttackPathNode uuid. */ - public uuid: string; - - /** AttackPathNode attackSteps. */ - public attackSteps: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode[]; - - /** - * Creates a new AttackPathNode instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackPathNode instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode): google.cloud.securitycenter.v1.AttackPath.AttackPathNode; - - /** - * Encodes the specified AttackPathNode message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify|verify} messages. - * @param message AttackPathNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackPathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify|verify} messages. - * @param message AttackPathNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AttackPath.IAttackPathNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackPathNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackPathNode - * @throws {Error} If the payload is not a reader 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.AttackPath.AttackPathNode; - - /** - * Decodes an AttackPathNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackPathNode - * @throws {Error} If the payload is not 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.AttackPath.AttackPathNode; - - /** - * Verifies an AttackPathNode message. - * @param message Plain 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 AttackPathNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackPathNode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath.AttackPathNode; - - /** - * Creates a plain object from an AttackPathNode message. Also converts values to other types if specified. - * @param message AttackPathNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackPathNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackPathNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AttackPathNode { - - /** Properties of a PathNodeAssociatedFinding. */ - interface IPathNodeAssociatedFinding { - - /** PathNodeAssociatedFinding canonicalFinding */ - canonicalFinding?: (string|null); - - /** PathNodeAssociatedFinding findingCategory */ - findingCategory?: (string|null); - - /** PathNodeAssociatedFinding name */ - name?: (string|null); - } - - /** Represents a PathNodeAssociatedFinding. */ - class PathNodeAssociatedFinding implements IPathNodeAssociatedFinding { - - /** - * Constructs a new PathNodeAssociatedFinding. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding); - - /** PathNodeAssociatedFinding canonicalFinding. */ - public canonicalFinding: string; - - /** PathNodeAssociatedFinding findingCategory. */ - public findingCategory: string; - - /** PathNodeAssociatedFinding name. */ - public name: string; - - /** - * Creates a new PathNodeAssociatedFinding instance using the specified properties. - * @param [properties] Properties to set - * @returns PathNodeAssociatedFinding instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding): google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding; - - /** - * Encodes the specified PathNodeAssociatedFinding message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. - * @param message PathNodeAssociatedFinding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PathNodeAssociatedFinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. - * @param message PathNodeAssociatedFinding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PathNodeAssociatedFinding - * @throws {Error} If the payload is not a reader 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.AttackPath.AttackPathNode.PathNodeAssociatedFinding; - - /** - * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PathNodeAssociatedFinding - * @throws {Error} If the payload is not 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.AttackPath.AttackPathNode.PathNodeAssociatedFinding; - - /** - * Verifies a PathNodeAssociatedFinding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PathNodeAssociatedFinding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PathNodeAssociatedFinding - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding; - - /** - * Creates a plain object from a PathNodeAssociatedFinding message. Also converts values to other types if specified. - * @param message PathNodeAssociatedFinding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PathNodeAssociatedFinding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PathNodeAssociatedFinding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** NodeType enum. */ - enum NodeType { - NODE_TYPE_UNSPECIFIED = 0, - NODE_TYPE_AND = 1, - NODE_TYPE_OR = 2, - NODE_TYPE_DEFENSE = 3, - NODE_TYPE_ATTACKER = 4 - } - - /** Properties of an AttackStepNode. */ - interface IAttackStepNode { - - /** AttackStepNode uuid */ - uuid?: (string|null); - - /** AttackStepNode type */ - type?: (google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType|keyof typeof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType|null); - - /** AttackStepNode displayName */ - displayName?: (string|null); - - /** AttackStepNode labels */ - labels?: ({ [k: string]: string }|null); - - /** AttackStepNode description */ - description?: (string|null); - } - - /** Represents an AttackStepNode. */ - class AttackStepNode implements IAttackStepNode { - - /** - * Constructs a new AttackStepNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode); - - /** AttackStepNode uuid. */ - public uuid: string; - - /** AttackStepNode type. */ - public type: (google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType|keyof typeof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType); - - /** AttackStepNode displayName. */ - public displayName: string; - - /** AttackStepNode labels. */ - public labels: { [k: string]: string }; - - /** AttackStepNode description. */ - public description: string; - - /** - * Creates a new AttackStepNode instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackStepNode instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode): google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode; - - /** - * Encodes the specified AttackStepNode message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. - * @param message AttackStepNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackStepNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. - * @param message AttackStepNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackStepNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackStepNode - * @throws {Error} If the payload is not a reader 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.AttackPath.AttackPathNode.AttackStepNode; - - /** - * Decodes an AttackStepNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackStepNode - * @throws {Error} If the payload is not 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.AttackPath.AttackPathNode.AttackStepNode; - - /** - * Verifies an AttackStepNode message. - * @param message Plain 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 AttackStepNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackStepNode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode; - - /** - * Creates a plain object from an AttackStepNode message. Also converts values to other types if specified. - * @param message AttackStepNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackStepNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackStepNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an AttackPathEdge. */ - interface IAttackPathEdge { - - /** AttackPathEdge source */ - source?: (string|null); - - /** AttackPathEdge destination */ - destination?: (string|null); - } - - /** Represents an AttackPathEdge. */ - class AttackPathEdge implements IAttackPathEdge { - - /** - * Constructs a new AttackPathEdge. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge); - - /** AttackPathEdge source. */ - public source: string; - - /** AttackPathEdge destination. */ - public destination: string; - - /** - * Creates a new AttackPathEdge instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackPathEdge instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge): google.cloud.securitycenter.v1.AttackPath.AttackPathEdge; - - /** - * Encodes the specified AttackPathEdge message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify|verify} messages. - * @param message AttackPathEdge message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackPathEdge message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify|verify} messages. - * @param message AttackPathEdge message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackPathEdge message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackPathEdge - * @throws {Error} If the payload is not a reader 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.AttackPath.AttackPathEdge; - - /** - * Decodes an AttackPathEdge message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackPathEdge - * @throws {Error} If the payload is not 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.AttackPath.AttackPathEdge; - - /** - * Verifies an AttackPathEdge message. - * @param message Plain 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 AttackPathEdge message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackPathEdge - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AttackPath.AttackPathEdge; - - /** - * Creates a plain object from an AttackPathEdge message. Also converts values to other types if specified. - * @param message AttackPathEdge - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AttackPath.AttackPathEdge, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackPathEdge to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackPathEdge - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a BackupDisasterRecovery. */ - interface IBackupDisasterRecovery { - - /** BackupDisasterRecovery backupTemplate */ - backupTemplate?: (string|null); - - /** BackupDisasterRecovery policies */ - policies?: (string[]|null); - - /** BackupDisasterRecovery host */ - host?: (string|null); - - /** BackupDisasterRecovery applications */ - applications?: (string[]|null); - - /** BackupDisasterRecovery storagePool */ - storagePool?: (string|null); - - /** BackupDisasterRecovery policyOptions */ - policyOptions?: (string[]|null); - - /** BackupDisasterRecovery profile */ - profile?: (string|null); - - /** BackupDisasterRecovery appliance */ - appliance?: (string|null); - - /** BackupDisasterRecovery backupType */ - backupType?: (string|null); - - /** BackupDisasterRecovery backupCreateTime */ - backupCreateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BackupDisasterRecovery. */ - class BackupDisasterRecovery implements IBackupDisasterRecovery { - - /** - * Constructs a new BackupDisasterRecovery. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IBackupDisasterRecovery); - - /** BackupDisasterRecovery backupTemplate. */ - public backupTemplate: string; - - /** BackupDisasterRecovery policies. */ - public policies: string[]; - - /** BackupDisasterRecovery host. */ - public host: string; - - /** BackupDisasterRecovery applications. */ - public applications: string[]; - - /** BackupDisasterRecovery storagePool. */ - public storagePool: string; - - /** BackupDisasterRecovery policyOptions. */ - public policyOptions: string[]; - - /** BackupDisasterRecovery profile. */ - public profile: string; - - /** BackupDisasterRecovery appliance. */ - public appliance: string; - - /** BackupDisasterRecovery backupType. */ - public backupType: string; - - /** BackupDisasterRecovery backupCreateTime. */ - public backupCreateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new BackupDisasterRecovery instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupDisasterRecovery instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IBackupDisasterRecovery): google.cloud.securitycenter.v1.BackupDisasterRecovery; - - /** - * Encodes the specified BackupDisasterRecovery message. Does not implicitly {@link google.cloud.securitycenter.v1.BackupDisasterRecovery.verify|verify} messages. - * @param message BackupDisasterRecovery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IBackupDisasterRecovery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupDisasterRecovery message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BackupDisasterRecovery.verify|verify} messages. - * @param message BackupDisasterRecovery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IBackupDisasterRecovery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupDisasterRecovery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupDisasterRecovery - * @throws {Error} If the payload is not a reader 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.BackupDisasterRecovery; - - /** - * Decodes a BackupDisasterRecovery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupDisasterRecovery - * @throws {Error} If the payload is not 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.BackupDisasterRecovery; - - /** - * Verifies a BackupDisasterRecovery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupDisasterRecovery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupDisasterRecovery - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BackupDisasterRecovery; - - /** - * Creates a plain object from a BackupDisasterRecovery message. Also converts values to other types if specified. - * @param message BackupDisasterRecovery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.BackupDisasterRecovery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupDisasterRecovery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupDisasterRecovery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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 Chokepoint. */ - interface IChokepoint { - - /** Chokepoint relatedFindings */ - relatedFindings?: (string[]|null); - } - - /** Represents a Chokepoint. */ - class Chokepoint implements IChokepoint { - - /** - * Constructs a new Chokepoint. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IChokepoint); - - /** Chokepoint relatedFindings. */ - public relatedFindings: string[]; - - /** - * Creates a new Chokepoint instance using the specified properties. - * @param [properties] Properties to set - * @returns Chokepoint instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IChokepoint): google.cloud.securitycenter.v1.Chokepoint; - - /** - * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. - * @param message Chokepoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. - * @param message Chokepoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Chokepoint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Chokepoint - * @throws {Error} If the payload is not a reader 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.Chokepoint; - - /** - * Decodes a Chokepoint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Chokepoint - * @throws {Error} If the payload is not 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.Chokepoint; - - /** - * Verifies a Chokepoint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Chokepoint - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Chokepoint; - - /** - * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. - * @param message Chokepoint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Chokepoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Chokepoint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Chokepoint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudArmor. */ - interface ICloudArmor { - - /** CloudArmor securityPolicy */ - securityPolicy?: (google.cloud.securitycenter.v1.ISecurityPolicy|null); - - /** CloudArmor requests */ - requests?: (google.cloud.securitycenter.v1.IRequests|null); - - /** CloudArmor adaptiveProtection */ - adaptiveProtection?: (google.cloud.securitycenter.v1.IAdaptiveProtection|null); - - /** CloudArmor attack */ - attack?: (google.cloud.securitycenter.v1.IAttack|null); - - /** CloudArmor threatVector */ - threatVector?: (string|null); - - /** CloudArmor duration */ - duration?: (google.protobuf.IDuration|null); - } - - /** Represents a CloudArmor. */ - class CloudArmor implements ICloudArmor { - - /** - * Constructs a new CloudArmor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICloudArmor); - - /** CloudArmor securityPolicy. */ - public securityPolicy?: (google.cloud.securitycenter.v1.ISecurityPolicy|null); - - /** CloudArmor requests. */ - public requests?: (google.cloud.securitycenter.v1.IRequests|null); - - /** CloudArmor adaptiveProtection. */ - public adaptiveProtection?: (google.cloud.securitycenter.v1.IAdaptiveProtection|null); - - /** CloudArmor attack. */ - public attack?: (google.cloud.securitycenter.v1.IAttack|null); - - /** CloudArmor threatVector. */ - public threatVector: string; - - /** CloudArmor duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** - * Creates a new CloudArmor instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudArmor instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICloudArmor): google.cloud.securitycenter.v1.CloudArmor; - - /** - * Encodes the specified CloudArmor message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudArmor.verify|verify} messages. - * @param message CloudArmor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICloudArmor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudArmor message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudArmor.verify|verify} messages. - * @param message CloudArmor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICloudArmor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudArmor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudArmor - * @throws {Error} If the payload is not a reader 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.CloudArmor; - - /** - * Decodes a CloudArmor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudArmor - * @throws {Error} If the payload is not 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.CloudArmor; - - /** - * Verifies a CloudArmor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudArmor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudArmor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CloudArmor; - - /** - * Creates a plain object from a CloudArmor message. Also converts values to other types if specified. - * @param message CloudArmor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CloudArmor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudArmor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudArmor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecurityPolicy. */ - interface ISecurityPolicy { - - /** SecurityPolicy name */ - name?: (string|null); - - /** SecurityPolicy type */ - type?: (string|null); - - /** SecurityPolicy preview */ - preview?: (boolean|null); - } - - /** Represents a SecurityPolicy. */ - class SecurityPolicy implements ISecurityPolicy { - - /** - * Constructs a new SecurityPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISecurityPolicy); - - /** SecurityPolicy name. */ - public name: string; - - /** SecurityPolicy type. */ - public type: string; - - /** SecurityPolicy preview. */ - public preview: boolean; - - /** - * Creates a new SecurityPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityPolicy instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISecurityPolicy): google.cloud.securitycenter.v1.SecurityPolicy; - - /** - * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPolicy.verify|verify} messages. - * @param message SecurityPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPolicy.verify|verify} messages. - * @param message SecurityPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityPolicy - * @throws {Error} If the payload is not a reader 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.SecurityPolicy; - - /** - * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityPolicy - * @throws {Error} If the payload is not 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.SecurityPolicy; - - /** - * Verifies a SecurityPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityPolicy; - - /** - * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. - * @param message SecurityPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SecurityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecurityPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Requests. */ - interface IRequests { - - /** Requests ratio */ - ratio?: (number|null); - - /** Requests shortTermAllowed */ - shortTermAllowed?: (number|null); - - /** Requests longTermAllowed */ - longTermAllowed?: (number|null); - - /** Requests longTermDenied */ - longTermDenied?: (number|null); - } - - /** Represents a Requests. */ - class Requests implements IRequests { - - /** - * Constructs a new Requests. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IRequests); - - /** Requests ratio. */ - public ratio: number; - - /** Requests shortTermAllowed. */ - public shortTermAllowed: number; - - /** Requests longTermAllowed. */ - public longTermAllowed: number; - - /** Requests longTermDenied. */ - public longTermDenied: number; - - /** - * Creates a new Requests instance using the specified properties. - * @param [properties] Properties to set - * @returns Requests instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IRequests): google.cloud.securitycenter.v1.Requests; - - /** - * Encodes the specified Requests message. Does not implicitly {@link google.cloud.securitycenter.v1.Requests.verify|verify} messages. - * @param message Requests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Requests message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Requests.verify|verify} messages. - * @param message Requests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Requests message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Requests - * @throws {Error} If the payload is not a reader 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.Requests; - - /** - * Decodes a Requests message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Requests - * @throws {Error} If the payload is not 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.Requests; - - /** - * Verifies a Requests message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Requests message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Requests - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Requests; - - /** - * Creates a plain object from a Requests message. Also converts values to other types if specified. - * @param message Requests - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Requests, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Requests to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Requests - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AdaptiveProtection. */ - interface IAdaptiveProtection { - - /** AdaptiveProtection confidence */ - confidence?: (number|null); - } - - /** Represents an AdaptiveProtection. */ - class AdaptiveProtection implements IAdaptiveProtection { - - /** - * Constructs a new AdaptiveProtection. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IAdaptiveProtection); - - /** AdaptiveProtection confidence. */ - public confidence: number; - - /** - * Creates a new AdaptiveProtection instance using the specified properties. - * @param [properties] Properties to set - * @returns AdaptiveProtection instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IAdaptiveProtection): google.cloud.securitycenter.v1.AdaptiveProtection; - - /** - * Encodes the specified AdaptiveProtection message. Does not implicitly {@link google.cloud.securitycenter.v1.AdaptiveProtection.verify|verify} messages. - * @param message AdaptiveProtection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IAdaptiveProtection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AdaptiveProtection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AdaptiveProtection.verify|verify} messages. - * @param message AdaptiveProtection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IAdaptiveProtection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AdaptiveProtection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AdaptiveProtection - * @throws {Error} If the payload is not a reader 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.AdaptiveProtection; - - /** - * Decodes an AdaptiveProtection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AdaptiveProtection - * @throws {Error} If the payload is not 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.AdaptiveProtection; - - /** - * Verifies an AdaptiveProtection message. - * @param message Plain 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 AdaptiveProtection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AdaptiveProtection - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AdaptiveProtection; - - /** - * Creates a plain object from an AdaptiveProtection message. Also converts values to other types if specified. - * @param message AdaptiveProtection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AdaptiveProtection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AdaptiveProtection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AdaptiveProtection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Attack. */ - interface IAttack { - - /** Attack volumePps */ - volumePps?: (number|null); - - /** Attack volumeBps */ - volumeBps?: (number|null); - - /** Attack classification */ - classification?: (string|null); - } - - /** Represents an Attack. */ - class Attack implements IAttack { - - /** - * Constructs a new Attack. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IAttack); - - /** Attack volumePps. */ - public volumePps: number; - - /** Attack volumeBps. */ - public volumeBps: number; - - /** Attack classification. */ - public classification: string; - - /** - * Creates a new Attack instance using the specified properties. - * @param [properties] Properties to set - * @returns Attack instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IAttack): google.cloud.securitycenter.v1.Attack; - - /** - * Encodes the specified Attack message. Does not implicitly {@link google.cloud.securitycenter.v1.Attack.verify|verify} messages. - * @param message Attack message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IAttack, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Attack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Attack.verify|verify} messages. - * @param message Attack message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IAttack, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Attack message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Attack - * @throws {Error} If the payload is not a reader 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.Attack; - - /** - * Decodes an Attack message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Attack - * @throws {Error} If the payload is not 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.Attack; - - /** - * Verifies an Attack message. - * @param message Plain 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 Attack message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Attack - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Attack; - - /** - * Creates a plain object from an Attack message. Also converts values to other types if specified. - * @param message Attack - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Attack, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Attack to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Attack - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudDlpDataProfile. */ - interface ICloudDlpDataProfile { - - /** CloudDlpDataProfile dataProfile */ - dataProfile?: (string|null); - - /** CloudDlpDataProfile parentType */ - parentType?: (google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|null); - - /** CloudDlpDataProfile infoTypes */ - infoTypes?: (google.cloud.securitycenter.v1.IInfoType[]|null); - } - - /** Represents a CloudDlpDataProfile. */ - class CloudDlpDataProfile implements ICloudDlpDataProfile { - - /** - * Constructs a new CloudDlpDataProfile. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICloudDlpDataProfile); - - /** CloudDlpDataProfile dataProfile. */ - public dataProfile: string; - - /** CloudDlpDataProfile parentType. */ - public parentType: (google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType); - - /** CloudDlpDataProfile infoTypes. */ - public infoTypes: google.cloud.securitycenter.v1.IInfoType[]; - - /** - * Creates a new CloudDlpDataProfile instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudDlpDataProfile instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICloudDlpDataProfile): google.cloud.securitycenter.v1.CloudDlpDataProfile; - - /** - * Encodes the specified CloudDlpDataProfile message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpDataProfile.verify|verify} messages. - * @param message CloudDlpDataProfile message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICloudDlpDataProfile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudDlpDataProfile message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpDataProfile.verify|verify} messages. - * @param message CloudDlpDataProfile message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICloudDlpDataProfile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudDlpDataProfile message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudDlpDataProfile - * @throws {Error} If the payload is not a reader 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.CloudDlpDataProfile; - - /** - * Decodes a CloudDlpDataProfile message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudDlpDataProfile - * @throws {Error} If the payload is not 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.CloudDlpDataProfile; - - /** - * Verifies a CloudDlpDataProfile message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudDlpDataProfile message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudDlpDataProfile - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CloudDlpDataProfile; - - /** - * Creates a plain object from a CloudDlpDataProfile message. Also converts values to other types if specified. - * @param message CloudDlpDataProfile - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CloudDlpDataProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudDlpDataProfile to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudDlpDataProfile - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CloudDlpDataProfile { - - /** ParentType enum. */ - enum ParentType { - PARENT_TYPE_UNSPECIFIED = 0, - ORGANIZATION = 1, - PROJECT = 2 - } - } - - /** Properties of an InfoType. */ - interface IInfoType { - - /** InfoType name */ - name?: (string|null); - - /** InfoType version */ - version?: (string|null); - - /** InfoType sensitivityScore */ - sensitivityScore?: (google.cloud.securitycenter.v1.ISensitivityScore|null); - } - - /** Represents an InfoType. */ - class InfoType implements IInfoType { - - /** - * Constructs a new InfoType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IInfoType); - - /** InfoType name. */ - public name: string; - - /** InfoType version. */ - public version: string; - - /** InfoType sensitivityScore. */ - public sensitivityScore?: (google.cloud.securitycenter.v1.ISensitivityScore|null); - - /** - * Creates a new InfoType instance using the specified properties. - * @param [properties] Properties to set - * @returns InfoType instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IInfoType): google.cloud.securitycenter.v1.InfoType; - - /** - * Encodes the specified InfoType message. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. - * @param message InfoType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IInfoType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InfoType message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. - * @param message InfoType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IInfoType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InfoType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InfoType - * @throws {Error} If the payload is not a reader 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.InfoType; - - /** - * Decodes an InfoType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InfoType - * @throws {Error} If the payload is not 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.InfoType; - - /** - * Verifies an InfoType message. - * @param message Plain 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 InfoType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InfoType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.InfoType; - - /** - * Creates a plain object from an InfoType message. Also converts values to other types if specified. - * @param message InfoType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.InfoType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InfoType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InfoType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SensitivityScore. */ - interface ISensitivityScore { - - /** SensitivityScore score */ - score?: (google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|keyof typeof google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|null); - } - - /** Represents a SensitivityScore. */ - class SensitivityScore implements ISensitivityScore { - - /** - * Constructs a new SensitivityScore. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISensitivityScore); - - /** SensitivityScore score. */ - public score: (google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|keyof typeof google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel); - - /** - * Creates a new SensitivityScore instance using the specified properties. - * @param [properties] Properties to set - * @returns SensitivityScore instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISensitivityScore): google.cloud.securitycenter.v1.SensitivityScore; - - /** - * Encodes the specified SensitivityScore message. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. - * @param message SensitivityScore message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISensitivityScore, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SensitivityScore message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. - * @param message SensitivityScore message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISensitivityScore, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SensitivityScore message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SensitivityScore - * @throws {Error} If the payload is not a reader 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.SensitivityScore; - - /** - * Decodes a SensitivityScore message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SensitivityScore - * @throws {Error} If the payload is not 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.SensitivityScore; - - /** - * Verifies a SensitivityScore message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SensitivityScore message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SensitivityScore - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SensitivityScore; - - /** - * Creates a plain object from a SensitivityScore message. Also converts values to other types if specified. - * @param message SensitivityScore - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SensitivityScore, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SensitivityScore to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SensitivityScore - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SensitivityScore { - - /** SensitivityScoreLevel enum. */ - enum SensitivityScoreLevel { - SENSITIVITY_SCORE_LEVEL_UNSPECIFIED = 0, - SENSITIVITY_LOW = 10, - SENSITIVITY_UNKNOWN = 12, - SENSITIVITY_MODERATE = 20, - SENSITIVITY_HIGH = 30 - } - } - - /** Properties of a CloudDlpInspection. */ - interface ICloudDlpInspection { - - /** CloudDlpInspection inspectJob */ - inspectJob?: (string|null); - - /** CloudDlpInspection infoType */ - infoType?: (string|null); - - /** CloudDlpInspection infoTypeCount */ - infoTypeCount?: (number|Long|string|null); - - /** CloudDlpInspection fullScan */ - fullScan?: (boolean|null); - } - - /** Represents a CloudDlpInspection. */ - class CloudDlpInspection implements ICloudDlpInspection { - - /** - * Constructs a new CloudDlpInspection. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICloudDlpInspection); - - /** CloudDlpInspection inspectJob. */ - public inspectJob: string; - - /** CloudDlpInspection infoType. */ - public infoType: string; - - /** CloudDlpInspection infoTypeCount. */ - public infoTypeCount: (number|Long|string); - - /** CloudDlpInspection fullScan. */ - public fullScan: boolean; - - /** - * Creates a new CloudDlpInspection instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudDlpInspection instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICloudDlpInspection): google.cloud.securitycenter.v1.CloudDlpInspection; - - /** - * Encodes the specified CloudDlpInspection message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpInspection.verify|verify} messages. - * @param message CloudDlpInspection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICloudDlpInspection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudDlpInspection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpInspection.verify|verify} messages. - * @param message CloudDlpInspection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICloudDlpInspection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudDlpInspection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudDlpInspection - * @throws {Error} If the payload is not a reader 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.CloudDlpInspection; - - /** - * Decodes a CloudDlpInspection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudDlpInspection - * @throws {Error} If the payload is not 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.CloudDlpInspection; - - /** - * Verifies a CloudDlpInspection message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudDlpInspection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudDlpInspection - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CloudDlpInspection; - - /** - * Creates a plain object from a CloudDlpInspection message. Also converts values to other types if specified. - * @param message CloudDlpInspection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CloudDlpInspection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudDlpInspection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudDlpInspection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** Protocol enum. */ - enum Protocol { - PROTOCOL_UNSPECIFIED = 0, - ICMP = 1, - TCP = 6, - UDP = 17, - GRE = 47, - ESP = 50 - } - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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); - - /** Container createTime */ - createTime?: (google.protobuf.ITimestamp|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[]; - - /** Container createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** - * 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 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); - - /** Database version */ - version?: (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[]; - - /** Database version. */ - public version: 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 EffectiveEventThreatDetectionCustomModule. */ - interface IEffectiveEventThreatDetectionCustomModule { - - /** EffectiveEventThreatDetectionCustomModule name */ - name?: (string|null); - - /** EffectiveEventThreatDetectionCustomModule config */ - config?: (google.protobuf.IStruct|null); - - /** EffectiveEventThreatDetectionCustomModule enablementState */ - enablementState?: (google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState|null); - - /** EffectiveEventThreatDetectionCustomModule type */ - type?: (string|null); - - /** EffectiveEventThreatDetectionCustomModule displayName */ - displayName?: (string|null); - - /** EffectiveEventThreatDetectionCustomModule description */ - description?: (string|null); - } - - /** Represents an EffectiveEventThreatDetectionCustomModule. */ - class EffectiveEventThreatDetectionCustomModule implements IEffectiveEventThreatDetectionCustomModule { - - /** - * Constructs a new EffectiveEventThreatDetectionCustomModule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule); - - /** EffectiveEventThreatDetectionCustomModule name. */ - public name: string; - - /** EffectiveEventThreatDetectionCustomModule config. */ - public config?: (google.protobuf.IStruct|null); - - /** EffectiveEventThreatDetectionCustomModule enablementState. */ - public enablementState: (google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState); - - /** EffectiveEventThreatDetectionCustomModule type. */ - public type: string; - - /** EffectiveEventThreatDetectionCustomModule displayName. */ - public displayName: string; - - /** EffectiveEventThreatDetectionCustomModule description. */ - public description: string; - - /** - * Creates a new EffectiveEventThreatDetectionCustomModule instance using the specified properties. - * @param [properties] Properties to set - * @returns EffectiveEventThreatDetectionCustomModule instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule): google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule; - - /** - * Encodes the specified EffectiveEventThreatDetectionCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify|verify} messages. - * @param message EffectiveEventThreatDetectionCustomModule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EffectiveEventThreatDetectionCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify|verify} messages. - * @param message EffectiveEventThreatDetectionCustomModule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EffectiveEventThreatDetectionCustomModule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EffectiveEventThreatDetectionCustomModule - * @throws {Error} If the payload is not a reader 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.EffectiveEventThreatDetectionCustomModule; - - /** - * Decodes an EffectiveEventThreatDetectionCustomModule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EffectiveEventThreatDetectionCustomModule - * @throws {Error} If the payload is not 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.EffectiveEventThreatDetectionCustomModule; - - /** - * Verifies an EffectiveEventThreatDetectionCustomModule message. - * @param message Plain 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 EffectiveEventThreatDetectionCustomModule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EffectiveEventThreatDetectionCustomModule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule; - - /** - * Creates a plain object from an EffectiveEventThreatDetectionCustomModule message. Also converts values to other types if specified. - * @param message EffectiveEventThreatDetectionCustomModule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EffectiveEventThreatDetectionCustomModule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EffectiveEventThreatDetectionCustomModule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EffectiveEventThreatDetectionCustomModule { - - /** EnablementState enum. */ - enum EnablementState { - ENABLEMENT_STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2 - } - } - - /** Properties of an EffectiveSecurityHealthAnalyticsCustomModule. */ - interface IEffectiveSecurityHealthAnalyticsCustomModule { - - /** EffectiveSecurityHealthAnalyticsCustomModule name */ - name?: (string|null); - - /** EffectiveSecurityHealthAnalyticsCustomModule customConfig */ - customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); - - /** EffectiveSecurityHealthAnalyticsCustomModule enablementState */ - enablementState?: (google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState|null); - - /** EffectiveSecurityHealthAnalyticsCustomModule displayName */ - displayName?: (string|null); - } - - /** Represents an EffectiveSecurityHealthAnalyticsCustomModule. */ - class EffectiveSecurityHealthAnalyticsCustomModule implements IEffectiveSecurityHealthAnalyticsCustomModule { - - /** - * Constructs a new EffectiveSecurityHealthAnalyticsCustomModule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule); - - /** EffectiveSecurityHealthAnalyticsCustomModule name. */ - public name: string; - - /** EffectiveSecurityHealthAnalyticsCustomModule customConfig. */ - public customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); - - /** EffectiveSecurityHealthAnalyticsCustomModule enablementState. */ - public enablementState: (google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState); - - /** EffectiveSecurityHealthAnalyticsCustomModule displayName. */ - public displayName: string; - - /** - * Creates a new EffectiveSecurityHealthAnalyticsCustomModule instance using the specified properties. - * @param [properties] Properties to set - * @returns EffectiveSecurityHealthAnalyticsCustomModule instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule): google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule; - - /** - * Encodes the specified EffectiveSecurityHealthAnalyticsCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify|verify} messages. - * @param message EffectiveSecurityHealthAnalyticsCustomModule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EffectiveSecurityHealthAnalyticsCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify|verify} messages. - * @param message EffectiveSecurityHealthAnalyticsCustomModule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EffectiveSecurityHealthAnalyticsCustomModule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EffectiveSecurityHealthAnalyticsCustomModule - * @throws {Error} If the payload is not a reader 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.EffectiveSecurityHealthAnalyticsCustomModule; - - /** - * Decodes an EffectiveSecurityHealthAnalyticsCustomModule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EffectiveSecurityHealthAnalyticsCustomModule - * @throws {Error} If the payload is not 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.EffectiveSecurityHealthAnalyticsCustomModule; - - /** - * Verifies an EffectiveSecurityHealthAnalyticsCustomModule message. - * @param message Plain 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 EffectiveSecurityHealthAnalyticsCustomModule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EffectiveSecurityHealthAnalyticsCustomModule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule; - - /** - * Creates a plain object from an EffectiveSecurityHealthAnalyticsCustomModule message. Also converts values to other types if specified. - * @param message EffectiveSecurityHealthAnalyticsCustomModule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EffectiveSecurityHealthAnalyticsCustomModule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EffectiveSecurityHealthAnalyticsCustomModule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EffectiveSecurityHealthAnalyticsCustomModule { - - /** EnablementState enum. */ - enum EnablementState { - ENABLEMENT_STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2 - } - } - - /** Properties of a CustomConfig. */ - interface ICustomConfig { - - /** CustomConfig predicate */ - predicate?: (google.type.IExpr|null); - - /** CustomConfig customOutput */ - customOutput?: (google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec|null); - - /** CustomConfig resourceSelector */ - resourceSelector?: (google.cloud.securitycenter.v1.CustomConfig.IResourceSelector|null); - - /** CustomConfig severity */ - severity?: (google.cloud.securitycenter.v1.CustomConfig.Severity|keyof typeof google.cloud.securitycenter.v1.CustomConfig.Severity|null); - - /** CustomConfig description */ - description?: (string|null); - - /** CustomConfig recommendation */ - recommendation?: (string|null); - } - - /** Represents a CustomConfig. */ - class CustomConfig implements ICustomConfig { - - /** - * Constructs a new CustomConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICustomConfig); - - /** CustomConfig predicate. */ - public predicate?: (google.type.IExpr|null); - - /** CustomConfig customOutput. */ - public customOutput?: (google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec|null); - - /** CustomConfig resourceSelector. */ - public resourceSelector?: (google.cloud.securitycenter.v1.CustomConfig.IResourceSelector|null); - - /** CustomConfig severity. */ - public severity: (google.cloud.securitycenter.v1.CustomConfig.Severity|keyof typeof google.cloud.securitycenter.v1.CustomConfig.Severity); - - /** CustomConfig description. */ - public description: string; - - /** CustomConfig recommendation. */ - public recommendation: string; - - /** - * Creates a new CustomConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomConfig instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICustomConfig): google.cloud.securitycenter.v1.CustomConfig; - - /** - * Encodes the specified CustomConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.verify|verify} messages. - * @param message CustomConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICustomConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.verify|verify} messages. - * @param message CustomConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICustomConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomConfig - * @throws {Error} If the payload is not a reader 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.CustomConfig; - - /** - * Decodes a CustomConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomConfig - * @throws {Error} If the payload is not 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.CustomConfig; - - /** - * Verifies a CustomConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomConfig; - - /** - * Creates a plain object from a CustomConfig message. Also converts values to other types if specified. - * @param message CustomConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CustomConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CustomConfig { - - /** Properties of a CustomOutputSpec. */ - interface ICustomOutputSpec { - - /** CustomOutputSpec properties */ - properties?: (google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty[]|null); - } - - /** Represents a CustomOutputSpec. */ - class CustomOutputSpec implements ICustomOutputSpec { - - /** - * Constructs a new CustomOutputSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec); - - /** CustomOutputSpec properties. */ - public properties: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty[]; - - /** - * Creates a new CustomOutputSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomOutputSpec instance - */ - public static create(properties?: google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec): google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec; - - /** - * Encodes the specified CustomOutputSpec message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify|verify} messages. - * @param message CustomOutputSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomOutputSpec message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify|verify} messages. - * @param message CustomOutputSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomOutputSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomOutputSpec - * @throws {Error} If the payload is not a reader 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.CustomConfig.CustomOutputSpec; - - /** - * Decodes a CustomOutputSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomOutputSpec - * @throws {Error} If the payload is not 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.CustomConfig.CustomOutputSpec; - - /** - * Verifies a CustomOutputSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomOutputSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomOutputSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec; - - /** - * Creates a plain object from a CustomOutputSpec message. Also converts values to other types if specified. - * @param message CustomOutputSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomOutputSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomOutputSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CustomOutputSpec { - - /** Properties of a Property. */ - interface IProperty { - - /** Property name */ - name?: (string|null); - - /** Property valueExpression */ - valueExpression?: (google.type.IExpr|null); - } - - /** Represents a Property. */ - class Property implements IProperty { - - /** - * Constructs a new Property. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty); - - /** Property name. */ - public name: string; - - /** Property valueExpression. */ - public valueExpression?: (google.type.IExpr|null); - - /** - * Creates a new Property instance using the specified properties. - * @param [properties] Properties to set - * @returns Property instance - */ - public static create(properties?: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty): google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property; - - /** - * Encodes the specified Property message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify|verify} messages. - * @param message Property message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify|verify} messages. - * @param message Property message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Property message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Property - * @throws {Error} If the payload is not a reader 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.CustomConfig.CustomOutputSpec.Property; - - /** - * Decodes a Property message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Property - * @throws {Error} If the payload is not 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.CustomConfig.CustomOutputSpec.Property; - - /** - * Verifies a Property message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Property message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Property - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property; - - /** - * Creates a plain object from a Property message. Also converts values to other types if specified. - * @param message Property - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Property to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Property - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ResourceSelector. */ - interface IResourceSelector { - - /** ResourceSelector resourceTypes */ - resourceTypes?: (string[]|null); - } - - /** Represents a ResourceSelector. */ - class ResourceSelector implements IResourceSelector { - - /** - * Constructs a new ResourceSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.CustomConfig.IResourceSelector); - - /** ResourceSelector resourceTypes. */ - public resourceTypes: string[]; - - /** - * Creates a new ResourceSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceSelector instance - */ - public static create(properties?: google.cloud.securitycenter.v1.CustomConfig.IResourceSelector): google.cloud.securitycenter.v1.CustomConfig.ResourceSelector; - - /** - * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify|verify} messages. - * @param message ResourceSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.CustomConfig.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify|verify} messages. - * @param message ResourceSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.CustomConfig.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceSelector - * @throws {Error} If the payload is not a reader 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.CustomConfig.ResourceSelector; - - /** - * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceSelector - * @throws {Error} If the payload is not 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.CustomConfig.ResourceSelector; - - /** - * Verifies a ResourceSelector message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceSelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomConfig.ResourceSelector; - - /** - * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. - * @param message ResourceSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CustomConfig.ResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceSelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - CRITICAL = 1, - HIGH = 2, - MEDIUM = 3, - LOW = 4 - } - } - - /** Properties of an EventThreatDetectionCustomModule. */ - interface IEventThreatDetectionCustomModule { - - /** EventThreatDetectionCustomModule name */ - name?: (string|null); - - /** EventThreatDetectionCustomModule config */ - config?: (google.protobuf.IStruct|null); - - /** EventThreatDetectionCustomModule ancestorModule */ - ancestorModule?: (string|null); - - /** EventThreatDetectionCustomModule enablementState */ - enablementState?: (google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState|null); - - /** EventThreatDetectionCustomModule type */ - type?: (string|null); - - /** EventThreatDetectionCustomModule displayName */ - displayName?: (string|null); - - /** EventThreatDetectionCustomModule description */ - description?: (string|null); - - /** EventThreatDetectionCustomModule updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** EventThreatDetectionCustomModule lastEditor */ - lastEditor?: (string|null); - } - - /** Represents an EventThreatDetectionCustomModule. */ - class EventThreatDetectionCustomModule implements IEventThreatDetectionCustomModule { - - /** - * Constructs a new EventThreatDetectionCustomModule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule); - - /** EventThreatDetectionCustomModule name. */ - public name: string; - - /** EventThreatDetectionCustomModule config. */ - public config?: (google.protobuf.IStruct|null); - - /** EventThreatDetectionCustomModule ancestorModule. */ - public ancestorModule: string; - - /** EventThreatDetectionCustomModule enablementState. */ - public enablementState: (google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState); - - /** EventThreatDetectionCustomModule type. */ - public type: string; - - /** EventThreatDetectionCustomModule displayName. */ - public displayName: string; - - /** EventThreatDetectionCustomModule description. */ - public description: string; - - /** EventThreatDetectionCustomModule updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** EventThreatDetectionCustomModule lastEditor. */ - public lastEditor: string; - - /** - * Creates a new EventThreatDetectionCustomModule instance using the specified properties. - * @param [properties] Properties to set - * @returns EventThreatDetectionCustomModule instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule): google.cloud.securitycenter.v1.EventThreatDetectionCustomModule; - - /** - * Encodes the specified EventThreatDetectionCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify|verify} messages. - * @param message EventThreatDetectionCustomModule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EventThreatDetectionCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify|verify} messages. - * @param message EventThreatDetectionCustomModule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EventThreatDetectionCustomModule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EventThreatDetectionCustomModule - * @throws {Error} If the payload is not a reader 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.EventThreatDetectionCustomModule; - - /** - * Decodes an EventThreatDetectionCustomModule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EventThreatDetectionCustomModule - * @throws {Error} If the payload is not 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.EventThreatDetectionCustomModule; - - /** - * Verifies an EventThreatDetectionCustomModule message. - * @param message Plain 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 EventThreatDetectionCustomModule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EventThreatDetectionCustomModule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.EventThreatDetectionCustomModule; - - /** - * Creates a plain object from an EventThreatDetectionCustomModule message. Also converts values to other types if specified. - * @param message EventThreatDetectionCustomModule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.EventThreatDetectionCustomModule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EventThreatDetectionCustomModule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EventThreatDetectionCustomModule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EventThreatDetectionCustomModule { - - /** EnablementState enum. */ - enum EnablementState { - ENABLEMENT_STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2, - INHERITED = 3 - } - } - - /** Properties of a CustomModuleValidationErrors. */ - interface ICustomModuleValidationErrors { - - /** CustomModuleValidationErrors errors */ - errors?: (google.cloud.securitycenter.v1.ICustomModuleValidationError[]|null); - } - - /** Represents a CustomModuleValidationErrors. */ - class CustomModuleValidationErrors implements ICustomModuleValidationErrors { - - /** - * Constructs a new CustomModuleValidationErrors. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICustomModuleValidationErrors); - - /** CustomModuleValidationErrors errors. */ - public errors: google.cloud.securitycenter.v1.ICustomModuleValidationError[]; - - /** - * Creates a new CustomModuleValidationErrors instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomModuleValidationErrors instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICustomModuleValidationErrors): google.cloud.securitycenter.v1.CustomModuleValidationErrors; - - /** - * Encodes the specified CustomModuleValidationErrors message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify|verify} messages. - * @param message CustomModuleValidationErrors message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICustomModuleValidationErrors, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomModuleValidationErrors message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify|verify} messages. - * @param message CustomModuleValidationErrors message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICustomModuleValidationErrors, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomModuleValidationErrors message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomModuleValidationErrors - * @throws {Error} If the payload is not a reader 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.CustomModuleValidationErrors; - - /** - * Decodes a CustomModuleValidationErrors message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomModuleValidationErrors - * @throws {Error} If the payload is not 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.CustomModuleValidationErrors; - - /** - * Verifies a CustomModuleValidationErrors message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomModuleValidationErrors message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomModuleValidationErrors - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomModuleValidationErrors; - - /** - * Creates a plain object from a CustomModuleValidationErrors message. Also converts values to other types if specified. - * @param message CustomModuleValidationErrors - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CustomModuleValidationErrors, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomModuleValidationErrors to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomModuleValidationErrors - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomModuleValidationError. */ - interface ICustomModuleValidationError { - - /** CustomModuleValidationError description */ - description?: (string|null); - - /** CustomModuleValidationError fieldPath */ - fieldPath?: (string|null); - - /** CustomModuleValidationError start */ - start?: (google.cloud.securitycenter.v1.IPosition|null); - - /** CustomModuleValidationError end */ - end?: (google.cloud.securitycenter.v1.IPosition|null); - } - - /** Represents a CustomModuleValidationError. */ - class CustomModuleValidationError implements ICustomModuleValidationError { - - /** - * Constructs a new CustomModuleValidationError. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICustomModuleValidationError); - - /** CustomModuleValidationError description. */ - public description: string; - - /** CustomModuleValidationError fieldPath. */ - public fieldPath: string; - - /** CustomModuleValidationError start. */ - public start?: (google.cloud.securitycenter.v1.IPosition|null); - - /** CustomModuleValidationError end. */ - public end?: (google.cloud.securitycenter.v1.IPosition|null); - - /** - * Creates a new CustomModuleValidationError instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomModuleValidationError instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICustomModuleValidationError): google.cloud.securitycenter.v1.CustomModuleValidationError; - - /** - * Encodes the specified CustomModuleValidationError message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationError.verify|verify} messages. - * @param message CustomModuleValidationError message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICustomModuleValidationError, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomModuleValidationError message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationError.verify|verify} messages. - * @param message CustomModuleValidationError message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICustomModuleValidationError, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomModuleValidationError message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomModuleValidationError - * @throws {Error} If the payload is not a reader 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.CustomModuleValidationError; - - /** - * Decodes a CustomModuleValidationError message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomModuleValidationError - * @throws {Error} If the payload is not 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.CustomModuleValidationError; - - /** - * Verifies a CustomModuleValidationError message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomModuleValidationError message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomModuleValidationError - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CustomModuleValidationError; - - /** - * Creates a plain object from a CustomModuleValidationError message. Also converts values to other types if specified. - * @param message CustomModuleValidationError - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CustomModuleValidationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomModuleValidationError to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomModuleValidationError - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Position. */ - interface IPosition { - - /** Position lineNumber */ - lineNumber?: (number|null); - - /** Position columnNumber */ - columnNumber?: (number|null); - } - - /** Represents a Position. */ - class Position implements IPosition { - - /** - * Constructs a new Position. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IPosition); - - /** Position lineNumber. */ - public lineNumber: number; - - /** Position columnNumber. */ - public columnNumber: number; - - /** - * Creates a new Position instance using the specified properties. - * @param [properties] Properties to set - * @returns Position instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IPosition): google.cloud.securitycenter.v1.Position; - - /** - * Encodes the specified Position message. Does not implicitly {@link google.cloud.securitycenter.v1.Position.verify|verify} messages. - * @param message Position message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Position.verify|verify} messages. - * @param message Position message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Position message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Position - * @throws {Error} If the payload is not a reader 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.Position; - - /** - * Decodes a Position message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Position - * @throws {Error} If the payload is not 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.Position; - - /** - * Verifies a Position message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Position message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Position - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Position; - - /** - * Creates a plain object from a Position message. Also converts values to other types if specified. - * @param message Position - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Position, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Position to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Position - * @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 { - - /** Exfiltration sources */ - sources?: (google.cloud.securitycenter.v1.IExfilResource[]|null); - - /** Exfiltration targets */ - targets?: (google.cloud.securitycenter.v1.IExfilResource[]|null); - - /** Exfiltration totalExfiltratedBytes */ - totalExfiltratedBytes?: (number|Long|string|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[]; - - /** Exfiltration totalExfiltratedBytes. */ - public totalExfiltratedBytes: (number|Long|string); - - /** - * 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 ExternalExposure. */ - interface IExternalExposure { - - /** ExternalExposure privateIpAddress */ - privateIpAddress?: (string|null); - - /** ExternalExposure privatePort */ - privatePort?: (string|null); - - /** ExternalExposure exposedService */ - exposedService?: (string|null); - - /** ExternalExposure publicIpAddress */ - publicIpAddress?: (string|null); - - /** ExternalExposure publicPort */ - publicPort?: (string|null); - - /** ExternalExposure exposedEndpoint */ - exposedEndpoint?: (string|null); - - /** ExternalExposure loadBalancerFirewallPolicy */ - loadBalancerFirewallPolicy?: (string|null); - - /** ExternalExposure serviceFirewallPolicy */ - serviceFirewallPolicy?: (string|null); - - /** ExternalExposure forwardingRule */ - forwardingRule?: (string|null); - - /** ExternalExposure backendService */ - backendService?: (string|null); - - /** ExternalExposure instanceGroup */ - instanceGroup?: (string|null); - - /** ExternalExposure networkEndpointGroup */ - networkEndpointGroup?: (string|null); - } - - /** Represents an ExternalExposure. */ - class ExternalExposure implements IExternalExposure { - - /** - * Constructs a new ExternalExposure. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IExternalExposure); - - /** ExternalExposure privateIpAddress. */ - public privateIpAddress: string; - - /** ExternalExposure privatePort. */ - public privatePort: string; - - /** ExternalExposure exposedService. */ - public exposedService: string; - - /** ExternalExposure publicIpAddress. */ - public publicIpAddress: string; - - /** ExternalExposure publicPort. */ - public publicPort: string; - - /** ExternalExposure exposedEndpoint. */ - public exposedEndpoint: string; - - /** ExternalExposure loadBalancerFirewallPolicy. */ - public loadBalancerFirewallPolicy: string; - - /** ExternalExposure serviceFirewallPolicy. */ - public serviceFirewallPolicy: string; - - /** ExternalExposure forwardingRule. */ - public forwardingRule: string; - - /** ExternalExposure backendService. */ - public backendService: string; - - /** ExternalExposure instanceGroup. */ - public instanceGroup: string; - - /** ExternalExposure networkEndpointGroup. */ - public networkEndpointGroup: string; - - /** - * Creates a new ExternalExposure instance using the specified properties. - * @param [properties] Properties to set - * @returns ExternalExposure instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IExternalExposure): google.cloud.securitycenter.v1.ExternalExposure; - - /** - * Encodes the specified ExternalExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. - * @param message ExternalExposure message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IExternalExposure, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExternalExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. - * @param message ExternalExposure message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IExternalExposure, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExternalExposure message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExternalExposure - * @throws {Error} If the payload is not a reader 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.ExternalExposure; - - /** - * Decodes an ExternalExposure message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExternalExposure - * @throws {Error} If the payload is not 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.ExternalExposure; - - /** - * Verifies an ExternalExposure message. - * @param message Plain 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 ExternalExposure message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExternalExposure - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExternalExposure; - - /** - * Creates a plain object from an ExternalExposure message. Also converts values to other types if specified. - * @param message ExternalExposure - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ExternalExposure, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExternalExposure to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExternalExposure - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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); - - /** ExternalSystem caseUri */ - caseUri?: (string|null); - - /** ExternalSystem casePriority */ - casePriority?: (string|null); - - /** ExternalSystem caseSla */ - caseSla?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem caseCreateTime */ - caseCreateTime?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem caseCloseTime */ - caseCloseTime?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem ticketInfo */ - ticketInfo?: (google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo|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); - - /** ExternalSystem caseUri. */ - public caseUri: string; - - /** ExternalSystem casePriority. */ - public casePriority: string; - - /** ExternalSystem caseSla. */ - public caseSla?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem caseCreateTime. */ - public caseCreateTime?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem caseCloseTime. */ - public caseCloseTime?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem ticketInfo. */ - public ticketInfo?: (google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo|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 }; - - /** - * 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; - } - - namespace ExternalSystem { - - /** Properties of a TicketInfo. */ - interface ITicketInfo { - - /** TicketInfo id */ - id?: (string|null); - - /** TicketInfo assignee */ - assignee?: (string|null); - - /** TicketInfo description */ - description?: (string|null); - - /** TicketInfo uri */ - uri?: (string|null); - - /** TicketInfo status */ - status?: (string|null); - - /** TicketInfo updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TicketInfo. */ - class TicketInfo implements ITicketInfo { - - /** - * Constructs a new TicketInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo); - - /** TicketInfo id. */ - public id: string; - - /** TicketInfo assignee. */ - public assignee: string; - - /** TicketInfo description. */ - public description: string; - - /** TicketInfo uri. */ - public uri: string; - - /** TicketInfo status. */ - public status: string; - - /** TicketInfo updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new TicketInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns TicketInfo instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo): google.cloud.securitycenter.v1.ExternalSystem.TicketInfo; - - /** - * Encodes the specified TicketInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify|verify} messages. - * @param message TicketInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TicketInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify|verify} messages. - * @param message TicketInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TicketInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TicketInfo - * @throws {Error} If the payload is not a reader 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.TicketInfo; - - /** - * Decodes a TicketInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TicketInfo - * @throws {Error} If the payload is not 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.TicketInfo; - - /** - * Verifies a TicketInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TicketInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TicketInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExternalSystem.TicketInfo; - - /** - * Creates a plain object from a TicketInfo message. Also converts values to other types if specified. - * @param message TicketInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ExternalSystem.TicketInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TicketInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TicketInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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); - - /** File diskPath */ - diskPath?: (google.cloud.securitycenter.v1.File.IDiskPath|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; - - /** File diskPath. */ - public diskPath?: (google.cloud.securitycenter.v1.File.IDiskPath|null); - - /** - * 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 }; - - /** - * 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; - } - - namespace File { - - /** Properties of a DiskPath. */ - interface IDiskPath { - - /** DiskPath partitionUuid */ - partitionUuid?: (string|null); - - /** DiskPath relativePath */ - relativePath?: (string|null); - } - - /** Represents a DiskPath. */ - class DiskPath implements IDiskPath { - - /** - * Constructs a new DiskPath. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.File.IDiskPath); - - /** DiskPath partitionUuid. */ - public partitionUuid: string; - - /** DiskPath relativePath. */ - public relativePath: string; - - /** - * Creates a new DiskPath instance using the specified properties. - * @param [properties] Properties to set - * @returns DiskPath instance - */ - public static create(properties?: google.cloud.securitycenter.v1.File.IDiskPath): google.cloud.securitycenter.v1.File.DiskPath; - - /** - * Encodes the specified DiskPath message. Does not implicitly {@link google.cloud.securitycenter.v1.File.DiskPath.verify|verify} messages. - * @param message DiskPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.File.IDiskPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiskPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.DiskPath.verify|verify} messages. - * @param message DiskPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.File.IDiskPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiskPath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiskPath - * @throws {Error} If the payload is not a reader 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.DiskPath; - - /** - * Decodes a DiskPath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiskPath - * @throws {Error} If the payload is not 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.DiskPath; - - /** - * Verifies a DiskPath message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiskPath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiskPath - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.File.DiskPath; - - /** - * Creates a plain object from a DiskPath message. Also converts values to other types if specified. - * @param message DiskPath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.File.DiskPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiskPath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiskPath - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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); - - /** Finding severity */ - severity?: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity|null); - - /** 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); - - /** Finding indicator */ - indicator?: (google.cloud.securitycenter.v1.IIndicator|null); - - /** Finding vulnerability */ - vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); - - /** Finding muteUpdateTime */ - muteUpdateTime?: (google.protobuf.ITimestamp|null); - - /** 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); - - /** Finding connections */ - connections?: (google.cloud.securitycenter.v1.IConnection[]|null); - - /** Finding muteInitiator */ - muteInitiator?: (string|null); - - /** Finding muteInfo */ - muteInfo?: (google.cloud.securitycenter.v1.Finding.IMuteInfo|null); - - /** 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); - - /** Finding parentDisplayName */ - parentDisplayName?: (string|null); - - /** Finding description */ - description?: (string|null); - - /** Finding exfiltration */ - exfiltration?: (google.cloud.securitycenter.v1.IExfiltration|null); - - /** Finding iamBindings */ - iamBindings?: (google.cloud.securitycenter.v1.IIamBinding[]|null); - - /** Finding nextSteps */ - nextSteps?: (string|null); - - /** Finding moduleName */ - moduleName?: (string|null); - - /** Finding containers */ - containers?: (google.cloud.securitycenter.v1.IContainer[]|null); - - /** Finding kubernetes */ - kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); - - /** Finding database */ - database?: (google.cloud.securitycenter.v1.IDatabase|null); - - /** Finding attackExposure */ - attackExposure?: (google.cloud.securitycenter.v1.IAttackExposure|null); - - /** Finding files */ - files?: (google.cloud.securitycenter.v1.IFile[]|null); - - /** Finding cloudDlpInspection */ - cloudDlpInspection?: (google.cloud.securitycenter.v1.ICloudDlpInspection|null); - - /** Finding cloudDlpDataProfile */ - cloudDlpDataProfile?: (google.cloud.securitycenter.v1.ICloudDlpDataProfile|null); - - /** Finding kernelRootkit */ - kernelRootkit?: (google.cloud.securitycenter.v1.IKernelRootkit|null); - - /** Finding orgPolicies */ - orgPolicies?: (google.cloud.securitycenter.v1.IOrgPolicy[]|null); - - /** Finding application */ - application?: (google.cloud.securitycenter.v1.IApplication|null); - - /** Finding backupDisasterRecovery */ - backupDisasterRecovery?: (google.cloud.securitycenter.v1.IBackupDisasterRecovery|null); - - /** Finding securityPosture */ - securityPosture?: (google.cloud.securitycenter.v1.ISecurityPosture|null); - - /** Finding logEntries */ - logEntries?: (google.cloud.securitycenter.v1.ILogEntry[]|null); - - /** Finding loadBalancers */ - loadBalancers?: (google.cloud.securitycenter.v1.ILoadBalancer[]|null); - - /** Finding cloudArmor */ - cloudArmor?: (google.cloud.securitycenter.v1.ICloudArmor|null); - - /** Finding notebook */ - notebook?: (google.cloud.securitycenter.v1.INotebook|null); - - /** Finding toxicCombination */ - toxicCombination?: (google.cloud.securitycenter.v1.IToxicCombination|null); - - /** Finding groupMemberships */ - groupMemberships?: (google.cloud.securitycenter.v1.IGroupMembership[]|null); - - /** Finding chokepoint */ - chokepoint?: (google.cloud.securitycenter.v1.IChokepoint|null); - - /** Finding externalExposure */ - externalExposure?: (google.cloud.securitycenter.v1.IExternalExposure|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); - - /** Finding severity. */ - public severity: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity); - - /** 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); - - /** Finding indicator. */ - public indicator?: (google.cloud.securitycenter.v1.IIndicator|null); - - /** Finding vulnerability. */ - public vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); - - /** Finding muteUpdateTime. */ - public muteUpdateTime?: (google.protobuf.ITimestamp|null); - - /** 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); - - /** Finding connections. */ - public connections: google.cloud.securitycenter.v1.IConnection[]; - - /** Finding muteInitiator. */ - public muteInitiator: string; - - /** Finding muteInfo. */ - public muteInfo?: (google.cloud.securitycenter.v1.Finding.IMuteInfo|null); - - /** 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[]; - - /** Finding parentDisplayName. */ - public parentDisplayName: string; - - /** Finding description. */ - public description: string; - - /** Finding exfiltration. */ - public exfiltration?: (google.cloud.securitycenter.v1.IExfiltration|null); - - /** Finding iamBindings. */ - public iamBindings: google.cloud.securitycenter.v1.IIamBinding[]; - - /** Finding nextSteps. */ - public nextSteps: string; - - /** Finding moduleName. */ - public moduleName: string; - - /** Finding containers. */ - public containers: google.cloud.securitycenter.v1.IContainer[]; - - /** Finding kubernetes. */ - public kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); - - /** Finding database. */ - public database?: (google.cloud.securitycenter.v1.IDatabase|null); - - /** Finding attackExposure. */ - public attackExposure?: (google.cloud.securitycenter.v1.IAttackExposure|null); - - /** Finding files. */ - public files: google.cloud.securitycenter.v1.IFile[]; - - /** Finding cloudDlpInspection. */ - public cloudDlpInspection?: (google.cloud.securitycenter.v1.ICloudDlpInspection|null); - - /** Finding cloudDlpDataProfile. */ - public cloudDlpDataProfile?: (google.cloud.securitycenter.v1.ICloudDlpDataProfile|null); - - /** Finding kernelRootkit. */ - public kernelRootkit?: (google.cloud.securitycenter.v1.IKernelRootkit|null); - - /** Finding orgPolicies. */ - public orgPolicies: google.cloud.securitycenter.v1.IOrgPolicy[]; - - /** Finding application. */ - public application?: (google.cloud.securitycenter.v1.IApplication|null); - - /** Finding backupDisasterRecovery. */ - public backupDisasterRecovery?: (google.cloud.securitycenter.v1.IBackupDisasterRecovery|null); - - /** Finding securityPosture. */ - public securityPosture?: (google.cloud.securitycenter.v1.ISecurityPosture|null); - - /** Finding logEntries. */ - public logEntries: google.cloud.securitycenter.v1.ILogEntry[]; - - /** Finding loadBalancers. */ - public loadBalancers: google.cloud.securitycenter.v1.ILoadBalancer[]; - - /** Finding cloudArmor. */ - public cloudArmor?: (google.cloud.securitycenter.v1.ICloudArmor|null); - - /** Finding notebook. */ - public notebook?: (google.cloud.securitycenter.v1.INotebook|null); - - /** Finding toxicCombination. */ - public toxicCombination?: (google.cloud.securitycenter.v1.IToxicCombination|null); - - /** Finding groupMemberships. */ - public groupMemberships: google.cloud.securitycenter.v1.IGroupMembership[]; - - /** Finding chokepoint. */ - public chokepoint?: (google.cloud.securitycenter.v1.IChokepoint|null); - - /** Finding externalExposure. */ - public externalExposure?: (google.cloud.securitycenter.v1.IExternalExposure|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 }; - - /** - * 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 { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INACTIVE = 2 - } - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - CRITICAL = 1, - HIGH = 2, - MEDIUM = 3, - LOW = 4 - } - - /** Mute enum. */ - enum Mute { - MUTE_UNSPECIFIED = 0, - MUTED = 1, - UNMUTED = 2, - UNDEFINED = 4 - } - - /** FindingClass enum. */ - enum FindingClass { - FINDING_CLASS_UNSPECIFIED = 0, - THREAT = 1, - VULNERABILITY = 2, - MISCONFIGURATION = 3, - OBSERVATION = 4, - SCC_ERROR = 5, - POSTURE_VIOLATION = 6, - TOXIC_COMBINATION = 7, - SENSITIVE_DATA_RISK = 8, - CHOKEPOINT = 9, - EXTERNAL_EXPOSURE = 10 - } - - /** Properties of a MuteInfo. */ - interface IMuteInfo { - - /** MuteInfo staticMute */ - staticMute?: (google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute|null); - - /** MuteInfo dynamicMuteRecords */ - dynamicMuteRecords?: (google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord[]|null); - } - - /** Represents a MuteInfo. */ - class MuteInfo implements IMuteInfo { - - /** - * Constructs a new MuteInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.Finding.IMuteInfo); - - /** MuteInfo staticMute. */ - public staticMute?: (google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute|null); - - /** MuteInfo dynamicMuteRecords. */ - public dynamicMuteRecords: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord[]; - - /** - * Creates a new MuteInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns MuteInfo instance - */ - public static create(properties?: google.cloud.securitycenter.v1.Finding.IMuteInfo): google.cloud.securitycenter.v1.Finding.MuteInfo; - - /** - * Encodes the specified MuteInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.verify|verify} messages. - * @param message MuteInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.Finding.IMuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MuteInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.verify|verify} messages. - * @param message MuteInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.Finding.IMuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MuteInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MuteInfo - * @throws {Error} If the payload is not a reader 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.MuteInfo; - - /** - * Decodes a MuteInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MuteInfo - * @throws {Error} If the payload is not 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.MuteInfo; - - /** - * Verifies a MuteInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MuteInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MuteInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding.MuteInfo; - - /** - * Creates a plain object from a MuteInfo message. Also converts values to other types if specified. - * @param message MuteInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Finding.MuteInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MuteInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MuteInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MuteInfo { - - /** Properties of a StaticMute. */ - interface IStaticMute { - - /** StaticMute state */ - state?: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute|null); - - /** StaticMute applyTime */ - applyTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a StaticMute. */ - class StaticMute implements IStaticMute { - - /** - * Constructs a new StaticMute. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute); - - /** StaticMute state. */ - public state: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute); - - /** StaticMute applyTime. */ - public applyTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new StaticMute instance using the specified properties. - * @param [properties] Properties to set - * @returns StaticMute instance - */ - public static create(properties?: google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute): google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute; - - /** - * Encodes the specified StaticMute message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify|verify} messages. - * @param message StaticMute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StaticMute message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify|verify} messages. - * @param message StaticMute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StaticMute message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StaticMute - * @throws {Error} If the payload is not a reader 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.MuteInfo.StaticMute; - - /** - * Decodes a StaticMute message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StaticMute - * @throws {Error} If the payload is not 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.MuteInfo.StaticMute; - - /** - * Verifies a StaticMute message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StaticMute message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StaticMute - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute; - - /** - * Creates a plain object from a StaticMute message. Also converts values to other types if specified. - * @param message StaticMute - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StaticMute to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StaticMute - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DynamicMuteRecord. */ - interface IDynamicMuteRecord { - - /** DynamicMuteRecord muteConfig */ - muteConfig?: (string|null); - - /** DynamicMuteRecord matchTime */ - matchTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DynamicMuteRecord. */ - class DynamicMuteRecord implements IDynamicMuteRecord { - - /** - * Constructs a new DynamicMuteRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord); - - /** DynamicMuteRecord muteConfig. */ - public muteConfig: string; - - /** DynamicMuteRecord matchTime. */ - public matchTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new DynamicMuteRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns DynamicMuteRecord instance - */ - public static create(properties?: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord): google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord; - - /** - * Encodes the specified DynamicMuteRecord message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. - * @param message DynamicMuteRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DynamicMuteRecord message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. - * @param message DynamicMuteRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DynamicMuteRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DynamicMuteRecord - * @throws {Error} If the payload is not a reader 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.MuteInfo.DynamicMuteRecord; - - /** - * Decodes a DynamicMuteRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DynamicMuteRecord - * @throws {Error} If the payload is not 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.MuteInfo.DynamicMuteRecord; - - /** - * Verifies a DynamicMuteRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DynamicMuteRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DynamicMuteRecord - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord; - - /** - * Creates a plain object from a DynamicMuteRecord message. Also converts values to other types if specified. - * @param message DynamicMuteRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DynamicMuteRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DynamicMuteRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a GroupMembership. */ - interface IGroupMembership { - - /** GroupMembership groupType */ - groupType?: (google.cloud.securitycenter.v1.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v1.GroupMembership.GroupType|null); - - /** GroupMembership groupId */ - groupId?: (string|null); - } - - /** Represents a GroupMembership. */ - class GroupMembership implements IGroupMembership { - - /** - * Constructs a new GroupMembership. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGroupMembership); - - /** GroupMembership groupType. */ - public groupType: (google.cloud.securitycenter.v1.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v1.GroupMembership.GroupType); - - /** GroupMembership groupId. */ - public groupId: string; - - /** - * Creates a new GroupMembership instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupMembership instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGroupMembership): google.cloud.securitycenter.v1.GroupMembership; - - /** - * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. - * @param message GroupMembership message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. - * @param message GroupMembership message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GroupMembership message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupMembership - * @throws {Error} If the payload is not a reader 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.GroupMembership; - - /** - * Decodes a GroupMembership message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupMembership - * @throws {Error} If the payload is not 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.GroupMembership; - - /** - * Verifies a GroupMembership message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupMembership - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupMembership; - - /** - * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. - * @param message GroupMembership - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.GroupMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GroupMembership to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GroupMembership - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GroupMembership { - - /** GroupType enum. */ - enum GroupType { - GROUP_TYPE_UNSPECIFIED = 0, - GROUP_TYPE_TOXIC_COMBINATION = 1, - GROUP_TYPE_CHOKEPOINT = 3 - } - } - - /** 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 }; - - /** - * 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 { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an Indicator. */ - interface IIndicator { - - /** Indicator ipAddresses */ - ipAddresses?: (string[]|null); - - /** Indicator domains */ - domains?: (string[]|null); - - /** Indicator signatures */ - signatures?: (google.cloud.securitycenter.v1.Indicator.IProcessSignature[]|null); - - /** Indicator uris */ - uris?: (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[]; - - /** 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 - * @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 }; - - /** - * 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 { - - /** 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); - - /** ProcessSignature signatureType */ - signatureType?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType|keyof typeof google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType|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 signatureType. */ - public signatureType: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType|keyof typeof google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType); - - /** 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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; - } - } - - /** 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 }; - - /** - * 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; - } - - /** SignatureType enum. */ - enum SignatureType { - SIGNATURE_TYPE_UNSPECIFIED = 0, - SIGNATURE_TYPE_PROCESS = 1, - SIGNATURE_TYPE_FILE = 2 - } - } - } - - /** Properties of a KernelRootkit. */ - interface IKernelRootkit { - - /** KernelRootkit name */ - name?: (string|null); - - /** KernelRootkit unexpectedCodeModification */ - unexpectedCodeModification?: (boolean|null); - - /** KernelRootkit unexpectedReadOnlyDataModification */ - unexpectedReadOnlyDataModification?: (boolean|null); - - /** KernelRootkit unexpectedFtraceHandler */ - unexpectedFtraceHandler?: (boolean|null); - - /** KernelRootkit unexpectedKprobeHandler */ - unexpectedKprobeHandler?: (boolean|null); - - /** KernelRootkit unexpectedKernelCodePages */ - unexpectedKernelCodePages?: (boolean|null); - - /** KernelRootkit unexpectedSystemCallHandler */ - unexpectedSystemCallHandler?: (boolean|null); - - /** KernelRootkit unexpectedInterruptHandler */ - unexpectedInterruptHandler?: (boolean|null); - - /** KernelRootkit unexpectedProcessesInRunqueue */ - unexpectedProcessesInRunqueue?: (boolean|null); - } - - /** Represents a KernelRootkit. */ - class KernelRootkit implements IKernelRootkit { - - /** - * Constructs a new KernelRootkit. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IKernelRootkit); - - /** KernelRootkit name. */ - public name: string; - - /** KernelRootkit unexpectedCodeModification. */ - public unexpectedCodeModification: boolean; - - /** KernelRootkit unexpectedReadOnlyDataModification. */ - public unexpectedReadOnlyDataModification: boolean; - - /** KernelRootkit unexpectedFtraceHandler. */ - public unexpectedFtraceHandler: boolean; - - /** KernelRootkit unexpectedKprobeHandler. */ - public unexpectedKprobeHandler: boolean; - - /** KernelRootkit unexpectedKernelCodePages. */ - public unexpectedKernelCodePages: boolean; - - /** KernelRootkit unexpectedSystemCallHandler. */ - public unexpectedSystemCallHandler: boolean; - - /** KernelRootkit unexpectedInterruptHandler. */ - public unexpectedInterruptHandler: boolean; - - /** KernelRootkit unexpectedProcessesInRunqueue. */ - public unexpectedProcessesInRunqueue: boolean; - - /** - * Creates a new KernelRootkit instance using the specified properties. - * @param [properties] Properties to set - * @returns KernelRootkit instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IKernelRootkit): google.cloud.securitycenter.v1.KernelRootkit; - - /** - * Encodes the specified KernelRootkit message. Does not implicitly {@link google.cloud.securitycenter.v1.KernelRootkit.verify|verify} messages. - * @param message KernelRootkit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IKernelRootkit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KernelRootkit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.KernelRootkit.verify|verify} messages. - * @param message KernelRootkit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IKernelRootkit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KernelRootkit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KernelRootkit - * @throws {Error} If the payload is not a reader 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.KernelRootkit; - - /** - * Decodes a KernelRootkit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KernelRootkit - * @throws {Error} If the payload is not 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.KernelRootkit; - - /** - * Verifies a KernelRootkit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KernelRootkit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KernelRootkit - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.KernelRootkit; - - /** - * Creates a plain object from a KernelRootkit message. Also converts values to other types if specified. - * @param message KernelRootkit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.KernelRootkit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KernelRootkit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KernelRootkit - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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); - - /** Kubernetes objects */ - objects?: (google.cloud.securitycenter.v1.Kubernetes.IObject[]|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[]; - - /** Kubernetes objects. */ - public objects: google.cloud.securitycenter.v1.Kubernetes.IObject[]; - - /** - * 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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; - } - - /** Properties of an Object. */ - interface IObject { - - /** Object group */ - group?: (string|null); - - /** Object kind */ - kind?: (string|null); - - /** Object ns */ - ns?: (string|null); - - /** Object name */ - name?: (string|null); - - /** Object containers */ - containers?: (google.cloud.securitycenter.v1.IContainer[]|null); - } - - /** Represents an Object. */ - class Object implements IObject { - - /** - * Constructs a new Object. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IObject); - - /** Object group. */ - public group: string; - - /** Object kind. */ - public kind: string; - - /** Object ns. */ - public ns: string; - - /** Object name. */ - public name: string; - - /** Object containers. */ - public containers: google.cloud.securitycenter.v1.IContainer[]; - - /** - * Creates a new Object instance using the specified properties. - * @param [properties] Properties to set - * @returns Object instance - */ - public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IObject): google.cloud.securitycenter.v1.Kubernetes.object; - - /** - * Encodes the specified Object message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Object.verify|verify} messages. - * @param message Object message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IObject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Object message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Object.verify|verify} messages. - * @param message Object message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IObject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Object message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Object - * @throws {Error} If the payload is not a reader 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.object; - - /** - * Decodes an Object message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Object - * @throws {Error} If the payload is not 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.object; - - /** - * Verifies an Object message. - * @param message Plain 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 Object message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Object - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.object; - - /** - * Creates a plain object from an Object message. Also converts values to other types if specified. - * @param message Object - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.object, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Object to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Object - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a LoadBalancer. */ - interface ILoadBalancer { - - /** LoadBalancer name */ - name?: (string|null); - } - - /** Represents a LoadBalancer. */ - class LoadBalancer implements ILoadBalancer { - - /** - * Constructs a new LoadBalancer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ILoadBalancer); - - /** LoadBalancer name. */ - public name: string; - - /** - * Creates a new LoadBalancer instance using the specified properties. - * @param [properties] Properties to set - * @returns LoadBalancer instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ILoadBalancer): google.cloud.securitycenter.v1.LoadBalancer; - - /** - * Encodes the specified LoadBalancer message. Does not implicitly {@link google.cloud.securitycenter.v1.LoadBalancer.verify|verify} messages. - * @param message LoadBalancer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ILoadBalancer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LoadBalancer message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.LoadBalancer.verify|verify} messages. - * @param message LoadBalancer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ILoadBalancer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LoadBalancer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LoadBalancer - * @throws {Error} If the payload is not a reader 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.LoadBalancer; - - /** - * Decodes a LoadBalancer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LoadBalancer - * @throws {Error} If the payload is not 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.LoadBalancer; - - /** - * Verifies a LoadBalancer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LoadBalancer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LoadBalancer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.LoadBalancer; - - /** - * Creates a plain object from a LoadBalancer message. Also converts values to other types if specified. - * @param message LoadBalancer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.LoadBalancer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LoadBalancer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LoadBalancer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LogEntry. */ - interface ILogEntry { - - /** LogEntry cloudLoggingEntry */ - cloudLoggingEntry?: (google.cloud.securitycenter.v1.ICloudLoggingEntry|null); - } - - /** Represents a LogEntry. */ - class LogEntry implements ILogEntry { - - /** - * Constructs a new LogEntry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ILogEntry); - - /** LogEntry cloudLoggingEntry. */ - public cloudLoggingEntry?: (google.cloud.securitycenter.v1.ICloudLoggingEntry|null); - - /** LogEntry logEntry. */ - public logEntry?: "cloudLoggingEntry"; - - /** - * Creates a new LogEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns LogEntry instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ILogEntry): google.cloud.securitycenter.v1.LogEntry; - - /** - * Encodes the specified LogEntry message. Does not implicitly {@link google.cloud.securitycenter.v1.LogEntry.verify|verify} messages. - * @param message LogEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.LogEntry.verify|verify} messages. - * @param message LogEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LogEntry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LogEntry - * @throws {Error} If the payload is not a reader 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.LogEntry; - - /** - * Decodes a LogEntry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LogEntry - * @throws {Error} If the payload is not 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.LogEntry; - - /** - * Verifies a LogEntry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LogEntry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.LogEntry; - - /** - * Creates a plain object from a LogEntry message. Also converts values to other types if specified. - * @param message LogEntry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.LogEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LogEntry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LogEntry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudLoggingEntry. */ - interface ICloudLoggingEntry { - - /** CloudLoggingEntry insertId */ - insertId?: (string|null); - - /** CloudLoggingEntry logId */ - logId?: (string|null); - - /** CloudLoggingEntry resourceContainer */ - resourceContainer?: (string|null); - - /** CloudLoggingEntry timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CloudLoggingEntry. */ - class CloudLoggingEntry implements ICloudLoggingEntry { - - /** - * Constructs a new CloudLoggingEntry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICloudLoggingEntry); - - /** CloudLoggingEntry insertId. */ - public insertId: string; - - /** CloudLoggingEntry logId. */ - public logId: string; - - /** CloudLoggingEntry resourceContainer. */ - public resourceContainer: string; - - /** CloudLoggingEntry timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CloudLoggingEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudLoggingEntry instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICloudLoggingEntry): google.cloud.securitycenter.v1.CloudLoggingEntry; - - /** - * Encodes the specified CloudLoggingEntry message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudLoggingEntry.verify|verify} messages. - * @param message CloudLoggingEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICloudLoggingEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudLoggingEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudLoggingEntry.verify|verify} messages. - * @param message CloudLoggingEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICloudLoggingEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudLoggingEntry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudLoggingEntry - * @throws {Error} If the payload is not a reader 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.CloudLoggingEntry; - - /** - * Decodes a CloudLoggingEntry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudLoggingEntry - * @throws {Error} If the payload is not 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.CloudLoggingEntry; - - /** - * Verifies a CloudLoggingEntry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudLoggingEntry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudLoggingEntry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CloudLoggingEntry; - - /** - * Creates a plain object from a CloudLoggingEntry message. Also converts values to other types if specified. - * @param message CloudLoggingEntry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CloudLoggingEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudLoggingEntry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudLoggingEntry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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 { - - /** 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, - MASQUERADING = 49, - MATCH_LEGITIMATE_NAME_OR_LOCATION = 50, - BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37, - STARTUP_ITEMS = 38, - NETWORK_SERVICE_DISCOVERY = 32, - PROCESS_DISCOVERY = 56, - COMMAND_AND_SCRIPTING_INTERPRETER = 6, - UNIX_SHELL = 7, - PYTHON = 59, - EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63, - PERMISSION_GROUPS_DISCOVERY = 18, - CLOUD_GROUPS = 19, - INDICATOR_REMOVAL_FILE_DELETION = 64, - APPLICATION_LAYER_PROTOCOL = 45, - DNS = 46, - SOFTWARE_DEPLOYMENT_TOOLS = 47, - VALID_ACCOUNTS = 14, - DEFAULT_ACCOUNTS = 35, - LOCAL_ACCOUNTS = 15, - CLOUD_ACCOUNTS = 16, - PROXY = 9, - EXTERNAL_PROXY = 10, - MULTI_HOP_PROXY = 11, - ACCOUNT_MANIPULATION = 22, - ADDITIONAL_CLOUD_CREDENTIALS = 40, - SSH_AUTHORIZED_KEYS = 23, - ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58, - INGRESS_TOOL_TRANSFER = 3, - NATIVE_API = 4, - BRUTE_FORCE = 44, - SHARED_MODULES = 5, - ACCESS_TOKEN_MANIPULATION = 33, - TOKEN_IMPERSONATION_OR_THEFT = 39, - EXPLOIT_PUBLIC_FACING_APPLICATION = 27, - DOMAIN_POLICY_MODIFICATION = 30, - DATA_DESTRUCTION = 29, - SERVICE_STOP = 52, - INHIBIT_SYSTEM_RECOVERY = 36, - RESOURCE_HIJACKING = 8, - NETWORK_DENIAL_OF_SERVICE = 17, - CLOUD_SERVICE_DISCOVERY = 48, - STEAL_APPLICATION_ACCESS_TOKEN = 42, - ACCOUNT_ACCESS_REMOVAL = 51, - STEAL_WEB_SESSION_COOKIE = 25, - CREATE_OR_MODIFY_SYSTEM_PROCESS = 24, - ABUSE_ELEVATION_CONTROL_MECHANISM = 34, - UNSECURED_CREDENTIALS = 13, - MODIFY_AUTHENTICATION_PROCESS = 28, - IMPAIR_DEFENSES = 31, - DISABLE_OR_MODIFY_TOOLS = 55, - EXFILTRATION_OVER_WEB_SERVICE = 20, - EXFILTRATION_TO_CLOUD_STORAGE = 21, - DYNAMIC_RESOLUTION = 12, - LATERAL_TOOL_TRANSFER = 41, - MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26, - CREATE_SNAPSHOT = 54, - CLOUD_INFRASTRUCTURE_DISCOVERY = 53, - OBTAIN_CAPABILITIES = 43, - ACTIVE_SCANNING = 1, - SCANNING_IP_BLOCKS = 2, - CONTAINER_ADMINISTRATION_COMMAND = 60, - ESCAPE_TO_HOST = 61, - CONTAINER_AND_RESOURCE_DISCOVERY = 57, - STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62 - } - } - - /** Properties of a Notebook. */ - interface INotebook { - - /** Notebook name */ - name?: (string|null); - - /** Notebook service */ - service?: (string|null); - - /** Notebook lastAuthor */ - lastAuthor?: (string|null); - - /** Notebook notebookUpdateTime */ - notebookUpdateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Notebook. */ - class Notebook implements INotebook { - - /** - * Constructs a new Notebook. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.INotebook); - - /** Notebook name. */ - public name: string; - - /** Notebook service. */ - public service: string; - - /** Notebook lastAuthor. */ - public lastAuthor: string; - - /** Notebook notebookUpdateTime. */ - public notebookUpdateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Notebook instance using the specified properties. - * @param [properties] Properties to set - * @returns Notebook instance - */ - public static create(properties?: google.cloud.securitycenter.v1.INotebook): google.cloud.securitycenter.v1.Notebook; - - /** - * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.securitycenter.v1.Notebook.verify|verify} messages. - * @param message Notebook message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Notebook.verify|verify} messages. - * @param message Notebook message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Notebook message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Notebook - * @throws {Error} If the payload is not a reader 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.Notebook; - - /** - * Decodes a Notebook message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Notebook - * @throws {Error} If the payload is not 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.Notebook; - - /** - * Verifies a Notebook message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Notebook message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Notebook - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Notebook; - - /** - * Creates a plain object from a Notebook message. Also converts values to other types if specified. - * @param message Notebook - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Notebook, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Notebook to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Notebook - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OrgPolicy. */ - interface IOrgPolicy { - - /** OrgPolicy name */ - name?: (string|null); - } - - /** Represents an OrgPolicy. */ - class OrgPolicy implements IOrgPolicy { - - /** - * Constructs a new OrgPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IOrgPolicy); - - /** OrgPolicy name. */ - public name: string; - - /** - * Creates a new OrgPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns OrgPolicy instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IOrgPolicy): google.cloud.securitycenter.v1.OrgPolicy; - - /** - * Encodes the specified OrgPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.OrgPolicy.verify|verify} messages. - * @param message OrgPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OrgPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrgPolicy.verify|verify} messages. - * @param message OrgPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OrgPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OrgPolicy - * @throws {Error} If the payload is not a reader 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.OrgPolicy; - - /** - * Decodes an OrgPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OrgPolicy - * @throws {Error} If the payload is not 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.OrgPolicy; - - /** - * Verifies an OrgPolicy message. - * @param message Plain 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 OrgPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OrgPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrgPolicy; - - /** - * Creates a plain object from an OrgPolicy message. Also converts values to other types if specified. - * @param message OrgPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.OrgPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OrgPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OrgPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Process. */ - interface IProcess { - - /** Process name */ - name?: (string|null); - - /** 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 name. */ - public name: string; - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 SecurityPosture. */ - interface ISecurityPosture { - - /** SecurityPosture name */ - name?: (string|null); - - /** SecurityPosture revisionId */ - revisionId?: (string|null); - - /** SecurityPosture postureDeploymentResource */ - postureDeploymentResource?: (string|null); - - /** SecurityPosture postureDeployment */ - postureDeployment?: (string|null); - - /** SecurityPosture changedPolicy */ - changedPolicy?: (string|null); - - /** SecurityPosture policySet */ - policySet?: (string|null); - - /** SecurityPosture policy */ - policy?: (string|null); - - /** SecurityPosture policyDriftDetails */ - policyDriftDetails?: (google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails[]|null); - } - - /** Represents a SecurityPosture. */ - class SecurityPosture implements ISecurityPosture { - - /** - * Constructs a new SecurityPosture. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISecurityPosture); - - /** SecurityPosture name. */ - public name: string; - - /** SecurityPosture revisionId. */ - public revisionId: string; - - /** SecurityPosture postureDeploymentResource. */ - public postureDeploymentResource: string; - - /** SecurityPosture postureDeployment. */ - public postureDeployment: string; - - /** SecurityPosture changedPolicy. */ - public changedPolicy: string; - - /** SecurityPosture policySet. */ - public policySet: string; - - /** SecurityPosture policy. */ - public policy: string; - - /** SecurityPosture policyDriftDetails. */ - public policyDriftDetails: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails[]; - - /** - * Creates a new SecurityPosture instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityPosture instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISecurityPosture): google.cloud.securitycenter.v1.SecurityPosture; - - /** - * Encodes the specified SecurityPosture message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.verify|verify} messages. - * @param message SecurityPosture message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISecurityPosture, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityPosture message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.verify|verify} messages. - * @param message SecurityPosture message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityPosture, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityPosture message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityPosture - * @throws {Error} If the payload is not a reader 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.SecurityPosture; - - /** - * Decodes a SecurityPosture message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityPosture - * @throws {Error} If the payload is not 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.SecurityPosture; - - /** - * Verifies a SecurityPosture message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecurityPosture message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityPosture - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityPosture; - - /** - * Creates a plain object from a SecurityPosture message. Also converts values to other types if specified. - * @param message SecurityPosture - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SecurityPosture, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityPosture to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecurityPosture - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SecurityPosture { - - /** Properties of a PolicyDriftDetails. */ - interface IPolicyDriftDetails { - - /** PolicyDriftDetails field */ - field?: (string|null); - - /** PolicyDriftDetails expectedValue */ - expectedValue?: (string|null); - - /** PolicyDriftDetails detectedValue */ - detectedValue?: (string|null); - } - - /** Represents a PolicyDriftDetails. */ - class PolicyDriftDetails implements IPolicyDriftDetails { - - /** - * Constructs a new PolicyDriftDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails); - - /** PolicyDriftDetails field. */ - public field: string; - - /** PolicyDriftDetails expectedValue. */ - public expectedValue: string; - - /** PolicyDriftDetails detectedValue. */ - public detectedValue: string; - - /** - * Creates a new PolicyDriftDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDriftDetails instance - */ - public static create(properties?: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails): google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails; - - /** - * Encodes the specified PolicyDriftDetails message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify|verify} messages. - * @param message PolicyDriftDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDriftDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify|verify} messages. - * @param message PolicyDriftDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDriftDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDriftDetails - * @throws {Error} If the payload is not a reader 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.SecurityPosture.PolicyDriftDetails; - - /** - * Decodes a PolicyDriftDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDriftDetails - * @throws {Error} If the payload is not 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.SecurityPosture.PolicyDriftDetails; - - /** - * Verifies a PolicyDriftDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDriftDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDriftDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails; - - /** - * Creates a plain object from a PolicyDriftDetails message. Also converts values to other types if specified. - * @param message PolicyDriftDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDriftDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDriftDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ToxicCombination. */ - interface IToxicCombination { - - /** ToxicCombination attackExposureScore */ - attackExposureScore?: (number|null); - - /** ToxicCombination relatedFindings */ - relatedFindings?: (string[]|null); - } - - /** Represents a ToxicCombination. */ - class ToxicCombination implements IToxicCombination { - - /** - * Constructs a new ToxicCombination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IToxicCombination); - - /** ToxicCombination attackExposureScore. */ - public attackExposureScore: number; - - /** ToxicCombination relatedFindings. */ - public relatedFindings: string[]; - - /** - * Creates a new ToxicCombination instance using the specified properties. - * @param [properties] Properties to set - * @returns ToxicCombination instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IToxicCombination): google.cloud.securitycenter.v1.ToxicCombination; - - /** - * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. - * @param message ToxicCombination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. - * @param message ToxicCombination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToxicCombination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToxicCombination - * @throws {Error} If the payload is not a reader 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.ToxicCombination; - - /** - * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToxicCombination - * @throws {Error} If the payload is not 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.ToxicCombination; - - /** - * Verifies a ToxicCombination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToxicCombination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ToxicCombination; - - /** - * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. - * @param message ToxicCombination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ToxicCombination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToxicCombination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToxicCombination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Vulnerability. */ - interface IVulnerability { - - /** Vulnerability cve */ - cve?: (google.cloud.securitycenter.v1.ICve|null); - - /** Vulnerability offendingPackage */ - offendingPackage?: (google.cloud.securitycenter.v1.IPackage|null); - - /** Vulnerability fixedPackage */ - fixedPackage?: (google.cloud.securitycenter.v1.IPackage|null); - - /** Vulnerability securityBulletin */ - securityBulletin?: (google.cloud.securitycenter.v1.ISecurityBulletin|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); - - /** Vulnerability offendingPackage. */ - public offendingPackage?: (google.cloud.securitycenter.v1.IPackage|null); - - /** Vulnerability fixedPackage. */ - public fixedPackage?: (google.cloud.securitycenter.v1.IPackage|null); - - /** Vulnerability securityBulletin. */ - public securityBulletin?: (google.cloud.securitycenter.v1.ISecurityBulletin|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 }; - - /** - * 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. */ - 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); - - /** Cve upstreamFixAvailable */ - upstreamFixAvailable?: (boolean|null); - - /** Cve impact */ - impact?: (google.cloud.securitycenter.v1.Cve.RiskRating|keyof typeof google.cloud.securitycenter.v1.Cve.RiskRating|null); - - /** Cve exploitationActivity */ - exploitationActivity?: (google.cloud.securitycenter.v1.Cve.ExploitationActivity|keyof typeof google.cloud.securitycenter.v1.Cve.ExploitationActivity|null); - - /** Cve observedInTheWild */ - observedInTheWild?: (boolean|null); - - /** Cve zeroDay */ - zeroDay?: (boolean|null); - - /** Cve exploitReleaseDate */ - exploitReleaseDate?: (google.protobuf.ITimestamp|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); - - /** Cve upstreamFixAvailable. */ - public upstreamFixAvailable: boolean; - - /** Cve impact. */ - public impact: (google.cloud.securitycenter.v1.Cve.RiskRating|keyof typeof google.cloud.securitycenter.v1.Cve.RiskRating); - - /** Cve exploitationActivity. */ - public exploitationActivity: (google.cloud.securitycenter.v1.Cve.ExploitationActivity|keyof typeof google.cloud.securitycenter.v1.Cve.ExploitationActivity); - - /** Cve observedInTheWild. */ - public observedInTheWild: boolean; - - /** Cve zeroDay. */ - public zeroDay: boolean; - - /** Cve exploitReleaseDate. */ - public exploitReleaseDate?: (google.protobuf.ITimestamp|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 }; - - /** - * 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; - } - - namespace Cve { - - /** RiskRating enum. */ - enum RiskRating { - RISK_RATING_UNSPECIFIED = 0, - LOW = 1, - MEDIUM = 2, - HIGH = 3, - CRITICAL = 4 - } - - /** ExploitationActivity enum. */ - enum ExploitationActivity { - EXPLOITATION_ACTIVITY_UNSPECIFIED = 0, - WIDE = 1, - CONFIRMED = 2, - AVAILABLE = 3, - ANTICIPATED = 4, - NO_KNOWN = 5 - } - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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 Package. */ - interface IPackage { - - /** Package packageName */ - packageName?: (string|null); - - /** Package cpeUri */ - cpeUri?: (string|null); - - /** Package packageType */ - packageType?: (string|null); - - /** Package packageVersion */ - packageVersion?: (string|null); - } - - /** Represents a Package. */ - class Package implements IPackage { - - /** - * Constructs a new Package. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IPackage); - - /** Package packageName. */ - public packageName: string; - - /** Package cpeUri. */ - public cpeUri: string; - - /** Package packageType. */ - public packageType: string; - - /** Package packageVersion. */ - public packageVersion: string; - - /** - * Creates a new Package instance using the specified properties. - * @param [properties] Properties to set - * @returns Package instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IPackage): google.cloud.securitycenter.v1.Package; - - /** - * Encodes the specified Package message. Does not implicitly {@link google.cloud.securitycenter.v1.Package.verify|verify} messages. - * @param message Package message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Package message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Package.verify|verify} messages. - * @param message Package message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Package message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Package - * @throws {Error} If the payload is not a reader 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.Package; - - /** - * Decodes a Package message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Package - * @throws {Error} If the payload is not 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.Package; - - /** - * Verifies a Package message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Package message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Package - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Package; - - /** - * Creates a plain object from a Package message. Also converts values to other types if specified. - * @param message Package - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Package, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Package to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Package - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecurityBulletin. */ - interface ISecurityBulletin { - - /** SecurityBulletin bulletinId */ - bulletinId?: (string|null); - - /** SecurityBulletin submissionTime */ - submissionTime?: (google.protobuf.ITimestamp|null); - - /** SecurityBulletin suggestedUpgradeVersion */ - suggestedUpgradeVersion?: (string|null); - } - - /** Represents a SecurityBulletin. */ - class SecurityBulletin implements ISecurityBulletin { - - /** - * Constructs a new SecurityBulletin. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISecurityBulletin); - - /** SecurityBulletin bulletinId. */ - public bulletinId: string; - - /** SecurityBulletin submissionTime. */ - public submissionTime?: (google.protobuf.ITimestamp|null); - - /** SecurityBulletin suggestedUpgradeVersion. */ - public suggestedUpgradeVersion: string; - - /** - * Creates a new SecurityBulletin instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityBulletin instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISecurityBulletin): google.cloud.securitycenter.v1.SecurityBulletin; - - /** - * Encodes the specified SecurityBulletin message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityBulletin.verify|verify} messages. - * @param message SecurityBulletin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISecurityBulletin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityBulletin message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityBulletin.verify|verify} messages. - * @param message SecurityBulletin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityBulletin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityBulletin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityBulletin - * @throws {Error} If the payload is not a reader 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.SecurityBulletin; - - /** - * Decodes a SecurityBulletin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityBulletin - * @throws {Error} If the payload is not 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.SecurityBulletin; - - /** - * Verifies a SecurityBulletin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecurityBulletin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityBulletin - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityBulletin; - - /** - * Creates a plain object from a SecurityBulletin message. Also converts values to other types if specified. - * @param message SecurityBulletin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SecurityBulletin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityBulletin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecurityBulletin - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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); - - /** MuteConfig type */ - type?: (google.cloud.securitycenter.v1.MuteConfig.MuteConfigType|keyof typeof google.cloud.securitycenter.v1.MuteConfig.MuteConfigType|null); - - /** MuteConfig expiryTime */ - expiryTime?: (google.protobuf.ITimestamp|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; - - /** MuteConfig type. */ - public type: (google.cloud.securitycenter.v1.MuteConfig.MuteConfigType|keyof typeof google.cloud.securitycenter.v1.MuteConfig.MuteConfigType); - - /** MuteConfig expiryTime. */ - public expiryTime?: (google.protobuf.ITimestamp|null); - - /** - * 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 }; - - /** - * 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; - } - - namespace MuteConfig { - - /** MuteConfigType enum. */ - enum MuteConfigType { - MUTE_CONFIG_TYPE_UNSPECIFIED = 0, - STATIC = 1, - DYNAMIC = 2 - } - } - - /** Properties of a NotificationConfig. */ - interface INotificationConfig { - - /** NotificationConfig name */ - name?: (string|null); - - /** NotificationConfig description */ - description?: (string|null); - - /** NotificationConfig pubsubTopic */ - pubsubTopic?: (string|null); - - /** NotificationConfig serviceAccount */ - serviceAccount?: (string|null); - - /** NotificationConfig streamingConfig */ - streamingConfig?: (google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null); - } - - /** Represents a NotificationConfig. */ - class NotificationConfig implements INotificationConfig { - - /** - * Constructs a new NotificationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.INotificationConfig); - - /** NotificationConfig name. */ - public name: string; - - /** NotificationConfig description. */ - public description: string; - - /** 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 NotificationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns NotificationConfig instance - */ - public static create(properties?: google.cloud.securitycenter.v1.INotificationConfig): google.cloud.securitycenter.v1.NotificationConfig; - - /** - * 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.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.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.v1.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.v1.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.v1.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.v1.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NotificationConfig to JSON. - * @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 { - - /** 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.v1.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.v1.NotificationConfig.IStreamingConfig): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; - - /** - * 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.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.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.v1.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.v1.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.v1.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.v1.NotificationConfig.StreamingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StreamingConfig to JSON. - * @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; - } - } - - /** Properties of a NotificationMessage. */ - interface INotificationMessage { - - /** NotificationMessage notificationConfigName */ - notificationConfigName?: (string|null); - - /** NotificationMessage finding */ - finding?: (google.cloud.securitycenter.v1.IFinding|null); - - /** NotificationMessage resource */ - resource?: (google.cloud.securitycenter.v1.IResource|null); - } - - /** Represents a NotificationMessage. */ - class NotificationMessage implements INotificationMessage { - - /** - * Constructs a new NotificationMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.INotificationMessage); - - /** NotificationMessage notificationConfigName. */ - public notificationConfigName: string; - - /** 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"; - - /** - * Creates a new NotificationMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns NotificationMessage instance - */ - public static create(properties?: google.cloud.securitycenter.v1.INotificationMessage): google.cloud.securitycenter.v1.NotificationMessage; - - /** - * 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.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.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.v1.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.v1.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.v1.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.v1.NotificationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NotificationMessage to JSON. - * @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. */ - interface IResource { - - /** Resource name */ - name?: (string|null); - - /** Resource displayName */ - displayName?: (string|null); - - /** Resource type */ - type?: (string|null); - - /** Resource project */ - project?: (string|null); - - /** Resource projectDisplayName */ - projectDisplayName?: (string|null); - - /** Resource parent */ - parent?: (string|null); - - /** Resource parentDisplayName */ - parentDisplayName?: (string|null); - - /** Resource folders */ - folders?: (google.cloud.securitycenter.v1.IFolder[]|null); - - /** Resource cloudProvider */ - cloudProvider?: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider|null); - - /** Resource organization */ - organization?: (string|null); - - /** Resource service */ - service?: (string|null); - - /** Resource location */ - location?: (string|null); - - /** Resource awsMetadata */ - awsMetadata?: (google.cloud.securitycenter.v1.IAwsMetadata|null); - - /** Resource azureMetadata */ - azureMetadata?: (google.cloud.securitycenter.v1.IAzureMetadata|null); - - /** Resource resourcePath */ - resourcePath?: (google.cloud.securitycenter.v1.IResourcePath|null); - - /** Resource resourcePathString */ - resourcePathString?: (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 displayName. */ - public displayName: string; - - /** Resource type. */ - public type: string; - - /** Resource project. */ - public project: string; - - /** Resource projectDisplayName. */ - public projectDisplayName: string; - - /** Resource parent. */ - public parent: string; - - /** Resource parentDisplayName. */ - public parentDisplayName: string; - - /** Resource folders. */ - public folders: google.cloud.securitycenter.v1.IFolder[]; - - /** Resource cloudProvider. */ - public cloudProvider: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider); - - /** Resource organization. */ - public organization: string; - - /** Resource service. */ - public service: string; - - /** Resource location. */ - public location: string; - - /** Resource awsMetadata. */ - public awsMetadata?: (google.cloud.securitycenter.v1.IAwsMetadata|null); - - /** Resource azureMetadata. */ - public azureMetadata?: (google.cloud.securitycenter.v1.IAzureMetadata|null); - - /** Resource resourcePath. */ - public resourcePath?: (google.cloud.securitycenter.v1.IResourcePath|null); - - /** Resource resourcePathString. */ - public resourcePathString: string; - - /** Resource cloudProviderMetadata. */ - public cloudProviderMetadata?: ("awsMetadata"|"azureMetadata"); - - /** - * 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 }; - - /** - * 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; - } - - /** CloudProvider enum. */ - enum CloudProvider { - CLOUD_PROVIDER_UNSPECIFIED = 0, - GOOGLE_CLOUD_PLATFORM = 1, - AMAZON_WEB_SERVICES = 2, - MICROSOFT_AZURE = 3 - } - - /** Properties of an AwsMetadata. */ - interface IAwsMetadata { - - /** AwsMetadata organization */ - organization?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization|null); - - /** AwsMetadata organizationalUnits */ - organizationalUnits?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit[]|null); - - /** AwsMetadata account */ - account?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount|null); - } - - /** Represents an AwsMetadata. */ - class AwsMetadata implements IAwsMetadata { - - /** - * Constructs a new AwsMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IAwsMetadata); - - /** AwsMetadata organization. */ - public organization?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization|null); - - /** AwsMetadata organizationalUnits. */ - public organizationalUnits: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit[]; - - /** AwsMetadata account. */ - public account?: (google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount|null); - - /** - * Creates a new AwsMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsMetadata instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IAwsMetadata): google.cloud.securitycenter.v1.AwsMetadata; - - /** - * Encodes the specified AwsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.verify|verify} messages. - * @param message AwsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IAwsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.verify|verify} messages. - * @param message AwsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IAwsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsMetadata - * @throws {Error} If the payload is not a reader 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.AwsMetadata; - - /** - * Decodes an AwsMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsMetadata - * @throws {Error} If the payload is not 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.AwsMetadata; - - /** - * Verifies an AwsMetadata message. - * @param message Plain 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 AwsMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AwsMetadata; - - /** - * Creates a plain object from an AwsMetadata message. Also converts values to other types if specified. - * @param message AwsMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AwsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AwsMetadata { - - /** Properties of an AwsOrganization. */ - interface IAwsOrganization { - - /** AwsOrganization id */ - id?: (string|null); - } - - /** Represents an AwsOrganization. */ - class AwsOrganization implements IAwsOrganization { - - /** - * Constructs a new AwsOrganization. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization); - - /** AwsOrganization id. */ - public id: string; - - /** - * Creates a new AwsOrganization instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsOrganization instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization): google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization; - - /** - * Encodes the specified AwsOrganization message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify|verify} messages. - * @param message AwsOrganization message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsOrganization message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify|verify} messages. - * @param message AwsOrganization message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsOrganization message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsOrganization - * @throws {Error} If the payload is not a reader 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.AwsMetadata.AwsOrganization; - - /** - * Decodes an AwsOrganization message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsOrganization - * @throws {Error} If the payload is not 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.AwsMetadata.AwsOrganization; - - /** - * Verifies an AwsOrganization message. - * @param message Plain 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 AwsOrganization message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsOrganization - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization; - - /** - * Creates a plain object from an AwsOrganization message. Also converts values to other types if specified. - * @param message AwsOrganization - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsOrganization to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsOrganization - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AwsOrganizationalUnit. */ - interface IAwsOrganizationalUnit { - - /** AwsOrganizationalUnit id */ - id?: (string|null); - - /** AwsOrganizationalUnit name */ - name?: (string|null); - } - - /** Represents an AwsOrganizationalUnit. */ - class AwsOrganizationalUnit implements IAwsOrganizationalUnit { - - /** - * Constructs a new AwsOrganizationalUnit. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit); - - /** AwsOrganizationalUnit id. */ - public id: string; - - /** AwsOrganizationalUnit name. */ - public name: string; - - /** - * Creates a new AwsOrganizationalUnit instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsOrganizationalUnit instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit): google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit; - - /** - * Encodes the specified AwsOrganizationalUnit message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. - * @param message AwsOrganizationalUnit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsOrganizationalUnit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. - * @param message AwsOrganizationalUnit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsOrganizationalUnit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsOrganizationalUnit - * @throws {Error} If the payload is not a reader 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.AwsMetadata.AwsOrganizationalUnit; - - /** - * Decodes an AwsOrganizationalUnit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsOrganizationalUnit - * @throws {Error} If the payload is not 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.AwsMetadata.AwsOrganizationalUnit; - - /** - * Verifies an AwsOrganizationalUnit message. - * @param message Plain 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 AwsOrganizationalUnit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsOrganizationalUnit - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit; - - /** - * Creates a plain object from an AwsOrganizationalUnit message. Also converts values to other types if specified. - * @param message AwsOrganizationalUnit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsOrganizationalUnit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsOrganizationalUnit - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AwsAccount. */ - interface IAwsAccount { - - /** AwsAccount id */ - id?: (string|null); - - /** AwsAccount name */ - name?: (string|null); - } - - /** Represents an AwsAccount. */ - class AwsAccount implements IAwsAccount { - - /** - * Constructs a new AwsAccount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount); - - /** AwsAccount id. */ - public id: string; - - /** AwsAccount name. */ - public name: string; - - /** - * Creates a new AwsAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsAccount instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount): google.cloud.securitycenter.v1.AwsMetadata.AwsAccount; - - /** - * Encodes the specified AwsAccount message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify|verify} messages. - * @param message AwsAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsAccount message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify|verify} messages. - * @param message AwsAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsAccount - * @throws {Error} If the payload is not a reader 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.AwsMetadata.AwsAccount; - - /** - * Decodes an AwsAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsAccount - * @throws {Error} If the payload is not 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.AwsMetadata.AwsAccount; - - /** - * Verifies an AwsAccount message. - * @param message Plain 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 AwsAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsAccount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AwsMetadata.AwsAccount; - - /** - * Creates a plain object from an AwsAccount message. Also converts values to other types if specified. - * @param message AwsAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AwsMetadata.AwsAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsAccount - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an AzureMetadata. */ - interface IAzureMetadata { - - /** AzureMetadata managementGroups */ - managementGroups?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup[]|null); - - /** AzureMetadata subscription */ - subscription?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription|null); - - /** AzureMetadata resourceGroup */ - resourceGroup?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup|null); - } - - /** Represents an AzureMetadata. */ - class AzureMetadata implements IAzureMetadata { - - /** - * Constructs a new AzureMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IAzureMetadata); - - /** AzureMetadata managementGroups. */ - public managementGroups: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup[]; - - /** AzureMetadata subscription. */ - public subscription?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription|null); - - /** AzureMetadata resourceGroup. */ - public resourceGroup?: (google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup|null); - - /** - * Creates a new AzureMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureMetadata instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IAzureMetadata): google.cloud.securitycenter.v1.AzureMetadata; - - /** - * Encodes the specified AzureMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.verify|verify} messages. - * @param message AzureMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IAzureMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.verify|verify} messages. - * @param message AzureMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IAzureMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureMetadata - * @throws {Error} If the payload is not a reader 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.AzureMetadata; - - /** - * Decodes an AzureMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureMetadata - * @throws {Error} If the payload is not 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.AzureMetadata; - - /** - * Verifies an AzureMetadata message. - * @param message Plain 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 AzureMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AzureMetadata; - - /** - * Creates a plain object from an AzureMetadata message. Also converts values to other types if specified. - * @param message AzureMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AzureMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AzureMetadata { - - /** Properties of an AzureManagementGroup. */ - interface IAzureManagementGroup { - - /** AzureManagementGroup id */ - id?: (string|null); - - /** AzureManagementGroup displayName */ - displayName?: (string|null); - } - - /** Represents an AzureManagementGroup. */ - class AzureManagementGroup implements IAzureManagementGroup { - - /** - * Constructs a new AzureManagementGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup); - - /** AzureManagementGroup id. */ - public id: string; - - /** AzureManagementGroup displayName. */ - public displayName: string; - - /** - * Creates a new AzureManagementGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureManagementGroup instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup): google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup; - - /** - * Encodes the specified AzureManagementGroup message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify|verify} messages. - * @param message AzureManagementGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureManagementGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify|verify} messages. - * @param message AzureManagementGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureManagementGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureManagementGroup - * @throws {Error} If the payload is not a reader 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.AzureMetadata.AzureManagementGroup; - - /** - * Decodes an AzureManagementGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureManagementGroup - * @throws {Error} If the payload is not 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.AzureMetadata.AzureManagementGroup; - - /** - * Verifies an AzureManagementGroup message. - * @param message Plain 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 AzureManagementGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureManagementGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup; - - /** - * Creates a plain object from an AzureManagementGroup message. Also converts values to other types if specified. - * @param message AzureManagementGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureManagementGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureManagementGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AzureSubscription. */ - interface IAzureSubscription { - - /** AzureSubscription id */ - id?: (string|null); - - /** AzureSubscription displayName */ - displayName?: (string|null); - } - - /** Represents an AzureSubscription. */ - class AzureSubscription implements IAzureSubscription { - - /** - * Constructs a new AzureSubscription. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription); - - /** AzureSubscription id. */ - public id: string; - - /** AzureSubscription displayName. */ - public displayName: string; - - /** - * Creates a new AzureSubscription instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureSubscription instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription): google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription; - - /** - * Encodes the specified AzureSubscription message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify|verify} messages. - * @param message AzureSubscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureSubscription message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify|verify} messages. - * @param message AzureSubscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureSubscription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureSubscription - * @throws {Error} If the payload is not a reader 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.AzureMetadata.AzureSubscription; - - /** - * Decodes an AzureSubscription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureSubscription - * @throws {Error} If the payload is not 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.AzureMetadata.AzureSubscription; - - /** - * Verifies an AzureSubscription message. - * @param message Plain 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 AzureSubscription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureSubscription - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription; - - /** - * Creates a plain object from an AzureSubscription message. Also converts values to other types if specified. - * @param message AzureSubscription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureSubscription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureSubscription - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AzureResourceGroup. */ - interface IAzureResourceGroup { - - /** AzureResourceGroup name */ - name?: (string|null); - } - - /** Represents an AzureResourceGroup. */ - class AzureResourceGroup implements IAzureResourceGroup { - - /** - * Constructs a new AzureResourceGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup); - - /** AzureResourceGroup name. */ - public name: string; - - /** - * Creates a new AzureResourceGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureResourceGroup instance - */ - public static create(properties?: google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup): google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup; - - /** - * Encodes the specified AzureResourceGroup message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify|verify} messages. - * @param message AzureResourceGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureResourceGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify|verify} messages. - * @param message AzureResourceGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureResourceGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureResourceGroup - * @throws {Error} If the payload is not a reader 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.AzureMetadata.AzureResourceGroup; - - /** - * Decodes an AzureResourceGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureResourceGroup - * @throws {Error} If the payload is not 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.AzureMetadata.AzureResourceGroup; - - /** - * Verifies an AzureResourceGroup message. - * @param message Plain 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 AzureResourceGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureResourceGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup; - - /** - * Creates a plain object from an AzureResourceGroup message. Also converts values to other types if specified. - * @param message AzureResourceGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureResourceGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureResourceGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ResourcePath. */ - interface IResourcePath { - - /** ResourcePath nodes */ - nodes?: (google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode[]|null); - } - - /** Represents a ResourcePath. */ - class ResourcePath implements IResourcePath { - - /** - * Constructs a new ResourcePath. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IResourcePath); - - /** ResourcePath nodes. */ - public nodes: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode[]; - - /** - * Creates a new ResourcePath instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourcePath instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IResourcePath): google.cloud.securitycenter.v1.ResourcePath; - - /** - * Encodes the specified ResourcePath message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.verify|verify} messages. - * @param message ResourcePath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IResourcePath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourcePath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.verify|verify} messages. - * @param message ResourcePath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IResourcePath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourcePath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourcePath - * @throws {Error} If the payload is not a reader 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.ResourcePath; - - /** - * Decodes a ResourcePath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourcePath - * @throws {Error} If the payload is not 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.ResourcePath; - - /** - * Verifies a ResourcePath message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourcePath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourcePath - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourcePath; - - /** - * Creates a plain object from a ResourcePath message. Also converts values to other types if specified. - * @param message ResourcePath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ResourcePath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourcePath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourcePath - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourcePath { - - /** ResourcePathNodeType enum. */ - enum ResourcePathNodeType { - RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0, - GCP_ORGANIZATION = 1, - GCP_FOLDER = 2, - GCP_PROJECT = 3, - AWS_ORGANIZATION = 4, - AWS_ORGANIZATIONAL_UNIT = 5, - AWS_ACCOUNT = 6, - AZURE_MANAGEMENT_GROUP = 7, - AZURE_SUBSCRIPTION = 8, - AZURE_RESOURCE_GROUP = 9 - } - - /** Properties of a ResourcePathNode. */ - interface IResourcePathNode { - - /** ResourcePathNode nodeType */ - nodeType?: (google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType|keyof typeof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType|null); - - /** ResourcePathNode id */ - id?: (string|null); - - /** ResourcePathNode displayName */ - displayName?: (string|null); - } - - /** Represents a ResourcePathNode. */ - class ResourcePathNode implements IResourcePathNode { - - /** - * Constructs a new ResourcePathNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode); - - /** ResourcePathNode nodeType. */ - public nodeType: (google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType|keyof typeof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType); - - /** ResourcePathNode id. */ - public id: string; - - /** ResourcePathNode displayName. */ - public displayName: string; - - /** - * Creates a new ResourcePathNode instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourcePathNode instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode): google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode; - - /** - * Encodes the specified ResourcePathNode message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.verify|verify} messages. - * @param message ResourcePathNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourcePathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.verify|verify} messages. - * @param message ResourcePathNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourcePathNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourcePathNode - * @throws {Error} If the payload is not a reader 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.ResourcePath.ResourcePathNode; - - /** - * Decodes a ResourcePathNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourcePathNode - * @throws {Error} If the payload is not 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.ResourcePath.ResourcePathNode; - - /** - * Verifies a ResourcePathNode message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourcePathNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourcePathNode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode; - - /** - * Creates a plain object from a ResourcePathNode message. Also converts values to other types if specified. - * @param message ResourcePathNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourcePathNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourcePathNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 }; - - /** - * 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 { - - /** 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); - - /** AssetDiscoveryConfig folderIds */ - folderIds?: (string[]|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); - - /** AssetDiscoveryConfig folderIds. */ - public folderIds: 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; - - /** - * 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 }; - - /** - * 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 { - - /** InclusionMode enum. */ - enum InclusionMode { - INCLUSION_MODE_UNSPECIFIED = 0, - INCLUDE_ONLY = 1, - EXCLUDE = 2 - } - } - } - - /** Properties of a ResourceValueConfig. */ - interface IResourceValueConfig { - - /** ResourceValueConfig name */ - name?: (string|null); - - /** ResourceValueConfig resourceValue */ - resourceValue?: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue|null); - - /** ResourceValueConfig tagValues */ - tagValues?: (string[]|null); - - /** ResourceValueConfig resourceType */ - resourceType?: (string|null); - - /** ResourceValueConfig scope */ - scope?: (string|null); - - /** ResourceValueConfig resourceLabelsSelector */ - resourceLabelsSelector?: ({ [k: string]: string }|null); - - /** ResourceValueConfig description */ - description?: (string|null); - - /** ResourceValueConfig createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceValueConfig updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ResourceValueConfig cloudProvider */ - cloudProvider?: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider|null); - - /** ResourceValueConfig sensitiveDataProtectionMapping */ - sensitiveDataProtectionMapping?: (google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping|null); - } - - /** Represents a ResourceValueConfig. */ - class ResourceValueConfig implements IResourceValueConfig { - - /** - * Constructs a new ResourceValueConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IResourceValueConfig); - - /** ResourceValueConfig name. */ - public name: string; - - /** ResourceValueConfig resourceValue. */ - public resourceValue: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue); - - /** ResourceValueConfig tagValues. */ - public tagValues: string[]; - - /** ResourceValueConfig resourceType. */ - public resourceType: string; - - /** ResourceValueConfig scope. */ - public scope: string; - - /** ResourceValueConfig resourceLabelsSelector. */ - public resourceLabelsSelector: { [k: string]: string }; - - /** ResourceValueConfig description. */ - public description: string; - - /** ResourceValueConfig createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceValueConfig updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ResourceValueConfig cloudProvider. */ - public cloudProvider: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider); - - /** ResourceValueConfig sensitiveDataProtectionMapping. */ - public sensitiveDataProtectionMapping?: (google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping|null); - - /** - * Creates a new ResourceValueConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceValueConfig instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IResourceValueConfig): google.cloud.securitycenter.v1.ResourceValueConfig; - - /** - * Encodes the specified ResourceValueConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.verify|verify} messages. - * @param message ResourceValueConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IResourceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceValueConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.verify|verify} messages. - * @param message ResourceValueConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IResourceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceValueConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceValueConfig - * @throws {Error} If the payload is not a reader 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.ResourceValueConfig; - - /** - * Decodes a ResourceValueConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceValueConfig - * @throws {Error} If the payload is not 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.ResourceValueConfig; - - /** - * Verifies a ResourceValueConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceValueConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceValueConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourceValueConfig; - - /** - * Creates a plain object from a ResourceValueConfig message. Also converts values to other types if specified. - * @param message ResourceValueConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ResourceValueConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceValueConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceValueConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceValueConfig { - - /** Properties of a SensitiveDataProtectionMapping. */ - interface ISensitiveDataProtectionMapping { - - /** SensitiveDataProtectionMapping highSensitivityMapping */ - highSensitivityMapping?: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue|null); - - /** SensitiveDataProtectionMapping mediumSensitivityMapping */ - mediumSensitivityMapping?: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue|null); - } - - /** Represents a SensitiveDataProtectionMapping. */ - class SensitiveDataProtectionMapping implements ISensitiveDataProtectionMapping { - - /** - * Constructs a new SensitiveDataProtectionMapping. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping); - - /** SensitiveDataProtectionMapping highSensitivityMapping. */ - public highSensitivityMapping: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue); - - /** SensitiveDataProtectionMapping mediumSensitivityMapping. */ - public mediumSensitivityMapping: (google.cloud.securitycenter.v1.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ResourceValue); - - /** - * Creates a new SensitiveDataProtectionMapping instance using the specified properties. - * @param [properties] Properties to set - * @returns SensitiveDataProtectionMapping instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping): google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping; - - /** - * Encodes the specified SensitiveDataProtectionMapping message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. - * @param message SensitiveDataProtectionMapping message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SensitiveDataProtectionMapping message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. - * @param message SensitiveDataProtectionMapping message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SensitiveDataProtectionMapping - * @throws {Error} If the payload is not a reader 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.ResourceValueConfig.SensitiveDataProtectionMapping; - - /** - * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SensitiveDataProtectionMapping - * @throws {Error} If the payload is not 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.ResourceValueConfig.SensitiveDataProtectionMapping; - - /** - * Verifies a SensitiveDataProtectionMapping message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SensitiveDataProtectionMapping message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SensitiveDataProtectionMapping - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping; - - /** - * Creates a plain object from a SensitiveDataProtectionMapping message. Also converts values to other types if specified. - * @param message SensitiveDataProtectionMapping - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SensitiveDataProtectionMapping to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SensitiveDataProtectionMapping - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ResourceValue enum. */ - enum ResourceValue { - RESOURCE_VALUE_UNSPECIFIED = 0, - HIGH = 1, - MEDIUM = 2, - LOW = 3, - NONE = 4 - } - - /** 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 }; - - /** - * 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 { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - COMPLETED = 1, - SUPERSEDED = 2, - TERMINATED = 3 - } - } - - /** Properties of a SecurityHealthAnalyticsCustomModule. */ - interface ISecurityHealthAnalyticsCustomModule { - - /** SecurityHealthAnalyticsCustomModule name */ - name?: (string|null); - - /** SecurityHealthAnalyticsCustomModule displayName */ - displayName?: (string|null); - - /** SecurityHealthAnalyticsCustomModule enablementState */ - enablementState?: (google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState|null); - - /** SecurityHealthAnalyticsCustomModule updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** SecurityHealthAnalyticsCustomModule lastEditor */ - lastEditor?: (string|null); - - /** SecurityHealthAnalyticsCustomModule ancestorModule */ - ancestorModule?: (string|null); - - /** SecurityHealthAnalyticsCustomModule customConfig */ - customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); - } - - /** Represents a SecurityHealthAnalyticsCustomModule. */ - class SecurityHealthAnalyticsCustomModule implements ISecurityHealthAnalyticsCustomModule { - - /** - * Constructs a new SecurityHealthAnalyticsCustomModule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule); - - /** SecurityHealthAnalyticsCustomModule name. */ - public name: string; - - /** SecurityHealthAnalyticsCustomModule displayName. */ - public displayName: string; - - /** SecurityHealthAnalyticsCustomModule enablementState. */ - public enablementState: (google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState|keyof typeof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState); - - /** SecurityHealthAnalyticsCustomModule updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** SecurityHealthAnalyticsCustomModule lastEditor. */ - public lastEditor: string; - - /** SecurityHealthAnalyticsCustomModule ancestorModule. */ - public ancestorModule: string; - - /** SecurityHealthAnalyticsCustomModule customConfig. */ - public customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); - - /** - * Creates a new SecurityHealthAnalyticsCustomModule instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityHealthAnalyticsCustomModule instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule): google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule; - - /** - * Encodes the specified SecurityHealthAnalyticsCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify|verify} messages. - * @param message SecurityHealthAnalyticsCustomModule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityHealthAnalyticsCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify|verify} messages. - * @param message SecurityHealthAnalyticsCustomModule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityHealthAnalyticsCustomModule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityHealthAnalyticsCustomModule - * @throws {Error} If the payload is not a reader 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.SecurityHealthAnalyticsCustomModule; - - /** - * Decodes a SecurityHealthAnalyticsCustomModule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityHealthAnalyticsCustomModule - * @throws {Error} If the payload is not 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.SecurityHealthAnalyticsCustomModule; - - /** - * Verifies a SecurityHealthAnalyticsCustomModule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecurityHealthAnalyticsCustomModule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityHealthAnalyticsCustomModule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule; - - /** - * Creates a plain object from a SecurityHealthAnalyticsCustomModule message. Also converts values to other types if specified. - * @param message SecurityHealthAnalyticsCustomModule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityHealthAnalyticsCustomModule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecurityHealthAnalyticsCustomModule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SecurityHealthAnalyticsCustomModule { - - /** EnablementState enum. */ - enum EnablementState { - ENABLEMENT_STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2, - INHERITED = 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 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 CreateSecurityHealthAnalyticsCustomModule. - * @param request CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule - */ - public createSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModuleCallback): void; - - /** - * Calls CreateSecurityHealthAnalyticsCustomModule. - * @param request CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns Promise - */ - public createSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest): Promise; - - /** - * 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 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 - * @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 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 - * @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 DeleteSecurityHealthAnalyticsCustomModule. - * @param request DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModuleCallback): void; - - /** - * Calls DeleteSecurityHealthAnalyticsCustomModule. - * @param request DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns Promise - */ - public deleteSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest): Promise; - - /** - * Calls GetSimulation. - * @param request GetSimulationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Simulation - */ - public getSimulation(request: google.cloud.securitycenter.v1.IGetSimulationRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSimulationCallback): void; - - /** - * Calls GetSimulation. - * @param request GetSimulationRequest message or plain object - * @returns Promise - */ - public getSimulation(request: google.cloud.securitycenter.v1.IGetSimulationRequest): Promise; - - /** - * Calls GetValuedResource. - * @param request GetValuedResourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ValuedResource - */ - public getValuedResource(request: google.cloud.securitycenter.v1.IGetValuedResourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetValuedResourceCallback): void; - - /** - * Calls GetValuedResource. - * @param request GetValuedResourceRequest message or plain object - * @returns Promise - */ - public getValuedResource(request: google.cloud.securitycenter.v1.IGetValuedResourceRequest): 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 - * @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 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 - * @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 GetEffectiveSecurityHealthAnalyticsCustomModule. - * @param request GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EffectiveSecurityHealthAnalyticsCustomModule - */ - public getEffectiveSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModuleCallback): void; - - /** - * Calls GetEffectiveSecurityHealthAnalyticsCustomModule. - * @param request GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns Promise - */ - public getEffectiveSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest): Promise; - - /** - * Calls GetSecurityHealthAnalyticsCustomModule. - * @param request GetSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule - */ - public getSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModuleCallback): void; - - /** - * Calls GetSecurityHealthAnalyticsCustomModule. - * @param request GetSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns Promise - */ - public getSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest): 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 ListDescendantSecurityHealthAnalyticsCustomModules. - * @param request ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDescendantSecurityHealthAnalyticsCustomModulesResponse - */ - public listDescendantSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModulesCallback): void; - - /** - * Calls ListDescendantSecurityHealthAnalyticsCustomModules. - * @param request ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @returns Promise - */ - public listDescendantSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest): 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 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 - * @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 ListEffectiveSecurityHealthAnalyticsCustomModules. - * @param request ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - */ - public listEffectiveSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModulesCallback): void; - - /** - * Calls ListEffectiveSecurityHealthAnalyticsCustomModules. - * @param request ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @returns Promise - */ - public listEffectiveSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest): Promise; - - /** - * Calls ListSecurityHealthAnalyticsCustomModules. - * @param request ListSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSecurityHealthAnalyticsCustomModulesResponse - */ - public listSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModulesCallback): void; - - /** - * Calls ListSecurityHealthAnalyticsCustomModules. - * @param request ListSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @returns Promise - */ - public listSecurityHealthAnalyticsCustomModules(request: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest): 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 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 - * @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 SimulateSecurityHealthAnalyticsCustomModule. - * @param request SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SimulateSecurityHealthAnalyticsCustomModuleResponse - */ - public simulateSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModuleCallback): void; - - /** - * Calls SimulateSecurityHealthAnalyticsCustomModule. - * @param request SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns Promise - */ - public simulateSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest): 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 - * @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 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 - * @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 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 UpdateSecurityHealthAnalyticsCustomModule. - * @param request UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule - */ - public updateSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModuleCallback): void; - - /** - * Calls UpdateSecurityHealthAnalyticsCustomModule. - * @param request UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns Promise - */ - public updateSecurityHealthAnalyticsCustomModule(request: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest): 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; - - /** - * 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; - - /** - * Calls CreateEventThreatDetectionCustomModule. - * @param request CreateEventThreatDetectionCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule - */ - public createEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModuleCallback): void; - - /** - * Calls CreateEventThreatDetectionCustomModule. - * @param request CreateEventThreatDetectionCustomModuleRequest message or plain object - * @returns Promise - */ - public createEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest): Promise; - - /** - * Calls DeleteEventThreatDetectionCustomModule. - * @param request DeleteEventThreatDetectionCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModuleCallback): void; - - /** - * Calls DeleteEventThreatDetectionCustomModule. - * @param request DeleteEventThreatDetectionCustomModuleRequest message or plain object - * @returns Promise - */ - public deleteEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest): Promise; - - /** - * Calls GetEventThreatDetectionCustomModule. - * @param request GetEventThreatDetectionCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule - */ - public getEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModuleCallback): void; - - /** - * Calls GetEventThreatDetectionCustomModule. - * @param request GetEventThreatDetectionCustomModuleRequest message or plain object - * @returns Promise - */ - public getEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest): Promise; - - /** - * Calls ListDescendantEventThreatDetectionCustomModules. - * @param request ListDescendantEventThreatDetectionCustomModulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDescendantEventThreatDetectionCustomModulesResponse - */ - public listDescendantEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModulesCallback): void; - - /** - * Calls ListDescendantEventThreatDetectionCustomModules. - * @param request ListDescendantEventThreatDetectionCustomModulesRequest message or plain object - * @returns Promise - */ - public listDescendantEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest): Promise; - - /** - * Calls ListEventThreatDetectionCustomModules. - * @param request ListEventThreatDetectionCustomModulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEventThreatDetectionCustomModulesResponse - */ - public listEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModulesCallback): void; - - /** - * Calls ListEventThreatDetectionCustomModules. - * @param request ListEventThreatDetectionCustomModulesRequest message or plain object - * @returns Promise - */ - public listEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest): Promise; - - /** - * Calls UpdateEventThreatDetectionCustomModule. - * @param request UpdateEventThreatDetectionCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule - */ - public updateEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModuleCallback): void; - - /** - * Calls UpdateEventThreatDetectionCustomModule. - * @param request UpdateEventThreatDetectionCustomModuleRequest message or plain object - * @returns Promise - */ - public updateEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest): Promise; - - /** - * Calls ValidateEventThreatDetectionCustomModule. - * @param request ValidateEventThreatDetectionCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ValidateEventThreatDetectionCustomModuleResponse - */ - public validateEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModuleCallback): void; - - /** - * Calls ValidateEventThreatDetectionCustomModule. - * @param request ValidateEventThreatDetectionCustomModuleRequest message or plain object - * @returns Promise - */ - public validateEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest): Promise; - - /** - * Calls GetEffectiveEventThreatDetectionCustomModule. - * @param request GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EffectiveEventThreatDetectionCustomModule - */ - public getEffectiveEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModuleCallback): void; - - /** - * Calls GetEffectiveEventThreatDetectionCustomModule. - * @param request GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object - * @returns Promise - */ - public getEffectiveEventThreatDetectionCustomModule(request: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest): Promise; - - /** - * Calls ListEffectiveEventThreatDetectionCustomModules. - * @param request ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEffectiveEventThreatDetectionCustomModulesResponse - */ - public listEffectiveEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModulesCallback): void; - - /** - * Calls ListEffectiveEventThreatDetectionCustomModules. - * @param request ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object - * @returns Promise - */ - public listEffectiveEventThreatDetectionCustomModules(request: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest): Promise; - - /** - * Calls BatchCreateResourceValueConfigs. - * @param request BatchCreateResourceValueConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchCreateResourceValueConfigsResponse - */ - public batchCreateResourceValueConfigs(request: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigsCallback): void; - - /** - * Calls BatchCreateResourceValueConfigs. - * @param request BatchCreateResourceValueConfigsRequest message or plain object - * @returns Promise - */ - public batchCreateResourceValueConfigs(request: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest): Promise; - - /** - * Calls DeleteResourceValueConfig. - * @param request DeleteResourceValueConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteResourceValueConfig(request: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfigCallback): void; - - /** - * Calls DeleteResourceValueConfig. - * @param request DeleteResourceValueConfigRequest message or plain object - * @returns Promise - */ - public deleteResourceValueConfig(request: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest): Promise; - - /** - * Calls GetResourceValueConfig. - * @param request GetResourceValueConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceValueConfig - */ - public getResourceValueConfig(request: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfigCallback): void; - - /** - * Calls GetResourceValueConfig. - * @param request GetResourceValueConfigRequest message or plain object - * @returns Promise - */ - public getResourceValueConfig(request: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest): Promise; - - /** - * Calls ListResourceValueConfigs. - * @param request ListResourceValueConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListResourceValueConfigsResponse - */ - public listResourceValueConfigs(request: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigsCallback): void; - - /** - * Calls ListResourceValueConfigs. - * @param request ListResourceValueConfigsRequest message or plain object - * @returns Promise - */ - public listResourceValueConfigs(request: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest): Promise; - - /** - * Calls UpdateResourceValueConfig. - * @param request UpdateResourceValueConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceValueConfig - */ - public updateResourceValueConfig(request: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfigCallback): void; - - /** - * Calls UpdateResourceValueConfig. - * @param request UpdateResourceValueConfigRequest message or plain object - * @returns Promise - */ - public updateResourceValueConfig(request: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest): Promise; - - /** - * Calls ListValuedResources. - * @param request ListValuedResourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListValuedResourcesResponse - */ - public listValuedResources(request: google.cloud.securitycenter.v1.IListValuedResourcesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListValuedResourcesCallback): void; - - /** - * Calls ListValuedResources. - * @param request ListValuedResourcesRequest message or plain object - * @returns Promise - */ - public listValuedResources(request: google.cloud.securitycenter.v1.IListValuedResourcesRequest): Promise; - - /** - * Calls ListAttackPaths. - * @param request ListAttackPathsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAttackPathsResponse - */ - public listAttackPaths(request: google.cloud.securitycenter.v1.IListAttackPathsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListAttackPathsCallback): void; - - /** - * Calls ListAttackPaths. - * @param request ListAttackPathsRequest message or plain object - * @returns Promise - */ - public listAttackPaths(request: google.cloud.securitycenter.v1.IListAttackPathsRequest): Promise; - } - - 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|createSecurityHealthAnalyticsCustomModule}. - * @param error Error, if any - * @param [response] SecurityHealthAnalyticsCustomModule - */ - type CreateSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => void; - - /** - * 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|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 - * @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}. - * @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 - * @param [response] Empty - */ - type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteSecurityHealthAnalyticsCustomModule}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSimulation}. - * @param error Error, if any - * @param [response] Simulation - */ - type GetSimulationCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Simulation) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getValuedResource}. - * @param error Error, if any - * @param [response] ValuedResource - */ - type GetValuedResourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ValuedResource) => 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 - * @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}. - * @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 - * @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|getEffectiveSecurityHealthAnalyticsCustomModule}. - * @param error Error, if any - * @param [response] EffectiveSecurityHealthAnalyticsCustomModule - */ - type GetEffectiveSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSecurityHealthAnalyticsCustomModule}. - * @param error Error, if any - * @param [response] SecurityHealthAnalyticsCustomModule - */ - type GetSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => 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|listDescendantSecurityHealthAnalyticsCustomModules}. - * @param error Error, if any - * @param [response] ListDescendantSecurityHealthAnalyticsCustomModulesResponse - */ - type ListDescendantSecurityHealthAnalyticsCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse) => 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|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 - * @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|listEffectiveSecurityHealthAnalyticsCustomModules}. - * @param error Error, if any - * @param [response] ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - */ - type ListEffectiveSecurityHealthAnalyticsCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listSecurityHealthAnalyticsCustomModules}. - * @param error Error, if any - * @param [response] ListSecurityHealthAnalyticsCustomModulesResponse - */ - type ListSecurityHealthAnalyticsCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse) => 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|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 - * @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|simulateSecurityHealthAnalyticsCustomModule}. - * @param error Error, if any - * @param [response] SimulateSecurityHealthAnalyticsCustomModuleResponse - */ - type SimulateSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse) => 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 - * @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}. - * @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 - * @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}. - * @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|updateSecurityHealthAnalyticsCustomModule}. - * @param error Error, if any - * @param [response] SecurityHealthAnalyticsCustomModule - */ - type UpdateSecurityHealthAnalyticsCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => 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; - - /** - * 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; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createEventThreatDetectionCustomModule}. - * @param error Error, if any - * @param [response] EventThreatDetectionCustomModule - */ - type CreateEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteEventThreatDetectionCustomModule}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getEventThreatDetectionCustomModule}. - * @param error Error, if any - * @param [response] EventThreatDetectionCustomModule - */ - type GetEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listDescendantEventThreatDetectionCustomModules}. - * @param error Error, if any - * @param [response] ListDescendantEventThreatDetectionCustomModulesResponse - */ - type ListDescendantEventThreatDetectionCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listEventThreatDetectionCustomModules}. - * @param error Error, if any - * @param [response] ListEventThreatDetectionCustomModulesResponse - */ - type ListEventThreatDetectionCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateEventThreatDetectionCustomModule}. - * @param error Error, if any - * @param [response] EventThreatDetectionCustomModule - */ - type UpdateEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|validateEventThreatDetectionCustomModule}. - * @param error Error, if any - * @param [response] ValidateEventThreatDetectionCustomModuleResponse - */ - type ValidateEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getEffectiveEventThreatDetectionCustomModule}. - * @param error Error, if any - * @param [response] EffectiveEventThreatDetectionCustomModule - */ - type GetEffectiveEventThreatDetectionCustomModuleCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listEffectiveEventThreatDetectionCustomModules}. - * @param error Error, if any - * @param [response] ListEffectiveEventThreatDetectionCustomModulesResponse - */ - type ListEffectiveEventThreatDetectionCustomModulesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|batchCreateResourceValueConfigs}. - * @param error Error, if any - * @param [response] BatchCreateResourceValueConfigsResponse - */ - type BatchCreateResourceValueConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteResourceValueConfig}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteResourceValueConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getResourceValueConfig}. - * @param error Error, if any - * @param [response] ResourceValueConfig - */ - type GetResourceValueConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ResourceValueConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listResourceValueConfigs}. - * @param error Error, if any - * @param [response] ListResourceValueConfigsResponse - */ - type ListResourceValueConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListResourceValueConfigsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateResourceValueConfig}. - * @param error Error, if any - * @param [response] ResourceValueConfig - */ - type UpdateResourceValueConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ResourceValueConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listValuedResources}. - * @param error Error, if any - * @param [response] ListValuedResourcesResponse - */ - type ListValuedResourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListValuedResourcesResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listAttackPaths}. - * @param error Error, if any - * @param [response] ListAttackPathsResponse - */ - type ListAttackPathsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAttackPathsResponse) => void; - } - - /** Properties of a BulkMuteFindingsRequest. */ - interface IBulkMuteFindingsRequest { - - /** BulkMuteFindingsRequest parent */ - parent?: (string|null); - - /** BulkMuteFindingsRequest filter */ - filter?: (string|null); - - /** BulkMuteFindingsRequest muteAnnotation */ - muteAnnotation?: (string|null); - - /** BulkMuteFindingsRequest muteState */ - muteState?: (google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState|keyof typeof google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState|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; - - /** BulkMuteFindingsRequest muteState. */ - public muteState: (google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState|keyof typeof google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState); - - /** - * 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 }; - - /** - * 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; - } - - namespace BulkMuteFindingsRequest { - - /** MuteState enum. */ - enum MuteState { - MUTE_STATE_UNSPECIFIED = 0, - MUTED = 1, - UNDEFINED = 2 - } - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 CreateResourceValueConfigRequest. */ - interface ICreateResourceValueConfigRequest { - - /** CreateResourceValueConfigRequest parent */ - parent?: (string|null); - - /** CreateResourceValueConfigRequest resourceValueConfig */ - resourceValueConfig?: (google.cloud.securitycenter.v1.IResourceValueConfig|null); - } - - /** Represents a CreateResourceValueConfigRequest. */ - class CreateResourceValueConfigRequest implements ICreateResourceValueConfigRequest { - - /** - * Constructs a new CreateResourceValueConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest); - - /** CreateResourceValueConfigRequest parent. */ - public parent: string; - - /** CreateResourceValueConfigRequest resourceValueConfig. */ - public resourceValueConfig?: (google.cloud.securitycenter.v1.IResourceValueConfig|null); - - /** - * Creates a new CreateResourceValueConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateResourceValueConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest): google.cloud.securitycenter.v1.CreateResourceValueConfigRequest; - - /** - * Encodes the specified CreateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify|verify} messages. - * @param message CreateResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify|verify} messages. - * @param message CreateResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader 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.CreateResourceValueConfigRequest; - - /** - * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateResourceValueConfigRequest - * @throws {Error} If the payload is not 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.CreateResourceValueConfigRequest; - - /** - * Verifies a CreateResourceValueConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateResourceValueConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateResourceValueConfigRequest; - - /** - * Creates a plain object from a CreateResourceValueConfigRequest message. Also converts values to other types if specified. - * @param message CreateResourceValueConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CreateResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateResourceValueConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateResourceValueConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateResourceValueConfigsRequest. */ - interface IBatchCreateResourceValueConfigsRequest { - - /** BatchCreateResourceValueConfigsRequest parent */ - parent?: (string|null); - - /** BatchCreateResourceValueConfigsRequest requests */ - requests?: (google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest[]|null); - } - - /** Represents a BatchCreateResourceValueConfigsRequest. */ - class BatchCreateResourceValueConfigsRequest implements IBatchCreateResourceValueConfigsRequest { - - /** - * Constructs a new BatchCreateResourceValueConfigsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest); - - /** BatchCreateResourceValueConfigsRequest parent. */ - public parent: string; - - /** BatchCreateResourceValueConfigsRequest requests. */ - public requests: google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest[]; - - /** - * Creates a new BatchCreateResourceValueConfigsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateResourceValueConfigsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest): google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest; - - /** - * Encodes the specified BatchCreateResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.verify|verify} messages. - * @param message BatchCreateResourceValueConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.verify|verify} messages. - * @param message BatchCreateResourceValueConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader 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.BatchCreateResourceValueConfigsRequest; - - /** - * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateResourceValueConfigsRequest - * @throws {Error} If the payload is not 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.BatchCreateResourceValueConfigsRequest; - - /** - * Verifies a BatchCreateResourceValueConfigsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateResourceValueConfigsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest; - - /** - * Creates a plain object from a BatchCreateResourceValueConfigsRequest message. Also converts values to other types if specified. - * @param message BatchCreateResourceValueConfigsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateResourceValueConfigsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateResourceValueConfigsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateResourceValueConfigsResponse. */ - interface IBatchCreateResourceValueConfigsResponse { - - /** BatchCreateResourceValueConfigsResponse resourceValueConfigs */ - resourceValueConfigs?: (google.cloud.securitycenter.v1.IResourceValueConfig[]|null); - } - - /** Represents a BatchCreateResourceValueConfigsResponse. */ - class BatchCreateResourceValueConfigsResponse implements IBatchCreateResourceValueConfigsResponse { - - /** - * Constructs a new BatchCreateResourceValueConfigsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse); - - /** BatchCreateResourceValueConfigsResponse resourceValueConfigs. */ - public resourceValueConfigs: google.cloud.securitycenter.v1.IResourceValueConfig[]; - - /** - * Creates a new BatchCreateResourceValueConfigsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateResourceValueConfigsResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse): google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse; - - /** - * Encodes the specified BatchCreateResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.verify|verify} messages. - * @param message BatchCreateResourceValueConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.verify|verify} messages. - * @param message BatchCreateResourceValueConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader 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.BatchCreateResourceValueConfigsResponse; - - /** - * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateResourceValueConfigsResponse - * @throws {Error} If the payload is not 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.BatchCreateResourceValueConfigsResponse; - - /** - * Verifies a BatchCreateResourceValueConfigsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateResourceValueConfigsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse; - - /** - * Creates a plain object from a BatchCreateResourceValueConfigsResponse message. Also converts values to other types if specified. - * @param message BatchCreateResourceValueConfigsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateResourceValueConfigsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateResourceValueConfigsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteResourceValueConfigRequest. */ - interface IDeleteResourceValueConfigRequest { - - /** DeleteResourceValueConfigRequest name */ - name?: (string|null); - } - - /** Represents a DeleteResourceValueConfigRequest. */ - class DeleteResourceValueConfigRequest implements IDeleteResourceValueConfigRequest { - - /** - * Constructs a new DeleteResourceValueConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest); - - /** DeleteResourceValueConfigRequest name. */ - public name: string; - - /** - * Creates a new DeleteResourceValueConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteResourceValueConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest): google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest; - - /** - * Encodes the specified DeleteResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest.verify|verify} messages. - * @param message DeleteResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest.verify|verify} messages. - * @param message DeleteResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteResourceValueConfigRequest - * @throws {Error} If the payload is not a reader 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.DeleteResourceValueConfigRequest; - - /** - * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteResourceValueConfigRequest - * @throws {Error} If the payload is not 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.DeleteResourceValueConfigRequest; - - /** - * Verifies a DeleteResourceValueConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteResourceValueConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest; - - /** - * Creates a plain object from a DeleteResourceValueConfigRequest message. Also converts values to other types if specified. - * @param message DeleteResourceValueConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteResourceValueConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteResourceValueConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetResourceValueConfigRequest. */ - interface IGetResourceValueConfigRequest { - - /** GetResourceValueConfigRequest name */ - name?: (string|null); - } - - /** Represents a GetResourceValueConfigRequest. */ - class GetResourceValueConfigRequest implements IGetResourceValueConfigRequest { - - /** - * Constructs a new GetResourceValueConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest); - - /** GetResourceValueConfigRequest name. */ - public name: string; - - /** - * Creates a new GetResourceValueConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetResourceValueConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest): google.cloud.securitycenter.v1.GetResourceValueConfigRequest; - - /** - * Encodes the specified GetResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetResourceValueConfigRequest.verify|verify} messages. - * @param message GetResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetResourceValueConfigRequest.verify|verify} messages. - * @param message GetResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetResourceValueConfigRequest - * @throws {Error} If the payload is not a reader 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.GetResourceValueConfigRequest; - - /** - * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetResourceValueConfigRequest - * @throws {Error} If the payload is not 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.GetResourceValueConfigRequest; - - /** - * Verifies a GetResourceValueConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetResourceValueConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetResourceValueConfigRequest; - - /** - * Creates a plain object from a GetResourceValueConfigRequest message. Also converts values to other types if specified. - * @param message GetResourceValueConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.GetResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetResourceValueConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetResourceValueConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListResourceValueConfigsRequest. */ - interface IListResourceValueConfigsRequest { - - /** ListResourceValueConfigsRequest parent */ - parent?: (string|null); - - /** ListResourceValueConfigsRequest pageSize */ - pageSize?: (number|null); - - /** ListResourceValueConfigsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListResourceValueConfigsRequest. */ - class ListResourceValueConfigsRequest implements IListResourceValueConfigsRequest { - - /** - * Constructs a new ListResourceValueConfigsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest); - - /** ListResourceValueConfigsRequest parent. */ - public parent: string; - - /** ListResourceValueConfigsRequest pageSize. */ - public pageSize: number; - - /** ListResourceValueConfigsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListResourceValueConfigsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceValueConfigsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest): google.cloud.securitycenter.v1.ListResourceValueConfigsRequest; - - /** - * Encodes the specified ListResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsRequest.verify|verify} messages. - * @param message ListResourceValueConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsRequest.verify|verify} messages. - * @param message ListResourceValueConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader 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.ListResourceValueConfigsRequest; - - /** - * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceValueConfigsRequest - * @throws {Error} If the payload is not 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.ListResourceValueConfigsRequest; - - /** - * Verifies a ListResourceValueConfigsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceValueConfigsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListResourceValueConfigsRequest; - - /** - * Creates a plain object from a ListResourceValueConfigsRequest message. Also converts values to other types if specified. - * @param message ListResourceValueConfigsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListResourceValueConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceValueConfigsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceValueConfigsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListResourceValueConfigsResponse. */ - interface IListResourceValueConfigsResponse { - - /** ListResourceValueConfigsResponse resourceValueConfigs */ - resourceValueConfigs?: (google.cloud.securitycenter.v1.IResourceValueConfig[]|null); - - /** ListResourceValueConfigsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListResourceValueConfigsResponse. */ - class ListResourceValueConfigsResponse implements IListResourceValueConfigsResponse { - - /** - * Constructs a new ListResourceValueConfigsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListResourceValueConfigsResponse); - - /** ListResourceValueConfigsResponse resourceValueConfigs. */ - public resourceValueConfigs: google.cloud.securitycenter.v1.IResourceValueConfig[]; - - /** ListResourceValueConfigsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListResourceValueConfigsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceValueConfigsResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListResourceValueConfigsResponse): google.cloud.securitycenter.v1.ListResourceValueConfigsResponse; - - /** - * Encodes the specified ListResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.verify|verify} messages. - * @param message ListResourceValueConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.verify|verify} messages. - * @param message ListResourceValueConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader 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.ListResourceValueConfigsResponse; - - /** - * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceValueConfigsResponse - * @throws {Error} If the payload is not 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.ListResourceValueConfigsResponse; - - /** - * Verifies a ListResourceValueConfigsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceValueConfigsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListResourceValueConfigsResponse; - - /** - * Creates a plain object from a ListResourceValueConfigsResponse message. Also converts values to other types if specified. - * @param message ListResourceValueConfigsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListResourceValueConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceValueConfigsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceValueConfigsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateResourceValueConfigRequest. */ - interface IUpdateResourceValueConfigRequest { - - /** UpdateResourceValueConfigRequest resourceValueConfig */ - resourceValueConfig?: (google.cloud.securitycenter.v1.IResourceValueConfig|null); - - /** UpdateResourceValueConfigRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateResourceValueConfigRequest. */ - class UpdateResourceValueConfigRequest implements IUpdateResourceValueConfigRequest { - - /** - * Constructs a new UpdateResourceValueConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest); - - /** UpdateResourceValueConfigRequest resourceValueConfig. */ - public resourceValueConfig?: (google.cloud.securitycenter.v1.IResourceValueConfig|null); - - /** UpdateResourceValueConfigRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateResourceValueConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateResourceValueConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest): google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest; - - /** - * Encodes the specified UpdateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.verify|verify} messages. - * @param message UpdateResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.verify|verify} messages. - * @param message UpdateResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader 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.UpdateResourceValueConfigRequest; - - /** - * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateResourceValueConfigRequest - * @throws {Error} If the payload is not 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.UpdateResourceValueConfigRequest; - - /** - * Verifies an UpdateResourceValueConfigRequest message. - * @param message Plain 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 UpdateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateResourceValueConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest; - - /** - * Creates a plain object from an UpdateResourceValueConfigRequest message. Also converts values to other types if specified. - * @param message UpdateResourceValueConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateResourceValueConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateResourceValueConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 { - - /** - * Constructs a new CreateNotificationConfigRequest. - * @param [properties] Properties to set - */ - 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); - - /** - * Creates a new CreateNotificationConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateNotificationConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; - - /** - * 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 static encode(message: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.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.v1.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.v1.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.v1.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.v1.CreateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateNotificationConfigRequest to JSON. - * @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 CreateSecurityHealthAnalyticsCustomModuleRequest. */ - interface ICreateSecurityHealthAnalyticsCustomModuleRequest { - - /** CreateSecurityHealthAnalyticsCustomModuleRequest parent */ - parent?: (string|null); - - /** CreateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule */ - securityHealthAnalyticsCustomModule?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null); - } - - /** Represents a CreateSecurityHealthAnalyticsCustomModuleRequest. */ - class CreateSecurityHealthAnalyticsCustomModuleRequest implements ICreateSecurityHealthAnalyticsCustomModuleRequest { - - /** - * Constructs a new CreateSecurityHealthAnalyticsCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest); - - /** CreateSecurityHealthAnalyticsCustomModuleRequest parent. */ - public parent: string; - - /** CreateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule. */ - public securityHealthAnalyticsCustomModule?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null); - - /** - * Creates a new CreateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSecurityHealthAnalyticsCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Encodes the specified CreateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.CreateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Decodes a CreateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not 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.CreateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Verifies a CreateSecurityHealthAnalyticsCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSecurityHealthAnalyticsCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Creates a plain object from a CreateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @param message CreateSecurityHealthAnalyticsCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSecurityHealthAnalyticsCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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.v1.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.v1.IDeleteNotificationConfigRequest): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; - - /** - * 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.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.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.v1.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.v1.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.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 }; - - /** - * 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 DeleteSecurityHealthAnalyticsCustomModuleRequest. */ - interface IDeleteSecurityHealthAnalyticsCustomModuleRequest { - - /** DeleteSecurityHealthAnalyticsCustomModuleRequest name */ - name?: (string|null); - } - - /** Represents a DeleteSecurityHealthAnalyticsCustomModuleRequest. */ - class DeleteSecurityHealthAnalyticsCustomModuleRequest implements IDeleteSecurityHealthAnalyticsCustomModuleRequest { - - /** - * Constructs a new DeleteSecurityHealthAnalyticsCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest); - - /** DeleteSecurityHealthAnalyticsCustomModuleRequest name. */ - public name: string; - - /** - * Creates a new DeleteSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSecurityHealthAnalyticsCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Encodes the specified DeleteSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.DeleteSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Decodes a DeleteSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not 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.DeleteSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Verifies a DeleteSecurityHealthAnalyticsCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSecurityHealthAnalyticsCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Creates a plain object from a DeleteSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @param message DeleteSecurityHealthAnalyticsCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSecurityHealthAnalyticsCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBigQueryExportRequest. */ - interface IGetBigQueryExportRequest { - - /** GetBigQueryExportRequest name */ - name?: (string|null); - } - - /** Represents a GetBigQueryExportRequest. */ - class GetBigQueryExportRequest implements IGetBigQueryExportRequest { - - /** - * Constructs a new GetBigQueryExportRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGetBigQueryExportRequest); - - /** GetBigQueryExportRequest name. */ - public name: string; - - /** - * Creates a new GetBigQueryExportRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBigQueryExportRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGetBigQueryExportRequest): google.cloud.securitycenter.v1.GetBigQueryExportRequest; - - /** - * 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.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.GetBigQueryExportRequest; - - /** - * Decodes a GetBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.GetBigQueryExportRequest; - - /** - * 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 GetBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBigQueryExportRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetBigQueryExportRequest; - - /** - * 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.GetBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBigQueryExportRequest to JSON. - * @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. */ - 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.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 }; - - /** - * 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. */ - 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); - - /** 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.v1.IGetNotificationConfigRequest): google.cloud.securitycenter.v1.GetNotificationConfigRequest; - - /** - * 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.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.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.v1.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.v1.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.v1.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.v1.GetNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetNotificationConfigRequest to JSON. - * @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. */ - 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 }; - - /** - * 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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. */ - interface IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest { - - /** GetEffectiveSecurityHealthAnalyticsCustomModuleRequest name */ - name?: (string|null); - } - - /** Represents a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. */ - class GetEffectiveSecurityHealthAnalyticsCustomModuleRequest implements IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest { - - /** - * Constructs a new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest); - - /** GetEffectiveSecurityHealthAnalyticsCustomModuleRequest name. */ - public name: string; - - /** - * Creates a new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEffectiveSecurityHealthAnalyticsCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Encodes the specified GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Decodes a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not 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.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Verifies a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Creates a plain object from a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @param message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEffectiveSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSecurityHealthAnalyticsCustomModuleRequest. */ - interface IGetSecurityHealthAnalyticsCustomModuleRequest { - - /** GetSecurityHealthAnalyticsCustomModuleRequest name */ - name?: (string|null); - } - - /** Represents a GetSecurityHealthAnalyticsCustomModuleRequest. */ - class GetSecurityHealthAnalyticsCustomModuleRequest implements IGetSecurityHealthAnalyticsCustomModuleRequest { - - /** - * Constructs a new GetSecurityHealthAnalyticsCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest); - - /** GetSecurityHealthAnalyticsCustomModuleRequest name. */ - public name: string; - - /** - * Creates a new GetSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSecurityHealthAnalyticsCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Encodes the specified GetSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message GetSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message GetSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.GetSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Decodes a GetSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not 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.GetSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Verifies a GetSecurityHealthAnalyticsCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSecurityHealthAnalyticsCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Creates a plain object from a GetSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @param message GetSecurityHealthAnalyticsCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSecurityHealthAnalyticsCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 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 }; - - /** - * 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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest. */ - interface IListDescendantSecurityHealthAnalyticsCustomModulesRequest { - - /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest parent */ - parent?: (string|null); - - /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageSize */ - pageSize?: (number|null); - - /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDescendantSecurityHealthAnalyticsCustomModulesRequest. */ - class ListDescendantSecurityHealthAnalyticsCustomModulesRequest implements IListDescendantSecurityHealthAnalyticsCustomModulesRequest { - - /** - * Constructs a new ListDescendantSecurityHealthAnalyticsCustomModulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest); - - /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest parent. */ - public parent: string; - - /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageSize. */ - public pageSize: number; - - /** ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDescendantSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDescendantSecurityHealthAnalyticsCustomModulesRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest): google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @param message ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @param message ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader 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.ListDescendantSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not 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.ListDescendantSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Verifies a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDescendantSecurityHealthAnalyticsCustomModulesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Creates a plain object from a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. - * @param message ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDescendantSecurityHealthAnalyticsCustomModulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDescendantSecurityHealthAnalyticsCustomModulesResponse. */ - interface IListDescendantSecurityHealthAnalyticsCustomModulesResponse { - - /** ListDescendantSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules */ - securityHealthAnalyticsCustomModules?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]|null); - - /** ListDescendantSecurityHealthAnalyticsCustomModulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDescendantSecurityHealthAnalyticsCustomModulesResponse. */ - class ListDescendantSecurityHealthAnalyticsCustomModulesResponse implements IListDescendantSecurityHealthAnalyticsCustomModulesResponse { - - /** - * Constructs a new ListDescendantSecurityHealthAnalyticsCustomModulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse); - - /** ListDescendantSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules. */ - public securityHealthAnalyticsCustomModules: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]; - - /** ListDescendantSecurityHealthAnalyticsCustomModulesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDescendantSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDescendantSecurityHealthAnalyticsCustomModulesResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse): google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @param message ListDescendantSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @param message ListDescendantSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader 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.ListDescendantSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not 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.ListDescendantSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Verifies a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDescendantSecurityHealthAnalyticsCustomModulesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Creates a plain object from a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. - * @param message ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDescendantSecurityHealthAnalyticsCustomModulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListValuedResourcesRequest. */ - interface IListValuedResourcesRequest { - - /** ListValuedResourcesRequest parent */ - parent?: (string|null); - - /** ListValuedResourcesRequest filter */ - filter?: (string|null); - - /** ListValuedResourcesRequest pageToken */ - pageToken?: (string|null); - - /** ListValuedResourcesRequest pageSize */ - pageSize?: (number|null); - - /** ListValuedResourcesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListValuedResourcesRequest. */ - class ListValuedResourcesRequest implements IListValuedResourcesRequest { - - /** - * Constructs a new ListValuedResourcesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListValuedResourcesRequest); - - /** ListValuedResourcesRequest parent. */ - public parent: string; - - /** ListValuedResourcesRequest filter. */ - public filter: string; - - /** ListValuedResourcesRequest pageToken. */ - public pageToken: string; - - /** ListValuedResourcesRequest pageSize. */ - public pageSize: number; - - /** ListValuedResourcesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListValuedResourcesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValuedResourcesRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListValuedResourcesRequest): google.cloud.securitycenter.v1.ListValuedResourcesRequest; - - /** - * Encodes the specified ListValuedResourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesRequest.verify|verify} messages. - * @param message ListValuedResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListValuedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValuedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesRequest.verify|verify} messages. - * @param message ListValuedResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListValuedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValuedResourcesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValuedResourcesRequest - * @throws {Error} If the payload is not a reader 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.ListValuedResourcesRequest; - - /** - * Decodes a ListValuedResourcesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValuedResourcesRequest - * @throws {Error} If the payload is not 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.ListValuedResourcesRequest; - - /** - * Verifies a ListValuedResourcesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValuedResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValuedResourcesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListValuedResourcesRequest; - - /** - * Creates a plain object from a ListValuedResourcesRequest message. Also converts values to other types if specified. - * @param message ListValuedResourcesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListValuedResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValuedResourcesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValuedResourcesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListValuedResourcesResponse. */ - interface IListValuedResourcesResponse { - - /** ListValuedResourcesResponse valuedResources */ - valuedResources?: (google.cloud.securitycenter.v1.IValuedResource[]|null); - - /** ListValuedResourcesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListValuedResourcesResponse totalSize */ - totalSize?: (number|null); - } - - /** Represents a ListValuedResourcesResponse. */ - class ListValuedResourcesResponse implements IListValuedResourcesResponse { - - /** - * Constructs a new ListValuedResourcesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListValuedResourcesResponse); - - /** ListValuedResourcesResponse valuedResources. */ - public valuedResources: google.cloud.securitycenter.v1.IValuedResource[]; - - /** ListValuedResourcesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListValuedResourcesResponse totalSize. */ - public totalSize: number; - - /** - * Creates a new ListValuedResourcesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValuedResourcesResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListValuedResourcesResponse): google.cloud.securitycenter.v1.ListValuedResourcesResponse; - - /** - * Encodes the specified ListValuedResourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesResponse.verify|verify} messages. - * @param message ListValuedResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListValuedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValuedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesResponse.verify|verify} messages. - * @param message ListValuedResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListValuedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValuedResourcesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValuedResourcesResponse - * @throws {Error} If the payload is not a reader 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.ListValuedResourcesResponse; - - /** - * Decodes a ListValuedResourcesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValuedResourcesResponse - * @throws {Error} If the payload is not 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.ListValuedResourcesResponse; - - /** - * Verifies a ListValuedResourcesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValuedResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValuedResourcesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListValuedResourcesResponse; - - /** - * Creates a plain object from a ListValuedResourcesResponse message. Also converts values to other types if specified. - * @param message ListValuedResourcesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListValuedResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValuedResourcesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValuedResourcesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAttackPathsRequest. */ - interface IListAttackPathsRequest { - - /** ListAttackPathsRequest parent */ - parent?: (string|null); - - /** ListAttackPathsRequest filter */ - filter?: (string|null); - - /** ListAttackPathsRequest pageToken */ - pageToken?: (string|null); - - /** ListAttackPathsRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListAttackPathsRequest. */ - class ListAttackPathsRequest implements IListAttackPathsRequest { - - /** - * Constructs a new ListAttackPathsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListAttackPathsRequest); - - /** ListAttackPathsRequest parent. */ - public parent: string; - - /** ListAttackPathsRequest filter. */ - public filter: string; - - /** ListAttackPathsRequest pageToken. */ - public pageToken: string; - - /** ListAttackPathsRequest pageSize. */ - public pageSize: number; - - /** - * Creates a new ListAttackPathsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttackPathsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListAttackPathsRequest): google.cloud.securitycenter.v1.ListAttackPathsRequest; - - /** - * Encodes the specified ListAttackPathsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsRequest.verify|verify} messages. - * @param message ListAttackPathsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListAttackPathsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttackPathsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsRequest.verify|verify} messages. - * @param message ListAttackPathsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAttackPathsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttackPathsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttackPathsRequest - * @throws {Error} If the payload is not a reader 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.ListAttackPathsRequest; - - /** - * Decodes a ListAttackPathsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttackPathsRequest - * @throws {Error} If the payload is not 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.ListAttackPathsRequest; - - /** - * Verifies a ListAttackPathsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttackPathsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttackPathsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAttackPathsRequest; - - /** - * Creates a plain object from a ListAttackPathsRequest message. Also converts values to other types if specified. - * @param message ListAttackPathsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListAttackPathsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttackPathsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttackPathsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAttackPathsResponse. */ - interface IListAttackPathsResponse { - - /** ListAttackPathsResponse attackPaths */ - attackPaths?: (google.cloud.securitycenter.v1.IAttackPath[]|null); - - /** ListAttackPathsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAttackPathsResponse. */ - class ListAttackPathsResponse implements IListAttackPathsResponse { - - /** - * Constructs a new ListAttackPathsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListAttackPathsResponse); - - /** ListAttackPathsResponse attackPaths. */ - public attackPaths: google.cloud.securitycenter.v1.IAttackPath[]; - - /** ListAttackPathsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAttackPathsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttackPathsResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListAttackPathsResponse): google.cloud.securitycenter.v1.ListAttackPathsResponse; - - /** - * Encodes the specified ListAttackPathsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsResponse.verify|verify} messages. - * @param message ListAttackPathsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListAttackPathsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttackPathsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsResponse.verify|verify} messages. - * @param message ListAttackPathsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAttackPathsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttackPathsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttackPathsResponse - * @throws {Error} If the payload is not a reader 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.ListAttackPathsResponse; - - /** - * Decodes a ListAttackPathsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttackPathsResponse - * @throws {Error} If the payload is not 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.ListAttackPathsResponse; - - /** - * Verifies a ListAttackPathsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttackPathsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttackPathsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAttackPathsResponse; - - /** - * Creates a plain object from a ListAttackPathsResponse message. Also converts values to other types if specified. - * @param message ListAttackPathsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListAttackPathsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttackPathsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttackPathsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSimulationRequest. */ - interface IGetSimulationRequest { - - /** GetSimulationRequest name */ - name?: (string|null); - } - - /** Represents a GetSimulationRequest. */ - class GetSimulationRequest implements IGetSimulationRequest { - - /** - * Constructs a new GetSimulationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGetSimulationRequest); - - /** GetSimulationRequest name. */ - public name: string; - - /** - * Creates a new GetSimulationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSimulationRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGetSimulationRequest): google.cloud.securitycenter.v1.GetSimulationRequest; - - /** - * Encodes the specified GetSimulationRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSimulationRequest.verify|verify} messages. - * @param message GetSimulationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGetSimulationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSimulationRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSimulationRequest.verify|verify} messages. - * @param message GetSimulationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetSimulationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSimulationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSimulationRequest - * @throws {Error} If the payload is not a reader 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.GetSimulationRequest; - - /** - * Decodes a GetSimulationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSimulationRequest - * @throws {Error} If the payload is not 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.GetSimulationRequest; - - /** - * Verifies a GetSimulationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSimulationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSimulationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetSimulationRequest; - - /** - * Creates a plain object from a GetSimulationRequest message. Also converts values to other types if specified. - * @param message GetSimulationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.GetSimulationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSimulationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSimulationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetValuedResourceRequest. */ - interface IGetValuedResourceRequest { - - /** GetValuedResourceRequest name */ - name?: (string|null); - } - - /** Represents a GetValuedResourceRequest. */ - class GetValuedResourceRequest implements IGetValuedResourceRequest { - - /** - * Constructs a new GetValuedResourceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGetValuedResourceRequest); - - /** GetValuedResourceRequest name. */ - public name: string; - - /** - * Creates a new GetValuedResourceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetValuedResourceRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGetValuedResourceRequest): google.cloud.securitycenter.v1.GetValuedResourceRequest; - - /** - * Encodes the specified GetValuedResourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetValuedResourceRequest.verify|verify} messages. - * @param message GetValuedResourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGetValuedResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetValuedResourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetValuedResourceRequest.verify|verify} messages. - * @param message GetValuedResourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetValuedResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetValuedResourceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetValuedResourceRequest - * @throws {Error} If the payload is not a reader 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.GetValuedResourceRequest; - - /** - * Decodes a GetValuedResourceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetValuedResourceRequest - * @throws {Error} If the payload is not 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.GetValuedResourceRequest; - - /** - * Verifies a GetValuedResourceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetValuedResourceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetValuedResourceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetValuedResourceRequest; - - /** - * Creates a plain object from a GetValuedResourceRequest message. Also converts values to other types if specified. - * @param message GetValuedResourceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.GetValuedResourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetValuedResourceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetValuedResourceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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.v1.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.v1.IListNotificationConfigsRequest): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; - - /** - * 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.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.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.v1.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.v1.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.v1.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.v1.ListNotificationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListNotificationConfigsRequest to JSON. - * @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. */ - interface IListNotificationConfigsResponse { - - /** ListNotificationConfigsResponse notificationConfigs */ - notificationConfigs?: (google.cloud.securitycenter.v1.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.v1.IListNotificationConfigsResponse); - - /** ListNotificationConfigsResponse notificationConfigs. */ - public notificationConfigs: google.cloud.securitycenter.v1.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.v1.IListNotificationConfigsResponse): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; - - /** - * 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.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.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.v1.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.v1.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.v1.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.v1.ListNotificationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListNotificationConfigsResponse to JSON. - * @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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. */ - interface IListEffectiveSecurityHealthAnalyticsCustomModulesRequest { - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest parent */ - parent?: (string|null); - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageSize */ - pageSize?: (number|null); - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. */ - class ListEffectiveSecurityHealthAnalyticsCustomModulesRequest implements IListEffectiveSecurityHealthAnalyticsCustomModulesRequest { - - /** - * Constructs a new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest); - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest parent. */ - public parent: string; - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageSize. */ - public pageSize: number; - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest): google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader 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.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not 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.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Verifies a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Creates a plain object from a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. - * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEffectiveSecurityHealthAnalyticsCustomModulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. */ - interface IListEffectiveSecurityHealthAnalyticsCustomModulesResponse { - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesResponse effectiveSecurityHealthAnalyticsCustomModules */ - effectiveSecurityHealthAnalyticsCustomModules?: (google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[]|null); - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. */ - class ListEffectiveSecurityHealthAnalyticsCustomModulesResponse implements IListEffectiveSecurityHealthAnalyticsCustomModulesResponse { - - /** - * Constructs a new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse); - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesResponse effectiveSecurityHealthAnalyticsCustomModules. */ - public effectiveSecurityHealthAnalyticsCustomModules: google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[]; - - /** ListEffectiveSecurityHealthAnalyticsCustomModulesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse): google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader 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.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not 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.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Verifies a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Creates a plain object from a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. - * @param message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEffectiveSecurityHealthAnalyticsCustomModulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSecurityHealthAnalyticsCustomModulesRequest. */ - interface IListSecurityHealthAnalyticsCustomModulesRequest { - - /** ListSecurityHealthAnalyticsCustomModulesRequest parent */ - parent?: (string|null); - - /** ListSecurityHealthAnalyticsCustomModulesRequest pageSize */ - pageSize?: (number|null); - - /** ListSecurityHealthAnalyticsCustomModulesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSecurityHealthAnalyticsCustomModulesRequest. */ - class ListSecurityHealthAnalyticsCustomModulesRequest implements IListSecurityHealthAnalyticsCustomModulesRequest { - - /** - * Constructs a new ListSecurityHealthAnalyticsCustomModulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest); - - /** ListSecurityHealthAnalyticsCustomModulesRequest parent. */ - public parent: string; - - /** ListSecurityHealthAnalyticsCustomModulesRequest pageSize. */ - public pageSize: number; - - /** ListSecurityHealthAnalyticsCustomModulesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSecurityHealthAnalyticsCustomModulesRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest): google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Encodes the specified ListSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @param message ListSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @param message ListSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader 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.ListSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Decodes a ListSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not 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.ListSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Verifies a ListSecurityHealthAnalyticsCustomModulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSecurityHealthAnalyticsCustomModulesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest; - - /** - * Creates a plain object from a ListSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. - * @param message ListSecurityHealthAnalyticsCustomModulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSecurityHealthAnalyticsCustomModulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSecurityHealthAnalyticsCustomModulesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSecurityHealthAnalyticsCustomModulesResponse. */ - interface IListSecurityHealthAnalyticsCustomModulesResponse { - - /** ListSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules */ - securityHealthAnalyticsCustomModules?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]|null); - - /** ListSecurityHealthAnalyticsCustomModulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSecurityHealthAnalyticsCustomModulesResponse. */ - class ListSecurityHealthAnalyticsCustomModulesResponse implements IListSecurityHealthAnalyticsCustomModulesResponse { - - /** - * Constructs a new ListSecurityHealthAnalyticsCustomModulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse); - - /** ListSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules. */ - public securityHealthAnalyticsCustomModules: google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]; - - /** ListSecurityHealthAnalyticsCustomModulesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSecurityHealthAnalyticsCustomModulesResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse): google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Encodes the specified ListSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @param message ListSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @param message ListSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader 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.ListSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Decodes a ListSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not 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.ListSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Verifies a ListSecurityHealthAnalyticsCustomModulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSecurityHealthAnalyticsCustomModulesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse; - - /** - * Creates a plain object from a ListSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. - * @param message ListSecurityHealthAnalyticsCustomModulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSecurityHealthAnalyticsCustomModulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSecurityHealthAnalyticsCustomModulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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|keyof typeof 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|keyof typeof 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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|keyof typeof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null); - - /** ListFindingsResult resource */ - resource?: (google.cloud.securitycenter.v1.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.v1.ListFindingsResponse.IListFindingsResult); - - /** ListFindingsResult finding. */ - public finding?: (google.cloud.securitycenter.v1.IFinding|null); - - /** 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); - - /** - * 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 }; - - /** - * 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 { - - /** StateChange enum. */ - enum StateChange { - UNUSED = 0, - CHANGED = 1, - UNCHANGED = 2, - ADDED = 3, - REMOVED = 4 - } - - /** Properties of a Resource. */ - interface IResource { - - /** Resource name */ - name?: (string|null); - - /** Resource displayName */ - displayName?: (string|null); - - /** Resource type */ - type?: (string|null); - - /** Resource projectName */ - projectName?: (string|null); - - /** Resource projectDisplayName */ - projectDisplayName?: (string|null); - - /** Resource parentName */ - parentName?: (string|null); - - /** Resource parentDisplayName */ - parentDisplayName?: (string|null); - - /** Resource folders */ - folders?: (google.cloud.securitycenter.v1.IFolder[]|null); - - /** Resource cloudProvider */ - cloudProvider?: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider|null); - - /** Resource organization */ - organization?: (string|null); - - /** Resource service */ - service?: (string|null); - - /** Resource location */ - location?: (string|null); - - /** Resource awsMetadata */ - awsMetadata?: (google.cloud.securitycenter.v1.IAwsMetadata|null); - - /** Resource azureMetadata */ - azureMetadata?: (google.cloud.securitycenter.v1.IAzureMetadata|null); - - /** Resource resourcePath */ - resourcePath?: (google.cloud.securitycenter.v1.IResourcePath|null); - - /** Resource resourcePathString */ - resourcePathString?: (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 displayName. */ - public displayName: string; - - /** Resource type. */ - public type: string; - - /** Resource projectName. */ - public projectName: string; - - /** Resource projectDisplayName. */ - public projectDisplayName: string; - - /** Resource parentName. */ - public parentName: string; - - /** Resource parentDisplayName. */ - public parentDisplayName: string; - - /** Resource folders. */ - public folders: google.cloud.securitycenter.v1.IFolder[]; - - /** Resource cloudProvider. */ - public cloudProvider: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider); - - /** Resource organization. */ - public organization: string; - - /** Resource service. */ - public service: string; - - /** Resource location. */ - public location: string; - - /** Resource awsMetadata. */ - public awsMetadata?: (google.cloud.securitycenter.v1.IAwsMetadata|null); - - /** Resource azureMetadata. */ - public azureMetadata?: (google.cloud.securitycenter.v1.IAzureMetadata|null); - - /** Resource resourcePath. */ - public resourcePath?: (google.cloud.securitycenter.v1.IResourcePath|null); - - /** Resource resourcePathString. */ - public resourcePathString: string; - - /** Resource cloudProviderMetadata. */ - public cloudProviderMetadata?: ("awsMetadata"|"azureMetadata"); - - /** - * 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 }; - - /** - * 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 a SetFindingStateRequest. */ - interface ISetFindingStateRequest { - - /** SetFindingStateRequest name */ - name?: (string|null); - - /** SetFindingStateRequest state */ - state?: (google.cloud.securitycenter.v1.Finding.State|keyof typeof 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|keyof typeof 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 a SimulateSecurityHealthAnalyticsCustomModuleRequest. */ - interface ISimulateSecurityHealthAnalyticsCustomModuleRequest { - - /** SimulateSecurityHealthAnalyticsCustomModuleRequest parent */ - parent?: (string|null); - - /** SimulateSecurityHealthAnalyticsCustomModuleRequest customConfig */ - customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); - - /** SimulateSecurityHealthAnalyticsCustomModuleRequest resource */ - resource?: (google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource|null); - } - - /** Represents a SimulateSecurityHealthAnalyticsCustomModuleRequest. */ - class SimulateSecurityHealthAnalyticsCustomModuleRequest implements ISimulateSecurityHealthAnalyticsCustomModuleRequest { - - /** - * Constructs a new SimulateSecurityHealthAnalyticsCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest); - - /** SimulateSecurityHealthAnalyticsCustomModuleRequest parent. */ - public parent: string; - - /** SimulateSecurityHealthAnalyticsCustomModuleRequest customConfig. */ - public customConfig?: (google.cloud.securitycenter.v1.ICustomConfig|null); - - /** SimulateSecurityHealthAnalyticsCustomModuleRequest resource. */ - public resource?: (google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource|null); - - /** - * Creates a new SimulateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SimulateSecurityHealthAnalyticsCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SimulateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimulateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.SimulateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Decodes a SimulateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimulateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not 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.SimulateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Verifies a SimulateSecurityHealthAnalyticsCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SimulateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimulateSecurityHealthAnalyticsCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Creates a plain object from a SimulateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @param message SimulateSecurityHealthAnalyticsCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SimulateSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SimulateSecurityHealthAnalyticsCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SimulateSecurityHealthAnalyticsCustomModuleRequest { - - /** Properties of a SimulatedResource. */ - interface ISimulatedResource { - - /** SimulatedResource resourceType */ - resourceType?: (string|null); - - /** SimulatedResource resourceData */ - resourceData?: (google.protobuf.IStruct|null); - - /** SimulatedResource iamPolicyData */ - iamPolicyData?: (google.iam.v1.IPolicy|null); - } - - /** Represents a SimulatedResource. */ - class SimulatedResource implements ISimulatedResource { - - /** - * Constructs a new SimulatedResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource); - - /** SimulatedResource resourceType. */ - public resourceType: string; - - /** SimulatedResource resourceData. */ - public resourceData?: (google.protobuf.IStruct|null); - - /** SimulatedResource iamPolicyData. */ - public iamPolicyData?: (google.iam.v1.IPolicy|null); - - /** - * Creates a new SimulatedResource instance using the specified properties. - * @param [properties] Properties to set - * @returns SimulatedResource instance - */ - public static create(properties?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource; - - /** - * Encodes the specified SimulatedResource message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify|verify} messages. - * @param message SimulatedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SimulatedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify|verify} messages. - * @param message SimulatedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SimulatedResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimulatedResource - * @throws {Error} If the payload is not a reader 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.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource; - - /** - * Decodes a SimulatedResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimulatedResource - * @throws {Error} If the payload is not 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.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource; - - /** - * Verifies a SimulatedResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SimulatedResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimulatedResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource; - - /** - * Creates a plain object from a SimulatedResource message. Also converts values to other types if specified. - * @param message SimulatedResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SimulatedResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SimulatedResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SimulateSecurityHealthAnalyticsCustomModuleResponse. */ - interface ISimulateSecurityHealthAnalyticsCustomModuleResponse { - - /** SimulateSecurityHealthAnalyticsCustomModuleResponse result */ - result?: (google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult|null); - } - - /** Represents a SimulateSecurityHealthAnalyticsCustomModuleResponse. */ - class SimulateSecurityHealthAnalyticsCustomModuleResponse implements ISimulateSecurityHealthAnalyticsCustomModuleResponse { - - /** - * Constructs a new SimulateSecurityHealthAnalyticsCustomModuleResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse); - - /** SimulateSecurityHealthAnalyticsCustomModuleResponse result. */ - public result?: (google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult|null); - - /** - * Creates a new SimulateSecurityHealthAnalyticsCustomModuleResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SimulateSecurityHealthAnalyticsCustomModuleResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse; - - /** - * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.verify|verify} messages. - * @param message SimulateSecurityHealthAnalyticsCustomModuleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.verify|verify} messages. - * @param message SimulateSecurityHealthAnalyticsCustomModuleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SimulateSecurityHealthAnalyticsCustomModuleResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimulateSecurityHealthAnalyticsCustomModuleResponse - * @throws {Error} If the payload is not a reader 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.SimulateSecurityHealthAnalyticsCustomModuleResponse; - - /** - * Decodes a SimulateSecurityHealthAnalyticsCustomModuleResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimulateSecurityHealthAnalyticsCustomModuleResponse - * @throws {Error} If the payload is not 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.SimulateSecurityHealthAnalyticsCustomModuleResponse; - - /** - * Verifies a SimulateSecurityHealthAnalyticsCustomModuleResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SimulateSecurityHealthAnalyticsCustomModuleResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimulateSecurityHealthAnalyticsCustomModuleResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse; - - /** - * Creates a plain object from a SimulateSecurityHealthAnalyticsCustomModuleResponse message. Also converts values to other types if specified. - * @param message SimulateSecurityHealthAnalyticsCustomModuleResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SimulateSecurityHealthAnalyticsCustomModuleResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SimulateSecurityHealthAnalyticsCustomModuleResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SimulateSecurityHealthAnalyticsCustomModuleResponse { - - /** Properties of a SimulatedResult. */ - interface ISimulatedResult { - - /** SimulatedResult finding */ - finding?: (google.cloud.securitycenter.v1.IFinding|null); - - /** SimulatedResult noViolation */ - noViolation?: (google.protobuf.IEmpty|null); - - /** SimulatedResult error */ - error?: (google.rpc.IStatus|null); - } - - /** Represents a SimulatedResult. */ - class SimulatedResult implements ISimulatedResult { - - /** - * Constructs a new SimulatedResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult); - - /** SimulatedResult finding. */ - public finding?: (google.cloud.securitycenter.v1.IFinding|null); - - /** SimulatedResult noViolation. */ - public noViolation?: (google.protobuf.IEmpty|null); - - /** SimulatedResult error. */ - public error?: (google.rpc.IStatus|null); - - /** SimulatedResult result. */ - public result?: ("finding"|"noViolation"|"error"); - - /** - * Creates a new SimulatedResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SimulatedResult instance - */ - public static create(properties?: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult; - - /** - * Encodes the specified SimulatedResult message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify|verify} messages. - * @param message SimulatedResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SimulatedResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify|verify} messages. - * @param message SimulatedResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SimulatedResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimulatedResult - * @throws {Error} If the payload is not a reader 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.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult; - - /** - * Decodes a SimulatedResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimulatedResult - * @throws {Error} If the payload is not 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.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult; - - /** - * Verifies a SimulatedResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SimulatedResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimulatedResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult; - - /** - * Creates a plain object from a SimulatedResult message. Also converts values to other types if specified. - * @param message SimulatedResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SimulatedResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SimulatedResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 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.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.v1.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.v1.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.v1.UpdateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateNotificationConfigRequest to JSON. - * @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 { - - /** 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 }; - - /** - * 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 UpdateSecurityHealthAnalyticsCustomModuleRequest. */ - interface IUpdateSecurityHealthAnalyticsCustomModuleRequest { - - /** UpdateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule */ - securityHealthAnalyticsCustomModule?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null); - - /** UpdateSecurityHealthAnalyticsCustomModuleRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateSecurityHealthAnalyticsCustomModuleRequest. */ - class UpdateSecurityHealthAnalyticsCustomModuleRequest implements IUpdateSecurityHealthAnalyticsCustomModuleRequest { - - /** - * Constructs a new UpdateSecurityHealthAnalyticsCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest); - - /** UpdateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule. */ - public securityHealthAnalyticsCustomModule?: (google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null); - - /** UpdateSecurityHealthAnalyticsCustomModuleRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSecurityHealthAnalyticsCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest): google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Encodes the specified UpdateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @param message UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.UpdateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Decodes an UpdateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not 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.UpdateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Verifies an UpdateSecurityHealthAnalyticsCustomModuleRequest message. - * @param message Plain 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 UpdateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSecurityHealthAnalyticsCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest; - - /** - * Creates a plain object from an UpdateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @param message UpdateSecurityHealthAnalyticsCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateSecurityHealthAnalyticsCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - interface ICreateBigQueryExportRequest { - - /** CreateBigQueryExportRequest parent */ - parent?: (string|null); - - /** CreateBigQueryExportRequest bigQueryExport */ - bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); - - /** CreateBigQueryExportRequest bigQueryExportId */ - bigQueryExportId?: (string|null); - } - - /** Represents a CreateBigQueryExportRequest. */ - class CreateBigQueryExportRequest implements ICreateBigQueryExportRequest { - - /** - * Constructs a new CreateBigQueryExportRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest); - - /** CreateBigQueryExportRequest parent. */ - public parent: string; - - /** CreateBigQueryExportRequest bigQueryExport. */ - public bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); - - /** CreateBigQueryExportRequest bigQueryExportId. */ - public bigQueryExportId: string; - - /** - * Creates a new CreateBigQueryExportRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBigQueryExportRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; - - /** - * 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.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.CreateBigQueryExportRequest; - - /** - * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.CreateBigQueryExportRequest; - - /** - * 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 CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBigQueryExportRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; - - /** - * 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.CreateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBigQueryExportRequest to JSON. - * @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. */ - interface IUpdateBigQueryExportRequest { - - /** UpdateBigQueryExportRequest bigQueryExport */ - bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); - - /** UpdateBigQueryExportRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateBigQueryExportRequest. */ - class UpdateBigQueryExportRequest implements IUpdateBigQueryExportRequest { - - /** - * Constructs a new UpdateBigQueryExportRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest); - - /** UpdateBigQueryExportRequest bigQueryExport. */ - public bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); - - /** UpdateBigQueryExportRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateBigQueryExportRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBigQueryExportRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; - - /** - * 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.v1.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.v1.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.v1.UpdateBigQueryExportRequest; - - /** - * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.v1.UpdateBigQueryExportRequest; - - /** - * 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 UpdateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBigQueryExportRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; - - /** - * 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.v1.UpdateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBigQueryExportRequest to JSON. - * @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. */ - interface IListBigQueryExportsRequest { - - /** ListBigQueryExportsRequest parent */ - parent?: (string|null); - - /** ListBigQueryExportsRequest pageSize */ - pageSize?: (number|null); - - /** ListBigQueryExportsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBigQueryExportsRequest. */ - class ListBigQueryExportsRequest implements IListBigQueryExportsRequest { - - /** - * Constructs a new ListBigQueryExportsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsRequest); - - /** ListBigQueryExportsRequest parent. */ - public parent: string; - - /** ListBigQueryExportsRequest pageSize. */ - public pageSize: number; - - /** ListBigQueryExportsRequest pageToken. */ - public pageToken: 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 CreateEventThreatDetectionCustomModuleRequest. */ - interface ICreateEventThreatDetectionCustomModuleRequest { - - /** CreateEventThreatDetectionCustomModuleRequest parent */ - parent?: (string|null); - - /** CreateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule */ - eventThreatDetectionCustomModule?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null); - } - - /** Represents a CreateEventThreatDetectionCustomModuleRequest. */ - class CreateEventThreatDetectionCustomModuleRequest implements ICreateEventThreatDetectionCustomModuleRequest { - - /** - * Constructs a new CreateEventThreatDetectionCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest); - - /** CreateEventThreatDetectionCustomModuleRequest parent. */ - public parent: string; - - /** CreateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule. */ - public eventThreatDetectionCustomModule?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null); - - /** - * Creates a new CreateEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateEventThreatDetectionCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest; - - /** - * Encodes the specified CreateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message CreateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message CreateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.CreateEventThreatDetectionCustomModuleRequest; - - /** - * Decodes a CreateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not 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.CreateEventThreatDetectionCustomModuleRequest; - - /** - * Verifies a CreateEventThreatDetectionCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateEventThreatDetectionCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest; - - /** - * Creates a plain object from a CreateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @param message CreateEventThreatDetectionCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateEventThreatDetectionCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateEventThreatDetectionCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValidateEventThreatDetectionCustomModuleRequest. */ - interface IValidateEventThreatDetectionCustomModuleRequest { - - /** ValidateEventThreatDetectionCustomModuleRequest parent */ - parent?: (string|null); - - /** ValidateEventThreatDetectionCustomModuleRequest rawText */ - rawText?: (string|null); - - /** ValidateEventThreatDetectionCustomModuleRequest type */ - type?: (string|null); - } - - /** Represents a ValidateEventThreatDetectionCustomModuleRequest. */ - class ValidateEventThreatDetectionCustomModuleRequest implements IValidateEventThreatDetectionCustomModuleRequest { - - /** - * Constructs a new ValidateEventThreatDetectionCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest); - - /** ValidateEventThreatDetectionCustomModuleRequest parent. */ - public parent: string; - - /** ValidateEventThreatDetectionCustomModuleRequest rawText. */ - public rawText: string; - - /** ValidateEventThreatDetectionCustomModuleRequest type. */ - public type: string; - - /** - * Creates a new ValidateEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidateEventThreatDetectionCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest; - - /** - * Encodes the specified ValidateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message ValidateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message ValidateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.ValidateEventThreatDetectionCustomModuleRequest; - - /** - * Decodes a ValidateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not 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.ValidateEventThreatDetectionCustomModuleRequest; - - /** - * Verifies a ValidateEventThreatDetectionCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValidateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidateEventThreatDetectionCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest; - - /** - * Creates a plain object from a ValidateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @param message ValidateEventThreatDetectionCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidateEventThreatDetectionCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValidateEventThreatDetectionCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValidateEventThreatDetectionCustomModuleResponse. */ - interface IValidateEventThreatDetectionCustomModuleResponse { - - /** ValidateEventThreatDetectionCustomModuleResponse errors */ - errors?: (google.cloud.securitycenter.v1.ICustomModuleValidationErrors|null); - } - - /** Represents a ValidateEventThreatDetectionCustomModuleResponse. */ - class ValidateEventThreatDetectionCustomModuleResponse implements IValidateEventThreatDetectionCustomModuleResponse { - - /** - * Constructs a new ValidateEventThreatDetectionCustomModuleResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse); - - /** ValidateEventThreatDetectionCustomModuleResponse errors. */ - public errors?: (google.cloud.securitycenter.v1.ICustomModuleValidationErrors|null); - - /** - * Creates a new ValidateEventThreatDetectionCustomModuleResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidateEventThreatDetectionCustomModuleResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse): google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse; - - /** - * Encodes the specified ValidateEventThreatDetectionCustomModuleResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.verify|verify} messages. - * @param message ValidateEventThreatDetectionCustomModuleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidateEventThreatDetectionCustomModuleResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.verify|verify} messages. - * @param message ValidateEventThreatDetectionCustomModuleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidateEventThreatDetectionCustomModuleResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidateEventThreatDetectionCustomModuleResponse - * @throws {Error} If the payload is not a reader 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.ValidateEventThreatDetectionCustomModuleResponse; - - /** - * Decodes a ValidateEventThreatDetectionCustomModuleResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidateEventThreatDetectionCustomModuleResponse - * @throws {Error} If the payload is not 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.ValidateEventThreatDetectionCustomModuleResponse; - - /** - * Verifies a ValidateEventThreatDetectionCustomModuleResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValidateEventThreatDetectionCustomModuleResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidateEventThreatDetectionCustomModuleResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse; - - /** - * Creates a plain object from a ValidateEventThreatDetectionCustomModuleResponse message. Also converts values to other types if specified. - * @param message ValidateEventThreatDetectionCustomModuleResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidateEventThreatDetectionCustomModuleResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValidateEventThreatDetectionCustomModuleResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteEventThreatDetectionCustomModuleRequest. */ - interface IDeleteEventThreatDetectionCustomModuleRequest { - - /** DeleteEventThreatDetectionCustomModuleRequest name */ - name?: (string|null); - } - - /** Represents a DeleteEventThreatDetectionCustomModuleRequest. */ - class DeleteEventThreatDetectionCustomModuleRequest implements IDeleteEventThreatDetectionCustomModuleRequest { - - /** - * Constructs a new DeleteEventThreatDetectionCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest); - - /** DeleteEventThreatDetectionCustomModuleRequest name. */ - public name: string; - - /** - * Creates a new DeleteEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteEventThreatDetectionCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest; - - /** - * Encodes the specified DeleteEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message DeleteEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message DeleteEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.DeleteEventThreatDetectionCustomModuleRequest; - - /** - * Decodes a DeleteEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not 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.DeleteEventThreatDetectionCustomModuleRequest; - - /** - * Verifies a DeleteEventThreatDetectionCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteEventThreatDetectionCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest; - - /** - * Creates a plain object from a DeleteEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @param message DeleteEventThreatDetectionCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteEventThreatDetectionCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteEventThreatDetectionCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEventThreatDetectionCustomModuleRequest. */ - interface IGetEventThreatDetectionCustomModuleRequest { - - /** GetEventThreatDetectionCustomModuleRequest name */ - name?: (string|null); - } - - /** Represents a GetEventThreatDetectionCustomModuleRequest. */ - class GetEventThreatDetectionCustomModuleRequest implements IGetEventThreatDetectionCustomModuleRequest { - - /** - * Constructs a new GetEventThreatDetectionCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest); - - /** GetEventThreatDetectionCustomModuleRequest name. */ - public name: string; - - /** - * Creates a new GetEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEventThreatDetectionCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest; - - /** - * Encodes the specified GetEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message GetEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message GetEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.GetEventThreatDetectionCustomModuleRequest; - - /** - * Decodes a GetEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not 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.GetEventThreatDetectionCustomModuleRequest; - - /** - * Verifies a GetEventThreatDetectionCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEventThreatDetectionCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest; - - /** - * Creates a plain object from a GetEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @param message GetEventThreatDetectionCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEventThreatDetectionCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEventThreatDetectionCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDescendantEventThreatDetectionCustomModulesRequest. */ - interface IListDescendantEventThreatDetectionCustomModulesRequest { - - /** ListDescendantEventThreatDetectionCustomModulesRequest parent */ - parent?: (string|null); - - /** ListDescendantEventThreatDetectionCustomModulesRequest pageToken */ - pageToken?: (string|null); - - /** ListDescendantEventThreatDetectionCustomModulesRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListDescendantEventThreatDetectionCustomModulesRequest. */ - class ListDescendantEventThreatDetectionCustomModulesRequest implements IListDescendantEventThreatDetectionCustomModulesRequest { - - /** - * Constructs a new ListDescendantEventThreatDetectionCustomModulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest); - - /** ListDescendantEventThreatDetectionCustomModulesRequest parent. */ - public parent: string; - - /** ListDescendantEventThreatDetectionCustomModulesRequest pageToken. */ - public pageToken: string; - - /** ListDescendantEventThreatDetectionCustomModulesRequest pageSize. */ - public pageSize: number; - - /** - * Creates a new ListDescendantEventThreatDetectionCustomModulesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDescendantEventThreatDetectionCustomModulesRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest): google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest; - - /** - * Encodes the specified ListDescendantEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @param message ListDescendantEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDescendantEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @param message ListDescendantEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDescendantEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDescendantEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader 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.ListDescendantEventThreatDetectionCustomModulesRequest; - - /** - * Decodes a ListDescendantEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDescendantEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not 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.ListDescendantEventThreatDetectionCustomModulesRequest; - - /** - * Verifies a ListDescendantEventThreatDetectionCustomModulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDescendantEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDescendantEventThreatDetectionCustomModulesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest; - - /** - * Creates a plain object from a ListDescendantEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. - * @param message ListDescendantEventThreatDetectionCustomModulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDescendantEventThreatDetectionCustomModulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDescendantEventThreatDetectionCustomModulesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDescendantEventThreatDetectionCustomModulesResponse. */ - interface IListDescendantEventThreatDetectionCustomModulesResponse { - - /** ListDescendantEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules */ - eventThreatDetectionCustomModules?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]|null); - - /** ListDescendantEventThreatDetectionCustomModulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDescendantEventThreatDetectionCustomModulesResponse. */ - class ListDescendantEventThreatDetectionCustomModulesResponse implements IListDescendantEventThreatDetectionCustomModulesResponse { - - /** - * Constructs a new ListDescendantEventThreatDetectionCustomModulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse); - - /** ListDescendantEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules. */ - public eventThreatDetectionCustomModules: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]; - - /** ListDescendantEventThreatDetectionCustomModulesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDescendantEventThreatDetectionCustomModulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDescendantEventThreatDetectionCustomModulesResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse): google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse; - - /** - * Encodes the specified ListDescendantEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @param message ListDescendantEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDescendantEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @param message ListDescendantEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDescendantEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDescendantEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader 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.ListDescendantEventThreatDetectionCustomModulesResponse; - - /** - * Decodes a ListDescendantEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDescendantEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not 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.ListDescendantEventThreatDetectionCustomModulesResponse; - - /** - * Verifies a ListDescendantEventThreatDetectionCustomModulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDescendantEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDescendantEventThreatDetectionCustomModulesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse; - - /** - * Creates a plain object from a ListDescendantEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. - * @param message ListDescendantEventThreatDetectionCustomModulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDescendantEventThreatDetectionCustomModulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDescendantEventThreatDetectionCustomModulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEventThreatDetectionCustomModulesRequest. */ - interface IListEventThreatDetectionCustomModulesRequest { - - /** ListEventThreatDetectionCustomModulesRequest parent */ - parent?: (string|null); - - /** ListEventThreatDetectionCustomModulesRequest pageToken */ - pageToken?: (string|null); - - /** ListEventThreatDetectionCustomModulesRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListEventThreatDetectionCustomModulesRequest. */ - class ListEventThreatDetectionCustomModulesRequest implements IListEventThreatDetectionCustomModulesRequest { - - /** - * Constructs a new ListEventThreatDetectionCustomModulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest); - - /** ListEventThreatDetectionCustomModulesRequest parent. */ - public parent: string; - - /** ListEventThreatDetectionCustomModulesRequest pageToken. */ - public pageToken: string; - - /** ListEventThreatDetectionCustomModulesRequest pageSize. */ - public pageSize: number; - - /** - * Creates a new ListEventThreatDetectionCustomModulesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEventThreatDetectionCustomModulesRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest): google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest; - - /** - * Encodes the specified ListEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @param message ListEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @param message ListEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader 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.ListEventThreatDetectionCustomModulesRequest; - - /** - * Decodes a ListEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not 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.ListEventThreatDetectionCustomModulesRequest; - - /** - * Verifies a ListEventThreatDetectionCustomModulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEventThreatDetectionCustomModulesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest; - - /** - * Creates a plain object from a ListEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. - * @param message ListEventThreatDetectionCustomModulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEventThreatDetectionCustomModulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEventThreatDetectionCustomModulesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEventThreatDetectionCustomModulesResponse. */ - interface IListEventThreatDetectionCustomModulesResponse { - - /** ListEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules */ - eventThreatDetectionCustomModules?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]|null); - - /** ListEventThreatDetectionCustomModulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEventThreatDetectionCustomModulesResponse. */ - class ListEventThreatDetectionCustomModulesResponse implements IListEventThreatDetectionCustomModulesResponse { - - /** - * Constructs a new ListEventThreatDetectionCustomModulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse); - - /** ListEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules. */ - public eventThreatDetectionCustomModules: google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]; - - /** ListEventThreatDetectionCustomModulesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEventThreatDetectionCustomModulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEventThreatDetectionCustomModulesResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse): google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse; - - /** - * Encodes the specified ListEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @param message ListEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @param message ListEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader 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.ListEventThreatDetectionCustomModulesResponse; - - /** - * Decodes a ListEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not 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.ListEventThreatDetectionCustomModulesResponse; - - /** - * Verifies a ListEventThreatDetectionCustomModulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEventThreatDetectionCustomModulesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse; - - /** - * Creates a plain object from a ListEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. - * @param message ListEventThreatDetectionCustomModulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEventThreatDetectionCustomModulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEventThreatDetectionCustomModulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateEventThreatDetectionCustomModuleRequest. */ - interface IUpdateEventThreatDetectionCustomModuleRequest { - - /** UpdateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule */ - eventThreatDetectionCustomModule?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null); - - /** UpdateEventThreatDetectionCustomModuleRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateEventThreatDetectionCustomModuleRequest. */ - class UpdateEventThreatDetectionCustomModuleRequest implements IUpdateEventThreatDetectionCustomModuleRequest { - - /** - * Constructs a new UpdateEventThreatDetectionCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest); - - /** UpdateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule. */ - public eventThreatDetectionCustomModule?: (google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null); - - /** UpdateEventThreatDetectionCustomModuleRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateEventThreatDetectionCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest; - - /** - * Encodes the specified UpdateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message UpdateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message UpdateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.UpdateEventThreatDetectionCustomModuleRequest; - - /** - * Decodes an UpdateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not 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.UpdateEventThreatDetectionCustomModuleRequest; - - /** - * Verifies an UpdateEventThreatDetectionCustomModuleRequest message. - * @param message Plain 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 UpdateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateEventThreatDetectionCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest; - - /** - * Creates a plain object from an UpdateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @param message UpdateEventThreatDetectionCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateEventThreatDetectionCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateEventThreatDetectionCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEffectiveEventThreatDetectionCustomModuleRequest. */ - interface IGetEffectiveEventThreatDetectionCustomModuleRequest { - - /** GetEffectiveEventThreatDetectionCustomModuleRequest name */ - name?: (string|null); - } - - /** Represents a GetEffectiveEventThreatDetectionCustomModuleRequest. */ - class GetEffectiveEventThreatDetectionCustomModuleRequest implements IGetEffectiveEventThreatDetectionCustomModuleRequest { - - /** - * Constructs a new GetEffectiveEventThreatDetectionCustomModuleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest); - - /** GetEffectiveEventThreatDetectionCustomModuleRequest name. */ - public name: string; - - /** - * Creates a new GetEffectiveEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEffectiveEventThreatDetectionCustomModuleRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest): google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest; - - /** - * Encodes the specified GetEffectiveEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEffectiveEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @param message GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEffectiveEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEffectiveEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader 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.GetEffectiveEventThreatDetectionCustomModuleRequest; - - /** - * Decodes a GetEffectiveEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEffectiveEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not 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.GetEffectiveEventThreatDetectionCustomModuleRequest; - - /** - * Verifies a GetEffectiveEventThreatDetectionCustomModuleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEffectiveEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEffectiveEventThreatDetectionCustomModuleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest; - - /** - * Creates a plain object from a GetEffectiveEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @param message GetEffectiveEventThreatDetectionCustomModuleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEffectiveEventThreatDetectionCustomModuleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEffectiveEventThreatDetectionCustomModuleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEffectiveEventThreatDetectionCustomModulesRequest. */ - interface IListEffectiveEventThreatDetectionCustomModulesRequest { - - /** ListEffectiveEventThreatDetectionCustomModulesRequest parent */ - parent?: (string|null); - - /** ListEffectiveEventThreatDetectionCustomModulesRequest pageToken */ - pageToken?: (string|null); - - /** ListEffectiveEventThreatDetectionCustomModulesRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListEffectiveEventThreatDetectionCustomModulesRequest. */ - class ListEffectiveEventThreatDetectionCustomModulesRequest implements IListEffectiveEventThreatDetectionCustomModulesRequest { - - /** - * Constructs a new ListEffectiveEventThreatDetectionCustomModulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest); - - /** ListEffectiveEventThreatDetectionCustomModulesRequest parent. */ - public parent: string; - - /** ListEffectiveEventThreatDetectionCustomModulesRequest pageToken. */ - public pageToken: string; - - /** ListEffectiveEventThreatDetectionCustomModulesRequest pageSize. */ - public pageSize: number; - - /** - * Creates a new ListEffectiveEventThreatDetectionCustomModulesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEffectiveEventThreatDetectionCustomModulesRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest): google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest; - - /** - * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @param message ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @param message ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEffectiveEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEffectiveEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader 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.ListEffectiveEventThreatDetectionCustomModulesRequest; - - /** - * Decodes a ListEffectiveEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEffectiveEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not 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.ListEffectiveEventThreatDetectionCustomModulesRequest; - - /** - * Verifies a ListEffectiveEventThreatDetectionCustomModulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEffectiveEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEffectiveEventThreatDetectionCustomModulesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest; - - /** - * Creates a plain object from a ListEffectiveEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. - * @param message ListEffectiveEventThreatDetectionCustomModulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEffectiveEventThreatDetectionCustomModulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEffectiveEventThreatDetectionCustomModulesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEffectiveEventThreatDetectionCustomModulesResponse. */ - interface IListEffectiveEventThreatDetectionCustomModulesResponse { - - /** ListEffectiveEventThreatDetectionCustomModulesResponse effectiveEventThreatDetectionCustomModules */ - effectiveEventThreatDetectionCustomModules?: (google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[]|null); - - /** ListEffectiveEventThreatDetectionCustomModulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEffectiveEventThreatDetectionCustomModulesResponse. */ - class ListEffectiveEventThreatDetectionCustomModulesResponse implements IListEffectiveEventThreatDetectionCustomModulesResponse { - - /** - * Constructs a new ListEffectiveEventThreatDetectionCustomModulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse); - - /** ListEffectiveEventThreatDetectionCustomModulesResponse effectiveEventThreatDetectionCustomModules. */ - public effectiveEventThreatDetectionCustomModules: google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[]; - - /** ListEffectiveEventThreatDetectionCustomModulesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEffectiveEventThreatDetectionCustomModulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEffectiveEventThreatDetectionCustomModulesResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse): google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse; - - /** - * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @param message ListEffectiveEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @param message ListEffectiveEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEffectiveEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEffectiveEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader 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.ListEffectiveEventThreatDetectionCustomModulesResponse; - - /** - * Decodes a ListEffectiveEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEffectiveEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not 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.ListEffectiveEventThreatDetectionCustomModulesResponse; - - /** - * Verifies a ListEffectiveEventThreatDetectionCustomModulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEffectiveEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEffectiveEventThreatDetectionCustomModulesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse; - - /** - * Creates a plain object from a ListEffectiveEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. - * @param message ListEffectiveEventThreatDetectionCustomModulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEffectiveEventThreatDetectionCustomModulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEffectiveEventThreatDetectionCustomModulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Simulation. */ - interface ISimulation { - - /** Simulation name */ - name?: (string|null); - - /** Simulation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Simulation resourceValueConfigsMetadata */ - resourceValueConfigsMetadata?: (google.cloud.securitycenter.v1.IResourceValueConfigMetadata[]|null); - - /** Simulation cloudProvider */ - cloudProvider?: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider|null); - } - - /** Represents a Simulation. */ - class Simulation implements ISimulation { - - /** - * Constructs a new Simulation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISimulation); - - /** Simulation name. */ - public name: string; - - /** Simulation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Simulation resourceValueConfigsMetadata. */ - public resourceValueConfigsMetadata: google.cloud.securitycenter.v1.IResourceValueConfigMetadata[]; - - /** Simulation cloudProvider. */ - public cloudProvider: (google.cloud.securitycenter.v1.CloudProvider|keyof typeof google.cloud.securitycenter.v1.CloudProvider); - - /** - * Creates a new Simulation instance using the specified properties. - * @param [properties] Properties to set - * @returns Simulation instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISimulation): google.cloud.securitycenter.v1.Simulation; - - /** - * Encodes the specified Simulation message. Does not implicitly {@link google.cloud.securitycenter.v1.Simulation.verify|verify} messages. - * @param message Simulation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISimulation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Simulation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Simulation.verify|verify} messages. - * @param message Simulation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISimulation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Simulation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Simulation - * @throws {Error} If the payload is not a reader 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.Simulation; - - /** - * Decodes a Simulation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Simulation - * @throws {Error} If the payload is not 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.Simulation; - - /** - * Verifies a Simulation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Simulation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Simulation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Simulation; - - /** - * Creates a plain object from a Simulation message. Also converts values to other types if specified. - * @param message Simulation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Simulation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Simulation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Simulation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValuedResource. */ - interface IValuedResource { - - /** ValuedResource name */ - name?: (string|null); - - /** ValuedResource resource */ - resource?: (string|null); - - /** ValuedResource resourceType */ - resourceType?: (string|null); - - /** ValuedResource displayName */ - displayName?: (string|null); - - /** ValuedResource resourceValue */ - resourceValue?: (google.cloud.securitycenter.v1.ValuedResource.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ValuedResource.ResourceValue|null); - - /** ValuedResource exposedScore */ - exposedScore?: (number|null); - - /** ValuedResource resourceValueConfigsUsed */ - resourceValueConfigsUsed?: (google.cloud.securitycenter.v1.IResourceValueConfigMetadata[]|null); - } - - /** Represents a ValuedResource. */ - class ValuedResource implements IValuedResource { - - /** - * Constructs a new ValuedResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IValuedResource); - - /** ValuedResource name. */ - public name: string; - - /** ValuedResource resource. */ - public resource: string; - - /** ValuedResource resourceType. */ - public resourceType: string; - - /** ValuedResource displayName. */ - public displayName: string; - - /** ValuedResource resourceValue. */ - public resourceValue: (google.cloud.securitycenter.v1.ValuedResource.ResourceValue|keyof typeof google.cloud.securitycenter.v1.ValuedResource.ResourceValue); - - /** ValuedResource exposedScore. */ - public exposedScore: number; - - /** ValuedResource resourceValueConfigsUsed. */ - public resourceValueConfigsUsed: google.cloud.securitycenter.v1.IResourceValueConfigMetadata[]; - - /** - * Creates a new ValuedResource instance using the specified properties. - * @param [properties] Properties to set - * @returns ValuedResource instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IValuedResource): google.cloud.securitycenter.v1.ValuedResource; - - /** - * Encodes the specified ValuedResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ValuedResource.verify|verify} messages. - * @param message ValuedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IValuedResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValuedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValuedResource.verify|verify} messages. - * @param message ValuedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IValuedResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValuedResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValuedResource - * @throws {Error} If the payload is not a reader 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.ValuedResource; - - /** - * Decodes a ValuedResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValuedResource - * @throws {Error} If the payload is not 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.ValuedResource; - - /** - * Verifies a ValuedResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValuedResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValuedResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ValuedResource; - - /** - * Creates a plain object from a ValuedResource message. Also converts values to other types if specified. - * @param message ValuedResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ValuedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValuedResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValuedResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ValuedResource { - - /** ResourceValue enum. */ - enum ResourceValue { - RESOURCE_VALUE_UNSPECIFIED = 0, - RESOURCE_VALUE_LOW = 1, - RESOURCE_VALUE_MEDIUM = 2, - RESOURCE_VALUE_HIGH = 3 - } - } - - /** Properties of a ResourceValueConfigMetadata. */ - interface IResourceValueConfigMetadata { - - /** ResourceValueConfigMetadata name */ - name?: (string|null); - } - - /** Represents a ResourceValueConfigMetadata. */ - class ResourceValueConfigMetadata implements IResourceValueConfigMetadata { - - /** - * Constructs a new ResourceValueConfigMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IResourceValueConfigMetadata); - - /** ResourceValueConfigMetadata name. */ - public name: string; - - /** - * Creates a new ResourceValueConfigMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceValueConfigMetadata instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IResourceValueConfigMetadata): google.cloud.securitycenter.v1.ResourceValueConfigMetadata; - - /** - * Encodes the specified ResourceValueConfigMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify|verify} messages. - * @param message ResourceValueConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IResourceValueConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceValueConfigMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify|verify} messages. - * @param message ResourceValueConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IResourceValueConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceValueConfigMetadata - * @throws {Error} If the payload is not a reader 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.ResourceValueConfigMetadata; - - /** - * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceValueConfigMetadata - * @throws {Error} If the payload is not 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.ResourceValueConfigMetadata; - - /** - * Verifies a ResourceValueConfigMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceValueConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceValueConfigMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ResourceValueConfigMetadata; - - /** - * Creates a plain object from a ResourceValueConfigMetadata message. Also converts values to other types if specified. - * @param message ResourceValueConfigMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ResourceValueConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceValueConfigMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceValueConfigMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * 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; - } - } - - /** 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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 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 }; - - /** - * 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. */ - 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|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 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|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 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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 { - - /** Properties of an AssetDiscoveryConfig. */ - interface IAssetDiscoveryConfig { - - /** AssetDiscoveryConfig projectIds */ - projectIds?: (string[]|null); - - /** AssetDiscoveryConfig inclusionMode */ - inclusionMode?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof 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|keyof typeof 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 }; - - /** - * 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 { - - /** 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.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 }; - - /** - * 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 { - - /** 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.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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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.v1beta1.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.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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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|keyof typeof 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|keyof typeof 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - interface ISetFindingStateRequest { - - /** SetFindingStateRequest name */ - name?: (string|null); - - /** SetFindingStateRequest state */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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; - } - } - - /** 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); - - /** Asset canonicalName */ - canonicalName?: (string|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); - - /** Asset canonicalName. */ - public canonicalName: string; - - /** - * 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 }; - - /** - * 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 { - - /** 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); - - /** SecurityCenterProperties folders */ - folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|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; - - /** SecurityCenterProperties folders. */ - public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; - - /** - * 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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; - } - } - - /** 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 }; - - /** - * 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. */ - interface ISecurityMarks { - - /** SecurityMarks name */ - name?: (string|null); - - /** SecurityMarks marks */ - marks?: ({ [k: string]: string }|null); - - /** SecurityMarks canonicalName */ - canonicalName?: (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 }; - - /** SecurityMarks canonicalName. */ - public canonicalName: 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 }; - - /** - * 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. */ - 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); - - /** 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. */ - 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); - - /** 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 - * @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 }; - - /** - * 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 { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INACTIVE = 2 - } - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - CRITICAL = 1, - HIGH = 2, - MEDIUM = 3, - LOW = 4 - } - } - - /** 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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. */ - 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); - - /** NotificationMessage resource */ - resource?: (google.cloud.securitycenter.v1p1beta1.IResource|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 resource. */ - public resource?: (google.cloud.securitycenter.v1p1beta1.IResource|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 }; - - /** - * 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. */ - 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); - - /** Resource folders */ - folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|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; - - /** Resource folders. */ - public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; - - /** - * 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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); - - /** AssetDiscoveryConfig folderIds */ - folderIds?: (string[]|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); - - /** AssetDiscoveryConfig folderIds. */ - public folderIds: 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.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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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.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 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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.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 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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.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 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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 { - - /** 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.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 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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 { - - /** 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 }; - - /** - * 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 { - - /** 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); - - /** Resource folders */ - folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|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; - - /** Resource folders. */ - public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; - - /** - * 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 }; - - /** - * 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. */ - 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); - } - - /** Represents a SetFindingStateRequest. */ - class SetFindingStateRequest implements ISetFindingStateRequest { - - /** - * Constructs a new SetFindingStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest); - - /** SetFindingStateRequest name. */ - public name: string; - - /** SetFindingStateRequest 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); - - /** - * Creates a new SetFindingStateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetFindingStateRequest instance - */ - 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.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.v1p1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetFindingStateRequest to JSON. - * @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. */ - 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.v1p1beta1.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.v1p1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; - - /** - * 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.v1p1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunAssetDiscoveryRequest to JSON. - * @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. */ - interface IUpdateFindingRequest { - - /** UpdateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateFindingRequest); - - /** UpdateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; - - /** - * 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.v1p1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateFindingRequest to JSON. - * @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. */ - 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 }; - - /** - * 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 { - - /** UpdateOrganizationSettingsRequest organizationSettings */ - organizationSettings?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateOrganizationSettingsRequest); - - /** UpdateOrganizationSettingsRequest organizationSettings. */ - public organizationSettings?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; - - /** - * 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.v1p1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateOrganizationSettingsRequest to JSON. - * @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. */ - interface IUpdateSourceRequest { - - /** UpdateSourceRequest source */ - source?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateSourceRequest); - - /** UpdateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; - - /** - * 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.v1p1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSourceRequest to JSON. - * @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. */ - interface IUpdateSecurityMarksRequest { - - /** UpdateSecurityMarksRequest securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateSecurityMarksRequest); - - /** UpdateSecurityMarksRequest securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; - - /** - * 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.v1p1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSecurityMarksRequest to JSON. - * @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. */ - 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.v1p1beta1.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.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 }; - - /** - * 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; - } - } - - /** Namespace v2. */ - namespace v2 { - - /** Properties of an Access. */ - interface IAccess { - - /** Access principalEmail */ - principalEmail?: (string|null); - - /** Access callerIp */ - callerIp?: (string|null); - - /** Access callerIpGeo */ - callerIpGeo?: (google.cloud.securitycenter.v2.IGeolocation|null); - - /** Access userAgentFamily */ - userAgentFamily?: (string|null); - - /** Access userAgent */ - userAgent?: (string|null); - - /** Access serviceName */ - serviceName?: (string|null); - - /** Access methodName */ - methodName?: (string|null); - - /** Access principalSubject */ - principalSubject?: (string|null); - - /** Access serviceAccountKeyName */ - serviceAccountKeyName?: (string|null); - - /** Access serviceAccountDelegationInfo */ - serviceAccountDelegationInfo?: (google.cloud.securitycenter.v2.IServiceAccountDelegationInfo[]|null); - - /** Access userName */ - userName?: (string|null); - } - - /** Represents an Access. */ - class Access implements IAccess { - - /** - * Constructs a new Access. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAccess); - - /** Access principalEmail. */ - public principalEmail: string; - - /** Access callerIp. */ - public callerIp: string; - - /** Access callerIpGeo. */ - public callerIpGeo?: (google.cloud.securitycenter.v2.IGeolocation|null); - - /** Access userAgentFamily. */ - public userAgentFamily: string; - - /** Access userAgent. */ - public userAgent: string; - - /** Access serviceName. */ - public serviceName: string; - - /** Access methodName. */ - public methodName: string; - - /** Access principalSubject. */ - public principalSubject: string; - - /** Access serviceAccountKeyName. */ - public serviceAccountKeyName: string; - - /** Access serviceAccountDelegationInfo. */ - public serviceAccountDelegationInfo: google.cloud.securitycenter.v2.IServiceAccountDelegationInfo[]; - - /** Access userName. */ - public userName: 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.v2.IAccess): google.cloud.securitycenter.v2.Access; - - /** - * Encodes the specified Access message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Access to JSON. - * @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 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.v2.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.v2.IServiceAccountDelegationInfo): google.cloud.securitycenter.v2.ServiceAccountDelegationInfo; - - /** - * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IServiceAccountDelegationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAccountDelegationInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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 { - - /** 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.v2.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.v2.IGeolocation): google.cloud.securitycenter.v2.Geolocation; - - /** - * Encodes the specified Geolocation message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGeolocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Geolocation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Geolocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Geolocation to JSON. - * @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 AffectedResources. */ - interface IAffectedResources { - - /** AffectedResources count */ - count?: (number|Long|string|null); - } - - /** Represents an AffectedResources. */ - class AffectedResources implements IAffectedResources { - - /** - * Constructs a new AffectedResources. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAffectedResources); - - /** AffectedResources count. */ - public count: (number|Long|string); - - /** - * Creates a new AffectedResources instance using the specified properties. - * @param [properties] Properties to set - * @returns AffectedResources instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAffectedResources): google.cloud.securitycenter.v2.AffectedResources; - - /** - * Encodes the specified AffectedResources message. Does not implicitly {@link google.cloud.securitycenter.v2.AffectedResources.verify|verify} messages. - * @param message AffectedResources message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAffectedResources, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AffectedResources message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AffectedResources.verify|verify} messages. - * @param message AffectedResources message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAffectedResources, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AffectedResources message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AffectedResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AffectedResources; - - /** - * Decodes an AffectedResources message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AffectedResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AffectedResources; - - /** - * Verifies an AffectedResources message. - * @param message Plain 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 AffectedResources message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AffectedResources - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AffectedResources; - - /** - * Creates a plain object from an AffectedResources message. Also converts values to other types if specified. - * @param message AffectedResources - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AffectedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AffectedResources to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AffectedResources - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AiModel. */ - interface IAiModel { - - /** AiModel name */ - name?: (string|null); - - /** AiModel domain */ - domain?: (string|null); - - /** AiModel library */ - library?: (string|null); - - /** AiModel location */ - location?: (string|null); - - /** AiModel publisher */ - publisher?: (string|null); - - /** AiModel deploymentPlatform */ - deploymentPlatform?: (google.cloud.securitycenter.v2.AiModel.DeploymentPlatform|keyof typeof google.cloud.securitycenter.v2.AiModel.DeploymentPlatform|null); - - /** AiModel displayName */ - displayName?: (string|null); - } - - /** Represents an AiModel. */ - class AiModel implements IAiModel { - - /** - * Constructs a new AiModel. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAiModel); - - /** AiModel name. */ - public name: string; - - /** AiModel domain. */ - public domain: string; - - /** AiModel library. */ - public library: string; - - /** AiModel location. */ - public location: string; - - /** AiModel publisher. */ - public publisher: string; - - /** AiModel deploymentPlatform. */ - public deploymentPlatform: (google.cloud.securitycenter.v2.AiModel.DeploymentPlatform|keyof typeof google.cloud.securitycenter.v2.AiModel.DeploymentPlatform); - - /** AiModel displayName. */ - public displayName: string; - - /** - * Creates a new AiModel instance using the specified properties. - * @param [properties] Properties to set - * @returns AiModel instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAiModel): google.cloud.securitycenter.v2.AiModel; - - /** - * Encodes the specified AiModel message. Does not implicitly {@link google.cloud.securitycenter.v2.AiModel.verify|verify} messages. - * @param message AiModel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAiModel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AiModel message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AiModel.verify|verify} messages. - * @param message AiModel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAiModel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AiModel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AiModel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AiModel; - - /** - * Decodes an AiModel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AiModel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AiModel; - - /** - * Verifies an AiModel message. - * @param message Plain 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 AiModel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AiModel - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AiModel; - - /** - * Creates a plain object from an AiModel message. Also converts values to other types if specified. - * @param message AiModel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AiModel, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AiModel to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AiModel - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AiModel { - - /** DeploymentPlatform enum. */ - enum DeploymentPlatform { - DEPLOYMENT_PLATFORM_UNSPECIFIED = 0, - VERTEX_AI = 1, - GKE = 2, - GCE = 3, - FINE_TUNED_MODEL = 4 - } - } - - /** Properties of an Application. */ - interface IApplication { - - /** Application baseUri */ - baseUri?: (string|null); - - /** Application fullUri */ - fullUri?: (string|null); - } - - /** Represents an Application. */ - class Application implements IApplication { - - /** - * Constructs a new Application. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IApplication); - - /** Application baseUri. */ - public baseUri: string; - - /** Application fullUri. */ - public fullUri: string; - - /** - * Creates a new Application instance using the specified properties. - * @param [properties] Properties to set - * @returns Application instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IApplication): google.cloud.securitycenter.v2.Application; - - /** - * Encodes the specified Application message. Does not implicitly {@link google.cloud.securitycenter.v2.Application.verify|verify} messages. - * @param message Application message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Application.verify|verify} messages. - * @param message Application message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Application message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Application; - - /** - * Decodes an Application message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Application; - - /** - * Verifies an Application message. - * @param message Plain 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 Application message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Application - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Application; - - /** - * Creates a plain object from an Application message. Also converts values to other types if specified. - * @param message Application - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Application, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Application to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Application - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AttackExposure. */ - interface IAttackExposure { - - /** AttackExposure score */ - score?: (number|null); - - /** AttackExposure latestCalculationTime */ - latestCalculationTime?: (google.protobuf.ITimestamp|null); - - /** AttackExposure attackExposureResult */ - attackExposureResult?: (string|null); - - /** AttackExposure state */ - state?: (google.cloud.securitycenter.v2.AttackExposure.State|keyof typeof google.cloud.securitycenter.v2.AttackExposure.State|null); - - /** AttackExposure exposedHighValueResourcesCount */ - exposedHighValueResourcesCount?: (number|null); - - /** AttackExposure exposedMediumValueResourcesCount */ - exposedMediumValueResourcesCount?: (number|null); - - /** AttackExposure exposedLowValueResourcesCount */ - exposedLowValueResourcesCount?: (number|null); - } - - /** Represents an AttackExposure. */ - class AttackExposure implements IAttackExposure { - - /** - * Constructs a new AttackExposure. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAttackExposure); - - /** AttackExposure score. */ - public score: number; - - /** AttackExposure latestCalculationTime. */ - public latestCalculationTime?: (google.protobuf.ITimestamp|null); - - /** AttackExposure attackExposureResult. */ - public attackExposureResult: string; - - /** AttackExposure state. */ - public state: (google.cloud.securitycenter.v2.AttackExposure.State|keyof typeof google.cloud.securitycenter.v2.AttackExposure.State); - - /** AttackExposure exposedHighValueResourcesCount. */ - public exposedHighValueResourcesCount: number; - - /** AttackExposure exposedMediumValueResourcesCount. */ - public exposedMediumValueResourcesCount: number; - - /** AttackExposure exposedLowValueResourcesCount. */ - public exposedLowValueResourcesCount: number; - - /** - * Creates a new AttackExposure instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackExposure instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAttackExposure): google.cloud.securitycenter.v2.AttackExposure; - - /** - * Encodes the specified AttackExposure message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackExposure.verify|verify} messages. - * @param message AttackExposure message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAttackExposure, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackExposure.verify|verify} messages. - * @param message AttackExposure message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAttackExposure, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackExposure message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackExposure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackExposure; - - /** - * Decodes an AttackExposure message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackExposure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackExposure; - - /** - * Verifies an AttackExposure message. - * @param message Plain 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 AttackExposure message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackExposure - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackExposure; - - /** - * Creates a plain object from an AttackExposure message. Also converts values to other types if specified. - * @param message AttackExposure - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AttackExposure, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackExposure to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackExposure - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AttackExposure { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CALCULATED = 1, - NOT_CALCULATED = 2 - } - } - - /** Properties of an AttackPath. */ - interface IAttackPath { - - /** AttackPath name */ - name?: (string|null); - - /** AttackPath pathNodes */ - pathNodes?: (google.cloud.securitycenter.v2.AttackPath.IAttackPathNode[]|null); - - /** AttackPath edges */ - edges?: (google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge[]|null); - } - - /** Represents an AttackPath. */ - class AttackPath implements IAttackPath { - - /** - * Constructs a new AttackPath. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAttackPath); - - /** AttackPath name. */ - public name: string; - - /** AttackPath pathNodes. */ - public pathNodes: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode[]; - - /** AttackPath edges. */ - public edges: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge[]; - - /** - * Creates a new AttackPath instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackPath instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAttackPath): google.cloud.securitycenter.v2.AttackPath; - - /** - * Encodes the specified AttackPath message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.verify|verify} messages. - * @param message AttackPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAttackPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.verify|verify} messages. - * @param message AttackPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAttackPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackPath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath; - - /** - * Decodes an AttackPath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath; - - /** - * Verifies an AttackPath message. - * @param message Plain 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 AttackPath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackPath - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath; - - /** - * Creates a plain object from an AttackPath message. Also converts values to other types if specified. - * @param message AttackPath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AttackPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackPath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackPath - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AttackPath { - - /** Properties of an AttackPathNode. */ - interface IAttackPathNode { - - /** AttackPathNode resource */ - resource?: (string|null); - - /** AttackPathNode resourceType */ - resourceType?: (string|null); - - /** AttackPathNode displayName */ - displayName?: (string|null); - - /** AttackPathNode associatedFindings */ - associatedFindings?: (google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding[]|null); - - /** AttackPathNode uuid */ - uuid?: (string|null); - - /** AttackPathNode attackSteps */ - attackSteps?: (google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode[]|null); - } - - /** Represents an AttackPathNode. */ - class AttackPathNode implements IAttackPathNode { - - /** - * Constructs a new AttackPathNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode); - - /** AttackPathNode resource. */ - public resource: string; - - /** AttackPathNode resourceType. */ - public resourceType: string; - - /** AttackPathNode displayName. */ - public displayName: string; - - /** AttackPathNode associatedFindings. */ - public associatedFindings: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding[]; - - /** AttackPathNode uuid. */ - public uuid: string; - - /** AttackPathNode attackSteps. */ - public attackSteps: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode[]; - - /** - * Creates a new AttackPathNode instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackPathNode instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode): google.cloud.securitycenter.v2.AttackPath.AttackPathNode; - - /** - * Encodes the specified AttackPathNode message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify|verify} messages. - * @param message AttackPathNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackPathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify|verify} messages. - * @param message AttackPathNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AttackPath.IAttackPathNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackPathNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackPathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath.AttackPathNode; - - /** - * Decodes an AttackPathNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackPathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath.AttackPathNode; - - /** - * Verifies an AttackPathNode message. - * @param message Plain 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 AttackPathNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackPathNode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath.AttackPathNode; - - /** - * Creates a plain object from an AttackPathNode message. Also converts values to other types if specified. - * @param message AttackPathNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackPathNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackPathNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AttackPathNode { - - /** Properties of a PathNodeAssociatedFinding. */ - interface IPathNodeAssociatedFinding { - - /** PathNodeAssociatedFinding canonicalFinding */ - canonicalFinding?: (string|null); - - /** PathNodeAssociatedFinding findingCategory */ - findingCategory?: (string|null); - - /** PathNodeAssociatedFinding name */ - name?: (string|null); - } - - /** Represents a PathNodeAssociatedFinding. */ - class PathNodeAssociatedFinding implements IPathNodeAssociatedFinding { - - /** - * Constructs a new PathNodeAssociatedFinding. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding); - - /** PathNodeAssociatedFinding canonicalFinding. */ - public canonicalFinding: string; - - /** PathNodeAssociatedFinding findingCategory. */ - public findingCategory: string; - - /** PathNodeAssociatedFinding name. */ - public name: string; - - /** - * Creates a new PathNodeAssociatedFinding instance using the specified properties. - * @param [properties] Properties to set - * @returns PathNodeAssociatedFinding instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding; - - /** - * Encodes the specified PathNodeAssociatedFinding message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. - * @param message PathNodeAssociatedFinding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PathNodeAssociatedFinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. - * @param message PathNodeAssociatedFinding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PathNodeAssociatedFinding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding; - - /** - * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PathNodeAssociatedFinding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding; - - /** - * Verifies a PathNodeAssociatedFinding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PathNodeAssociatedFinding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PathNodeAssociatedFinding - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding; - - /** - * Creates a plain object from a PathNodeAssociatedFinding message. Also converts values to other types if specified. - * @param message PathNodeAssociatedFinding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PathNodeAssociatedFinding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PathNodeAssociatedFinding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** NodeType enum. */ - enum NodeType { - NODE_TYPE_UNSPECIFIED = 0, - NODE_TYPE_AND = 1, - NODE_TYPE_OR = 2, - NODE_TYPE_DEFENSE = 3, - NODE_TYPE_ATTACKER = 4 - } - - /** Properties of an AttackStepNode. */ - interface IAttackStepNode { - - /** AttackStepNode uuid */ - uuid?: (string|null); - - /** AttackStepNode type */ - type?: (google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType|keyof typeof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType|null); - - /** AttackStepNode displayName */ - displayName?: (string|null); - - /** AttackStepNode labels */ - labels?: ({ [k: string]: string }|null); - - /** AttackStepNode description */ - description?: (string|null); - } - - /** Represents an AttackStepNode. */ - class AttackStepNode implements IAttackStepNode { - - /** - * Constructs a new AttackStepNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode); - - /** AttackStepNode uuid. */ - public uuid: string; - - /** AttackStepNode type. */ - public type: (google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType|keyof typeof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType); - - /** AttackStepNode displayName. */ - public displayName: string; - - /** AttackStepNode labels. */ - public labels: { [k: string]: string }; - - /** AttackStepNode description. */ - public description: string; - - /** - * Creates a new AttackStepNode instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackStepNode instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode; - - /** - * Encodes the specified AttackStepNode message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. - * @param message AttackStepNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackStepNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. - * @param message AttackStepNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackStepNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackStepNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode; - - /** - * Decodes an AttackStepNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackStepNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode; - - /** - * Verifies an AttackStepNode message. - * @param message Plain 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 AttackStepNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackStepNode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode; - - /** - * Creates a plain object from an AttackStepNode message. Also converts values to other types if specified. - * @param message AttackStepNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackStepNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackStepNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an AttackPathEdge. */ - interface IAttackPathEdge { - - /** AttackPathEdge source */ - source?: (string|null); - - /** AttackPathEdge destination */ - destination?: (string|null); - } - - /** Represents an AttackPathEdge. */ - class AttackPathEdge implements IAttackPathEdge { - - /** - * Constructs a new AttackPathEdge. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge); - - /** AttackPathEdge source. */ - public source: string; - - /** AttackPathEdge destination. */ - public destination: string; - - /** - * Creates a new AttackPathEdge instance using the specified properties. - * @param [properties] Properties to set - * @returns AttackPathEdge instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge): google.cloud.securitycenter.v2.AttackPath.AttackPathEdge; - - /** - * Encodes the specified AttackPathEdge message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify|verify} messages. - * @param message AttackPathEdge message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttackPathEdge message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify|verify} messages. - * @param message AttackPathEdge message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttackPathEdge message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttackPathEdge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AttackPath.AttackPathEdge; - - /** - * Decodes an AttackPathEdge message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttackPathEdge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AttackPath.AttackPathEdge; - - /** - * Verifies an AttackPathEdge message. - * @param message Plain 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 AttackPathEdge message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttackPathEdge - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AttackPath.AttackPathEdge; - - /** - * Creates a plain object from an AttackPathEdge message. Also converts values to other types if specified. - * @param message AttackPathEdge - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AttackPath.AttackPathEdge, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttackPathEdge to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttackPathEdge - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a BackupDisasterRecovery. */ - interface IBackupDisasterRecovery { - - /** BackupDisasterRecovery backupTemplate */ - backupTemplate?: (string|null); - - /** BackupDisasterRecovery policies */ - policies?: (string[]|null); - - /** BackupDisasterRecovery host */ - host?: (string|null); - - /** BackupDisasterRecovery applications */ - applications?: (string[]|null); - - /** BackupDisasterRecovery storagePool */ - storagePool?: (string|null); - - /** BackupDisasterRecovery policyOptions */ - policyOptions?: (string[]|null); - - /** BackupDisasterRecovery profile */ - profile?: (string|null); - - /** BackupDisasterRecovery appliance */ - appliance?: (string|null); - - /** BackupDisasterRecovery backupType */ - backupType?: (string|null); - - /** BackupDisasterRecovery backupCreateTime */ - backupCreateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BackupDisasterRecovery. */ - class BackupDisasterRecovery implements IBackupDisasterRecovery { - - /** - * Constructs a new BackupDisasterRecovery. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IBackupDisasterRecovery); - - /** BackupDisasterRecovery backupTemplate. */ - public backupTemplate: string; - - /** BackupDisasterRecovery policies. */ - public policies: string[]; - - /** BackupDisasterRecovery host. */ - public host: string; - - /** BackupDisasterRecovery applications. */ - public applications: string[]; - - /** BackupDisasterRecovery storagePool. */ - public storagePool: string; - - /** BackupDisasterRecovery policyOptions. */ - public policyOptions: string[]; - - /** BackupDisasterRecovery profile. */ - public profile: string; - - /** BackupDisasterRecovery appliance. */ - public appliance: string; - - /** BackupDisasterRecovery backupType. */ - public backupType: string; - - /** BackupDisasterRecovery backupCreateTime. */ - public backupCreateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new BackupDisasterRecovery instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupDisasterRecovery instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IBackupDisasterRecovery): google.cloud.securitycenter.v2.BackupDisasterRecovery; - - /** - * Encodes the specified BackupDisasterRecovery message. Does not implicitly {@link google.cloud.securitycenter.v2.BackupDisasterRecovery.verify|verify} messages. - * @param message BackupDisasterRecovery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IBackupDisasterRecovery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupDisasterRecovery message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BackupDisasterRecovery.verify|verify} messages. - * @param message BackupDisasterRecovery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IBackupDisasterRecovery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupDisasterRecovery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupDisasterRecovery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.BackupDisasterRecovery; - - /** - * Decodes a BackupDisasterRecovery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupDisasterRecovery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.BackupDisasterRecovery; - - /** - * Verifies a BackupDisasterRecovery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupDisasterRecovery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupDisasterRecovery - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.BackupDisasterRecovery; - - /** - * Creates a plain object from a BackupDisasterRecovery message. Also converts values to other types if specified. - * @param message BackupDisasterRecovery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.BackupDisasterRecovery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupDisasterRecovery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupDisasterRecovery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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.v2.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.v2.IBigQueryExport): google.cloud.securitycenter.v2.BigQueryExport; - - /** - * Encodes the specified BigQueryExport message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IBigQueryExport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BigQueryExport message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.BigQueryExport, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BigQueryExport to JSON. - * @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 Chokepoint. */ - interface IChokepoint { - - /** Chokepoint relatedFindings */ - relatedFindings?: (string[]|null); - } - - /** Represents a Chokepoint. */ - class Chokepoint implements IChokepoint { - - /** - * Constructs a new Chokepoint. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IChokepoint); - - /** Chokepoint relatedFindings. */ - public relatedFindings: string[]; - - /** - * Creates a new Chokepoint instance using the specified properties. - * @param [properties] Properties to set - * @returns Chokepoint instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IChokepoint): google.cloud.securitycenter.v2.Chokepoint; - - /** - * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v2.Chokepoint.verify|verify} messages. - * @param message Chokepoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Chokepoint.verify|verify} messages. - * @param message Chokepoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Chokepoint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Chokepoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Chokepoint; - - /** - * Decodes a Chokepoint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Chokepoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Chokepoint; - - /** - * Verifies a Chokepoint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Chokepoint - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Chokepoint; - - /** - * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. - * @param message Chokepoint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Chokepoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Chokepoint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Chokepoint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudArmor. */ - interface ICloudArmor { - - /** CloudArmor securityPolicy */ - securityPolicy?: (google.cloud.securitycenter.v2.ISecurityPolicy|null); - - /** CloudArmor requests */ - requests?: (google.cloud.securitycenter.v2.IRequests|null); - - /** CloudArmor adaptiveProtection */ - adaptiveProtection?: (google.cloud.securitycenter.v2.IAdaptiveProtection|null); - - /** CloudArmor attack */ - attack?: (google.cloud.securitycenter.v2.IAttack|null); - - /** CloudArmor threatVector */ - threatVector?: (string|null); - - /** CloudArmor duration */ - duration?: (google.protobuf.IDuration|null); - } - - /** Represents a CloudArmor. */ - class CloudArmor implements ICloudArmor { - - /** - * Constructs a new CloudArmor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICloudArmor); - - /** CloudArmor securityPolicy. */ - public securityPolicy?: (google.cloud.securitycenter.v2.ISecurityPolicy|null); - - /** CloudArmor requests. */ - public requests?: (google.cloud.securitycenter.v2.IRequests|null); - - /** CloudArmor adaptiveProtection. */ - public adaptiveProtection?: (google.cloud.securitycenter.v2.IAdaptiveProtection|null); - - /** CloudArmor attack. */ - public attack?: (google.cloud.securitycenter.v2.IAttack|null); - - /** CloudArmor threatVector. */ - public threatVector: string; - - /** CloudArmor duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** - * Creates a new CloudArmor instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudArmor instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ICloudArmor): google.cloud.securitycenter.v2.CloudArmor; - - /** - * Encodes the specified CloudArmor message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudArmor.verify|verify} messages. - * @param message CloudArmor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ICloudArmor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudArmor message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudArmor.verify|verify} messages. - * @param message CloudArmor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ICloudArmor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudArmor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudArmor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CloudArmor; - - /** - * Decodes a CloudArmor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudArmor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CloudArmor; - - /** - * Verifies a CloudArmor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudArmor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudArmor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CloudArmor; - - /** - * Creates a plain object from a CloudArmor message. Also converts values to other types if specified. - * @param message CloudArmor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.CloudArmor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudArmor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudArmor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecurityPolicy. */ - interface ISecurityPolicy { - - /** SecurityPolicy name */ - name?: (string|null); - - /** SecurityPolicy type */ - type?: (string|null); - - /** SecurityPolicy preview */ - preview?: (boolean|null); - } - - /** Represents a SecurityPolicy. */ - class SecurityPolicy implements ISecurityPolicy { - - /** - * Constructs a new SecurityPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ISecurityPolicy); - - /** SecurityPolicy name. */ - public name: string; - - /** SecurityPolicy type. */ - public type: string; - - /** SecurityPolicy preview. */ - public preview: boolean; - - /** - * Creates a new SecurityPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityPolicy instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ISecurityPolicy): google.cloud.securitycenter.v2.SecurityPolicy; - - /** - * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPolicy.verify|verify} messages. - * @param message SecurityPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPolicy.verify|verify} messages. - * @param message SecurityPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.SecurityPolicy; - - /** - * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.SecurityPolicy; - - /** - * Verifies a SecurityPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.SecurityPolicy; - - /** - * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. - * @param message SecurityPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.SecurityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecurityPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Requests. */ - interface IRequests { - - /** Requests ratio */ - ratio?: (number|null); - - /** Requests shortTermAllowed */ - shortTermAllowed?: (number|null); - - /** Requests longTermAllowed */ - longTermAllowed?: (number|null); - - /** Requests longTermDenied */ - longTermDenied?: (number|null); - } - - /** Represents a Requests. */ - class Requests implements IRequests { - - /** - * Constructs a new Requests. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IRequests); - - /** Requests ratio. */ - public ratio: number; - - /** Requests shortTermAllowed. */ - public shortTermAllowed: number; - - /** Requests longTermAllowed. */ - public longTermAllowed: number; - - /** Requests longTermDenied. */ - public longTermDenied: number; - - /** - * Creates a new Requests instance using the specified properties. - * @param [properties] Properties to set - * @returns Requests instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IRequests): google.cloud.securitycenter.v2.Requests; - - /** - * Encodes the specified Requests message. Does not implicitly {@link google.cloud.securitycenter.v2.Requests.verify|verify} messages. - * @param message Requests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Requests message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Requests.verify|verify} messages. - * @param message Requests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Requests message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Requests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Requests; - - /** - * Decodes a Requests message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Requests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Requests; - - /** - * Verifies a Requests message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Requests message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Requests - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Requests; - - /** - * Creates a plain object from a Requests message. Also converts values to other types if specified. - * @param message Requests - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Requests, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Requests to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Requests - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AdaptiveProtection. */ - interface IAdaptiveProtection { - - /** AdaptiveProtection confidence */ - confidence?: (number|null); - } - - /** Represents an AdaptiveProtection. */ - class AdaptiveProtection implements IAdaptiveProtection { - - /** - * Constructs a new AdaptiveProtection. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAdaptiveProtection); - - /** AdaptiveProtection confidence. */ - public confidence: number; - - /** - * Creates a new AdaptiveProtection instance using the specified properties. - * @param [properties] Properties to set - * @returns AdaptiveProtection instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAdaptiveProtection): google.cloud.securitycenter.v2.AdaptiveProtection; - - /** - * Encodes the specified AdaptiveProtection message. Does not implicitly {@link google.cloud.securitycenter.v2.AdaptiveProtection.verify|verify} messages. - * @param message AdaptiveProtection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAdaptiveProtection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AdaptiveProtection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AdaptiveProtection.verify|verify} messages. - * @param message AdaptiveProtection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAdaptiveProtection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AdaptiveProtection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AdaptiveProtection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AdaptiveProtection; - - /** - * Decodes an AdaptiveProtection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AdaptiveProtection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AdaptiveProtection; - - /** - * Verifies an AdaptiveProtection message. - * @param message Plain 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 AdaptiveProtection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AdaptiveProtection - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AdaptiveProtection; - - /** - * Creates a plain object from an AdaptiveProtection message. Also converts values to other types if specified. - * @param message AdaptiveProtection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AdaptiveProtection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AdaptiveProtection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AdaptiveProtection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Attack. */ - interface IAttack { - - /** Attack volumePpsLong */ - volumePpsLong?: (number|Long|string|null); - - /** Attack volumeBpsLong */ - volumeBpsLong?: (number|Long|string|null); - - /** Attack classification */ - classification?: (string|null); - - /** Attack volumePps */ - volumePps?: (number|null); - - /** Attack volumeBps */ - volumeBps?: (number|null); - } - - /** Represents an Attack. */ - class Attack implements IAttack { - - /** - * Constructs a new Attack. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAttack); - - /** Attack volumePpsLong. */ - public volumePpsLong: (number|Long|string); - - /** Attack volumeBpsLong. */ - public volumeBpsLong: (number|Long|string); - - /** Attack classification. */ - public classification: string; - - /** Attack volumePps. */ - public volumePps: number; - - /** Attack volumeBps. */ - public volumeBps: number; - - /** - * Creates a new Attack instance using the specified properties. - * @param [properties] Properties to set - * @returns Attack instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAttack): google.cloud.securitycenter.v2.Attack; - - /** - * Encodes the specified Attack message. Does not implicitly {@link google.cloud.securitycenter.v2.Attack.verify|verify} messages. - * @param message Attack message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAttack, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Attack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Attack.verify|verify} messages. - * @param message Attack message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAttack, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Attack message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Attack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Attack; - - /** - * Decodes an Attack message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Attack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Attack; - - /** - * Verifies an Attack message. - * @param message Plain 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 Attack message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Attack - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Attack; - - /** - * Creates a plain object from an Attack message. Also converts values to other types if specified. - * @param message Attack - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Attack, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Attack to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Attack - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudDlpDataProfile. */ - interface ICloudDlpDataProfile { - - /** CloudDlpDataProfile dataProfile */ - dataProfile?: (string|null); - - /** CloudDlpDataProfile parentType */ - parentType?: (google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType|null); - } - - /** Represents a CloudDlpDataProfile. */ - class CloudDlpDataProfile implements ICloudDlpDataProfile { - - /** - * Constructs a new CloudDlpDataProfile. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICloudDlpDataProfile); - - /** CloudDlpDataProfile dataProfile. */ - public dataProfile: string; - - /** CloudDlpDataProfile parentType. */ - public parentType: (google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType); - - /** - * Creates a new CloudDlpDataProfile instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudDlpDataProfile instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ICloudDlpDataProfile): google.cloud.securitycenter.v2.CloudDlpDataProfile; - - /** - * Encodes the specified CloudDlpDataProfile message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpDataProfile.verify|verify} messages. - * @param message CloudDlpDataProfile message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ICloudDlpDataProfile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudDlpDataProfile message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpDataProfile.verify|verify} messages. - * @param message CloudDlpDataProfile message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ICloudDlpDataProfile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudDlpDataProfile message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudDlpDataProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CloudDlpDataProfile; - - /** - * Decodes a CloudDlpDataProfile message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudDlpDataProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CloudDlpDataProfile; - - /** - * Verifies a CloudDlpDataProfile message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudDlpDataProfile message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudDlpDataProfile - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CloudDlpDataProfile; - - /** - * Creates a plain object from a CloudDlpDataProfile message. Also converts values to other types if specified. - * @param message CloudDlpDataProfile - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.CloudDlpDataProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudDlpDataProfile to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudDlpDataProfile - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CloudDlpDataProfile { - - /** ParentType enum. */ - enum ParentType { - PARENT_TYPE_UNSPECIFIED = 0, - ORGANIZATION = 1, - PROJECT = 2 - } - } - - /** Properties of a CloudDlpInspection. */ - interface ICloudDlpInspection { - - /** CloudDlpInspection inspectJob */ - inspectJob?: (string|null); - - /** CloudDlpInspection infoType */ - infoType?: (string|null); - - /** CloudDlpInspection infoTypeCount */ - infoTypeCount?: (number|Long|string|null); - - /** CloudDlpInspection fullScan */ - fullScan?: (boolean|null); - } - - /** Represents a CloudDlpInspection. */ - class CloudDlpInspection implements ICloudDlpInspection { - - /** - * Constructs a new CloudDlpInspection. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICloudDlpInspection); - - /** CloudDlpInspection inspectJob. */ - public inspectJob: string; - - /** CloudDlpInspection infoType. */ - public infoType: string; - - /** CloudDlpInspection infoTypeCount. */ - public infoTypeCount: (number|Long|string); - - /** CloudDlpInspection fullScan. */ - public fullScan: boolean; - - /** - * Creates a new CloudDlpInspection instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudDlpInspection instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ICloudDlpInspection): google.cloud.securitycenter.v2.CloudDlpInspection; - - /** - * Encodes the specified CloudDlpInspection message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpInspection.verify|verify} messages. - * @param message CloudDlpInspection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ICloudDlpInspection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudDlpInspection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpInspection.verify|verify} messages. - * @param message CloudDlpInspection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ICloudDlpInspection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudDlpInspection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudDlpInspection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CloudDlpInspection; - - /** - * Decodes a CloudDlpInspection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudDlpInspection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CloudDlpInspection; - - /** - * Verifies a CloudDlpInspection message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudDlpInspection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudDlpInspection - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CloudDlpInspection; - - /** - * Creates a plain object from a CloudDlpInspection message. Also converts values to other types if specified. - * @param message CloudDlpInspection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.CloudDlpInspection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudDlpInspection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudDlpInspection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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.v2.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.v2.ICompliance): google.cloud.securitycenter.v2.Compliance; - - /** - * Encodes the specified Compliance message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICompliance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Compliance message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Compliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Compliance to JSON. - * @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. */ - 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.v2.Connection.Protocol|keyof typeof google.cloud.securitycenter.v2.Connection.Protocol|null); - } - - /** Represents a Connection. */ - class Connection implements IConnection { - - /** - * Constructs a new Connection. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.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.v2.Connection.Protocol|keyof typeof google.cloud.securitycenter.v2.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.v2.IConnection): google.cloud.securitycenter.v2.Connection; - - /** - * Encodes the specified Connection message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Connection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Connection to JSON. - * @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 { - - /** Protocol enum. */ - enum Protocol { - PROTOCOL_UNSPECIFIED = 0, - ICMP = 1, - TCP = 6, - UDP = 17, - GRE = 47, - ESP = 50 - } - } - - /** Properties of a ContactDetails. */ - interface IContactDetails { - - /** ContactDetails contacts */ - contacts?: (google.cloud.securitycenter.v2.IContact[]|null); - } - - /** Represents a ContactDetails. */ - class ContactDetails implements IContactDetails { - - /** - * Constructs a new ContactDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IContactDetails); - - /** ContactDetails contacts. */ - public contacts: google.cloud.securitycenter.v2.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.v2.IContactDetails): google.cloud.securitycenter.v2.ContactDetails; - - /** - * Encodes the specified ContactDetails message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IContactDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContactDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ContactDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContactDetails to JSON. - * @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. */ - 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.v2.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.v2.IContact): google.cloud.securitycenter.v2.Contact; - - /** - * Encodes the specified Contact message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IContact, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Contact message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Contact, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Contact to JSON. - * @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. */ - interface IContainer { - - /** Container name */ - name?: (string|null); - - /** Container uri */ - uri?: (string|null); - - /** Container imageId */ - imageId?: (string|null); - - /** Container labels */ - labels?: (google.cloud.securitycenter.v2.ILabel[]|null); - - /** Container createTime */ - createTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Container. */ - class Container implements IContainer { - - /** - * Constructs a new Container. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IContainer); - - /** Container name. */ - public name: string; - - /** Container uri. */ - public uri: string; - - /** Container imageId. */ - public imageId: string; - - /** Container labels. */ - public labels: google.cloud.securitycenter.v2.ILabel[]; - - /** Container createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Container instance using the specified properties. - * @param [properties] Properties to set - * @returns Container instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IContainer): google.cloud.securitycenter.v2.Container; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Container to JSON. - * @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. */ - 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.v2.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.v2.ILabel): google.cloud.securitycenter.v2.Label; - - /** - * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ILabel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Label message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Label, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Label to JSON. - * @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 a DataAccessEvent. */ - interface IDataAccessEvent { - - /** DataAccessEvent eventId */ - eventId?: (string|null); - - /** DataAccessEvent principalEmail */ - principalEmail?: (string|null); - - /** DataAccessEvent operation */ - operation?: (google.cloud.securitycenter.v2.DataAccessEvent.Operation|keyof typeof google.cloud.securitycenter.v2.DataAccessEvent.Operation|null); - - /** DataAccessEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DataAccessEvent. */ - class DataAccessEvent implements IDataAccessEvent { - - /** - * Constructs a new DataAccessEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IDataAccessEvent); - - /** DataAccessEvent eventId. */ - public eventId: string; - - /** DataAccessEvent principalEmail. */ - public principalEmail: string; - - /** DataAccessEvent operation. */ - public operation: (google.cloud.securitycenter.v2.DataAccessEvent.Operation|keyof typeof google.cloud.securitycenter.v2.DataAccessEvent.Operation); - - /** DataAccessEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new DataAccessEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns DataAccessEvent instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IDataAccessEvent): google.cloud.securitycenter.v2.DataAccessEvent; - - /** - * Encodes the specified DataAccessEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataAccessEvent.verify|verify} messages. - * @param message DataAccessEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IDataAccessEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataAccessEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataAccessEvent.verify|verify} messages. - * @param message DataAccessEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IDataAccessEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataAccessEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataAccessEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.DataAccessEvent; - - /** - * Decodes a DataAccessEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataAccessEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.DataAccessEvent; - - /** - * Verifies a DataAccessEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataAccessEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataAccessEvent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.DataAccessEvent; - - /** - * Creates a plain object from a DataAccessEvent message. Also converts values to other types if specified. - * @param message DataAccessEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.DataAccessEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataAccessEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataAccessEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataAccessEvent { - - /** Operation enum. */ - enum Operation { - OPERATION_UNSPECIFIED = 0, - READ = 1, - MOVE = 2, - COPY = 3 - } - } - - /** Properties of a DataFlowEvent. */ - interface IDataFlowEvent { - - /** DataFlowEvent eventId */ - eventId?: (string|null); - - /** DataFlowEvent principalEmail */ - principalEmail?: (string|null); - - /** DataFlowEvent operation */ - operation?: (google.cloud.securitycenter.v2.DataFlowEvent.Operation|keyof typeof google.cloud.securitycenter.v2.DataFlowEvent.Operation|null); - - /** DataFlowEvent violatedLocation */ - violatedLocation?: (string|null); - - /** DataFlowEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DataFlowEvent. */ - class DataFlowEvent implements IDataFlowEvent { - - /** - * Constructs a new DataFlowEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IDataFlowEvent); - - /** DataFlowEvent eventId. */ - public eventId: string; - - /** DataFlowEvent principalEmail. */ - public principalEmail: string; - - /** DataFlowEvent operation. */ - public operation: (google.cloud.securitycenter.v2.DataFlowEvent.Operation|keyof typeof google.cloud.securitycenter.v2.DataFlowEvent.Operation); - - /** DataFlowEvent violatedLocation. */ - public violatedLocation: string; - - /** DataFlowEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new DataFlowEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns DataFlowEvent instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IDataFlowEvent): google.cloud.securitycenter.v2.DataFlowEvent; - - /** - * Encodes the specified DataFlowEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataFlowEvent.verify|verify} messages. - * @param message DataFlowEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IDataFlowEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataFlowEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataFlowEvent.verify|verify} messages. - * @param message DataFlowEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IDataFlowEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataFlowEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataFlowEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.DataFlowEvent; - - /** - * Decodes a DataFlowEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataFlowEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.DataFlowEvent; - - /** - * Verifies a DataFlowEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataFlowEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataFlowEvent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.DataFlowEvent; - - /** - * Creates a plain object from a DataFlowEvent message. Also converts values to other types if specified. - * @param message DataFlowEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.DataFlowEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataFlowEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataFlowEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataFlowEvent { - - /** Operation enum. */ - enum Operation { - OPERATION_UNSPECIFIED = 0, - READ = 1, - MOVE = 2, - COPY = 3 - } - } - - /** Properties of a DataRetentionDeletionEvent. */ - interface IDataRetentionDeletionEvent { - - /** DataRetentionDeletionEvent eventDetectionTime */ - eventDetectionTime?: (google.protobuf.ITimestamp|null); - - /** DataRetentionDeletionEvent dataObjectCount */ - dataObjectCount?: (number|Long|string|null); - - /** DataRetentionDeletionEvent maxRetentionAllowed */ - maxRetentionAllowed?: (google.protobuf.IDuration|null); - - /** DataRetentionDeletionEvent eventType */ - eventType?: (google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType|keyof typeof google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType|null); - } - - /** Represents a DataRetentionDeletionEvent. */ - class DataRetentionDeletionEvent implements IDataRetentionDeletionEvent { - - /** - * Constructs a new DataRetentionDeletionEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent); - - /** DataRetentionDeletionEvent eventDetectionTime. */ - public eventDetectionTime?: (google.protobuf.ITimestamp|null); - - /** DataRetentionDeletionEvent dataObjectCount. */ - public dataObjectCount: (number|Long|string); - - /** DataRetentionDeletionEvent maxRetentionAllowed. */ - public maxRetentionAllowed?: (google.protobuf.IDuration|null); - - /** DataRetentionDeletionEvent eventType. */ - public eventType: (google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType|keyof typeof google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType); - - /** - * Creates a new DataRetentionDeletionEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns DataRetentionDeletionEvent instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent): google.cloud.securitycenter.v2.DataRetentionDeletionEvent; - - /** - * Encodes the specified DataRetentionDeletionEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify|verify} messages. - * @param message DataRetentionDeletionEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataRetentionDeletionEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify|verify} messages. - * @param message DataRetentionDeletionEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataRetentionDeletionEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataRetentionDeletionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.DataRetentionDeletionEvent; - - /** - * Decodes a DataRetentionDeletionEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataRetentionDeletionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.DataRetentionDeletionEvent; - - /** - * Verifies a DataRetentionDeletionEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataRetentionDeletionEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataRetentionDeletionEvent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.DataRetentionDeletionEvent; - - /** - * Creates a plain object from a DataRetentionDeletionEvent message. Also converts values to other types if specified. - * @param message DataRetentionDeletionEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.DataRetentionDeletionEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataRetentionDeletionEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataRetentionDeletionEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataRetentionDeletionEvent { - - /** EventType enum. */ - enum EventType { - EVENT_TYPE_UNSPECIFIED = 0, - EVENT_TYPE_MAX_TTL_EXCEEDED = 1 - } - } - - /** 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); - - /** Database version */ - version?: (string|null); - } - - /** Represents a Database. */ - class Database implements IDatabase { - - /** - * Constructs a new Database. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.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[]; - - /** Database version. */ - public version: 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.v2.IDatabase): google.cloud.securitycenter.v2.Database; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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 a Disk. */ - interface IDisk { - - /** Disk name */ - name?: (string|null); - } - - /** Represents a Disk. */ - class Disk implements IDisk { - - /** - * Constructs a new Disk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IDisk); - - /** Disk name. */ - public name: string; - - /** - * Creates a new Disk instance using the specified properties. - * @param [properties] Properties to set - * @returns Disk instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IDisk): google.cloud.securitycenter.v2.Disk; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.securitycenter.v2.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Disk; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Disk; - - /** - * Verifies a Disk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Disk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Disk; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @param message Disk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Disk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Disk - * @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 { - - /** Exfiltration sources */ - sources?: (google.cloud.securitycenter.v2.IExfilResource[]|null); - - /** Exfiltration targets */ - targets?: (google.cloud.securitycenter.v2.IExfilResource[]|null); - - /** Exfiltration totalExfiltratedBytes */ - totalExfiltratedBytes?: (number|Long|string|null); - } - - /** Represents an Exfiltration. */ - class Exfiltration implements IExfiltration { - - /** - * Constructs a new Exfiltration. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IExfiltration); - - /** Exfiltration sources. */ - public sources: google.cloud.securitycenter.v2.IExfilResource[]; - - /** Exfiltration targets. */ - public targets: google.cloud.securitycenter.v2.IExfilResource[]; - - /** Exfiltration totalExfiltratedBytes. */ - public totalExfiltratedBytes: (number|Long|string); - - /** - * Creates a new Exfiltration instance using the specified properties. - * @param [properties] Properties to set - * @returns Exfiltration instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IExfiltration): google.cloud.securitycenter.v2.Exfiltration; - - /** - * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IExfiltration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Exfiltration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Exfiltration to JSON. - * @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. */ - 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.v2.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.v2.IExfilResource): google.cloud.securitycenter.v2.ExfilResource; - - /** - * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IExfilResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ExfilResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExfilResource to JSON. - * @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. */ - 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); - - /** ExternalSystem caseUri */ - caseUri?: (string|null); - - /** ExternalSystem casePriority */ - casePriority?: (string|null); - - /** ExternalSystem caseSla */ - caseSla?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem caseCreateTime */ - caseCreateTime?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem caseCloseTime */ - caseCloseTime?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem ticketInfo */ - ticketInfo?: (google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo|null); - } - - /** Represents an ExternalSystem. */ - class ExternalSystem implements IExternalSystem { - - /** - * Constructs a new ExternalSystem. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.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); - - /** ExternalSystem caseUri. */ - public caseUri: string; - - /** ExternalSystem casePriority. */ - public casePriority: string; - - /** ExternalSystem caseSla. */ - public caseSla?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem caseCreateTime. */ - public caseCreateTime?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem caseCloseTime. */ - public caseCloseTime?: (google.protobuf.ITimestamp|null); - - /** ExternalSystem ticketInfo. */ - public ticketInfo?: (google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo|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.v2.IExternalSystem): google.cloud.securitycenter.v2.ExternalSystem; - - /** - * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IExternalSystem, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ExternalSystem, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExternalSystem to JSON. - * @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; - } - - namespace ExternalSystem { - - /** Properties of a TicketInfo. */ - interface ITicketInfo { - - /** TicketInfo id */ - id?: (string|null); - - /** TicketInfo assignee */ - assignee?: (string|null); - - /** TicketInfo description */ - description?: (string|null); - - /** TicketInfo uri */ - uri?: (string|null); - - /** TicketInfo status */ - status?: (string|null); - - /** TicketInfo updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TicketInfo. */ - class TicketInfo implements ITicketInfo { - - /** - * Constructs a new TicketInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo); - - /** TicketInfo id. */ - public id: string; - - /** TicketInfo assignee. */ - public assignee: string; - - /** TicketInfo description. */ - public description: string; - - /** TicketInfo uri. */ - public uri: string; - - /** TicketInfo status. */ - public status: string; - - /** TicketInfo updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new TicketInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns TicketInfo instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo): google.cloud.securitycenter.v2.ExternalSystem.TicketInfo; - - /** - * Encodes the specified TicketInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify|verify} messages. - * @param message TicketInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TicketInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify|verify} messages. - * @param message TicketInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TicketInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TicketInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ExternalSystem.TicketInfo; - - /** - * Decodes a TicketInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TicketInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ExternalSystem.TicketInfo; - - /** - * Verifies a TicketInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TicketInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TicketInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ExternalSystem.TicketInfo; - - /** - * Creates a plain object from a TicketInfo message. Also converts values to other types if specified. - * @param message TicketInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ExternalSystem.TicketInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TicketInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TicketInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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); - - /** File diskPath */ - diskPath?: (google.cloud.securitycenter.v2.File.IDiskPath|null); - - /** File operations */ - operations?: (google.cloud.securitycenter.v2.File.IFileOperation[]|null); - } - - /** Represents a File. */ - class File implements IFile { - - /** - * Constructs a new File. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.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; - - /** File diskPath. */ - public diskPath?: (google.cloud.securitycenter.v2.File.IDiskPath|null); - - /** File operations. */ - public operations: google.cloud.securitycenter.v2.File.IFileOperation[]; - - /** - * Creates a new File instance using the specified properties. - * @param [properties] Properties to set - * @returns File instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IFile): google.cloud.securitycenter.v2.File; - - /** - * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IFile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.File, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this File to JSON. - * @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; - } - - namespace File { - - /** Properties of a DiskPath. */ - interface IDiskPath { - - /** DiskPath partitionUuid */ - partitionUuid?: (string|null); - - /** DiskPath relativePath */ - relativePath?: (string|null); - } - - /** Represents a DiskPath. */ - class DiskPath implements IDiskPath { - - /** - * Constructs a new DiskPath. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.File.IDiskPath); - - /** DiskPath partitionUuid. */ - public partitionUuid: string; - - /** DiskPath relativePath. */ - public relativePath: string; - - /** - * Creates a new DiskPath instance using the specified properties. - * @param [properties] Properties to set - * @returns DiskPath instance - */ - public static create(properties?: google.cloud.securitycenter.v2.File.IDiskPath): google.cloud.securitycenter.v2.File.DiskPath; - - /** - * Encodes the specified DiskPath message. Does not implicitly {@link google.cloud.securitycenter.v2.File.DiskPath.verify|verify} messages. - * @param message DiskPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.File.IDiskPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiskPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.DiskPath.verify|verify} messages. - * @param message DiskPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.File.IDiskPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiskPath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiskPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.File.DiskPath; - - /** - * Decodes a DiskPath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiskPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.File.DiskPath; - - /** - * Verifies a DiskPath message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiskPath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiskPath - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.File.DiskPath; - - /** - * Creates a plain object from a DiskPath message. Also converts values to other types if specified. - * @param message DiskPath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.File.DiskPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiskPath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiskPath - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOperation. */ - interface IFileOperation { - - /** FileOperation type */ - type?: (google.cloud.securitycenter.v2.File.FileOperation.OperationType|keyof typeof google.cloud.securitycenter.v2.File.FileOperation.OperationType|null); - } - - /** Represents a FileOperation. */ - class FileOperation implements IFileOperation { - - /** - * Constructs a new FileOperation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.File.IFileOperation); - - /** FileOperation type. */ - public type: (google.cloud.securitycenter.v2.File.FileOperation.OperationType|keyof typeof google.cloud.securitycenter.v2.File.FileOperation.OperationType); - - /** - * Creates a new FileOperation instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOperation instance - */ - public static create(properties?: google.cloud.securitycenter.v2.File.IFileOperation): google.cloud.securitycenter.v2.File.FileOperation; - - /** - * Encodes the specified FileOperation message. Does not implicitly {@link google.cloud.securitycenter.v2.File.FileOperation.verify|verify} messages. - * @param message FileOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.File.IFileOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOperation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.FileOperation.verify|verify} messages. - * @param message FileOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.File.IFileOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOperation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.File.FileOperation; - - /** - * Decodes a FileOperation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.File.FileOperation; - - /** - * Verifies a FileOperation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOperation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOperation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.File.FileOperation; - - /** - * Creates a plain object from a FileOperation message. Also converts values to other types if specified. - * @param message FileOperation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.File.FileOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOperation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOperation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOperation { - - /** OperationType enum. */ - enum OperationType { - OPERATION_TYPE_UNSPECIFIED = 0, - OPEN = 1, - READ = 2, - RENAME = 3, - WRITE = 4, - EXECUTE = 5 - } - } - } - - /** Properties of a Finding. */ - interface IFinding { - - /** Finding name */ - name?: (string|null); - - /** Finding canonicalName */ - canonicalName?: (string|null); - - /** Finding parent */ - parent?: (string|null); - - /** Finding resourceName */ - resourceName?: (string|null); - - /** Finding state */ - state?: (google.cloud.securitycenter.v2.Finding.State|keyof typeof google.cloud.securitycenter.v2.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.v2.ISecurityMarks|null); - - /** Finding eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - - /** Finding createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Finding severity */ - severity?: (google.cloud.securitycenter.v2.Finding.Severity|keyof typeof google.cloud.securitycenter.v2.Finding.Severity|null); - - /** Finding mute */ - mute?: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute|null); - - /** Finding muteInfo */ - muteInfo?: (google.cloud.securitycenter.v2.Finding.IMuteInfo|null); - - /** Finding findingClass */ - findingClass?: (google.cloud.securitycenter.v2.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v2.Finding.FindingClass|null); - - /** Finding indicator */ - indicator?: (google.cloud.securitycenter.v2.IIndicator|null); - - /** Finding vulnerability */ - vulnerability?: (google.cloud.securitycenter.v2.IVulnerability|null); - - /** Finding muteUpdateTime */ - muteUpdateTime?: (google.protobuf.ITimestamp|null); - - /** Finding externalSystems */ - externalSystems?: ({ [k: string]: google.cloud.securitycenter.v2.IExternalSystem }|null); - - /** Finding mitreAttack */ - mitreAttack?: (google.cloud.securitycenter.v2.IMitreAttack|null); - - /** Finding access */ - access?: (google.cloud.securitycenter.v2.IAccess|null); - - /** Finding connections */ - connections?: (google.cloud.securitycenter.v2.IConnection[]|null); - - /** Finding muteInitiator */ - muteInitiator?: (string|null); - - /** Finding processes */ - processes?: (google.cloud.securitycenter.v2.IProcess[]|null); - - /** Finding contacts */ - contacts?: ({ [k: string]: google.cloud.securitycenter.v2.IContactDetails }|null); - - /** Finding compliances */ - compliances?: (google.cloud.securitycenter.v2.ICompliance[]|null); - - /** Finding parentDisplayName */ - parentDisplayName?: (string|null); - - /** Finding description */ - description?: (string|null); - - /** Finding exfiltration */ - exfiltration?: (google.cloud.securitycenter.v2.IExfiltration|null); - - /** Finding iamBindings */ - iamBindings?: (google.cloud.securitycenter.v2.IIamBinding[]|null); - - /** Finding nextSteps */ - nextSteps?: (string|null); - - /** Finding moduleName */ - moduleName?: (string|null); - - /** Finding containers */ - containers?: (google.cloud.securitycenter.v2.IContainer[]|null); - - /** Finding kubernetes */ - kubernetes?: (google.cloud.securitycenter.v2.IKubernetes|null); - - /** Finding database */ - database?: (google.cloud.securitycenter.v2.IDatabase|null); - - /** Finding attackExposure */ - attackExposure?: (google.cloud.securitycenter.v2.IAttackExposure|null); - - /** Finding files */ - files?: (google.cloud.securitycenter.v2.IFile[]|null); - - /** Finding cloudDlpInspection */ - cloudDlpInspection?: (google.cloud.securitycenter.v2.ICloudDlpInspection|null); - - /** Finding cloudDlpDataProfile */ - cloudDlpDataProfile?: (google.cloud.securitycenter.v2.ICloudDlpDataProfile|null); - - /** Finding kernelRootkit */ - kernelRootkit?: (google.cloud.securitycenter.v2.IKernelRootkit|null); - - /** Finding orgPolicies */ - orgPolicies?: (google.cloud.securitycenter.v2.IOrgPolicy[]|null); - - /** Finding job */ - job?: (google.cloud.securitycenter.v2.IJob|null); - - /** Finding application */ - application?: (google.cloud.securitycenter.v2.IApplication|null); - - /** Finding ipRules */ - ipRules?: (google.cloud.securitycenter.v2.IIpRules|null); - - /** Finding backupDisasterRecovery */ - backupDisasterRecovery?: (google.cloud.securitycenter.v2.IBackupDisasterRecovery|null); - - /** Finding securityPosture */ - securityPosture?: (google.cloud.securitycenter.v2.ISecurityPosture|null); - - /** Finding logEntries */ - logEntries?: (google.cloud.securitycenter.v2.ILogEntry[]|null); - - /** Finding loadBalancers */ - loadBalancers?: (google.cloud.securitycenter.v2.ILoadBalancer[]|null); - - /** Finding cloudArmor */ - cloudArmor?: (google.cloud.securitycenter.v2.ICloudArmor|null); - - /** Finding notebook */ - notebook?: (google.cloud.securitycenter.v2.INotebook|null); - - /** Finding toxicCombination */ - toxicCombination?: (google.cloud.securitycenter.v2.IToxicCombination|null); - - /** Finding groupMemberships */ - groupMemberships?: (google.cloud.securitycenter.v2.IGroupMembership[]|null); - - /** Finding disk */ - disk?: (google.cloud.securitycenter.v2.IDisk|null); - - /** Finding dataAccessEvents */ - dataAccessEvents?: (google.cloud.securitycenter.v2.IDataAccessEvent[]|null); - - /** Finding dataFlowEvents */ - dataFlowEvents?: (google.cloud.securitycenter.v2.IDataFlowEvent[]|null); - - /** Finding networks */ - networks?: (google.cloud.securitycenter.v2.INetwork[]|null); - - /** Finding dataRetentionDeletionEvents */ - dataRetentionDeletionEvents?: (google.cloud.securitycenter.v2.IDataRetentionDeletionEvent[]|null); - - /** Finding affectedResources */ - affectedResources?: (google.cloud.securitycenter.v2.IAffectedResources|null); - - /** Finding aiModel */ - aiModel?: (google.cloud.securitycenter.v2.IAiModel|null); - - /** Finding chokepoint */ - chokepoint?: (google.cloud.securitycenter.v2.IChokepoint|null); - - /** Finding vertexAi */ - vertexAi?: (google.cloud.securitycenter.v2.IVertexAi|null); - } - - /** Represents a Finding. */ - class Finding implements IFinding { - - /** - * Constructs a new Finding. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IFinding); - - /** Finding name. */ - public name: string; - - /** Finding canonicalName. */ - public canonicalName: string; - - /** Finding parent. */ - public parent: string; - - /** Finding resourceName. */ - public resourceName: string; - - /** Finding state. */ - public state: (google.cloud.securitycenter.v2.Finding.State|keyof typeof google.cloud.securitycenter.v2.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.v2.ISecurityMarks|null); - - /** Finding eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** Finding createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Finding severity. */ - public severity: (google.cloud.securitycenter.v2.Finding.Severity|keyof typeof google.cloud.securitycenter.v2.Finding.Severity); - - /** Finding mute. */ - public mute: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute); - - /** Finding muteInfo. */ - public muteInfo?: (google.cloud.securitycenter.v2.Finding.IMuteInfo|null); - - /** Finding findingClass. */ - public findingClass: (google.cloud.securitycenter.v2.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v2.Finding.FindingClass); - - /** Finding indicator. */ - public indicator?: (google.cloud.securitycenter.v2.IIndicator|null); - - /** Finding vulnerability. */ - public vulnerability?: (google.cloud.securitycenter.v2.IVulnerability|null); - - /** Finding muteUpdateTime. */ - public muteUpdateTime?: (google.protobuf.ITimestamp|null); - - /** Finding externalSystems. */ - public externalSystems: { [k: string]: google.cloud.securitycenter.v2.IExternalSystem }; - - /** Finding mitreAttack. */ - public mitreAttack?: (google.cloud.securitycenter.v2.IMitreAttack|null); - - /** Finding access. */ - public access?: (google.cloud.securitycenter.v2.IAccess|null); - - /** Finding connections. */ - public connections: google.cloud.securitycenter.v2.IConnection[]; - - /** Finding muteInitiator. */ - public muteInitiator: string; - - /** Finding processes. */ - public processes: google.cloud.securitycenter.v2.IProcess[]; - - /** Finding contacts. */ - public contacts: { [k: string]: google.cloud.securitycenter.v2.IContactDetails }; - - /** Finding compliances. */ - public compliances: google.cloud.securitycenter.v2.ICompliance[]; - - /** Finding parentDisplayName. */ - public parentDisplayName: string; - - /** Finding description. */ - public description: string; - - /** Finding exfiltration. */ - public exfiltration?: (google.cloud.securitycenter.v2.IExfiltration|null); - - /** Finding iamBindings. */ - public iamBindings: google.cloud.securitycenter.v2.IIamBinding[]; - - /** Finding nextSteps. */ - public nextSteps: string; - - /** Finding moduleName. */ - public moduleName: string; - - /** Finding containers. */ - public containers: google.cloud.securitycenter.v2.IContainer[]; - - /** Finding kubernetes. */ - public kubernetes?: (google.cloud.securitycenter.v2.IKubernetes|null); - - /** Finding database. */ - public database?: (google.cloud.securitycenter.v2.IDatabase|null); - - /** Finding attackExposure. */ - public attackExposure?: (google.cloud.securitycenter.v2.IAttackExposure|null); - - /** Finding files. */ - public files: google.cloud.securitycenter.v2.IFile[]; - - /** Finding cloudDlpInspection. */ - public cloudDlpInspection?: (google.cloud.securitycenter.v2.ICloudDlpInspection|null); - - /** Finding cloudDlpDataProfile. */ - public cloudDlpDataProfile?: (google.cloud.securitycenter.v2.ICloudDlpDataProfile|null); - - /** Finding kernelRootkit. */ - public kernelRootkit?: (google.cloud.securitycenter.v2.IKernelRootkit|null); - - /** Finding orgPolicies. */ - public orgPolicies: google.cloud.securitycenter.v2.IOrgPolicy[]; - - /** Finding job. */ - public job?: (google.cloud.securitycenter.v2.IJob|null); - - /** Finding application. */ - public application?: (google.cloud.securitycenter.v2.IApplication|null); - - /** Finding ipRules. */ - public ipRules?: (google.cloud.securitycenter.v2.IIpRules|null); - - /** Finding backupDisasterRecovery. */ - public backupDisasterRecovery?: (google.cloud.securitycenter.v2.IBackupDisasterRecovery|null); - - /** Finding securityPosture. */ - public securityPosture?: (google.cloud.securitycenter.v2.ISecurityPosture|null); - - /** Finding logEntries. */ - public logEntries: google.cloud.securitycenter.v2.ILogEntry[]; - - /** Finding loadBalancers. */ - public loadBalancers: google.cloud.securitycenter.v2.ILoadBalancer[]; - - /** Finding cloudArmor. */ - public cloudArmor?: (google.cloud.securitycenter.v2.ICloudArmor|null); - - /** Finding notebook. */ - public notebook?: (google.cloud.securitycenter.v2.INotebook|null); - - /** Finding toxicCombination. */ - public toxicCombination?: (google.cloud.securitycenter.v2.IToxicCombination|null); - - /** Finding groupMemberships. */ - public groupMemberships: google.cloud.securitycenter.v2.IGroupMembership[]; - - /** Finding disk. */ - public disk?: (google.cloud.securitycenter.v2.IDisk|null); - - /** Finding dataAccessEvents. */ - public dataAccessEvents: google.cloud.securitycenter.v2.IDataAccessEvent[]; - - /** Finding dataFlowEvents. */ - public dataFlowEvents: google.cloud.securitycenter.v2.IDataFlowEvent[]; - - /** Finding networks. */ - public networks: google.cloud.securitycenter.v2.INetwork[]; - - /** Finding dataRetentionDeletionEvents. */ - public dataRetentionDeletionEvents: google.cloud.securitycenter.v2.IDataRetentionDeletionEvent[]; - - /** Finding affectedResources. */ - public affectedResources?: (google.cloud.securitycenter.v2.IAffectedResources|null); - - /** Finding aiModel. */ - public aiModel?: (google.cloud.securitycenter.v2.IAiModel|null); - - /** Finding chokepoint. */ - public chokepoint?: (google.cloud.securitycenter.v2.IChokepoint|null); - - /** Finding vertexAi. */ - public vertexAi?: (google.cloud.securitycenter.v2.IVertexAi|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.v2.IFinding): google.cloud.securitycenter.v2.Finding; - - /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Finding to JSON. - * @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 { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INACTIVE = 2 - } - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - CRITICAL = 1, - HIGH = 2, - MEDIUM = 3, - LOW = 4 - } - - /** Mute enum. */ - enum Mute { - MUTE_UNSPECIFIED = 0, - MUTED = 1, - UNMUTED = 2, - UNDEFINED = 3 - } - - /** Properties of a MuteInfo. */ - interface IMuteInfo { - - /** MuteInfo staticMute */ - staticMute?: (google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute|null); - - /** MuteInfo dynamicMuteRecords */ - dynamicMuteRecords?: (google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord[]|null); - } - - /** Represents a MuteInfo. */ - class MuteInfo implements IMuteInfo { - - /** - * Constructs a new MuteInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.Finding.IMuteInfo); - - /** MuteInfo staticMute. */ - public staticMute?: (google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute|null); - - /** MuteInfo dynamicMuteRecords. */ - public dynamicMuteRecords: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord[]; - - /** - * Creates a new MuteInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns MuteInfo instance - */ - public static create(properties?: google.cloud.securitycenter.v2.Finding.IMuteInfo): google.cloud.securitycenter.v2.Finding.MuteInfo; - - /** - * Encodes the specified MuteInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.verify|verify} messages. - * @param message MuteInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.Finding.IMuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MuteInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.verify|verify} messages. - * @param message MuteInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.Finding.IMuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MuteInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MuteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Finding.MuteInfo; - - /** - * Decodes a MuteInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MuteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Finding.MuteInfo; - - /** - * Verifies a MuteInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MuteInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MuteInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Finding.MuteInfo; - - /** - * Creates a plain object from a MuteInfo message. Also converts values to other types if specified. - * @param message MuteInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Finding.MuteInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MuteInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MuteInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MuteInfo { - - /** Properties of a StaticMute. */ - interface IStaticMute { - - /** StaticMute state */ - state?: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute|null); - - /** StaticMute applyTime */ - applyTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a StaticMute. */ - class StaticMute implements IStaticMute { - - /** - * Constructs a new StaticMute. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute); - - /** StaticMute state. */ - public state: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute); - - /** StaticMute applyTime. */ - public applyTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new StaticMute instance using the specified properties. - * @param [properties] Properties to set - * @returns StaticMute instance - */ - public static create(properties?: google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute): google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute; - - /** - * Encodes the specified StaticMute message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify|verify} messages. - * @param message StaticMute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StaticMute message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify|verify} messages. - * @param message StaticMute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StaticMute message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StaticMute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute; - - /** - * Decodes a StaticMute message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StaticMute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute; - - /** - * Verifies a StaticMute message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StaticMute message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StaticMute - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute; - - /** - * Creates a plain object from a StaticMute message. Also converts values to other types if specified. - * @param message StaticMute - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StaticMute to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StaticMute - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DynamicMuteRecord. */ - interface IDynamicMuteRecord { - - /** DynamicMuteRecord muteConfig */ - muteConfig?: (string|null); - - /** DynamicMuteRecord matchTime */ - matchTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DynamicMuteRecord. */ - class DynamicMuteRecord implements IDynamicMuteRecord { - - /** - * Constructs a new DynamicMuteRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord); - - /** DynamicMuteRecord muteConfig. */ - public muteConfig: string; - - /** DynamicMuteRecord matchTime. */ - public matchTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new DynamicMuteRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns DynamicMuteRecord instance - */ - public static create(properties?: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord): google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord; - - /** - * Encodes the specified DynamicMuteRecord message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. - * @param message DynamicMuteRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DynamicMuteRecord message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. - * @param message DynamicMuteRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DynamicMuteRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DynamicMuteRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord; - - /** - * Decodes a DynamicMuteRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DynamicMuteRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord; - - /** - * Verifies a DynamicMuteRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DynamicMuteRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DynamicMuteRecord - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord; - - /** - * Creates a plain object from a DynamicMuteRecord message. Also converts values to other types if specified. - * @param message DynamicMuteRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DynamicMuteRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DynamicMuteRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** FindingClass enum. */ - enum FindingClass { - FINDING_CLASS_UNSPECIFIED = 0, - THREAT = 1, - VULNERABILITY = 2, - MISCONFIGURATION = 3, - OBSERVATION = 4, - SCC_ERROR = 5, - POSTURE_VIOLATION = 6, - TOXIC_COMBINATION = 7, - SENSITIVE_DATA_RISK = 8, - CHOKEPOINT = 9 - } - } - - /** Properties of a GroupMembership. */ - interface IGroupMembership { - - /** GroupMembership groupType */ - groupType?: (google.cloud.securitycenter.v2.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v2.GroupMembership.GroupType|null); - - /** GroupMembership groupId */ - groupId?: (string|null); - } - - /** Represents a GroupMembership. */ - class GroupMembership implements IGroupMembership { - - /** - * Constructs a new GroupMembership. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IGroupMembership); - - /** GroupMembership groupType. */ - public groupType: (google.cloud.securitycenter.v2.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v2.GroupMembership.GroupType); - - /** GroupMembership groupId. */ - public groupId: string; - - /** - * Creates a new GroupMembership instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupMembership instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IGroupMembership): google.cloud.securitycenter.v2.GroupMembership; - - /** - * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. - * @param message GroupMembership message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. - * @param message GroupMembership message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GroupMembership message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupMembership - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GroupMembership; - - /** - * Decodes a GroupMembership message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupMembership - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GroupMembership; - - /** - * Verifies a GroupMembership message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupMembership - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GroupMembership; - - /** - * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. - * @param message GroupMembership - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.GroupMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GroupMembership to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GroupMembership - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GroupMembership { - - /** GroupType enum. */ - enum GroupType { - GROUP_TYPE_UNSPECIFIED = 0, - GROUP_TYPE_TOXIC_COMBINATION = 1, - GROUP_TYPE_CHOKEPOINT = 3 - } - } - - /** Properties of an IamBinding. */ - interface IIamBinding { - - /** IamBinding action */ - action?: (google.cloud.securitycenter.v2.IamBinding.Action|keyof typeof google.cloud.securitycenter.v2.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.v2.IIamBinding); - - /** IamBinding action. */ - public action: (google.cloud.securitycenter.v2.IamBinding.Action|keyof typeof google.cloud.securitycenter.v2.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.v2.IIamBinding): google.cloud.securitycenter.v2.IamBinding; - - /** - * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IIamBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.IamBinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IamBinding to JSON. - * @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 { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an Indicator. */ - interface IIndicator { - - /** Indicator ipAddresses */ - ipAddresses?: (string[]|null); - - /** Indicator domains */ - domains?: (string[]|null); - - /** Indicator signatures */ - signatures?: (google.cloud.securitycenter.v2.Indicator.IProcessSignature[]|null); - - /** Indicator uris */ - uris?: (string[]|null); - } - - /** Represents an Indicator. */ - class Indicator implements IIndicator { - - /** - * Constructs a new Indicator. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IIndicator); - - /** Indicator ipAddresses. */ - public ipAddresses: string[]; - - /** Indicator domains. */ - public domains: string[]; - - /** Indicator signatures. */ - public signatures: google.cloud.securitycenter.v2.Indicator.IProcessSignature[]; - - /** Indicator uris. */ - public uris: 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.v2.IIndicator): google.cloud.securitycenter.v2.Indicator; - - /** - * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IIndicator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Indicator to JSON. - * @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 { - - /** Properties of a ProcessSignature. */ - interface IProcessSignature { - - /** ProcessSignature memoryHashSignature */ - memoryHashSignature?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.IMemoryHashSignature|null); - - /** ProcessSignature yaraRuleSignature */ - yaraRuleSignature?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature|null); - - /** ProcessSignature signatureType */ - signatureType?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType|keyof typeof google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType|null); - } - - /** Represents a ProcessSignature. */ - class ProcessSignature implements IProcessSignature { - - /** - * Constructs a new ProcessSignature. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.Indicator.IProcessSignature); - - /** ProcessSignature memoryHashSignature. */ - public memoryHashSignature?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.IMemoryHashSignature|null); - - /** ProcessSignature yaraRuleSignature. */ - public yaraRuleSignature?: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature|null); - - /** ProcessSignature signatureType. */ - public signatureType: (google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType|keyof typeof google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType); - - /** 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.v2.Indicator.IProcessSignature): google.cloud.securitycenter.v2.Indicator.ProcessSignature; - - /** - * Encodes the specified ProcessSignature message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Indicator.IProcessSignature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessSignature to JSON. - * @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 { - - /** Properties of a MemoryHashSignature. */ - interface IMemoryHashSignature { - - /** MemoryHashSignature binaryFamily */ - binaryFamily?: (string|null); - - /** MemoryHashSignature detections */ - detections?: (google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IMemoryHashSignature); - - /** MemoryHashSignature binaryFamily. */ - public binaryFamily: string; - - /** MemoryHashSignature detections. */ - public detections: google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IMemoryHashSignature): google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature; - - /** - * Encodes the specified MemoryHashSignature message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IMemoryHashSignature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MemoryHashSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MemoryHashSignature to JSON. - * @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 { - - /** 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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.IDetection): google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection; - - /** - * Encodes the specified Detection message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.IDetection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Detection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Detection to JSON. - * @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; - } - } - - /** 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.v2.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.v2.Indicator.ProcessSignature.IYaraRuleSignature): google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature; - - /** - * Encodes the specified YaraRuleSignature message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IYaraRuleSignature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified YaraRuleSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this YaraRuleSignature to JSON. - * @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; - } - - /** SignatureType enum. */ - enum SignatureType { - SIGNATURE_TYPE_UNSPECIFIED = 0, - SIGNATURE_TYPE_PROCESS = 1, - SIGNATURE_TYPE_FILE = 2 - } - } - } - - /** Properties of an IpRules. */ - interface IIpRules { - - /** IpRules direction */ - direction?: (google.cloud.securitycenter.v2.IpRules.Direction|keyof typeof google.cloud.securitycenter.v2.IpRules.Direction|null); - - /** IpRules allowed */ - allowed?: (google.cloud.securitycenter.v2.IAllowed|null); - - /** IpRules denied */ - denied?: (google.cloud.securitycenter.v2.IDenied|null); - - /** IpRules sourceIpRanges */ - sourceIpRanges?: (string[]|null); - - /** IpRules destinationIpRanges */ - destinationIpRanges?: (string[]|null); - - /** IpRules exposedServices */ - exposedServices?: (string[]|null); - } - - /** Represents an IpRules. */ - class IpRules implements IIpRules { - - /** - * Constructs a new IpRules. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IIpRules); - - /** IpRules direction. */ - public direction: (google.cloud.securitycenter.v2.IpRules.Direction|keyof typeof google.cloud.securitycenter.v2.IpRules.Direction); - - /** IpRules allowed. */ - public allowed?: (google.cloud.securitycenter.v2.IAllowed|null); - - /** IpRules denied. */ - public denied?: (google.cloud.securitycenter.v2.IDenied|null); - - /** IpRules sourceIpRanges. */ - public sourceIpRanges: string[]; - - /** IpRules destinationIpRanges. */ - public destinationIpRanges: string[]; - - /** IpRules exposedServices. */ - public exposedServices: string[]; - - /** IpRules rules. */ - public rules?: ("allowed"|"denied"); - - /** - * Creates a new IpRules instance using the specified properties. - * @param [properties] Properties to set - * @returns IpRules instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IIpRules): google.cloud.securitycenter.v2.IpRules; - - /** - * Encodes the specified IpRules message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRules.verify|verify} messages. - * @param message IpRules message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IIpRules, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IpRules message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRules.verify|verify} messages. - * @param message IpRules message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IIpRules, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IpRules message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IpRules - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.IpRules; - - /** - * Decodes an IpRules message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IpRules - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.IpRules; - - /** - * Verifies an IpRules message. - * @param message Plain 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 IpRules message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IpRules - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.IpRules; - - /** - * Creates a plain object from an IpRules message. Also converts values to other types if specified. - * @param message IpRules - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.IpRules, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IpRules to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IpRules - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace IpRules { - - /** Direction enum. */ - enum Direction { - DIRECTION_UNSPECIFIED = 0, - INGRESS = 1, - EGRESS = 2 - } - } - - /** Properties of an IpRule. */ - interface IIpRule { - - /** IpRule protocol */ - protocol?: (string|null); - - /** IpRule portRanges */ - portRanges?: (google.cloud.securitycenter.v2.IpRule.IPortRange[]|null); - } - - /** Represents an IpRule. */ - class IpRule implements IIpRule { - - /** - * Constructs a new IpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IIpRule); - - /** IpRule protocol. */ - public protocol: string; - - /** IpRule portRanges. */ - public portRanges: google.cloud.securitycenter.v2.IpRule.IPortRange[]; - - /** - * Creates a new IpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns IpRule instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IIpRule): google.cloud.securitycenter.v2.IpRule; - - /** - * Encodes the specified IpRule message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.verify|verify} messages. - * @param message IpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IIpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IpRule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.verify|verify} messages. - * @param message IpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IIpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.IpRule; - - /** - * Decodes an IpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.IpRule; - - /** - * Verifies an IpRule message. - * @param message Plain 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 IpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IpRule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.IpRule; - - /** - * Creates a plain object from an IpRule message. Also converts values to other types if specified. - * @param message IpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.IpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace IpRule { - - /** Properties of a PortRange. */ - interface IPortRange { - - /** PortRange min */ - min?: (number|Long|string|null); - - /** PortRange max */ - max?: (number|Long|string|null); - } - - /** Represents a PortRange. */ - class PortRange implements IPortRange { - - /** - * Constructs a new PortRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IpRule.IPortRange); - - /** PortRange min. */ - public min: (number|Long|string); - - /** PortRange max. */ - public max: (number|Long|string); - - /** - * Creates a new PortRange instance using the specified properties. - * @param [properties] Properties to set - * @returns PortRange instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IpRule.IPortRange): google.cloud.securitycenter.v2.IpRule.PortRange; - - /** - * Encodes the specified PortRange message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.PortRange.verify|verify} messages. - * @param message PortRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IpRule.IPortRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PortRange message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.PortRange.verify|verify} messages. - * @param message PortRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IpRule.IPortRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PortRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PortRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.IpRule.PortRange; - - /** - * Decodes a PortRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PortRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.IpRule.PortRange; - - /** - * Verifies a PortRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PortRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PortRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.IpRule.PortRange; - - /** - * Creates a plain object from a PortRange message. Also converts values to other types if specified. - * @param message PortRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.IpRule.PortRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PortRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PortRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an Allowed. */ - interface IAllowed { - - /** Allowed ipRules */ - ipRules?: (google.cloud.securitycenter.v2.IIpRule[]|null); - } - - /** Represents an Allowed. */ - class Allowed implements IAllowed { - - /** - * Constructs a new Allowed. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAllowed); - - /** Allowed ipRules. */ - public ipRules: google.cloud.securitycenter.v2.IIpRule[]; - - /** - * Creates a new Allowed instance using the specified properties. - * @param [properties] Properties to set - * @returns Allowed instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAllowed): google.cloud.securitycenter.v2.Allowed; - - /** - * Encodes the specified Allowed message. Does not implicitly {@link google.cloud.securitycenter.v2.Allowed.verify|verify} messages. - * @param message Allowed message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAllowed, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Allowed message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Allowed.verify|verify} messages. - * @param message Allowed message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAllowed, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Allowed message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Allowed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Allowed; - - /** - * Decodes an Allowed message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Allowed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Allowed; - - /** - * Verifies an Allowed message. - * @param message Plain 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 Allowed message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Allowed - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Allowed; - - /** - * Creates a plain object from an Allowed message. Also converts values to other types if specified. - * @param message Allowed - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Allowed, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Allowed to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Allowed - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Denied. */ - interface IDenied { - - /** Denied ipRules */ - ipRules?: (google.cloud.securitycenter.v2.IIpRule[]|null); - } - - /** Represents a Denied. */ - class Denied implements IDenied { - - /** - * Constructs a new Denied. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IDenied); - - /** Denied ipRules. */ - public ipRules: google.cloud.securitycenter.v2.IIpRule[]; - - /** - * Creates a new Denied instance using the specified properties. - * @param [properties] Properties to set - * @returns Denied instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IDenied): google.cloud.securitycenter.v2.Denied; - - /** - * Encodes the specified Denied message. Does not implicitly {@link google.cloud.securitycenter.v2.Denied.verify|verify} messages. - * @param message Denied message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IDenied, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Denied message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Denied.verify|verify} messages. - * @param message Denied message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IDenied, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Denied message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Denied - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Denied; - - /** - * Decodes a Denied message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Denied - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Denied; - - /** - * Verifies a Denied message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Denied message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Denied - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Denied; - - /** - * Creates a plain object from a Denied message. Also converts values to other types if specified. - * @param message Denied - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Denied, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Denied to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Denied - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Job. */ - interface IJob { - - /** Job name */ - name?: (string|null); - - /** Job state */ - state?: (google.cloud.securitycenter.v2.JobState|keyof typeof google.cloud.securitycenter.v2.JobState|null); - - /** Job errorCode */ - errorCode?: (number|null); - - /** Job location */ - location?: (string|null); - } - - /** Represents a Job. */ - class Job implements IJob { - - /** - * Constructs a new Job. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IJob); - - /** Job name. */ - public name: string; - - /** Job state. */ - public state: (google.cloud.securitycenter.v2.JobState|keyof typeof google.cloud.securitycenter.v2.JobState); - - /** Job errorCode. */ - public errorCode: number; - - /** Job location. */ - public location: string; - - /** - * Creates a new Job instance using the specified properties. - * @param [properties] Properties to set - * @returns Job instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IJob): google.cloud.securitycenter.v2.Job; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.securitycenter.v2.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Job message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Job; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Job; - - /** - * Verifies a Job message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Job - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Job; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @param message Job - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Job to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Job - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** JobState enum. */ - enum JobState { - JOB_STATE_UNSPECIFIED = 0, - PENDING = 1, - RUNNING = 2, - SUCCEEDED = 3, - FAILED = 4 - } - - /** Properties of a KernelRootkit. */ - interface IKernelRootkit { - - /** KernelRootkit name */ - name?: (string|null); - - /** KernelRootkit unexpectedCodeModification */ - unexpectedCodeModification?: (boolean|null); - - /** KernelRootkit unexpectedReadOnlyDataModification */ - unexpectedReadOnlyDataModification?: (boolean|null); - - /** KernelRootkit unexpectedFtraceHandler */ - unexpectedFtraceHandler?: (boolean|null); - - /** KernelRootkit unexpectedKprobeHandler */ - unexpectedKprobeHandler?: (boolean|null); - - /** KernelRootkit unexpectedKernelCodePages */ - unexpectedKernelCodePages?: (boolean|null); - - /** KernelRootkit unexpectedSystemCallHandler */ - unexpectedSystemCallHandler?: (boolean|null); - - /** KernelRootkit unexpectedInterruptHandler */ - unexpectedInterruptHandler?: (boolean|null); - - /** KernelRootkit unexpectedProcessesInRunqueue */ - unexpectedProcessesInRunqueue?: (boolean|null); - } - - /** Represents a KernelRootkit. */ - class KernelRootkit implements IKernelRootkit { - - /** - * Constructs a new KernelRootkit. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IKernelRootkit); - - /** KernelRootkit name. */ - public name: string; - - /** KernelRootkit unexpectedCodeModification. */ - public unexpectedCodeModification: boolean; - - /** KernelRootkit unexpectedReadOnlyDataModification. */ - public unexpectedReadOnlyDataModification: boolean; - - /** KernelRootkit unexpectedFtraceHandler. */ - public unexpectedFtraceHandler: boolean; - - /** KernelRootkit unexpectedKprobeHandler. */ - public unexpectedKprobeHandler: boolean; - - /** KernelRootkit unexpectedKernelCodePages. */ - public unexpectedKernelCodePages: boolean; - - /** KernelRootkit unexpectedSystemCallHandler. */ - public unexpectedSystemCallHandler: boolean; - - /** KernelRootkit unexpectedInterruptHandler. */ - public unexpectedInterruptHandler: boolean; - - /** KernelRootkit unexpectedProcessesInRunqueue. */ - public unexpectedProcessesInRunqueue: boolean; - - /** - * Creates a new KernelRootkit instance using the specified properties. - * @param [properties] Properties to set - * @returns KernelRootkit instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IKernelRootkit): google.cloud.securitycenter.v2.KernelRootkit; - - /** - * Encodes the specified KernelRootkit message. Does not implicitly {@link google.cloud.securitycenter.v2.KernelRootkit.verify|verify} messages. - * @param message KernelRootkit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IKernelRootkit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KernelRootkit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.KernelRootkit.verify|verify} messages. - * @param message KernelRootkit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IKernelRootkit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KernelRootkit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KernelRootkit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.KernelRootkit; - - /** - * Decodes a KernelRootkit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KernelRootkit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.KernelRootkit; - - /** - * Verifies a KernelRootkit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KernelRootkit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KernelRootkit - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.KernelRootkit; - - /** - * Creates a plain object from a KernelRootkit message. Also converts values to other types if specified. - * @param message KernelRootkit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.KernelRootkit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KernelRootkit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KernelRootkit - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Kubernetes. */ - interface IKubernetes { - - /** Kubernetes pods */ - pods?: (google.cloud.securitycenter.v2.Kubernetes.IPod[]|null); - - /** Kubernetes nodes */ - nodes?: (google.cloud.securitycenter.v2.Kubernetes.INode[]|null); - - /** Kubernetes nodePools */ - nodePools?: (google.cloud.securitycenter.v2.Kubernetes.INodePool[]|null); - - /** Kubernetes roles */ - roles?: (google.cloud.securitycenter.v2.Kubernetes.IRole[]|null); - - /** Kubernetes bindings */ - bindings?: (google.cloud.securitycenter.v2.Kubernetes.IBinding[]|null); - - /** Kubernetes accessReviews */ - accessReviews?: (google.cloud.securitycenter.v2.Kubernetes.IAccessReview[]|null); - - /** Kubernetes objects */ - objects?: (google.cloud.securitycenter.v2.Kubernetes.IObject[]|null); - } - - /** Represents a Kubernetes. */ - class Kubernetes implements IKubernetes { - - /** - * Constructs a new Kubernetes. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IKubernetes); - - /** Kubernetes pods. */ - public pods: google.cloud.securitycenter.v2.Kubernetes.IPod[]; - - /** Kubernetes nodes. */ - public nodes: google.cloud.securitycenter.v2.Kubernetes.INode[]; - - /** Kubernetes nodePools. */ - public nodePools: google.cloud.securitycenter.v2.Kubernetes.INodePool[]; - - /** Kubernetes roles. */ - public roles: google.cloud.securitycenter.v2.Kubernetes.IRole[]; - - /** Kubernetes bindings. */ - public bindings: google.cloud.securitycenter.v2.Kubernetes.IBinding[]; - - /** Kubernetes accessReviews. */ - public accessReviews: google.cloud.securitycenter.v2.Kubernetes.IAccessReview[]; - - /** Kubernetes objects. */ - public objects: google.cloud.securitycenter.v2.Kubernetes.IObject[]; - - /** - * Creates a new Kubernetes instance using the specified properties. - * @param [properties] Properties to set - * @returns Kubernetes instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IKubernetes): google.cloud.securitycenter.v2.Kubernetes; - - /** - * Encodes the specified Kubernetes message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IKubernetes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Kubernetes message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Kubernetes to JSON. - * @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 { - - /** Properties of a Pod. */ - interface IPod { - - /** Pod ns */ - ns?: (string|null); - - /** Pod name */ - name?: (string|null); - - /** Pod labels */ - labels?: (google.cloud.securitycenter.v2.ILabel[]|null); - - /** Pod containers */ - containers?: (google.cloud.securitycenter.v2.IContainer[]|null); - } - - /** Represents a Pod. */ - class Pod implements IPod { - - /** - * Constructs a new Pod. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.Kubernetes.IPod); - - /** Pod ns. */ - public ns: string; - - /** Pod name. */ - public name: string; - - /** Pod labels. */ - public labels: google.cloud.securitycenter.v2.ILabel[]; - - /** Pod containers. */ - public containers: google.cloud.securitycenter.v2.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.v2.Kubernetes.IPod): google.cloud.securitycenter.v2.Kubernetes.Pod; - - /** - * Encodes the specified Pod message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.IPod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Pod message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Pod, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Pod to JSON. - * @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. */ - 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.v2.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.v2.Kubernetes.INode): google.cloud.securitycenter.v2.Kubernetes.Node; - - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.INode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Node to JSON. - * @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. */ - interface INodePool { - - /** NodePool name */ - name?: (string|null); - - /** NodePool nodes */ - nodes?: (google.cloud.securitycenter.v2.Kubernetes.INode[]|null); - } - - /** Represents a NodePool. */ - class NodePool implements INodePool { - - /** - * Constructs a new NodePool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.Kubernetes.INodePool); - - /** NodePool name. */ - public name: string; - - /** NodePool nodes. */ - public nodes: google.cloud.securitycenter.v2.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.v2.Kubernetes.INodePool): google.cloud.securitycenter.v2.Kubernetes.NodePool; - - /** - * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.INodePool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.NodePool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodePool to JSON. - * @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. */ - interface IRole { - - /** Role kind */ - kind?: (google.cloud.securitycenter.v2.Kubernetes.Role.Kind|keyof typeof google.cloud.securitycenter.v2.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.v2.Kubernetes.IRole); - - /** Role kind. */ - public kind: (google.cloud.securitycenter.v2.Kubernetes.Role.Kind|keyof typeof google.cloud.securitycenter.v2.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.v2.Kubernetes.IRole): google.cloud.securitycenter.v2.Kubernetes.Role; - - /** - * Encodes the specified Role message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.IRole, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Role message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Role, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Role to JSON. - * @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 { - - /** 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.v2.Kubernetes.IRole|null); - - /** Binding subjects */ - subjects?: (google.cloud.securitycenter.v2.Kubernetes.ISubject[]|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.Kubernetes.IBinding); - - /** Binding ns. */ - public ns: string; - - /** Binding name. */ - public name: string; - - /** Binding role. */ - public role?: (google.cloud.securitycenter.v2.Kubernetes.IRole|null); - - /** Binding subjects. */ - public subjects: google.cloud.securitycenter.v2.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.v2.Kubernetes.IBinding): google.cloud.securitycenter.v2.Kubernetes.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @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. */ - interface ISubject { - - /** Subject kind */ - kind?: (google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType|keyof typeof google.cloud.securitycenter.v2.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.v2.Kubernetes.ISubject); - - /** Subject kind. */ - public kind: (google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType|keyof typeof google.cloud.securitycenter.v2.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.v2.Kubernetes.ISubject): google.cloud.securitycenter.v2.Kubernetes.Subject; - - /** - * Encodes the specified Subject message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Subject to JSON. - * @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 { - - /** 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.v2.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.v2.Kubernetes.IAccessReview): google.cloud.securitycenter.v2.Kubernetes.AccessReview; - - /** - * Encodes the specified AccessReview message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.Kubernetes.IAccessReview, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AccessReview message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.AccessReview, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AccessReview to JSON. - * @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; - } - - /** Properties of an Object. */ - interface IObject { - - /** Object group */ - group?: (string|null); - - /** Object kind */ - kind?: (string|null); - - /** Object ns */ - ns?: (string|null); - - /** Object name */ - name?: (string|null); - - /** Object containers */ - containers?: (google.cloud.securitycenter.v2.IContainer[]|null); - } - - /** Represents an Object. */ - class Object implements IObject { - - /** - * Constructs a new Object. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.Kubernetes.IObject); - - /** Object group. */ - public group: string; - - /** Object kind. */ - public kind: string; - - /** Object ns. */ - public ns: string; - - /** Object name. */ - public name: string; - - /** Object containers. */ - public containers: google.cloud.securitycenter.v2.IContainer[]; - - /** - * Creates a new Object instance using the specified properties. - * @param [properties] Properties to set - * @returns Object instance - */ - public static create(properties?: google.cloud.securitycenter.v2.Kubernetes.IObject): google.cloud.securitycenter.v2.Kubernetes.object; - - /** - * Encodes the specified Object message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Object.verify|verify} messages. - * @param message Object message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.Kubernetes.IObject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Object message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Object.verify|verify} messages. - * @param message Object message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.Kubernetes.IObject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Object message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Object - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Kubernetes.object; - - /** - * Decodes an Object message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Object - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Kubernetes.object; - - /** - * Verifies an Object message. - * @param message Plain 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 Object message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Object - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Kubernetes.object; - - /** - * Creates a plain object from an Object message. Also converts values to other types if specified. - * @param message Object - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Kubernetes.object, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Object to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Object - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a LoadBalancer. */ - interface ILoadBalancer { - - /** LoadBalancer name */ - name?: (string|null); - } - - /** Represents a LoadBalancer. */ - class LoadBalancer implements ILoadBalancer { - - /** - * Constructs a new LoadBalancer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ILoadBalancer); - - /** LoadBalancer name. */ - public name: string; - - /** - * Creates a new LoadBalancer instance using the specified properties. - * @param [properties] Properties to set - * @returns LoadBalancer instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ILoadBalancer): google.cloud.securitycenter.v2.LoadBalancer; - - /** - * Encodes the specified LoadBalancer message. Does not implicitly {@link google.cloud.securitycenter.v2.LoadBalancer.verify|verify} messages. - * @param message LoadBalancer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ILoadBalancer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LoadBalancer message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.LoadBalancer.verify|verify} messages. - * @param message LoadBalancer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ILoadBalancer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LoadBalancer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LoadBalancer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.LoadBalancer; - - /** - * Decodes a LoadBalancer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LoadBalancer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.LoadBalancer; - - /** - * Verifies a LoadBalancer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LoadBalancer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LoadBalancer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.LoadBalancer; - - /** - * Creates a plain object from a LoadBalancer message. Also converts values to other types if specified. - * @param message LoadBalancer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.LoadBalancer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LoadBalancer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LoadBalancer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LogEntry. */ - interface ILogEntry { - - /** LogEntry cloudLoggingEntry */ - cloudLoggingEntry?: (google.cloud.securitycenter.v2.ICloudLoggingEntry|null); - } - - /** Represents a LogEntry. */ - class LogEntry implements ILogEntry { - - /** - * Constructs a new LogEntry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ILogEntry); - - /** LogEntry cloudLoggingEntry. */ - public cloudLoggingEntry?: (google.cloud.securitycenter.v2.ICloudLoggingEntry|null); - - /** LogEntry logEntry. */ - public logEntry?: "cloudLoggingEntry"; - - /** - * Creates a new LogEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns LogEntry instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ILogEntry): google.cloud.securitycenter.v2.LogEntry; - - /** - * Encodes the specified LogEntry message. Does not implicitly {@link google.cloud.securitycenter.v2.LogEntry.verify|verify} messages. - * @param message LogEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.LogEntry.verify|verify} messages. - * @param message LogEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LogEntry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LogEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.LogEntry; - - /** - * Decodes a LogEntry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LogEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.LogEntry; - - /** - * Verifies a LogEntry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LogEntry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.LogEntry; - - /** - * Creates a plain object from a LogEntry message. Also converts values to other types if specified. - * @param message LogEntry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.LogEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LogEntry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LogEntry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudLoggingEntry. */ - interface ICloudLoggingEntry { - - /** CloudLoggingEntry insertId */ - insertId?: (string|null); - - /** CloudLoggingEntry logId */ - logId?: (string|null); - - /** CloudLoggingEntry resourceContainer */ - resourceContainer?: (string|null); - - /** CloudLoggingEntry timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CloudLoggingEntry. */ - class CloudLoggingEntry implements ICloudLoggingEntry { - - /** - * Constructs a new CloudLoggingEntry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICloudLoggingEntry); - - /** CloudLoggingEntry insertId. */ - public insertId: string; - - /** CloudLoggingEntry logId. */ - public logId: string; - - /** CloudLoggingEntry resourceContainer. */ - public resourceContainer: string; - - /** CloudLoggingEntry timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CloudLoggingEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudLoggingEntry instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ICloudLoggingEntry): google.cloud.securitycenter.v2.CloudLoggingEntry; - - /** - * Encodes the specified CloudLoggingEntry message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudLoggingEntry.verify|verify} messages. - * @param message CloudLoggingEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ICloudLoggingEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudLoggingEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudLoggingEntry.verify|verify} messages. - * @param message CloudLoggingEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ICloudLoggingEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudLoggingEntry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudLoggingEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CloudLoggingEntry; - - /** - * Decodes a CloudLoggingEntry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudLoggingEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CloudLoggingEntry; - - /** - * Verifies a CloudLoggingEntry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudLoggingEntry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudLoggingEntry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CloudLoggingEntry; - - /** - * Creates a plain object from a CloudLoggingEntry message. Also converts values to other types if specified. - * @param message CloudLoggingEntry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.CloudLoggingEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudLoggingEntry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudLoggingEntry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MitreAttack. */ - interface IMitreAttack { - - /** MitreAttack primaryTactic */ - primaryTactic?: (google.cloud.securitycenter.v2.MitreAttack.Tactic|keyof typeof google.cloud.securitycenter.v2.MitreAttack.Tactic|null); - - /** MitreAttack primaryTechniques */ - primaryTechniques?: (google.cloud.securitycenter.v2.MitreAttack.Technique[]|null); - - /** MitreAttack additionalTactics */ - additionalTactics?: (google.cloud.securitycenter.v2.MitreAttack.Tactic[]|null); - - /** MitreAttack additionalTechniques */ - additionalTechniques?: (google.cloud.securitycenter.v2.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.v2.IMitreAttack); - - /** MitreAttack primaryTactic. */ - public primaryTactic: (google.cloud.securitycenter.v2.MitreAttack.Tactic|keyof typeof google.cloud.securitycenter.v2.MitreAttack.Tactic); - - /** MitreAttack primaryTechniques. */ - public primaryTechniques: google.cloud.securitycenter.v2.MitreAttack.Technique[]; - - /** MitreAttack additionalTactics. */ - public additionalTactics: google.cloud.securitycenter.v2.MitreAttack.Tactic[]; - - /** MitreAttack additionalTechniques. */ - public additionalTechniques: google.cloud.securitycenter.v2.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.v2.IMitreAttack): google.cloud.securitycenter.v2.MitreAttack; - - /** - * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IMitreAttack, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MitreAttack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.MitreAttack, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MitreAttack to JSON. - * @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 { - - /** 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, - DATA_OBFUSCATION = 70, - DATA_OBFUSCATION_STEGANOGRAPHY = 71, - OS_CREDENTIAL_DUMPING = 114, - OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM = 115, - OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW = 122, - DATA_FROM_LOCAL_SYSTEM = 117, - AUTOMATED_EXFILTRATION = 68, - OBFUSCATED_FILES_OR_INFO = 72, - STEGANOGRAPHY = 73, - COMPILE_AFTER_DELIVERY = 74, - COMMAND_OBFUSCATION = 75, - SCHEDULED_TRANSFER = 120, - SYSTEM_OWNER_USER_DISCOVERY = 118, - MASQUERADING = 49, - MATCH_LEGITIMATE_NAME_OR_LOCATION = 50, - BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37, - STARTUP_ITEMS = 38, - NETWORK_SERVICE_DISCOVERY = 32, - SCHEDULED_TASK_JOB = 89, - SCHEDULED_TASK_JOB_CRON = 119, - CONTAINER_ORCHESTRATION_JOB = 90, - PROCESS_INJECTION = 93, - INPUT_CAPTURE = 103, - INPUT_CAPTURE_KEYLOGGING = 104, - PROCESS_DISCOVERY = 56, - COMMAND_AND_SCRIPTING_INTERPRETER = 6, - UNIX_SHELL = 7, - PYTHON = 59, - EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63, - PERMISSION_GROUPS_DISCOVERY = 18, - CLOUD_GROUPS = 19, - INDICATOR_REMOVAL = 123, - INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS = 124, - INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY = 125, - INDICATOR_REMOVAL_FILE_DELETION = 64, - INDICATOR_REMOVAL_TIMESTOMP = 128, - INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA = 126, - APPLICATION_LAYER_PROTOCOL = 45, - DNS = 46, - SOFTWARE_DEPLOYMENT_TOOLS = 47, - VALID_ACCOUNTS = 14, - DEFAULT_ACCOUNTS = 35, - LOCAL_ACCOUNTS = 15, - CLOUD_ACCOUNTS = 16, - FILE_AND_DIRECTORY_DISCOVERY = 121, - ACCOUNT_DISCOVERY_LOCAL_ACCOUNT = 116, - PROXY = 9, - EXTERNAL_PROXY = 10, - MULTI_HOP_PROXY = 11, - ACCOUNT_MANIPULATION = 22, - ADDITIONAL_CLOUD_CREDENTIALS = 40, - ADDITIONAL_CLOUD_ROLES = 67, - SSH_AUTHORIZED_KEYS = 23, - ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58, - MULTI_STAGE_CHANNELS = 76, - INGRESS_TOOL_TRANSFER = 3, - NATIVE_API = 4, - BRUTE_FORCE = 44, - AUTOMATED_COLLECTION = 94, - SHARED_MODULES = 5, - DATA_ENCODING = 77, - STANDARD_ENCODING = 78, - ACCESS_TOKEN_MANIPULATION = 33, - TOKEN_IMPERSONATION_OR_THEFT = 39, - CREATE_ACCOUNT = 79, - LOCAL_ACCOUNT = 80, - DEOBFUSCATE_DECODE_FILES_OR_INFO = 95, - EXPLOIT_PUBLIC_FACING_APPLICATION = 27, - SUPPLY_CHAIN_COMPROMISE = 129, - COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS = 130, - EXPLOITATION_FOR_CLIENT_EXECUTION = 134, - USER_EXECUTION = 69, - LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = 135, - DOMAIN_POLICY_MODIFICATION = 30, - DATA_DESTRUCTION = 29, - DATA_ENCRYPTED_FOR_IMPACT = 132, - SERVICE_STOP = 52, - INHIBIT_SYSTEM_RECOVERY = 36, - FIRMWARE_CORRUPTION = 81, - RESOURCE_HIJACKING = 8, - NETWORK_DENIAL_OF_SERVICE = 17, - CLOUD_SERVICE_DISCOVERY = 48, - STEAL_APPLICATION_ACCESS_TOKEN = 42, - ACCOUNT_ACCESS_REMOVAL = 51, - TRANSFER_DATA_TO_CLOUD_ACCOUNT = 91, - STEAL_WEB_SESSION_COOKIE = 25, - CREATE_OR_MODIFY_SYSTEM_PROCESS = 24, - EVENT_TRIGGERED_EXECUTION = 65, - BOOT_OR_LOGON_AUTOSTART_EXECUTION = 82, - KERNEL_MODULES_AND_EXTENSIONS = 83, - SHORTCUT_MODIFICATION = 127, - ABUSE_ELEVATION_CONTROL_MECHANISM = 34, - ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID = 136, - ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING = 109, - UNSECURED_CREDENTIALS = 13, - CREDENTIALS_IN_FILES = 105, - BASH_HISTORY = 96, - PRIVATE_KEYS = 97, - SUBVERT_TRUST_CONTROL = 106, - INSTALL_ROOT_CERTIFICATE = 107, - COMPROMISE_HOST_SOFTWARE_BINARY = 84, - CREDENTIALS_FROM_PASSWORD_STORES = 98, - MODIFY_AUTHENTICATION_PROCESS = 28, - PLUGGABLE_AUTHENTICATION_MODULES = 108, - MULTI_FACTOR_AUTHENTICATION = 137, - IMPAIR_DEFENSES = 31, - DISABLE_OR_MODIFY_TOOLS = 55, - INDICATOR_BLOCKING = 110, - DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM = 111, - HIDE_ARTIFACTS = 85, - HIDDEN_FILES_AND_DIRECTORIES = 86, - HIDDEN_USERS = 87, - EXFILTRATION_OVER_WEB_SERVICE = 20, - EXFILTRATION_TO_CLOUD_STORAGE = 21, - DYNAMIC_RESOLUTION = 12, - LATERAL_TOOL_TRANSFER = 41, - HIJACK_EXECUTION_FLOW = 112, - HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING = 113, - MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26, - CREATE_SNAPSHOT = 54, - CLOUD_INFRASTRUCTURE_DISCOVERY = 53, - DEVELOP_CAPABILITIES = 99, - DEVELOP_CAPABILITIES_MALWARE = 100, - OBTAIN_CAPABILITIES = 43, - OBTAIN_CAPABILITIES_MALWARE = 101, - OBTAIN_CAPABILITIES_VULNERABILITIES = 133, - ACTIVE_SCANNING = 1, - SCANNING_IP_BLOCKS = 2, - STAGE_CAPABILITIES = 88, - UPLOAD_MALWARE = 102, - CONTAINER_ADMINISTRATION_COMMAND = 60, - DEPLOY_CONTAINER = 66, - ESCAPE_TO_HOST = 61, - CONTAINER_AND_RESOURCE_DISCOVERY = 57, - REFLECTIVE_CODE_LOADING = 92, - STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62, - FINANCIAL_THEFT = 131 - } - } - - /** Properties of a Network. */ - interface INetwork { - - /** Network name */ - name?: (string|null); - } - - /** Represents a Network. */ - class Network implements INetwork { - - /** - * Constructs a new Network. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.INetwork); - - /** Network name. */ - public name: string; - - /** - * Creates a new Network instance using the specified properties. - * @param [properties] Properties to set - * @returns Network instance - */ - public static create(properties?: google.cloud.securitycenter.v2.INetwork): google.cloud.securitycenter.v2.Network; - - /** - * Encodes the specified Network message. Does not implicitly {@link google.cloud.securitycenter.v2.Network.verify|verify} messages. - * @param message Network message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Network message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Network.verify|verify} messages. - * @param message Network message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Network message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Network; - - /** - * Decodes a Network message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Network; - - /** - * Verifies a Network message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Network message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Network - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Network; - - /** - * Creates a plain object from a Network message. Also converts values to other types if specified. - * @param message Network - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Network, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Network to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Network - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Notebook. */ - interface INotebook { - - /** Notebook name */ - name?: (string|null); - - /** Notebook service */ - service?: (string|null); - - /** Notebook lastAuthor */ - lastAuthor?: (string|null); - - /** Notebook notebookUpdateTime */ - notebookUpdateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Notebook. */ - class Notebook implements INotebook { - - /** - * Constructs a new Notebook. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.INotebook); - - /** Notebook name. */ - public name: string; - - /** Notebook service. */ - public service: string; - - /** Notebook lastAuthor. */ - public lastAuthor: string; - - /** Notebook notebookUpdateTime. */ - public notebookUpdateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Notebook instance using the specified properties. - * @param [properties] Properties to set - * @returns Notebook instance - */ - public static create(properties?: google.cloud.securitycenter.v2.INotebook): google.cloud.securitycenter.v2.Notebook; - - /** - * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.securitycenter.v2.Notebook.verify|verify} messages. - * @param message Notebook message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Notebook.verify|verify} messages. - * @param message Notebook message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Notebook message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Notebook - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Notebook; - - /** - * Decodes a Notebook message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Notebook - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Notebook; - - /** - * Verifies a Notebook message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Notebook message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Notebook - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Notebook; - - /** - * Creates a plain object from a Notebook message. Also converts values to other types if specified. - * @param message Notebook - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Notebook, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Notebook to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Notebook - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OrgPolicy. */ - interface IOrgPolicy { - - /** OrgPolicy name */ - name?: (string|null); - } - - /** Represents an OrgPolicy. */ - class OrgPolicy implements IOrgPolicy { - - /** - * Constructs a new OrgPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IOrgPolicy); - - /** OrgPolicy name. */ - public name: string; - - /** - * Creates a new OrgPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns OrgPolicy instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IOrgPolicy): google.cloud.securitycenter.v2.OrgPolicy; - - /** - * Encodes the specified OrgPolicy message. Does not implicitly {@link google.cloud.securitycenter.v2.OrgPolicy.verify|verify} messages. - * @param message OrgPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OrgPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.OrgPolicy.verify|verify} messages. - * @param message OrgPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OrgPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OrgPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.OrgPolicy; - - /** - * Decodes an OrgPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OrgPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.OrgPolicy; - - /** - * Verifies an OrgPolicy message. - * @param message Plain 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 OrgPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OrgPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.OrgPolicy; - - /** - * Creates a plain object from an OrgPolicy message. Also converts values to other types if specified. - * @param message OrgPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.OrgPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OrgPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OrgPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Process. */ - interface IProcess { - - /** Process name */ - name?: (string|null); - - /** Process binary */ - binary?: (google.cloud.securitycenter.v2.IFile|null); - - /** Process libraries */ - libraries?: (google.cloud.securitycenter.v2.IFile[]|null); - - /** Process script */ - script?: (google.cloud.securitycenter.v2.IFile|null); - - /** Process args */ - args?: (string[]|null); - - /** Process argumentsTruncated */ - argumentsTruncated?: (boolean|null); - - /** Process envVariables */ - envVariables?: (google.cloud.securitycenter.v2.IEnvironmentVariable[]|null); - - /** Process envVariablesTruncated */ - envVariablesTruncated?: (boolean|null); - - /** Process pid */ - pid?: (number|Long|string|null); - - /** Process parentPid */ - parentPid?: (number|Long|string|null); - - /** Process userId */ - userId?: (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.v2.IProcess); - - /** Process name. */ - public name: string; - - /** Process binary. */ - public binary?: (google.cloud.securitycenter.v2.IFile|null); - - /** Process libraries. */ - public libraries: google.cloud.securitycenter.v2.IFile[]; - - /** Process script. */ - public script?: (google.cloud.securitycenter.v2.IFile|null); - - /** Process args. */ - public args: string[]; - - /** Process argumentsTruncated. */ - public argumentsTruncated: boolean; - - /** Process envVariables. */ - public envVariables: google.cloud.securitycenter.v2.IEnvironmentVariable[]; - - /** Process envVariablesTruncated. */ - public envVariablesTruncated: boolean; - - /** Process pid. */ - public pid: (number|Long|string); - - /** Process parentPid. */ - public parentPid: (number|Long|string); - - /** Process userId. */ - public userId: (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.v2.IProcess): google.cloud.securitycenter.v2.Process; - - /** - * Encodes the specified Process message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IProcess, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Process message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Process, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Process to JSON. - * @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. */ - 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.v2.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.v2.IEnvironmentVariable): google.cloud.securitycenter.v2.EnvironmentVariable; - - /** - * Encodes the specified EnvironmentVariable message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IEnvironmentVariable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnvironmentVariable message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.EnvironmentVariable, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnvironmentVariable to JSON. - * @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 SecurityMarks. */ - interface ISecurityMarks { - - /** SecurityMarks name */ - name?: (string|null); - - /** SecurityMarks marks */ - marks?: ({ [k: string]: string }|null); - - /** SecurityMarks canonicalName */ - canonicalName?: (string|null); - } - - /** Represents a SecurityMarks. */ - class SecurityMarks implements ISecurityMarks { - - /** - * Constructs a new SecurityMarks. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ISecurityMarks); - - /** SecurityMarks name. */ - public name: string; - - /** 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 - * @returns SecurityMarks instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ISecurityMarks): google.cloud.securitycenter.v2.SecurityMarks; - - /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityMarks to JSON. - * @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 SecurityPosture. */ - interface ISecurityPosture { - - /** SecurityPosture name */ - name?: (string|null); - - /** SecurityPosture revisionId */ - revisionId?: (string|null); - - /** SecurityPosture postureDeploymentResource */ - postureDeploymentResource?: (string|null); - - /** SecurityPosture postureDeployment */ - postureDeployment?: (string|null); - - /** SecurityPosture changedPolicy */ - changedPolicy?: (string|null); - - /** SecurityPosture policySet */ - policySet?: (string|null); - - /** SecurityPosture policy */ - policy?: (string|null); - - /** SecurityPosture policyDriftDetails */ - policyDriftDetails?: (google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails[]|null); - } - - /** Represents a SecurityPosture. */ - class SecurityPosture implements ISecurityPosture { - - /** - * Constructs a new SecurityPosture. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ISecurityPosture); - - /** SecurityPosture name. */ - public name: string; - - /** SecurityPosture revisionId. */ - public revisionId: string; - - /** SecurityPosture postureDeploymentResource. */ - public postureDeploymentResource: string; - - /** SecurityPosture postureDeployment. */ - public postureDeployment: string; - - /** SecurityPosture changedPolicy. */ - public changedPolicy: string; - - /** SecurityPosture policySet. */ - public policySet: string; - - /** SecurityPosture policy. */ - public policy: string; - - /** SecurityPosture policyDriftDetails. */ - public policyDriftDetails: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails[]; - - /** - * Creates a new SecurityPosture instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityPosture instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ISecurityPosture): google.cloud.securitycenter.v2.SecurityPosture; - - /** - * Encodes the specified SecurityPosture message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.verify|verify} messages. - * @param message SecurityPosture message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ISecurityPosture, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityPosture message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.verify|verify} messages. - * @param message SecurityPosture message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ISecurityPosture, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityPosture message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityPosture - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.SecurityPosture; - - /** - * Decodes a SecurityPosture message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityPosture - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.SecurityPosture; - - /** - * Verifies a SecurityPosture message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecurityPosture message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityPosture - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.SecurityPosture; - - /** - * Creates a plain object from a SecurityPosture message. Also converts values to other types if specified. - * @param message SecurityPosture - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.SecurityPosture, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityPosture to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecurityPosture - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SecurityPosture { - - /** Properties of a PolicyDriftDetails. */ - interface IPolicyDriftDetails { - - /** PolicyDriftDetails field */ - field?: (string|null); - - /** PolicyDriftDetails expectedValue */ - expectedValue?: (string|null); - - /** PolicyDriftDetails detectedValue */ - detectedValue?: (string|null); - } - - /** Represents a PolicyDriftDetails. */ - class PolicyDriftDetails implements IPolicyDriftDetails { - - /** - * Constructs a new PolicyDriftDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails); - - /** PolicyDriftDetails field. */ - public field: string; - - /** PolicyDriftDetails expectedValue. */ - public expectedValue: string; - - /** PolicyDriftDetails detectedValue. */ - public detectedValue: string; - - /** - * Creates a new PolicyDriftDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDriftDetails instance - */ - public static create(properties?: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails): google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails; - - /** - * Encodes the specified PolicyDriftDetails message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify|verify} messages. - * @param message PolicyDriftDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDriftDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify|verify} messages. - * @param message PolicyDriftDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDriftDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDriftDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails; - - /** - * Decodes a PolicyDriftDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDriftDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails; - - /** - * Verifies a PolicyDriftDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDriftDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDriftDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails; - - /** - * Creates a plain object from a PolicyDriftDetails message. Also converts values to other types if specified. - * @param message PolicyDriftDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDriftDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDriftDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ToxicCombination. */ - interface IToxicCombination { - - /** ToxicCombination attackExposureScore */ - attackExposureScore?: (number|null); - - /** ToxicCombination relatedFindings */ - relatedFindings?: (string[]|null); - } - - /** Represents a ToxicCombination. */ - class ToxicCombination implements IToxicCombination { - - /** - * Constructs a new ToxicCombination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IToxicCombination); - - /** ToxicCombination attackExposureScore. */ - public attackExposureScore: number; - - /** ToxicCombination relatedFindings. */ - public relatedFindings: string[]; - - /** - * Creates a new ToxicCombination instance using the specified properties. - * @param [properties] Properties to set - * @returns ToxicCombination instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IToxicCombination): google.cloud.securitycenter.v2.ToxicCombination; - - /** - * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. - * @param message ToxicCombination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. - * @param message ToxicCombination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToxicCombination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToxicCombination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ToxicCombination; - - /** - * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToxicCombination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ToxicCombination; - - /** - * Verifies a ToxicCombination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToxicCombination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ToxicCombination; - - /** - * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. - * @param message ToxicCombination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ToxicCombination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToxicCombination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToxicCombination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a VertexAi. */ - interface IVertexAi { - - /** VertexAi datasets */ - datasets?: (google.cloud.securitycenter.v2.VertexAi.IDataset[]|null); - - /** VertexAi pipelines */ - pipelines?: (google.cloud.securitycenter.v2.VertexAi.IPipeline[]|null); - } - - /** Represents a VertexAi. */ - class VertexAi implements IVertexAi { - - /** - * Constructs a new VertexAi. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IVertexAi); - - /** VertexAi datasets. */ - public datasets: google.cloud.securitycenter.v2.VertexAi.IDataset[]; - - /** VertexAi pipelines. */ - public pipelines: google.cloud.securitycenter.v2.VertexAi.IPipeline[]; - - /** - * Creates a new VertexAi instance using the specified properties. - * @param [properties] Properties to set - * @returns VertexAi instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IVertexAi): google.cloud.securitycenter.v2.VertexAi; - - /** - * Encodes the specified VertexAi message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.verify|verify} messages. - * @param message VertexAi message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IVertexAi, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VertexAi message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.verify|verify} messages. - * @param message VertexAi message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IVertexAi, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VertexAi message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VertexAi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.VertexAi; - - /** - * Decodes a VertexAi message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VertexAi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.VertexAi; - - /** - * Verifies a VertexAi message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VertexAi message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VertexAi - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.VertexAi; - - /** - * Creates a plain object from a VertexAi message. Also converts values to other types if specified. - * @param message VertexAi - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.VertexAi, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VertexAi to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VertexAi - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace VertexAi { - - /** Properties of a Dataset. */ - interface IDataset { - - /** Dataset name */ - name?: (string|null); - - /** Dataset displayName */ - displayName?: (string|null); - - /** Dataset source */ - source?: (string|null); - } - - /** Represents a Dataset. */ - class Dataset implements IDataset { - - /** - * Constructs a new Dataset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.VertexAi.IDataset); - - /** Dataset name. */ - public name: string; - - /** Dataset displayName. */ - public displayName: string; - - /** Dataset source. */ - public source: string; - - /** - * Creates a new Dataset instance using the specified properties. - * @param [properties] Properties to set - * @returns Dataset instance - */ - public static create(properties?: google.cloud.securitycenter.v2.VertexAi.IDataset): google.cloud.securitycenter.v2.VertexAi.Dataset; - - /** - * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Dataset.verify|verify} messages. - * @param message Dataset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.VertexAi.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Dataset.verify|verify} messages. - * @param message Dataset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.VertexAi.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Dataset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Dataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.VertexAi.Dataset; - - /** - * Decodes a Dataset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Dataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.VertexAi.Dataset; - - /** - * Verifies a Dataset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Dataset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Dataset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.VertexAi.Dataset; - - /** - * Creates a plain object from a Dataset message. Also converts values to other types if specified. - * @param message Dataset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.VertexAi.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Dataset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Dataset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Pipeline. */ - interface IPipeline { - - /** Pipeline name */ - name?: (string|null); - - /** Pipeline displayName */ - displayName?: (string|null); - } - - /** Represents a Pipeline. */ - class Pipeline implements IPipeline { - - /** - * Constructs a new Pipeline. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.VertexAi.IPipeline); - - /** Pipeline name. */ - public name: string; - - /** Pipeline displayName. */ - public displayName: string; - - /** - * Creates a new Pipeline instance using the specified properties. - * @param [properties] Properties to set - * @returns Pipeline instance - */ - public static create(properties?: google.cloud.securitycenter.v2.VertexAi.IPipeline): google.cloud.securitycenter.v2.VertexAi.Pipeline; - - /** - * Encodes the specified Pipeline message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Pipeline.verify|verify} messages. - * @param message Pipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.VertexAi.IPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Pipeline message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Pipeline.verify|verify} messages. - * @param message Pipeline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.VertexAi.IPipeline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Pipeline message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Pipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.VertexAi.Pipeline; - - /** - * Decodes a Pipeline message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Pipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.VertexAi.Pipeline; - - /** - * Verifies a Pipeline message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Pipeline message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Pipeline - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.VertexAi.Pipeline; - - /** - * Creates a plain object from a Pipeline message. Also converts values to other types if specified. - * @param message Pipeline - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.VertexAi.Pipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Pipeline to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Pipeline - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Vulnerability. */ - interface IVulnerability { - - /** Vulnerability cve */ - cve?: (google.cloud.securitycenter.v2.ICve|null); - - /** Vulnerability offendingPackage */ - offendingPackage?: (google.cloud.securitycenter.v2.IPackage|null); - - /** Vulnerability fixedPackage */ - fixedPackage?: (google.cloud.securitycenter.v2.IPackage|null); - - /** Vulnerability securityBulletin */ - securityBulletin?: (google.cloud.securitycenter.v2.ISecurityBulletin|null); - - /** Vulnerability providerRiskScore */ - providerRiskScore?: (number|Long|string|null); - - /** Vulnerability reachable */ - reachable?: (boolean|null); - - /** Vulnerability cwes */ - cwes?: (google.cloud.securitycenter.v2.ICwe[]|null); - } - - /** Represents a Vulnerability. */ - class Vulnerability implements IVulnerability { - - /** - * Constructs a new Vulnerability. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IVulnerability); - - /** Vulnerability cve. */ - public cve?: (google.cloud.securitycenter.v2.ICve|null); - - /** Vulnerability offendingPackage. */ - public offendingPackage?: (google.cloud.securitycenter.v2.IPackage|null); - - /** Vulnerability fixedPackage. */ - public fixedPackage?: (google.cloud.securitycenter.v2.IPackage|null); - - /** Vulnerability securityBulletin. */ - public securityBulletin?: (google.cloud.securitycenter.v2.ISecurityBulletin|null); - - /** Vulnerability providerRiskScore. */ - public providerRiskScore: (number|Long|string); - - /** Vulnerability reachable. */ - public reachable: boolean; - - /** Vulnerability cwes. */ - public cwes: google.cloud.securitycenter.v2.ICwe[]; - - /** - * Creates a new Vulnerability instance using the specified properties. - * @param [properties] Properties to set - * @returns Vulnerability instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IVulnerability): google.cloud.securitycenter.v2.Vulnerability; - - /** - * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IVulnerability, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Vulnerability, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Vulnerability to JSON. - * @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. */ - interface ICve { - - /** Cve id */ - id?: (string|null); - - /** Cve references */ - references?: (google.cloud.securitycenter.v2.IReference[]|null); - - /** Cve cvssv3 */ - cvssv3?: (google.cloud.securitycenter.v2.ICvssv3|null); - - /** Cve upstreamFixAvailable */ - upstreamFixAvailable?: (boolean|null); - - /** Cve impact */ - impact?: (google.cloud.securitycenter.v2.Cve.RiskRating|keyof typeof google.cloud.securitycenter.v2.Cve.RiskRating|null); - - /** Cve exploitationActivity */ - exploitationActivity?: (google.cloud.securitycenter.v2.Cve.ExploitationActivity|keyof typeof google.cloud.securitycenter.v2.Cve.ExploitationActivity|null); - - /** Cve observedInTheWild */ - observedInTheWild?: (boolean|null); - - /** Cve zeroDay */ - zeroDay?: (boolean|null); - - /** Cve exploitReleaseDate */ - exploitReleaseDate?: (google.protobuf.ITimestamp|null); - - /** Cve firstExploitationDate */ - firstExploitationDate?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Cve. */ - class Cve implements ICve { - - /** - * Constructs a new Cve. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICve); - - /** Cve id. */ - public id: string; - - /** Cve references. */ - public references: google.cloud.securitycenter.v2.IReference[]; - - /** Cve cvssv3. */ - public cvssv3?: (google.cloud.securitycenter.v2.ICvssv3|null); - - /** Cve upstreamFixAvailable. */ - public upstreamFixAvailable: boolean; - - /** Cve impact. */ - public impact: (google.cloud.securitycenter.v2.Cve.RiskRating|keyof typeof google.cloud.securitycenter.v2.Cve.RiskRating); - - /** Cve exploitationActivity. */ - public exploitationActivity: (google.cloud.securitycenter.v2.Cve.ExploitationActivity|keyof typeof google.cloud.securitycenter.v2.Cve.ExploitationActivity); - - /** Cve observedInTheWild. */ - public observedInTheWild: boolean; - - /** Cve zeroDay. */ - public zeroDay: boolean; - - /** Cve exploitReleaseDate. */ - public exploitReleaseDate?: (google.protobuf.ITimestamp|null); - - /** Cve firstExploitationDate. */ - public firstExploitationDate?: (google.protobuf.ITimestamp|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.v2.ICve): google.cloud.securitycenter.v2.Cve; - - /** - * Encodes the specified Cve message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICve, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Cve message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Cve, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cve to JSON. - * @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; - } - - namespace Cve { - - /** RiskRating enum. */ - enum RiskRating { - RISK_RATING_UNSPECIFIED = 0, - LOW = 1, - MEDIUM = 2, - HIGH = 3, - CRITICAL = 4 - } - - /** ExploitationActivity enum. */ - enum ExploitationActivity { - EXPLOITATION_ACTIVITY_UNSPECIFIED = 0, - WIDE = 1, - CONFIRMED = 2, - AVAILABLE = 3, - ANTICIPATED = 4, - NO_KNOWN = 5 - } - } - - /** 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.v2.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.v2.IReference): google.cloud.securitycenter.v2.Reference; - - /** - * Encodes the specified Reference message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Reference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Reference to JSON. - * @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. */ - interface ICvssv3 { - - /** Cvssv3 baseScore */ - baseScore?: (number|null); - - /** Cvssv3 attackVector */ - attackVector?: (google.cloud.securitycenter.v2.Cvssv3.AttackVector|keyof typeof google.cloud.securitycenter.v2.Cvssv3.AttackVector|null); - - /** Cvssv3 attackComplexity */ - attackComplexity?: (google.cloud.securitycenter.v2.Cvssv3.AttackComplexity|keyof typeof google.cloud.securitycenter.v2.Cvssv3.AttackComplexity|null); - - /** Cvssv3 privilegesRequired */ - privilegesRequired?: (google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired|keyof typeof google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired|null); - - /** Cvssv3 userInteraction */ - userInteraction?: (google.cloud.securitycenter.v2.Cvssv3.UserInteraction|keyof typeof google.cloud.securitycenter.v2.Cvssv3.UserInteraction|null); - - /** Cvssv3 scope */ - scope?: (google.cloud.securitycenter.v2.Cvssv3.Scope|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Scope|null); - - /** Cvssv3 confidentialityImpact */ - confidentialityImpact?: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact|null); - - /** Cvssv3 integrityImpact */ - integrityImpact?: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact|null); - - /** Cvssv3 availabilityImpact */ - availabilityImpact?: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact|null); - } - - /** Represents a Cvssv3. */ - class Cvssv3 implements ICvssv3 { - - /** - * Constructs a new Cvssv3. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICvssv3); - - /** Cvssv3 baseScore. */ - public baseScore: number; - - /** Cvssv3 attackVector. */ - public attackVector: (google.cloud.securitycenter.v2.Cvssv3.AttackVector|keyof typeof google.cloud.securitycenter.v2.Cvssv3.AttackVector); - - /** Cvssv3 attackComplexity. */ - public attackComplexity: (google.cloud.securitycenter.v2.Cvssv3.AttackComplexity|keyof typeof google.cloud.securitycenter.v2.Cvssv3.AttackComplexity); - - /** Cvssv3 privilegesRequired. */ - public privilegesRequired: (google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired|keyof typeof google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired); - - /** Cvssv3 userInteraction. */ - public userInteraction: (google.cloud.securitycenter.v2.Cvssv3.UserInteraction|keyof typeof google.cloud.securitycenter.v2.Cvssv3.UserInteraction); - - /** Cvssv3 scope. */ - public scope: (google.cloud.securitycenter.v2.Cvssv3.Scope|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Scope); - - /** Cvssv3 confidentialityImpact. */ - public confidentialityImpact: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact); - - /** Cvssv3 integrityImpact. */ - public integrityImpact: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.Cvssv3.Impact); - - /** Cvssv3 availabilityImpact. */ - public availabilityImpact: (google.cloud.securitycenter.v2.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v2.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.v2.ICvssv3): google.cloud.securitycenter.v2.Cvssv3; - - /** - * Encodes the specified Cvssv3 message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICvssv3, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Cvssv3 message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Cvssv3, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cvssv3 to JSON. - * @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 { - - /** 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 Package. */ - interface IPackage { - - /** Package packageName */ - packageName?: (string|null); - - /** Package cpeUri */ - cpeUri?: (string|null); - - /** Package packageType */ - packageType?: (string|null); - - /** Package packageVersion */ - packageVersion?: (string|null); - } - - /** Represents a Package. */ - class Package implements IPackage { - - /** - * Constructs a new Package. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IPackage); - - /** Package packageName. */ - public packageName: string; - - /** Package cpeUri. */ - public cpeUri: string; - - /** Package packageType. */ - public packageType: string; - - /** Package packageVersion. */ - public packageVersion: string; - - /** - * Creates a new Package instance using the specified properties. - * @param [properties] Properties to set - * @returns Package instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IPackage): google.cloud.securitycenter.v2.Package; - - /** - * Encodes the specified Package message. Does not implicitly {@link google.cloud.securitycenter.v2.Package.verify|verify} messages. - * @param message Package message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Package message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Package.verify|verify} messages. - * @param message Package message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Package message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Package - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Package; - - /** - * Decodes a Package message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Package - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Package; - - /** - * Verifies a Package message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Package message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Package - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Package; - - /** - * Creates a plain object from a Package message. Also converts values to other types if specified. - * @param message Package - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Package, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Package to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Package - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecurityBulletin. */ - interface ISecurityBulletin { - - /** SecurityBulletin bulletinId */ - bulletinId?: (string|null); - - /** SecurityBulletin submissionTime */ - submissionTime?: (google.protobuf.ITimestamp|null); - - /** SecurityBulletin suggestedUpgradeVersion */ - suggestedUpgradeVersion?: (string|null); - } - - /** Represents a SecurityBulletin. */ - class SecurityBulletin implements ISecurityBulletin { - - /** - * Constructs a new SecurityBulletin. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ISecurityBulletin); - - /** SecurityBulletin bulletinId. */ - public bulletinId: string; - - /** SecurityBulletin submissionTime. */ - public submissionTime?: (google.protobuf.ITimestamp|null); - - /** SecurityBulletin suggestedUpgradeVersion. */ - public suggestedUpgradeVersion: string; - - /** - * Creates a new SecurityBulletin instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityBulletin instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ISecurityBulletin): google.cloud.securitycenter.v2.SecurityBulletin; - - /** - * Encodes the specified SecurityBulletin message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityBulletin.verify|verify} messages. - * @param message SecurityBulletin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ISecurityBulletin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityBulletin message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityBulletin.verify|verify} messages. - * @param message SecurityBulletin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ISecurityBulletin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityBulletin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityBulletin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.SecurityBulletin; - - /** - * Decodes a SecurityBulletin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityBulletin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.SecurityBulletin; - - /** - * Verifies a SecurityBulletin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecurityBulletin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityBulletin - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.SecurityBulletin; - - /** - * Creates a plain object from a SecurityBulletin message. Also converts values to other types if specified. - * @param message SecurityBulletin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.SecurityBulletin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityBulletin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecurityBulletin - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Cwe. */ - interface ICwe { - - /** Cwe id */ - id?: (string|null); - - /** Cwe references */ - references?: (google.cloud.securitycenter.v2.IReference[]|null); - } - - /** Represents a Cwe. */ - class Cwe implements ICwe { - - /** - * Constructs a new Cwe. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICwe); - - /** Cwe id. */ - public id: string; - - /** Cwe references. */ - public references: google.cloud.securitycenter.v2.IReference[]; - - /** - * Creates a new Cwe instance using the specified properties. - * @param [properties] Properties to set - * @returns Cwe instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ICwe): google.cloud.securitycenter.v2.Cwe; - - /** - * Encodes the specified Cwe message. Does not implicitly {@link google.cloud.securitycenter.v2.Cwe.verify|verify} messages. - * @param message Cwe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ICwe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Cwe message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Cwe.verify|verify} messages. - * @param message Cwe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ICwe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Cwe message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Cwe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Cwe; - - /** - * Decodes a Cwe message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Cwe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Cwe; - - /** - * Verifies a Cwe message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Cwe message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cwe - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Cwe; - - /** - * Creates a plain object from a Cwe message. Also converts values to other types if specified. - * @param message Cwe - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Cwe, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cwe to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Cwe - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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.v2.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.v2.IFolder): google.cloud.securitycenter.v2.Folder; - - /** - * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Folder to JSON. - * @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 MuteConfig. */ - interface IMuteConfig { - - /** MuteConfig name */ - name?: (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); - - /** MuteConfig type */ - type?: (google.cloud.securitycenter.v2.MuteConfig.MuteConfigType|keyof typeof google.cloud.securitycenter.v2.MuteConfig.MuteConfigType|null); - - /** MuteConfig expiryTime */ - expiryTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a MuteConfig. */ - class MuteConfig implements IMuteConfig { - - /** - * Constructs a new MuteConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IMuteConfig); - - /** MuteConfig name. */ - public name: 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; - - /** MuteConfig type. */ - public type: (google.cloud.securitycenter.v2.MuteConfig.MuteConfigType|keyof typeof google.cloud.securitycenter.v2.MuteConfig.MuteConfigType); - - /** MuteConfig expiryTime. */ - public expiryTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new MuteConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns MuteConfig instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IMuteConfig): google.cloud.securitycenter.v2.MuteConfig; - - /** - * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IMuteConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.MuteConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MuteConfig to JSON. - * @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; - } - - namespace MuteConfig { - - /** MuteConfigType enum. */ - enum MuteConfigType { - MUTE_CONFIG_TYPE_UNSPECIFIED = 0, - STATIC = 1, - DYNAMIC = 2 - } - } - - /** Properties of a NotificationConfig. */ - interface INotificationConfig { - - /** NotificationConfig name */ - name?: (string|null); - - /** NotificationConfig description */ - description?: (string|null); - - /** NotificationConfig pubsubTopic */ - pubsubTopic?: (string|null); - - /** NotificationConfig serviceAccount */ - serviceAccount?: (string|null); - - /** NotificationConfig streamingConfig */ - streamingConfig?: (google.cloud.securitycenter.v2.NotificationConfig.IStreamingConfig|null); - - /** NotificationConfig updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a NotificationConfig. */ - class NotificationConfig implements INotificationConfig { - - /** - * Constructs a new NotificationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.INotificationConfig); - - /** NotificationConfig name. */ - public name: string; - - /** NotificationConfig description. */ - public description: string; - - /** NotificationConfig pubsubTopic. */ - public pubsubTopic: string; - - /** NotificationConfig serviceAccount. */ - public serviceAccount: string; - - /** NotificationConfig streamingConfig. */ - public streamingConfig?: (google.cloud.securitycenter.v2.NotificationConfig.IStreamingConfig|null); - - /** NotificationConfig updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|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.v2.INotificationConfig): google.cloud.securitycenter.v2.NotificationConfig; - - /** - * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NotificationConfig to JSON. - * @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 { - - /** 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.v2.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.v2.NotificationConfig.IStreamingConfig): google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig; - - /** - * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.NotificationConfig.StreamingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StreamingConfig to JSON. - * @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; - } - } - - /** Properties of a NotificationMessage. */ - interface INotificationMessage { - - /** NotificationMessage notificationConfigName */ - notificationConfigName?: (string|null); - - /** NotificationMessage finding */ - finding?: (google.cloud.securitycenter.v2.IFinding|null); - - /** NotificationMessage resource */ - resource?: (google.cloud.securitycenter.v2.IResource|null); - } - - /** Represents a NotificationMessage. */ - class NotificationMessage implements INotificationMessage { - - /** - * Constructs a new NotificationMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.INotificationMessage); - - /** NotificationMessage notificationConfigName. */ - public notificationConfigName: string; - - /** NotificationMessage finding. */ - public finding?: (google.cloud.securitycenter.v2.IFinding|null); - - /** NotificationMessage resource. */ - public resource?: (google.cloud.securitycenter.v2.IResource|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.v2.INotificationMessage): google.cloud.securitycenter.v2.NotificationMessage; - - /** - * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.NotificationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NotificationMessage to JSON. - * @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. */ - interface IResource { - - /** Resource name */ - name?: (string|null); - - /** Resource displayName */ - displayName?: (string|null); - - /** Resource type */ - type?: (string|null); - - /** Resource cloudProvider */ - cloudProvider?: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider|null); - - /** Resource service */ - service?: (string|null); - - /** Resource location */ - location?: (string|null); - - /** Resource gcpMetadata */ - gcpMetadata?: (google.cloud.securitycenter.v2.IGcpMetadata|null); - - /** Resource awsMetadata */ - awsMetadata?: (google.cloud.securitycenter.v2.IAwsMetadata|null); - - /** Resource azureMetadata */ - azureMetadata?: (google.cloud.securitycenter.v2.IAzureMetadata|null); - - /** Resource resourcePath */ - resourcePath?: (google.cloud.securitycenter.v2.IResourcePath|null); - - /** Resource resourcePathString */ - resourcePathString?: (string|null); - } - - /** Represents a Resource. */ - class Resource implements IResource { - - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IResource); - - /** Resource name. */ - public name: string; - - /** Resource displayName. */ - public displayName: string; - - /** Resource type. */ - public type: string; - - /** Resource cloudProvider. */ - public cloudProvider: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider); - - /** Resource service. */ - public service: string; - - /** Resource location. */ - public location: string; - - /** Resource gcpMetadata. */ - public gcpMetadata?: (google.cloud.securitycenter.v2.IGcpMetadata|null); - - /** Resource awsMetadata. */ - public awsMetadata?: (google.cloud.securitycenter.v2.IAwsMetadata|null); - - /** Resource azureMetadata. */ - public azureMetadata?: (google.cloud.securitycenter.v2.IAzureMetadata|null); - - /** Resource resourcePath. */ - public resourcePath?: (google.cloud.securitycenter.v2.IResourcePath|null); - - /** Resource resourcePathString. */ - public resourcePathString: string; - - /** Resource cloudProviderMetadata. */ - public cloudProviderMetadata?: ("gcpMetadata"|"awsMetadata"|"azureMetadata"); - - /** - * Creates a new Resource instance using the specified properties. - * @param [properties] Properties to set - * @returns Resource instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IResource): google.cloud.securitycenter.v2.Resource; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Resource to JSON. - * @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; - } - - /** CloudProvider enum. */ - enum CloudProvider { - CLOUD_PROVIDER_UNSPECIFIED = 0, - GOOGLE_CLOUD_PLATFORM = 1, - AMAZON_WEB_SERVICES = 2, - MICROSOFT_AZURE = 3 - } - - /** Properties of a GcpMetadata. */ - interface IGcpMetadata { - - /** GcpMetadata project */ - project?: (string|null); - - /** GcpMetadata projectDisplayName */ - projectDisplayName?: (string|null); - - /** GcpMetadata parent */ - parent?: (string|null); - - /** GcpMetadata parentDisplayName */ - parentDisplayName?: (string|null); - - /** GcpMetadata folders */ - folders?: (google.cloud.securitycenter.v2.IFolder[]|null); - - /** GcpMetadata organization */ - organization?: (string|null); - } - - /** Represents a GcpMetadata. */ - class GcpMetadata implements IGcpMetadata { - - /** - * Constructs a new GcpMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IGcpMetadata); - - /** GcpMetadata project. */ - public project: string; - - /** GcpMetadata projectDisplayName. */ - public projectDisplayName: string; - - /** GcpMetadata parent. */ - public parent: string; - - /** GcpMetadata parentDisplayName. */ - public parentDisplayName: string; - - /** GcpMetadata folders. */ - public folders: google.cloud.securitycenter.v2.IFolder[]; - - /** GcpMetadata organization. */ - public organization: string; - - /** - * Creates a new GcpMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns GcpMetadata instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IGcpMetadata): google.cloud.securitycenter.v2.GcpMetadata; - - /** - * Encodes the specified GcpMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.GcpMetadata.verify|verify} messages. - * @param message GcpMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IGcpMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcpMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GcpMetadata.verify|verify} messages. - * @param message GcpMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IGcpMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcpMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcpMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GcpMetadata; - - /** - * Decodes a GcpMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcpMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GcpMetadata; - - /** - * Verifies a GcpMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcpMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcpMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GcpMetadata; - - /** - * Creates a plain object from a GcpMetadata message. Also converts values to other types if specified. - * @param message GcpMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.GcpMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcpMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcpMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AwsMetadata. */ - interface IAwsMetadata { - - /** AwsMetadata organization */ - organization?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization|null); - - /** AwsMetadata organizationalUnits */ - organizationalUnits?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit[]|null); - - /** AwsMetadata account */ - account?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount|null); - } - - /** Represents an AwsMetadata. */ - class AwsMetadata implements IAwsMetadata { - - /** - * Constructs a new AwsMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAwsMetadata); - - /** AwsMetadata organization. */ - public organization?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization|null); - - /** AwsMetadata organizationalUnits. */ - public organizationalUnits: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit[]; - - /** AwsMetadata account. */ - public account?: (google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount|null); - - /** - * Creates a new AwsMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsMetadata instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAwsMetadata): google.cloud.securitycenter.v2.AwsMetadata; - - /** - * Encodes the specified AwsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.verify|verify} messages. - * @param message AwsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAwsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.verify|verify} messages. - * @param message AwsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAwsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AwsMetadata; - - /** - * Decodes an AwsMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AwsMetadata; - - /** - * Verifies an AwsMetadata message. - * @param message Plain 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 AwsMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AwsMetadata; - - /** - * Creates a plain object from an AwsMetadata message. Also converts values to other types if specified. - * @param message AwsMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AwsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AwsMetadata { - - /** Properties of an AwsOrganization. */ - interface IAwsOrganization { - - /** AwsOrganization id */ - id?: (string|null); - } - - /** Represents an AwsOrganization. */ - class AwsOrganization implements IAwsOrganization { - - /** - * Constructs a new AwsOrganization. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization); - - /** AwsOrganization id. */ - public id: string; - - /** - * Creates a new AwsOrganization instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsOrganization instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization; - - /** - * Encodes the specified AwsOrganization message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify|verify} messages. - * @param message AwsOrganization message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsOrganization message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify|verify} messages. - * @param message AwsOrganization message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsOrganization message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsOrganization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization; - - /** - * Decodes an AwsOrganization message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsOrganization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization; - - /** - * Verifies an AwsOrganization message. - * @param message Plain 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 AwsOrganization message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsOrganization - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization; - - /** - * Creates a plain object from an AwsOrganization message. Also converts values to other types if specified. - * @param message AwsOrganization - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsOrganization to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsOrganization - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AwsOrganizationalUnit. */ - interface IAwsOrganizationalUnit { - - /** AwsOrganizationalUnit id */ - id?: (string|null); - - /** AwsOrganizationalUnit name */ - name?: (string|null); - } - - /** Represents an AwsOrganizationalUnit. */ - class AwsOrganizationalUnit implements IAwsOrganizationalUnit { - - /** - * Constructs a new AwsOrganizationalUnit. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit); - - /** AwsOrganizationalUnit id. */ - public id: string; - - /** AwsOrganizationalUnit name. */ - public name: string; - - /** - * Creates a new AwsOrganizationalUnit instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsOrganizationalUnit instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit; - - /** - * Encodes the specified AwsOrganizationalUnit message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. - * @param message AwsOrganizationalUnit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsOrganizationalUnit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. - * @param message AwsOrganizationalUnit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsOrganizationalUnit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsOrganizationalUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit; - - /** - * Decodes an AwsOrganizationalUnit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsOrganizationalUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit; - - /** - * Verifies an AwsOrganizationalUnit message. - * @param message Plain 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 AwsOrganizationalUnit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsOrganizationalUnit - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit; - - /** - * Creates a plain object from an AwsOrganizationalUnit message. Also converts values to other types if specified. - * @param message AwsOrganizationalUnit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsOrganizationalUnit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsOrganizationalUnit - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AwsAccount. */ - interface IAwsAccount { - - /** AwsAccount id */ - id?: (string|null); - - /** AwsAccount name */ - name?: (string|null); - } - - /** Represents an AwsAccount. */ - class AwsAccount implements IAwsAccount { - - /** - * Constructs a new AwsAccount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount); - - /** AwsAccount id. */ - public id: string; - - /** AwsAccount name. */ - public name: string; - - /** - * Creates a new AwsAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsAccount instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount): google.cloud.securitycenter.v2.AwsMetadata.AwsAccount; - - /** - * Encodes the specified AwsAccount message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify|verify} messages. - * @param message AwsAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsAccount message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify|verify} messages. - * @param message AwsAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AwsMetadata.AwsAccount; - - /** - * Decodes an AwsAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AwsMetadata.AwsAccount; - - /** - * Verifies an AwsAccount message. - * @param message Plain 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 AwsAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsAccount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AwsMetadata.AwsAccount; - - /** - * Creates a plain object from an AwsAccount message. Also converts values to other types if specified. - * @param message AwsAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AwsMetadata.AwsAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsAccount - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an AzureMetadata. */ - interface IAzureMetadata { - - /** AzureMetadata managementGroups */ - managementGroups?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup[]|null); - - /** AzureMetadata subscription */ - subscription?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription|null); - - /** AzureMetadata resourceGroup */ - resourceGroup?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup|null); - - /** AzureMetadata tenant */ - tenant?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant|null); - } - - /** Represents an AzureMetadata. */ - class AzureMetadata implements IAzureMetadata { - - /** - * Constructs a new AzureMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IAzureMetadata); - - /** AzureMetadata managementGroups. */ - public managementGroups: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup[]; - - /** AzureMetadata subscription. */ - public subscription?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription|null); - - /** AzureMetadata resourceGroup. */ - public resourceGroup?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup|null); - - /** AzureMetadata tenant. */ - public tenant?: (google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant|null); - - /** - * Creates a new AzureMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureMetadata instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IAzureMetadata): google.cloud.securitycenter.v2.AzureMetadata; - - /** - * Encodes the specified AzureMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.verify|verify} messages. - * @param message AzureMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IAzureMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.verify|verify} messages. - * @param message AzureMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IAzureMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata; - - /** - * Decodes an AzureMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata; - - /** - * Verifies an AzureMetadata message. - * @param message Plain 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 AzureMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata; - - /** - * Creates a plain object from an AzureMetadata message. Also converts values to other types if specified. - * @param message AzureMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AzureMetadata { - - /** Properties of an AzureManagementGroup. */ - interface IAzureManagementGroup { - - /** AzureManagementGroup id */ - id?: (string|null); - - /** AzureManagementGroup displayName */ - displayName?: (string|null); - } - - /** Represents an AzureManagementGroup. */ - class AzureManagementGroup implements IAzureManagementGroup { - - /** - * Constructs a new AzureManagementGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup); - - /** AzureManagementGroup id. */ - public id: string; - - /** AzureManagementGroup displayName. */ - public displayName: string; - - /** - * Creates a new AzureManagementGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureManagementGroup instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup): google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup; - - /** - * Encodes the specified AzureManagementGroup message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify|verify} messages. - * @param message AzureManagementGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureManagementGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify|verify} messages. - * @param message AzureManagementGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureManagementGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureManagementGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup; - - /** - * Decodes an AzureManagementGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureManagementGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup; - - /** - * Verifies an AzureManagementGroup message. - * @param message Plain 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 AzureManagementGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureManagementGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup; - - /** - * Creates a plain object from an AzureManagementGroup message. Also converts values to other types if specified. - * @param message AzureManagementGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureManagementGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureManagementGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AzureSubscription. */ - interface IAzureSubscription { - - /** AzureSubscription id */ - id?: (string|null); - - /** AzureSubscription displayName */ - displayName?: (string|null); - } - - /** Represents an AzureSubscription. */ - class AzureSubscription implements IAzureSubscription { - - /** - * Constructs a new AzureSubscription. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription); - - /** AzureSubscription id. */ - public id: string; - - /** AzureSubscription displayName. */ - public displayName: string; - - /** - * Creates a new AzureSubscription instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureSubscription instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription): google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription; - - /** - * Encodes the specified AzureSubscription message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify|verify} messages. - * @param message AzureSubscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureSubscription message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify|verify} messages. - * @param message AzureSubscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureSubscription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureSubscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription; - - /** - * Decodes an AzureSubscription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureSubscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription; - - /** - * Verifies an AzureSubscription message. - * @param message Plain 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 AzureSubscription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureSubscription - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription; - - /** - * Creates a plain object from an AzureSubscription message. Also converts values to other types if specified. - * @param message AzureSubscription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureSubscription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureSubscription - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AzureResourceGroup. */ - interface IAzureResourceGroup { - - /** AzureResourceGroup id */ - id?: (string|null); - - /** AzureResourceGroup name */ - name?: (string|null); - } - - /** Represents an AzureResourceGroup. */ - class AzureResourceGroup implements IAzureResourceGroup { - - /** - * Constructs a new AzureResourceGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup); - - /** AzureResourceGroup id. */ - public id: string; - - /** AzureResourceGroup name. */ - public name: string; - - /** - * Creates a new AzureResourceGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureResourceGroup instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup): google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup; - - /** - * Encodes the specified AzureResourceGroup message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify|verify} messages. - * @param message AzureResourceGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureResourceGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify|verify} messages. - * @param message AzureResourceGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureResourceGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureResourceGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup; - - /** - * Decodes an AzureResourceGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureResourceGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup; - - /** - * Verifies an AzureResourceGroup message. - * @param message Plain 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 AzureResourceGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureResourceGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup; - - /** - * Creates a plain object from an AzureResourceGroup message. Also converts values to other types if specified. - * @param message AzureResourceGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureResourceGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureResourceGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AzureTenant. */ - interface IAzureTenant { - - /** AzureTenant id */ - id?: (string|null); - - /** AzureTenant displayName */ - displayName?: (string|null); - } - - /** Represents an AzureTenant. */ - class AzureTenant implements IAzureTenant { - - /** - * Constructs a new AzureTenant. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant); - - /** AzureTenant id. */ - public id: string; - - /** AzureTenant displayName. */ - public displayName: string; - - /** - * Creates a new AzureTenant instance using the specified properties. - * @param [properties] Properties to set - * @returns AzureTenant instance - */ - public static create(properties?: google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant): google.cloud.securitycenter.v2.AzureMetadata.AzureTenant; - - /** - * Encodes the specified AzureTenant message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify|verify} messages. - * @param message AzureTenant message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AzureTenant message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify|verify} messages. - * @param message AzureTenant message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AzureTenant message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AzureTenant - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.AzureMetadata.AzureTenant; - - /** - * Decodes an AzureTenant message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AzureTenant - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.AzureMetadata.AzureTenant; - - /** - * Verifies an AzureTenant message. - * @param message Plain 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 AzureTenant message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AzureTenant - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.AzureMetadata.AzureTenant; - - /** - * Creates a plain object from an AzureTenant message. Also converts values to other types if specified. - * @param message AzureTenant - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.AzureMetadata.AzureTenant, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AzureTenant to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AzureTenant - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ResourcePath. */ - interface IResourcePath { - - /** ResourcePath nodes */ - nodes?: (google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode[]|null); - } - - /** Represents a ResourcePath. */ - class ResourcePath implements IResourcePath { - - /** - * Constructs a new ResourcePath. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IResourcePath); - - /** ResourcePath nodes. */ - public nodes: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode[]; - - /** - * Creates a new ResourcePath instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourcePath instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IResourcePath): google.cloud.securitycenter.v2.ResourcePath; - - /** - * Encodes the specified ResourcePath message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.verify|verify} messages. - * @param message ResourcePath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IResourcePath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourcePath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.verify|verify} messages. - * @param message ResourcePath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IResourcePath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourcePath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourcePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourcePath; - - /** - * Decodes a ResourcePath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourcePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourcePath; - - /** - * Verifies a ResourcePath message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourcePath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourcePath - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourcePath; - - /** - * Creates a plain object from a ResourcePath message. Also converts values to other types if specified. - * @param message ResourcePath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ResourcePath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourcePath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourcePath - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourcePath { - - /** ResourcePathNodeType enum. */ - enum ResourcePathNodeType { - RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0, - GCP_ORGANIZATION = 1, - GCP_FOLDER = 2, - GCP_PROJECT = 3, - AWS_ORGANIZATION = 4, - AWS_ORGANIZATIONAL_UNIT = 5, - AWS_ACCOUNT = 6, - AZURE_MANAGEMENT_GROUP = 7, - AZURE_SUBSCRIPTION = 8, - AZURE_RESOURCE_GROUP = 9 - } - - /** Properties of a ResourcePathNode. */ - interface IResourcePathNode { - - /** ResourcePathNode nodeType */ - nodeType?: (google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType|keyof typeof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType|null); - - /** ResourcePathNode id */ - id?: (string|null); - - /** ResourcePathNode displayName */ - displayName?: (string|null); - } - - /** Represents a ResourcePathNode. */ - class ResourcePathNode implements IResourcePathNode { - - /** - * Constructs a new ResourcePathNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode); - - /** ResourcePathNode nodeType. */ - public nodeType: (google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType|keyof typeof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType); - - /** ResourcePathNode id. */ - public id: string; - - /** ResourcePathNode displayName. */ - public displayName: string; - - /** - * Creates a new ResourcePathNode instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourcePathNode instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode): google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode; - - /** - * Encodes the specified ResourcePathNode message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.verify|verify} messages. - * @param message ResourcePathNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourcePathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.verify|verify} messages. - * @param message ResourcePathNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourcePathNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourcePathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode; - - /** - * Decodes a ResourcePathNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourcePathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode; - - /** - * Verifies a ResourcePathNode message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourcePathNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourcePathNode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode; - - /** - * Creates a plain object from a ResourcePathNode message. Also converts values to other types if specified. - * @param message ResourcePathNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourcePathNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourcePathNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ResourceValueConfig. */ - interface IResourceValueConfig { - - /** ResourceValueConfig name */ - name?: (string|null); - - /** ResourceValueConfig resourceValue */ - resourceValue?: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue|null); - - /** ResourceValueConfig tagValues */ - tagValues?: (string[]|null); - - /** ResourceValueConfig resourceType */ - resourceType?: (string|null); - - /** ResourceValueConfig scope */ - scope?: (string|null); - - /** ResourceValueConfig resourceLabelsSelector */ - resourceLabelsSelector?: ({ [k: string]: string }|null); - - /** ResourceValueConfig description */ - description?: (string|null); - - /** ResourceValueConfig createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceValueConfig updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ResourceValueConfig cloudProvider */ - cloudProvider?: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider|null); - - /** ResourceValueConfig sensitiveDataProtectionMapping */ - sensitiveDataProtectionMapping?: (google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping|null); - } - - /** Represents a ResourceValueConfig. */ - class ResourceValueConfig implements IResourceValueConfig { - - /** - * Constructs a new ResourceValueConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IResourceValueConfig); - - /** ResourceValueConfig name. */ - public name: string; - - /** ResourceValueConfig resourceValue. */ - public resourceValue: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue); - - /** ResourceValueConfig tagValues. */ - public tagValues: string[]; - - /** ResourceValueConfig resourceType. */ - public resourceType: string; - - /** ResourceValueConfig scope. */ - public scope: string; - - /** ResourceValueConfig resourceLabelsSelector. */ - public resourceLabelsSelector: { [k: string]: string }; - - /** ResourceValueConfig description. */ - public description: string; - - /** ResourceValueConfig createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceValueConfig updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ResourceValueConfig cloudProvider. */ - public cloudProvider: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider); - - /** ResourceValueConfig sensitiveDataProtectionMapping. */ - public sensitiveDataProtectionMapping?: (google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping|null); - - /** - * Creates a new ResourceValueConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceValueConfig instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IResourceValueConfig): google.cloud.securitycenter.v2.ResourceValueConfig; - - /** - * Encodes the specified ResourceValueConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.verify|verify} messages. - * @param message ResourceValueConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IResourceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceValueConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.verify|verify} messages. - * @param message ResourceValueConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IResourceValueConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceValueConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceValueConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourceValueConfig; - - /** - * Decodes a ResourceValueConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceValueConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourceValueConfig; - - /** - * Verifies a ResourceValueConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceValueConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceValueConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourceValueConfig; - - /** - * Creates a plain object from a ResourceValueConfig message. Also converts values to other types if specified. - * @param message ResourceValueConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ResourceValueConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceValueConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceValueConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceValueConfig { - - /** Properties of a SensitiveDataProtectionMapping. */ - interface ISensitiveDataProtectionMapping { - - /** SensitiveDataProtectionMapping highSensitivityMapping */ - highSensitivityMapping?: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue|null); - - /** SensitiveDataProtectionMapping mediumSensitivityMapping */ - mediumSensitivityMapping?: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue|null); - } - - /** Represents a SensitiveDataProtectionMapping. */ - class SensitiveDataProtectionMapping implements ISensitiveDataProtectionMapping { - - /** - * Constructs a new SensitiveDataProtectionMapping. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping); - - /** SensitiveDataProtectionMapping highSensitivityMapping. */ - public highSensitivityMapping: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue); - - /** SensitiveDataProtectionMapping mediumSensitivityMapping. */ - public mediumSensitivityMapping: (google.cloud.securitycenter.v2.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ResourceValue); - - /** - * Creates a new SensitiveDataProtectionMapping instance using the specified properties. - * @param [properties] Properties to set - * @returns SensitiveDataProtectionMapping instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping): google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping; - - /** - * Encodes the specified SensitiveDataProtectionMapping message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. - * @param message SensitiveDataProtectionMapping message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SensitiveDataProtectionMapping message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. - * @param message SensitiveDataProtectionMapping message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SensitiveDataProtectionMapping - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping; - - /** - * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SensitiveDataProtectionMapping - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping; - - /** - * Verifies a SensitiveDataProtectionMapping message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SensitiveDataProtectionMapping message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SensitiveDataProtectionMapping - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping; - - /** - * Creates a plain object from a SensitiveDataProtectionMapping message. Also converts values to other types if specified. - * @param message SensitiveDataProtectionMapping - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SensitiveDataProtectionMapping to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SensitiveDataProtectionMapping - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ResourceValue enum. */ - enum ResourceValue { - RESOURCE_VALUE_UNSPECIFIED = 0, - HIGH = 1, - MEDIUM = 2, - LOW = 3, - NONE = 4 - } - - /** 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 BatchCreateResourceValueConfigs. - * @param request BatchCreateResourceValueConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchCreateResourceValueConfigsResponse - */ - public batchCreateResourceValueConfigs(request: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigsCallback): void; - - /** - * Calls BatchCreateResourceValueConfigs. - * @param request BatchCreateResourceValueConfigsRequest message or plain object - * @returns Promise - */ - public batchCreateResourceValueConfigs(request: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest): Promise; - - /** - * 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.v2.IBulkMuteFindingsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.BulkMuteFindingsCallback): void; - - /** - * Calls BulkMuteFindings. - * @param request BulkMuteFindingsRequest message or plain object - * @returns Promise - */ - public bulkMuteFindings(request: google.cloud.securitycenter.v2.IBulkMuteFindingsRequest): 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.v2.ICreateBigQueryExportRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateBigQueryExportCallback): void; - - /** - * Calls CreateBigQueryExport. - * @param request CreateBigQueryExportRequest message or plain object - * @returns Promise - */ - public createBigQueryExport(request: google.cloud.securitycenter.v2.ICreateBigQueryExportRequest): 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.v2.ICreateFindingRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateFindingCallback): void; - - /** - * Calls CreateFinding. - * @param request CreateFindingRequest message or plain object - * @returns Promise - */ - public createFinding(request: google.cloud.securitycenter.v2.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.v2.ICreateMuteConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateMuteConfigCallback): void; - - /** - * Calls CreateMuteConfig. - * @param request CreateMuteConfigRequest message or plain object - * @returns Promise - */ - public createMuteConfig(request: google.cloud.securitycenter.v2.ICreateMuteConfigRequest): 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.v2.ICreateNotificationConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateNotificationConfigCallback): void; - - /** - * Calls CreateNotificationConfig. - * @param request CreateNotificationConfigRequest message or plain object - * @returns Promise - */ - public createNotificationConfig(request: google.cloud.securitycenter.v2.ICreateNotificationConfigRequest): Promise; - - /** - * 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.v2.ICreateSourceRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.CreateSourceCallback): void; - - /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object - * @returns Promise - */ - public createSource(request: google.cloud.securitycenter.v2.ICreateSourceRequest): 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.v2.IDeleteBigQueryExportRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.DeleteBigQueryExportCallback): void; - - /** - * Calls DeleteBigQueryExport. - * @param request DeleteBigQueryExportRequest message or plain object - * @returns Promise - */ - public deleteBigQueryExport(request: google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest): 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.v2.IDeleteMuteConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.DeleteMuteConfigCallback): void; - - /** - * Calls DeleteMuteConfig. - * @param request DeleteMuteConfigRequest message or plain object - * @returns Promise - */ - public deleteMuteConfig(request: google.cloud.securitycenter.v2.IDeleteMuteConfigRequest): 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.v2.IDeleteNotificationConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.DeleteNotificationConfigCallback): void; - - /** - * Calls DeleteNotificationConfig. - * @param request DeleteNotificationConfigRequest message or plain object - * @returns Promise - */ - public deleteNotificationConfig(request: google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest): Promise; - - /** - * Calls DeleteResourceValueConfig. - * @param request DeleteResourceValueConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteResourceValueConfig(request: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfigCallback): void; - - /** - * Calls DeleteResourceValueConfig. - * @param request DeleteResourceValueConfigRequest message or plain object - * @returns Promise - */ - public deleteResourceValueConfig(request: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest): 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.v2.IGetBigQueryExportRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetBigQueryExportCallback): void; - - /** - * Calls GetBigQueryExport. - * @param request GetBigQueryExportRequest message or plain object - * @returns Promise - */ - public getBigQueryExport(request: google.cloud.securitycenter.v2.IGetBigQueryExportRequest): Promise; - - /** - * Calls GetSimulation. - * @param request GetSimulationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Simulation - */ - public getSimulation(request: google.cloud.securitycenter.v2.IGetSimulationRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetSimulationCallback): void; - - /** - * Calls GetSimulation. - * @param request GetSimulationRequest message or plain object - * @returns Promise - */ - public getSimulation(request: google.cloud.securitycenter.v2.IGetSimulationRequest): Promise; - - /** - * Calls GetValuedResource. - * @param request GetValuedResourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ValuedResource - */ - public getValuedResource(request: google.cloud.securitycenter.v2.IGetValuedResourceRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetValuedResourceCallback): void; - - /** - * Calls GetValuedResource. - * @param request GetValuedResourceRequest message or plain object - * @returns Promise - */ - public getValuedResource(request: google.cloud.securitycenter.v2.IGetValuedResourceRequest): 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.v2.SecurityCenter.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - 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.v2.IGetMuteConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetMuteConfigCallback): void; - - /** - * Calls GetMuteConfig. - * @param request GetMuteConfigRequest message or plain object - * @returns Promise - */ - public getMuteConfig(request: google.cloud.securitycenter.v2.IGetMuteConfigRequest): 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.v2.IGetNotificationConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetNotificationConfigCallback): void; - - /** - * Calls GetNotificationConfig. - * @param request GetNotificationConfigRequest message or plain object - * @returns Promise - */ - public getNotificationConfig(request: google.cloud.securitycenter.v2.IGetNotificationConfigRequest): Promise; - - /** - * Calls GetResourceValueConfig. - * @param request GetResourceValueConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceValueConfig - */ - public getResourceValueConfig(request: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfigCallback): void; - - /** - * Calls GetResourceValueConfig. - * @param request GetResourceValueConfigRequest message or plain object - * @returns Promise - */ - public getResourceValueConfig(request: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest): 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.v2.IGetSourceRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GetSourceCallback): void; - - /** - * Calls GetSource. - * @param request GetSourceRequest message or plain object - * @returns Promise - */ - public getSource(request: google.cloud.securitycenter.v2.IGetSourceRequest): 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.v2.IGroupFindingsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.GroupFindingsCallback): void; - - /** - * Calls GroupFindings. - * @param request GroupFindingsRequest message or plain object - * @returns Promise - */ - public groupFindings(request: google.cloud.securitycenter.v2.IGroupFindingsRequest): Promise; - - /** - * Calls ListAttackPaths. - * @param request ListAttackPathsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAttackPathsResponse - */ - public listAttackPaths(request: google.cloud.securitycenter.v2.IListAttackPathsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListAttackPathsCallback): void; - - /** - * Calls ListAttackPaths. - * @param request ListAttackPathsRequest message or plain object - * @returns Promise - */ - public listAttackPaths(request: google.cloud.securitycenter.v2.IListAttackPathsRequest): 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.v2.IListBigQueryExportsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListBigQueryExportsCallback): void; - - /** - * Calls ListBigQueryExports. - * @param request ListBigQueryExportsRequest message or plain object - * @returns Promise - */ - public listBigQueryExports(request: google.cloud.securitycenter.v2.IListBigQueryExportsRequest): 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.v2.IListFindingsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListFindingsCallback): void; - - /** - * Calls ListFindings. - * @param request ListFindingsRequest message or plain object - * @returns Promise - */ - public listFindings(request: google.cloud.securitycenter.v2.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.v2.IListMuteConfigsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListMuteConfigsCallback): void; - - /** - * Calls ListMuteConfigs. - * @param request ListMuteConfigsRequest message or plain object - * @returns Promise - */ - public listMuteConfigs(request: google.cloud.securitycenter.v2.IListMuteConfigsRequest): 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.v2.IListNotificationConfigsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListNotificationConfigsCallback): void; - - /** - * Calls ListNotificationConfigs. - * @param request ListNotificationConfigsRequest message or plain object - * @returns Promise - */ - public listNotificationConfigs(request: google.cloud.securitycenter.v2.IListNotificationConfigsRequest): Promise; - - /** - * Calls ListResourceValueConfigs. - * @param request ListResourceValueConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListResourceValueConfigsResponse - */ - public listResourceValueConfigs(request: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigsCallback): void; - - /** - * Calls ListResourceValueConfigs. - * @param request ListResourceValueConfigsRequest message or plain object - * @returns Promise - */ - public listResourceValueConfigs(request: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest): 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.v2.IListSourcesRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListSourcesCallback): void; - - /** - * Calls ListSources. - * @param request ListSourcesRequest message or plain object - * @returns Promise - */ - public listSources(request: google.cloud.securitycenter.v2.IListSourcesRequest): Promise; - - /** - * Calls ListValuedResources. - * @param request ListValuedResourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListValuedResourcesResponse - */ - public listValuedResources(request: google.cloud.securitycenter.v2.IListValuedResourcesRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.ListValuedResourcesCallback): void; - - /** - * Calls ListValuedResources. - * @param request ListValuedResourcesRequest message or plain object - * @returns Promise - */ - public listValuedResources(request: google.cloud.securitycenter.v2.IListValuedResourcesRequest): 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.v2.ISetFindingStateRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.SetFindingStateCallback): void; - - /** - * Calls SetFindingState. - * @param request SetFindingStateRequest message or plain object - * @returns Promise - */ - public setFindingState(request: google.cloud.securitycenter.v2.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.v2.SecurityCenter.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): 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.v2.ISetMuteRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.SetMuteCallback): void; - - /** - * Calls SetMute. - * @param request SetMuteRequest message or plain object - * @returns Promise - */ - public setMute(request: google.cloud.securitycenter.v2.ISetMuteRequest): 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.v2.SecurityCenter.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): 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.v2.IUpdateBigQueryExportRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateBigQueryExportCallback): void; - - /** - * Calls UpdateBigQueryExport. - * @param request UpdateBigQueryExportRequest message or plain object - * @returns Promise - */ - public updateBigQueryExport(request: google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest): 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.v2.IUpdateExternalSystemRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateExternalSystemCallback): void; - - /** - * Calls UpdateExternalSystem. - * @param request UpdateExternalSystemRequest message or plain object - * @returns Promise - */ - public updateExternalSystem(request: google.cloud.securitycenter.v2.IUpdateExternalSystemRequest): 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.v2.IUpdateFindingRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateFindingCallback): void; - - /** - * Calls UpdateFinding. - * @param request UpdateFindingRequest message or plain object - * @returns Promise - */ - public updateFinding(request: google.cloud.securitycenter.v2.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.v2.IUpdateMuteConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateMuteConfigCallback): void; - - /** - * Calls UpdateMuteConfig. - * @param request UpdateMuteConfigRequest message or plain object - * @returns Promise - */ - public updateMuteConfig(request: google.cloud.securitycenter.v2.IUpdateMuteConfigRequest): 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.v2.IUpdateNotificationConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateNotificationConfigCallback): void; - - /** - * Calls UpdateNotificationConfig. - * @param request UpdateNotificationConfigRequest message or plain object - * @returns Promise - */ - public updateNotificationConfig(request: google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest): Promise; - - /** - * Calls UpdateResourceValueConfig. - * @param request UpdateResourceValueConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceValueConfig - */ - public updateResourceValueConfig(request: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfigCallback): void; - - /** - * Calls UpdateResourceValueConfig. - * @param request UpdateResourceValueConfigRequest message or plain object - * @returns Promise - */ - public updateResourceValueConfig(request: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest): 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.v2.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateSecurityMarksCallback): void; - - /** - * Calls UpdateSecurityMarks. - * @param request UpdateSecurityMarksRequest message or plain object - * @returns Promise - */ - public updateSecurityMarks(request: google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest): 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.v2.IUpdateSourceRequest, callback: google.cloud.securitycenter.v2.SecurityCenter.UpdateSourceCallback): void; - - /** - * Calls UpdateSource. - * @param request UpdateSourceRequest message or plain object - * @returns Promise - */ - public updateSource(request: google.cloud.securitycenter.v2.IUpdateSourceRequest): Promise; - } - - namespace SecurityCenter { - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|batchCreateResourceValueConfigs}. - * @param error Error, if any - * @param [response] BatchCreateResourceValueConfigsResponse - */ - type BatchCreateResourceValueConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.SecurityCenter|createBigQueryExport}. - * @param error Error, if any - * @param [response] BigQueryExport - */ - type CreateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.BigQueryExport) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createFinding}. - * @param error Error, if any - * @param [response] Finding - */ - type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Finding) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createMuteConfig}. - * @param error Error, if any - * @param [response] MuteConfig - */ - type CreateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.MuteConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createNotificationConfig}. - * @param error Error, if any - * @param [response] NotificationConfig - */ - type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.NotificationConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createSource}. - * @param error Error, if any - * @param [response] Source - */ - type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Source) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.SecurityCenter|deleteResourceValueConfig}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteResourceValueConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getBigQueryExport}. - * @param error Error, if any - * @param [response] BigQueryExport - */ - type GetBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.BigQueryExport) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getSimulation}. - * @param error Error, if any - * @param [response] Simulation - */ - type GetSimulationCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Simulation) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getValuedResource}. - * @param error Error, if any - * @param [response] ValuedResource - */ - type GetValuedResourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ValuedResource) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.SecurityCenter|getMuteConfig}. - * @param error Error, if any - * @param [response] MuteConfig - */ - type GetMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.MuteConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getNotificationConfig}. - * @param error Error, if any - * @param [response] NotificationConfig - */ - type GetNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.NotificationConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getResourceValueConfig}. - * @param error Error, if any - * @param [response] ResourceValueConfig - */ - type GetResourceValueConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ResourceValueConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getSource}. - * @param error Error, if any - * @param [response] Source - */ - type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Source) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|groupFindings}. - * @param error Error, if any - * @param [response] GroupFindingsResponse - */ - type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.GroupFindingsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listAttackPaths}. - * @param error Error, if any - * @param [response] ListAttackPathsResponse - */ - type ListAttackPathsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListAttackPathsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listBigQueryExports}. - * @param error Error, if any - * @param [response] ListBigQueryExportsResponse - */ - type ListBigQueryExportsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListBigQueryExportsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listFindings}. - * @param error Error, if any - * @param [response] ListFindingsResponse - */ - type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListFindingsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listMuteConfigs}. - * @param error Error, if any - * @param [response] ListMuteConfigsResponse - */ - type ListMuteConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListMuteConfigsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listNotificationConfigs}. - * @param error Error, if any - * @param [response] ListNotificationConfigsResponse - */ - type ListNotificationConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListNotificationConfigsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listResourceValueConfigs}. - * @param error Error, if any - * @param [response] ListResourceValueConfigsResponse - */ - type ListResourceValueConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListResourceValueConfigsResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listSources}. - * @param error Error, if any - * @param [response] ListSourcesResponse - */ - type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListSourcesResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listValuedResources}. - * @param error Error, if any - * @param [response] ListValuedResourcesResponse - */ - type ListValuedResourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ListValuedResourcesResponse) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|setFindingState}. - * @param error Error, if any - * @param [response] Finding - */ - type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Finding) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.SecurityCenter|setMute}. - * @param error Error, if any - * @param [response] Finding - */ - type SetMuteCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Finding) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.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.v2.SecurityCenter|updateBigQueryExport}. - * @param error Error, if any - * @param [response] BigQueryExport - */ - type UpdateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.BigQueryExport) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateExternalSystem}. - * @param error Error, if any - * @param [response] ExternalSystem - */ - type UpdateExternalSystemCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ExternalSystem) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateFinding}. - * @param error Error, if any - * @param [response] Finding - */ - type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Finding) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateMuteConfig}. - * @param error Error, if any - * @param [response] MuteConfig - */ - type UpdateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.MuteConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateNotificationConfig}. - * @param error Error, if any - * @param [response] NotificationConfig - */ - type UpdateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.NotificationConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateResourceValueConfig}. - * @param error Error, if any - * @param [response] ResourceValueConfig - */ - type UpdateResourceValueConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.ResourceValueConfig) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateSecurityMarks}. - * @param error Error, if any - * @param [response] SecurityMarks - */ - type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.SecurityMarks) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateSource}. - * @param error Error, if any - * @param [response] Source - */ - type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v2.Source) => void; - } - - /** Properties of a BatchCreateResourceValueConfigsRequest. */ - interface IBatchCreateResourceValueConfigsRequest { - - /** BatchCreateResourceValueConfigsRequest parent */ - parent?: (string|null); - - /** BatchCreateResourceValueConfigsRequest requests */ - requests?: (google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest[]|null); - } - - /** Represents a BatchCreateResourceValueConfigsRequest. */ - class BatchCreateResourceValueConfigsRequest implements IBatchCreateResourceValueConfigsRequest { - - /** - * Constructs a new BatchCreateResourceValueConfigsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest); - - /** BatchCreateResourceValueConfigsRequest parent. */ - public parent: string; - - /** BatchCreateResourceValueConfigsRequest requests. */ - public requests: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest[]; - - /** - * Creates a new BatchCreateResourceValueConfigsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateResourceValueConfigsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest; - - /** - * Encodes the specified BatchCreateResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.verify|verify} messages. - * @param message BatchCreateResourceValueConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.verify|verify} messages. - * @param message BatchCreateResourceValueConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest; - - /** - * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest; - - /** - * Verifies a BatchCreateResourceValueConfigsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateResourceValueConfigsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest; - - /** - * Creates a plain object from a BatchCreateResourceValueConfigsRequest message. Also converts values to other types if specified. - * @param message BatchCreateResourceValueConfigsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateResourceValueConfigsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateResourceValueConfigsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateResourceValueConfigsResponse. */ - interface IBatchCreateResourceValueConfigsResponse { - - /** BatchCreateResourceValueConfigsResponse resourceValueConfigs */ - resourceValueConfigs?: (google.cloud.securitycenter.v2.IResourceValueConfig[]|null); - } - - /** Represents a BatchCreateResourceValueConfigsResponse. */ - class BatchCreateResourceValueConfigsResponse implements IBatchCreateResourceValueConfigsResponse { - - /** - * Constructs a new BatchCreateResourceValueConfigsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse); - - /** BatchCreateResourceValueConfigsResponse resourceValueConfigs. */ - public resourceValueConfigs: google.cloud.securitycenter.v2.IResourceValueConfig[]; - - /** - * Creates a new BatchCreateResourceValueConfigsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateResourceValueConfigsResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; - - /** - * Encodes the specified BatchCreateResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.verify|verify} messages. - * @param message BatchCreateResourceValueConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.verify|verify} messages. - * @param message BatchCreateResourceValueConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; - - /** - * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; - - /** - * Verifies a BatchCreateResourceValueConfigsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateResourceValueConfigsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; - - /** - * Creates a plain object from a BatchCreateResourceValueConfigsResponse message. Also converts values to other types if specified. - * @param message BatchCreateResourceValueConfigsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateResourceValueConfigsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateResourceValueConfigsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BulkMuteFindingsRequest. */ - interface IBulkMuteFindingsRequest { - - /** BulkMuteFindingsRequest parent */ - parent?: (string|null); - - /** BulkMuteFindingsRequest filter */ - filter?: (string|null); - - /** BulkMuteFindingsRequest muteState */ - muteState?: (google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState|keyof typeof google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState|null); - } - - /** Represents a BulkMuteFindingsRequest. */ - class BulkMuteFindingsRequest implements IBulkMuteFindingsRequest { - - /** - * Constructs a new BulkMuteFindingsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IBulkMuteFindingsRequest); - - /** BulkMuteFindingsRequest parent. */ - public parent: string; - - /** BulkMuteFindingsRequest filter. */ - public filter: string; - - /** BulkMuteFindingsRequest muteState. */ - public muteState: (google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState|keyof typeof google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState); - - /** - * Creates a new BulkMuteFindingsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BulkMuteFindingsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IBulkMuteFindingsRequest): google.cloud.securitycenter.v2.BulkMuteFindingsRequest; - - /** - * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IBulkMuteFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.BulkMuteFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BulkMuteFindingsRequest to JSON. - * @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; - } - - namespace BulkMuteFindingsRequest { - - /** MuteState enum. */ - enum MuteState { - MUTE_STATE_UNSPECIFIED = 0, - MUTED = 1, - UNDEFINED = 2 - } - } - - /** 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.v2.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.v2.IBulkMuteFindingsResponse): google.cloud.securitycenter.v2.BulkMuteFindingsResponse; - - /** - * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IBulkMuteFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BulkMuteFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.BulkMuteFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BulkMuteFindingsResponse to JSON. - * @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 CreateBigQueryExportRequest. */ - interface ICreateBigQueryExportRequest { - - /** CreateBigQueryExportRequest parent */ - parent?: (string|null); - - /** CreateBigQueryExportRequest bigQueryExport */ - bigQueryExport?: (google.cloud.securitycenter.v2.IBigQueryExport|null); - - /** CreateBigQueryExportRequest bigQueryExportId */ - bigQueryExportId?: (string|null); - } - - /** Represents a CreateBigQueryExportRequest. */ - class CreateBigQueryExportRequest implements ICreateBigQueryExportRequest { - - /** - * Constructs a new CreateBigQueryExportRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICreateBigQueryExportRequest); - - /** CreateBigQueryExportRequest parent. */ - public parent: string; - - /** CreateBigQueryExportRequest bigQueryExport. */ - public bigQueryExport?: (google.cloud.securitycenter.v2.IBigQueryExport|null); - - /** CreateBigQueryExportRequest bigQueryExportId. */ - public bigQueryExportId: string; - - /** - * Creates a new CreateBigQueryExportRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBigQueryExportRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ICreateBigQueryExportRequest): google.cloud.securitycenter.v2.CreateBigQueryExportRequest; - - /** - * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.v2.CreateBigQueryExportRequest; - - /** - * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.v2.CreateBigQueryExportRequest; - - /** - * 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 CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBigQueryExportRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CreateBigQueryExportRequest; - - /** - * 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.v2.CreateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBigQueryExportRequest to JSON. - * @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 a CreateFindingRequest. */ - interface ICreateFindingRequest { - - /** CreateFindingRequest parent */ - parent?: (string|null); - - /** CreateFindingRequest findingId */ - findingId?: (string|null); - - /** CreateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v2.IFinding|null); - } - - /** Represents a CreateFindingRequest. */ - class CreateFindingRequest implements ICreateFindingRequest { - - /** - * Constructs a new CreateFindingRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICreateFindingRequest); - - /** CreateFindingRequest parent. */ - public parent: string; - - /** CreateFindingRequest findingId. */ - public findingId: string; - - /** CreateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v2.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.v2.ICreateFindingRequest): google.cloud.securitycenter.v2.CreateFindingRequest; - - /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateFindingRequest to JSON. - * @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. */ - interface ICreateMuteConfigRequest { - - /** CreateMuteConfigRequest parent */ - parent?: (string|null); - - /** CreateMuteConfigRequest muteConfig */ - muteConfig?: (google.cloud.securitycenter.v2.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.v2.ICreateMuteConfigRequest); - - /** CreateMuteConfigRequest parent. */ - public parent: string; - - /** CreateMuteConfigRequest muteConfig. */ - public muteConfig?: (google.cloud.securitycenter.v2.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.v2.ICreateMuteConfigRequest): google.cloud.securitycenter.v2.CreateMuteConfigRequest; - - /** - * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.CreateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateMuteConfigRequest to JSON. - * @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. */ - interface ICreateNotificationConfigRequest { - - /** CreateNotificationConfigRequest parent */ - parent?: (string|null); - - /** CreateNotificationConfigRequest configId */ - configId?: (string|null); - - /** CreateNotificationConfigRequest notificationConfig */ - notificationConfig?: (google.cloud.securitycenter.v2.INotificationConfig|null); - } - - /** Represents a CreateNotificationConfigRequest. */ - class CreateNotificationConfigRequest implements ICreateNotificationConfigRequest { - - /** - * Constructs a new CreateNotificationConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICreateNotificationConfigRequest); - - /** CreateNotificationConfigRequest parent. */ - public parent: string; - - /** CreateNotificationConfigRequest configId. */ - public configId: string; - - /** CreateNotificationConfigRequest notificationConfig. */ - public notificationConfig?: (google.cloud.securitycenter.v2.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.v2.ICreateNotificationConfigRequest): google.cloud.securitycenter.v2.CreateNotificationConfigRequest; - - /** - * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.CreateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateNotificationConfigRequest to JSON. - * @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 CreateResourceValueConfigRequest. */ - interface ICreateResourceValueConfigRequest { - - /** CreateResourceValueConfigRequest parent */ - parent?: (string|null); - - /** CreateResourceValueConfigRequest resourceValueConfig */ - resourceValueConfig?: (google.cloud.securitycenter.v2.IResourceValueConfig|null); - } - - /** Represents a CreateResourceValueConfigRequest. */ - class CreateResourceValueConfigRequest implements ICreateResourceValueConfigRequest { - - /** - * Constructs a new CreateResourceValueConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest); - - /** CreateResourceValueConfigRequest parent. */ - public parent: string; - - /** CreateResourceValueConfigRequest resourceValueConfig. */ - public resourceValueConfig?: (google.cloud.securitycenter.v2.IResourceValueConfig|null); - - /** - * Creates a new CreateResourceValueConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateResourceValueConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest): google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; - - /** - * Encodes the specified CreateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify|verify} messages. - * @param message CreateResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify|verify} messages. - * @param message CreateResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; - - /** - * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; - - /** - * Verifies a CreateResourceValueConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateResourceValueConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; - - /** - * Creates a plain object from a CreateResourceValueConfigRequest message. Also converts values to other types if specified. - * @param message CreateResourceValueConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.CreateResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateResourceValueConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateResourceValueConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateSourceRequest. */ - interface ICreateSourceRequest { - - /** CreateSourceRequest parent */ - parent?: (string|null); - - /** CreateSourceRequest source */ - source?: (google.cloud.securitycenter.v2.ISource|null); - } - - /** Represents a CreateSourceRequest. */ - class CreateSourceRequest implements ICreateSourceRequest { - - /** - * Constructs a new CreateSourceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ICreateSourceRequest); - - /** CreateSourceRequest parent. */ - public parent: string; - - /** CreateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v2.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.v2.ICreateSourceRequest): google.cloud.securitycenter.v2.CreateSourceRequest; - - /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSourceRequest to JSON. - * @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 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.v2.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.v2.IDeleteBigQueryExportRequest): google.cloud.securitycenter.v2.DeleteBigQueryExportRequest; - - /** - * Encodes the specified DeleteBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IDeleteBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.DeleteBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBigQueryExportRequest to JSON. - * @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 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.v2.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.v2.IDeleteMuteConfigRequest): google.cloud.securitycenter.v2.DeleteMuteConfigRequest; - - /** - * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IDeleteMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.DeleteMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteMuteConfigRequest to JSON. - * @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. */ - 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.v2.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.v2.IDeleteNotificationConfigRequest): google.cloud.securitycenter.v2.DeleteNotificationConfigRequest; - - /** - * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteNotificationConfigRequest to JSON. - * @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 DeleteResourceValueConfigRequest. */ - interface IDeleteResourceValueConfigRequest { - - /** DeleteResourceValueConfigRequest name */ - name?: (string|null); - } - - /** Represents a DeleteResourceValueConfigRequest. */ - class DeleteResourceValueConfigRequest implements IDeleteResourceValueConfigRequest { - - /** - * Constructs a new DeleteResourceValueConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest); - - /** DeleteResourceValueConfigRequest name. */ - public name: string; - - /** - * Creates a new DeleteResourceValueConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteResourceValueConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest): google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest; - - /** - * Encodes the specified DeleteResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest.verify|verify} messages. - * @param message DeleteResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest.verify|verify} messages. - * @param message DeleteResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest; - - /** - * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest; - - /** - * Verifies a DeleteResourceValueConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteResourceValueConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest; - - /** - * Creates a plain object from a DeleteResourceValueConfigRequest message. Also converts values to other types if specified. - * @param message DeleteResourceValueConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteResourceValueConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteResourceValueConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BigQueryDestination. */ - interface IBigQueryDestination { - - /** BigQueryDestination dataset */ - dataset?: (string|null); - } - - /** Represents a BigQueryDestination. */ - class BigQueryDestination implements IBigQueryDestination { - - /** - * Constructs a new BigQueryDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IBigQueryDestination); - - /** BigQueryDestination dataset. */ - public dataset: string; - - /** - * Creates a new BigQueryDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns BigQueryDestination instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IBigQueryDestination): google.cloud.securitycenter.v2.BigQueryDestination; - - /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BigQueryDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.BigQueryDestination; - - /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.BigQueryDestination; - - /** - * Verifies a BigQueryDestination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BigQueryDestination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.BigQueryDestination; - - /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @param message BigQueryDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BigQueryDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BigQueryDestination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportFindingsMetadata. */ - interface IExportFindingsMetadata { - - /** ExportFindingsMetadata exportStartTime */ - exportStartTime?: (google.protobuf.ITimestamp|null); - - /** ExportFindingsMetadata bigQueryDestination */ - bigQueryDestination?: (google.cloud.securitycenter.v2.IBigQueryDestination|null); - } - - /** Represents an ExportFindingsMetadata. */ - class ExportFindingsMetadata implements IExportFindingsMetadata { - - /** - * Constructs a new ExportFindingsMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IExportFindingsMetadata); - - /** ExportFindingsMetadata exportStartTime. */ - public exportStartTime?: (google.protobuf.ITimestamp|null); - - /** ExportFindingsMetadata bigQueryDestination. */ - public bigQueryDestination?: (google.cloud.securitycenter.v2.IBigQueryDestination|null); - - /** ExportFindingsMetadata destination. */ - public destination?: "bigQueryDestination"; - - /** - * Creates a new ExportFindingsMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportFindingsMetadata instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IExportFindingsMetadata): google.cloud.securitycenter.v2.ExportFindingsMetadata; - - /** - * Encodes the specified ExportFindingsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsMetadata.verify|verify} messages. - * @param message ExportFindingsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IExportFindingsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportFindingsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsMetadata.verify|verify} messages. - * @param message ExportFindingsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IExportFindingsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportFindingsMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportFindingsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ExportFindingsMetadata; - - /** - * Decodes an ExportFindingsMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportFindingsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ExportFindingsMetadata; - - /** - * Verifies an ExportFindingsMetadata message. - * @param message Plain 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 ExportFindingsMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportFindingsMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ExportFindingsMetadata; - - /** - * Creates a plain object from an ExportFindingsMetadata message. Also converts values to other types if specified. - * @param message ExportFindingsMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ExportFindingsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportFindingsMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportFindingsMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportFindingsResponse. */ - interface IExportFindingsResponse { - } - - /** Represents an ExportFindingsResponse. */ - class ExportFindingsResponse implements IExportFindingsResponse { - - /** - * Constructs a new ExportFindingsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IExportFindingsResponse); - - /** - * Creates a new ExportFindingsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportFindingsResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IExportFindingsResponse): google.cloud.securitycenter.v2.ExportFindingsResponse; - - /** - * Encodes the specified ExportFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsResponse.verify|verify} messages. - * @param message ExportFindingsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IExportFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsResponse.verify|verify} messages. - * @param message ExportFindingsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IExportFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportFindingsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ExportFindingsResponse; - - /** - * Decodes an ExportFindingsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ExportFindingsResponse; - - /** - * Verifies an ExportFindingsResponse message. - * @param message Plain 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 ExportFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportFindingsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ExportFindingsResponse; - - /** - * Creates a plain object from an ExportFindingsResponse message. Also converts values to other types if specified. - * @param message ExportFindingsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ExportFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportFindingsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportFindingsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBigQueryExportRequest. */ - interface IGetBigQueryExportRequest { - - /** GetBigQueryExportRequest name */ - name?: (string|null); - } - - /** Represents a GetBigQueryExportRequest. */ - class GetBigQueryExportRequest implements IGetBigQueryExportRequest { - - /** - * Constructs a new GetBigQueryExportRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IGetBigQueryExportRequest); - - /** GetBigQueryExportRequest name. */ - public name: string; - - /** - * Creates a new GetBigQueryExportRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBigQueryExportRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IGetBigQueryExportRequest): google.cloud.securitycenter.v2.GetBigQueryExportRequest; - - /** - * Encodes the specified GetBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.v2.GetBigQueryExportRequest; - - /** - * Decodes a GetBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.v2.GetBigQueryExportRequest; - - /** - * 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 GetBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBigQueryExportRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GetBigQueryExportRequest; - - /** - * 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.v2.GetBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBigQueryExportRequest to JSON. - * @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. */ - 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.v2.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.v2.IGetMuteConfigRequest): google.cloud.securitycenter.v2.GetMuteConfigRequest; - - /** - * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GetMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetMuteConfigRequest to JSON. - * @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. */ - 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.v2.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.v2.IGetNotificationConfigRequest): google.cloud.securitycenter.v2.GetNotificationConfigRequest; - - /** - * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GetNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetNotificationConfigRequest to JSON. - * @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 GetResourceValueConfigRequest. */ - interface IGetResourceValueConfigRequest { - - /** GetResourceValueConfigRequest name */ - name?: (string|null); - } - - /** Represents a GetResourceValueConfigRequest. */ - class GetResourceValueConfigRequest implements IGetResourceValueConfigRequest { - - /** - * Constructs a new GetResourceValueConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest); - - /** GetResourceValueConfigRequest name. */ - public name: string; - - /** - * Creates a new GetResourceValueConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetResourceValueConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest): google.cloud.securitycenter.v2.GetResourceValueConfigRequest; - - /** - * Encodes the specified GetResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetResourceValueConfigRequest.verify|verify} messages. - * @param message GetResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetResourceValueConfigRequest.verify|verify} messages. - * @param message GetResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GetResourceValueConfigRequest; - - /** - * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GetResourceValueConfigRequest; - - /** - * Verifies a GetResourceValueConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetResourceValueConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GetResourceValueConfigRequest; - - /** - * Creates a plain object from a GetResourceValueConfigRequest message. Also converts values to other types if specified. - * @param message GetResourceValueConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.GetResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetResourceValueConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetResourceValueConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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.v2.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.v2.IGetSourceRequest): google.cloud.securitycenter.v2.GetSourceRequest; - - /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSourceRequest to JSON. - * @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 GroupFindingsRequest. */ - interface IGroupFindingsRequest { - - /** GroupFindingsRequest parent */ - parent?: (string|null); - - /** GroupFindingsRequest filter */ - filter?: (string|null); - - /** GroupFindingsRequest groupBy */ - groupBy?: (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.v2.IGroupFindingsRequest); - - /** GroupFindingsRequest parent. */ - public parent: string; - - /** GroupFindingsRequest filter. */ - public filter: string; - - /** GroupFindingsRequest groupBy. */ - public groupBy: 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.v2.IGroupFindingsRequest): google.cloud.securitycenter.v2.GroupFindingsRequest; - - /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GroupFindingsRequest to JSON. - * @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. */ - interface IGroupFindingsResponse { - - /** GroupFindingsResponse groupByResults */ - groupByResults?: (google.cloud.securitycenter.v2.IGroupResult[]|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.v2.IGroupFindingsResponse); - - /** GroupFindingsResponse groupByResults. */ - public groupByResults: google.cloud.securitycenter.v2.IGroupResult[]; - - /** 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.v2.IGroupFindingsResponse): google.cloud.securitycenter.v2.GroupFindingsResponse; - - /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GroupFindingsResponse to JSON. - * @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. */ - 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.v2.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.v2.IGroupResult): google.cloud.securitycenter.v2.GroupResult; - - /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GroupResult to JSON. - * @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 ListAttackPathsRequest. */ - interface IListAttackPathsRequest { - - /** ListAttackPathsRequest parent */ - parent?: (string|null); - - /** ListAttackPathsRequest filter */ - filter?: (string|null); - - /** ListAttackPathsRequest pageToken */ - pageToken?: (string|null); - - /** ListAttackPathsRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListAttackPathsRequest. */ - class ListAttackPathsRequest implements IListAttackPathsRequest { - - /** - * Constructs a new ListAttackPathsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IListAttackPathsRequest); - - /** ListAttackPathsRequest parent. */ - public parent: string; - - /** ListAttackPathsRequest filter. */ - public filter: string; - - /** ListAttackPathsRequest pageToken. */ - public pageToken: string; - - /** ListAttackPathsRequest pageSize. */ - public pageSize: number; - - /** - * Creates a new ListAttackPathsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttackPathsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IListAttackPathsRequest): google.cloud.securitycenter.v2.ListAttackPathsRequest; - - /** - * Encodes the specified ListAttackPathsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsRequest.verify|verify} messages. - * @param message ListAttackPathsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IListAttackPathsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttackPathsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsRequest.verify|verify} messages. - * @param message ListAttackPathsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IListAttackPathsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttackPathsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttackPathsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListAttackPathsRequest; - - /** - * Decodes a ListAttackPathsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttackPathsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListAttackPathsRequest; - - /** - * Verifies a ListAttackPathsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttackPathsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttackPathsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListAttackPathsRequest; - - /** - * Creates a plain object from a ListAttackPathsRequest message. Also converts values to other types if specified. - * @param message ListAttackPathsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ListAttackPathsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttackPathsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttackPathsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAttackPathsResponse. */ - interface IListAttackPathsResponse { - - /** ListAttackPathsResponse attackPaths */ - attackPaths?: (google.cloud.securitycenter.v2.IAttackPath[]|null); - - /** ListAttackPathsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAttackPathsResponse. */ - class ListAttackPathsResponse implements IListAttackPathsResponse { - - /** - * Constructs a new ListAttackPathsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IListAttackPathsResponse); - - /** ListAttackPathsResponse attackPaths. */ - public attackPaths: google.cloud.securitycenter.v2.IAttackPath[]; - - /** ListAttackPathsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAttackPathsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttackPathsResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IListAttackPathsResponse): google.cloud.securitycenter.v2.ListAttackPathsResponse; - - /** - * Encodes the specified ListAttackPathsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsResponse.verify|verify} messages. - * @param message ListAttackPathsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IListAttackPathsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttackPathsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsResponse.verify|verify} messages. - * @param message ListAttackPathsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IListAttackPathsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttackPathsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttackPathsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListAttackPathsResponse; - - /** - * Decodes a ListAttackPathsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttackPathsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListAttackPathsResponse; - - /** - * Verifies a ListAttackPathsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttackPathsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttackPathsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListAttackPathsResponse; - - /** - * Creates a plain object from a ListAttackPathsResponse message. Also converts values to other types if specified. - * @param message ListAttackPathsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ListAttackPathsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttackPathsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttackPathsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSimulationRequest. */ - interface IGetSimulationRequest { - - /** GetSimulationRequest name */ - name?: (string|null); - } - - /** Represents a GetSimulationRequest. */ - class GetSimulationRequest implements IGetSimulationRequest { - - /** - * Constructs a new GetSimulationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IGetSimulationRequest); - - /** GetSimulationRequest name. */ - public name: string; - - /** - * Creates a new GetSimulationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSimulationRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IGetSimulationRequest): google.cloud.securitycenter.v2.GetSimulationRequest; - - /** - * Encodes the specified GetSimulationRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetSimulationRequest.verify|verify} messages. - * @param message GetSimulationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IGetSimulationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSimulationRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetSimulationRequest.verify|verify} messages. - * @param message GetSimulationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IGetSimulationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSimulationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSimulationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GetSimulationRequest; - - /** - * Decodes a GetSimulationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSimulationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GetSimulationRequest; - - /** - * Verifies a GetSimulationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSimulationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSimulationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GetSimulationRequest; - - /** - * Creates a plain object from a GetSimulationRequest message. Also converts values to other types if specified. - * @param message GetSimulationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.GetSimulationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSimulationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSimulationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetValuedResourceRequest. */ - interface IGetValuedResourceRequest { - - /** GetValuedResourceRequest name */ - name?: (string|null); - } - - /** Represents a GetValuedResourceRequest. */ - class GetValuedResourceRequest implements IGetValuedResourceRequest { - - /** - * Constructs a new GetValuedResourceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IGetValuedResourceRequest); - - /** GetValuedResourceRequest name. */ - public name: string; - - /** - * Creates a new GetValuedResourceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetValuedResourceRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IGetValuedResourceRequest): google.cloud.securitycenter.v2.GetValuedResourceRequest; - - /** - * Encodes the specified GetValuedResourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetValuedResourceRequest.verify|verify} messages. - * @param message GetValuedResourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IGetValuedResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetValuedResourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetValuedResourceRequest.verify|verify} messages. - * @param message GetValuedResourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IGetValuedResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetValuedResourceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetValuedResourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GetValuedResourceRequest; - - /** - * Decodes a GetValuedResourceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetValuedResourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GetValuedResourceRequest; - - /** - * Verifies a GetValuedResourceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetValuedResourceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetValuedResourceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GetValuedResourceRequest; - - /** - * Creates a plain object from a GetValuedResourceRequest message. Also converts values to other types if specified. - * @param message GetValuedResourceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.GetValuedResourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetValuedResourceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetValuedResourceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBigQueryExportsRequest. */ - interface IListBigQueryExportsRequest { - - /** ListBigQueryExportsRequest parent */ - parent?: (string|null); - - /** ListBigQueryExportsRequest pageSize */ - pageSize?: (number|null); - - /** ListBigQueryExportsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBigQueryExportsRequest. */ - class ListBigQueryExportsRequest implements IListBigQueryExportsRequest { - - /** - * Constructs a new ListBigQueryExportsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IListBigQueryExportsRequest); - - /** ListBigQueryExportsRequest parent. */ - public parent: string; - - /** ListBigQueryExportsRequest pageSize. */ - public pageSize: number; - - /** ListBigQueryExportsRequest pageToken. */ - public pageToken: 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.v2.IListBigQueryExportsRequest): google.cloud.securitycenter.v2.ListBigQueryExportsRequest; - - /** - * Encodes the specified ListBigQueryExportsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBigQueryExportsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.v2.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.v2.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.v2.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.v2.ListBigQueryExportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBigQueryExportsRequest to JSON. - * @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. */ - interface IListBigQueryExportsResponse { - - /** ListBigQueryExportsResponse bigQueryExports */ - bigQueryExports?: (google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsResponse); - - /** ListBigQueryExportsResponse bigQueryExports. */ - public bigQueryExports: google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsResponse): google.cloud.securitycenter.v2.ListBigQueryExportsResponse; - - /** - * Encodes the specified ListBigQueryExportsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListBigQueryExportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBigQueryExportsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListBigQueryExportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBigQueryExportsResponse to JSON. - * @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 ListFindingsRequest. */ - interface IListFindingsRequest { - - /** ListFindingsRequest parent */ - parent?: (string|null); - - /** ListFindingsRequest filter */ - filter?: (string|null); - - /** ListFindingsRequest orderBy */ - orderBy?: (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.v2.IListFindingsRequest); - - /** ListFindingsRequest parent. */ - public parent: string; - - /** ListFindingsRequest filter. */ - public filter: string; - - /** ListFindingsRequest orderBy. */ - public orderBy: 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.v2.IListFindingsRequest): google.cloud.securitycenter.v2.ListFindingsRequest; - - /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListFindingsRequest to JSON. - * @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. */ - interface IListFindingsResponse { - - /** ListFindingsResponse listFindingsResults */ - listFindingsResults?: (google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[]|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.v2.IListFindingsResponse); - - /** ListFindingsResponse listFindingsResults. */ - public listFindingsResults: google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[]; - - /** 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.v2.IListFindingsResponse): google.cloud.securitycenter.v2.ListFindingsResponse; - - /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListFindingsResponse to JSON. - * @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 { - - /** Properties of a ListFindingsResult. */ - interface IListFindingsResult { - - /** ListFindingsResult finding */ - finding?: (google.cloud.securitycenter.v2.IFinding|null); - - /** ListFindingsResult resource */ - resource?: (google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.IListFindingsResult); - - /** ListFindingsResult finding. */ - public finding?: (google.cloud.securitycenter.v2.IFinding|null); - - /** ListFindingsResult resource. */ - public resource?: (google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.IListFindingsResult): google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult; - - /** - * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListFindingsResponse.ListFindingsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListFindingsResult to JSON. - * @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 { - - /** Properties of a Resource. */ - interface IResource { - - /** Resource name */ - name?: (string|null); - - /** Resource displayName */ - displayName?: (string|null); - - /** Resource type */ - type?: (string|null); - - /** Resource cloudProvider */ - cloudProvider?: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider|null); - - /** Resource service */ - service?: (string|null); - - /** Resource location */ - location?: (string|null); - - /** Resource gcpMetadata */ - gcpMetadata?: (google.cloud.securitycenter.v2.IGcpMetadata|null); - - /** Resource awsMetadata */ - awsMetadata?: (google.cloud.securitycenter.v2.IAwsMetadata|null); - - /** Resource azureMetadata */ - azureMetadata?: (google.cloud.securitycenter.v2.IAzureMetadata|null); - - /** Resource resourcePath */ - resourcePath?: (google.cloud.securitycenter.v2.IResourcePath|null); - - /** Resource resourcePathString */ - resourcePathString?: (string|null); - } - - /** Represents a Resource. */ - class Resource implements IResource { - - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource); - - /** Resource name. */ - public name: string; - - /** Resource displayName. */ - public displayName: string; - - /** Resource type. */ - public type: string; - - /** Resource cloudProvider. */ - public cloudProvider: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider); - - /** Resource service. */ - public service: string; - - /** Resource location. */ - public location: string; - - /** Resource gcpMetadata. */ - public gcpMetadata?: (google.cloud.securitycenter.v2.IGcpMetadata|null); - - /** Resource awsMetadata. */ - public awsMetadata?: (google.cloud.securitycenter.v2.IAwsMetadata|null); - - /** Resource azureMetadata. */ - public azureMetadata?: (google.cloud.securitycenter.v2.IAzureMetadata|null); - - /** Resource resourcePath. */ - public resourcePath?: (google.cloud.securitycenter.v2.IResourcePath|null); - - /** Resource resourcePathString. */ - public resourcePathString: string; - - /** Resource cloudProviderMetadata. */ - public cloudProviderMetadata?: ("gcpMetadata"|"awsMetadata"|"azureMetadata"); - - /** - * Creates a new Resource instance using the specified properties. - * @param [properties] Properties to set - * @returns Resource instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource): google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListFindingsResponse.ListFindingsResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Resource to JSON. - * @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 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.v2.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.v2.IListMuteConfigsRequest): google.cloud.securitycenter.v2.ListMuteConfigsRequest; - - /** - * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListMuteConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListMuteConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListMuteConfigsRequest to JSON. - * @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. */ - interface IListMuteConfigsResponse { - - /** ListMuteConfigsResponse muteConfigs */ - muteConfigs?: (google.cloud.securitycenter.v2.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.v2.IListMuteConfigsResponse); - - /** ListMuteConfigsResponse muteConfigs. */ - public muteConfigs: google.cloud.securitycenter.v2.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.v2.IListMuteConfigsResponse): google.cloud.securitycenter.v2.ListMuteConfigsResponse; - - /** - * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListMuteConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListMuteConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListMuteConfigsResponse to JSON. - * @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. */ - 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.v2.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.v2.IListNotificationConfigsRequest): google.cloud.securitycenter.v2.ListNotificationConfigsRequest; - - /** - * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListNotificationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListNotificationConfigsRequest to JSON. - * @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. */ - interface IListNotificationConfigsResponse { - - /** ListNotificationConfigsResponse notificationConfigs */ - notificationConfigs?: (google.cloud.securitycenter.v2.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.v2.IListNotificationConfigsResponse); - - /** ListNotificationConfigsResponse notificationConfigs. */ - public notificationConfigs: google.cloud.securitycenter.v2.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.v2.IListNotificationConfigsResponse): google.cloud.securitycenter.v2.ListNotificationConfigsResponse; - - /** - * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListNotificationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListNotificationConfigsResponse to JSON. - * @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 ListResourceValueConfigsRequest. */ - interface IListResourceValueConfigsRequest { - - /** ListResourceValueConfigsRequest parent */ - parent?: (string|null); - - /** ListResourceValueConfigsRequest pageSize */ - pageSize?: (number|null); - - /** ListResourceValueConfigsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListResourceValueConfigsRequest. */ - class ListResourceValueConfigsRequest implements IListResourceValueConfigsRequest { - - /** - * Constructs a new ListResourceValueConfigsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest); - - /** ListResourceValueConfigsRequest parent. */ - public parent: string; - - /** ListResourceValueConfigsRequest pageSize. */ - public pageSize: number; - - /** ListResourceValueConfigsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListResourceValueConfigsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceValueConfigsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest): google.cloud.securitycenter.v2.ListResourceValueConfigsRequest; - - /** - * Encodes the specified ListResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsRequest.verify|verify} messages. - * @param message ListResourceValueConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsRequest.verify|verify} messages. - * @param message ListResourceValueConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListResourceValueConfigsRequest; - - /** - * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListResourceValueConfigsRequest; - - /** - * Verifies a ListResourceValueConfigsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceValueConfigsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListResourceValueConfigsRequest; - - /** - * Creates a plain object from a ListResourceValueConfigsRequest message. Also converts values to other types if specified. - * @param message ListResourceValueConfigsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ListResourceValueConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceValueConfigsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceValueConfigsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListResourceValueConfigsResponse. */ - interface IListResourceValueConfigsResponse { - - /** ListResourceValueConfigsResponse resourceValueConfigs */ - resourceValueConfigs?: (google.cloud.securitycenter.v2.IResourceValueConfig[]|null); - - /** ListResourceValueConfigsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListResourceValueConfigsResponse. */ - class ListResourceValueConfigsResponse implements IListResourceValueConfigsResponse { - - /** - * Constructs a new ListResourceValueConfigsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IListResourceValueConfigsResponse); - - /** ListResourceValueConfigsResponse resourceValueConfigs. */ - public resourceValueConfigs: google.cloud.securitycenter.v2.IResourceValueConfig[]; - - /** ListResourceValueConfigsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListResourceValueConfigsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceValueConfigsResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IListResourceValueConfigsResponse): google.cloud.securitycenter.v2.ListResourceValueConfigsResponse; - - /** - * Encodes the specified ListResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.verify|verify} messages. - * @param message ListResourceValueConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IListResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.verify|verify} messages. - * @param message ListResourceValueConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IListResourceValueConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListResourceValueConfigsResponse; - - /** - * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListResourceValueConfigsResponse; - - /** - * Verifies a ListResourceValueConfigsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceValueConfigsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListResourceValueConfigsResponse; - - /** - * Creates a plain object from a ListResourceValueConfigsResponse message. Also converts values to other types if specified. - * @param message ListResourceValueConfigsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ListResourceValueConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceValueConfigsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceValueConfigsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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.v2.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.v2.IListSourcesRequest): google.cloud.securitycenter.v2.ListSourcesRequest; - - /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSourcesRequest to JSON. - * @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. */ - interface IListSourcesResponse { - - /** ListSourcesResponse sources */ - sources?: (google.cloud.securitycenter.v2.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.v2.IListSourcesResponse); - - /** ListSourcesResponse sources. */ - public sources: google.cloud.securitycenter.v2.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.v2.IListSourcesResponse): google.cloud.securitycenter.v2.ListSourcesResponse; - - /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSourcesResponse to JSON. - * @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 ListValuedResourcesRequest. */ - interface IListValuedResourcesRequest { - - /** ListValuedResourcesRequest parent */ - parent?: (string|null); - - /** ListValuedResourcesRequest filter */ - filter?: (string|null); - - /** ListValuedResourcesRequest pageToken */ - pageToken?: (string|null); - - /** ListValuedResourcesRequest pageSize */ - pageSize?: (number|null); - - /** ListValuedResourcesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListValuedResourcesRequest. */ - class ListValuedResourcesRequest implements IListValuedResourcesRequest { - - /** - * Constructs a new ListValuedResourcesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IListValuedResourcesRequest); - - /** ListValuedResourcesRequest parent. */ - public parent: string; - - /** ListValuedResourcesRequest filter. */ - public filter: string; - - /** ListValuedResourcesRequest pageToken. */ - public pageToken: string; - - /** ListValuedResourcesRequest pageSize. */ - public pageSize: number; - - /** ListValuedResourcesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListValuedResourcesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValuedResourcesRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IListValuedResourcesRequest): google.cloud.securitycenter.v2.ListValuedResourcesRequest; - - /** - * Encodes the specified ListValuedResourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesRequest.verify|verify} messages. - * @param message ListValuedResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IListValuedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValuedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesRequest.verify|verify} messages. - * @param message ListValuedResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IListValuedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValuedResourcesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValuedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListValuedResourcesRequest; - - /** - * Decodes a ListValuedResourcesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValuedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListValuedResourcesRequest; - - /** - * Verifies a ListValuedResourcesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValuedResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValuedResourcesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListValuedResourcesRequest; - - /** - * Creates a plain object from a ListValuedResourcesRequest message. Also converts values to other types if specified. - * @param message ListValuedResourcesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ListValuedResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValuedResourcesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValuedResourcesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListValuedResourcesResponse. */ - interface IListValuedResourcesResponse { - - /** ListValuedResourcesResponse valuedResources */ - valuedResources?: (google.cloud.securitycenter.v2.IValuedResource[]|null); - - /** ListValuedResourcesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListValuedResourcesResponse totalSize */ - totalSize?: (number|null); - } - - /** Represents a ListValuedResourcesResponse. */ - class ListValuedResourcesResponse implements IListValuedResourcesResponse { - - /** - * Constructs a new ListValuedResourcesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IListValuedResourcesResponse); - - /** ListValuedResourcesResponse valuedResources. */ - public valuedResources: google.cloud.securitycenter.v2.IValuedResource[]; - - /** ListValuedResourcesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListValuedResourcesResponse totalSize. */ - public totalSize: number; - - /** - * Creates a new ListValuedResourcesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValuedResourcesResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IListValuedResourcesResponse): google.cloud.securitycenter.v2.ListValuedResourcesResponse; - - /** - * Encodes the specified ListValuedResourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesResponse.verify|verify} messages. - * @param message ListValuedResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IListValuedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValuedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesResponse.verify|verify} messages. - * @param message ListValuedResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IListValuedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValuedResourcesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValuedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ListValuedResourcesResponse; - - /** - * Decodes a ListValuedResourcesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValuedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ListValuedResourcesResponse; - - /** - * Verifies a ListValuedResourcesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValuedResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValuedResourcesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ListValuedResourcesResponse; - - /** - * Creates a plain object from a ListValuedResourcesResponse message. Also converts values to other types if specified. - * @param message ListValuedResourcesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ListValuedResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValuedResourcesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValuedResourcesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetFindingStateRequest. */ - interface ISetFindingStateRequest { - - /** SetFindingStateRequest name */ - name?: (string|null); - - /** SetFindingStateRequest state */ - state?: (google.cloud.securitycenter.v2.Finding.State|keyof typeof google.cloud.securitycenter.v2.Finding.State|null); - } - - /** Represents a SetFindingStateRequest. */ - class SetFindingStateRequest implements ISetFindingStateRequest { - - /** - * Constructs a new SetFindingStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ISetFindingStateRequest); - - /** SetFindingStateRequest name. */ - public name: string; - - /** SetFindingStateRequest state. */ - public state: (google.cloud.securitycenter.v2.Finding.State|keyof typeof google.cloud.securitycenter.v2.Finding.State); - - /** - * Creates a new SetFindingStateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetFindingStateRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ISetFindingStateRequest): google.cloud.securitycenter.v2.SetFindingStateRequest; - - /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetFindingStateRequest to JSON. - * @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. */ - interface ISetMuteRequest { - - /** SetMuteRequest name */ - name?: (string|null); - - /** SetMuteRequest mute */ - mute?: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.Finding.Mute|null); - } - - /** Represents a SetMuteRequest. */ - class SetMuteRequest implements ISetMuteRequest { - - /** - * Constructs a new SetMuteRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ISetMuteRequest); - - /** SetMuteRequest name. */ - public name: string; - - /** SetMuteRequest mute. */ - public mute: (google.cloud.securitycenter.v2.Finding.Mute|keyof typeof google.cloud.securitycenter.v2.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.v2.ISetMuteRequest): google.cloud.securitycenter.v2.SetMuteRequest; - - /** - * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ISetMuteRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.SetMuteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetMuteRequest to JSON. - * @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 an UpdateBigQueryExportRequest. */ - interface IUpdateBigQueryExportRequest { - - /** UpdateBigQueryExportRequest bigQueryExport */ - bigQueryExport?: (google.cloud.securitycenter.v2.IBigQueryExport|null); - - /** UpdateBigQueryExportRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateBigQueryExportRequest. */ - class UpdateBigQueryExportRequest implements IUpdateBigQueryExportRequest { - - /** - * Constructs a new UpdateBigQueryExportRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest); - - /** UpdateBigQueryExportRequest bigQueryExport. */ - public bigQueryExport?: (google.cloud.securitycenter.v2.IBigQueryExport|null); - - /** UpdateBigQueryExportRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateBigQueryExportRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBigQueryExportRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest): google.cloud.securitycenter.v2.UpdateBigQueryExportRequest; - - /** - * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.v2.UpdateBigQueryExportRequest; - - /** - * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.v2.UpdateBigQueryExportRequest; - - /** - * 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 UpdateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBigQueryExportRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.UpdateBigQueryExportRequest; - - /** - * 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.v2.UpdateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBigQueryExportRequest to JSON. - * @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 an UpdateExternalSystemRequest. */ - interface IUpdateExternalSystemRequest { - - /** UpdateExternalSystemRequest externalSystem */ - externalSystem?: (google.cloud.securitycenter.v2.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.v2.IUpdateExternalSystemRequest); - - /** UpdateExternalSystemRequest externalSystem. */ - public externalSystem?: (google.cloud.securitycenter.v2.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.v2.IUpdateExternalSystemRequest): google.cloud.securitycenter.v2.UpdateExternalSystemRequest; - - /** - * Encodes the specified UpdateExternalSystemRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateExternalSystemRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateExternalSystemRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateExternalSystemRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateExternalSystemRequest to JSON. - * @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. */ - interface IUpdateFindingRequest { - - /** UpdateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v2.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.v2.IUpdateFindingRequest); - - /** UpdateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v2.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.v2.IUpdateFindingRequest): google.cloud.securitycenter.v2.UpdateFindingRequest; - - /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateFindingRequest to JSON. - * @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. */ - interface IUpdateMuteConfigRequest { - - /** UpdateMuteConfigRequest muteConfig */ - muteConfig?: (google.cloud.securitycenter.v2.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.v2.IUpdateMuteConfigRequest); - - /** UpdateMuteConfigRequest muteConfig. */ - public muteConfig?: (google.cloud.securitycenter.v2.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.v2.IUpdateMuteConfigRequest): google.cloud.securitycenter.v2.UpdateMuteConfigRequest; - - /** - * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateMuteConfigRequest to JSON. - * @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. */ - interface IUpdateNotificationConfigRequest { - - /** UpdateNotificationConfigRequest notificationConfig */ - notificationConfig?: (google.cloud.securitycenter.v2.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.v2.IUpdateNotificationConfigRequest); - - /** UpdateNotificationConfigRequest notificationConfig. */ - public notificationConfig?: (google.cloud.securitycenter.v2.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.v2.IUpdateNotificationConfigRequest): google.cloud.securitycenter.v2.UpdateNotificationConfigRequest; - - /** - * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateNotificationConfigRequest to JSON. - * @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 UpdateResourceValueConfigRequest. */ - interface IUpdateResourceValueConfigRequest { - - /** UpdateResourceValueConfigRequest resourceValueConfig */ - resourceValueConfig?: (google.cloud.securitycenter.v2.IResourceValueConfig|null); - - /** UpdateResourceValueConfigRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateResourceValueConfigRequest. */ - class UpdateResourceValueConfigRequest implements IUpdateResourceValueConfigRequest { - - /** - * Constructs a new UpdateResourceValueConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest); - - /** UpdateResourceValueConfigRequest resourceValueConfig. */ - public resourceValueConfig?: (google.cloud.securitycenter.v2.IResourceValueConfig|null); - - /** UpdateResourceValueConfigRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateResourceValueConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateResourceValueConfigRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest): google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest; - - /** - * Encodes the specified UpdateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.verify|verify} messages. - * @param message UpdateResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.verify|verify} messages. - * @param message UpdateResourceValueConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest; - - /** - * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest; - - /** - * Verifies an UpdateResourceValueConfigRequest message. - * @param message Plain 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 UpdateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateResourceValueConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest; - - /** - * Creates a plain object from an UpdateResourceValueConfigRequest message. Also converts values to other types if specified. - * @param message UpdateResourceValueConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateResourceValueConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateResourceValueConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateSecurityMarksRequest. */ - interface IUpdateSecurityMarksRequest { - - /** UpdateSecurityMarksRequest securityMarks */ - securityMarks?: (google.cloud.securitycenter.v2.ISecurityMarks|null); - - /** UpdateSecurityMarksRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateSecurityMarksRequest. */ - class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { - - /** - * Constructs a new UpdateSecurityMarksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest); - - /** UpdateSecurityMarksRequest securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v2.ISecurityMarks|null); - - /** UpdateSecurityMarksRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|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.v2.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v2.UpdateSecurityMarksRequest; - - /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSecurityMarksRequest to JSON. - * @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 an UpdateSourceRequest. */ - interface IUpdateSourceRequest { - - /** UpdateSourceRequest source */ - source?: (google.cloud.securitycenter.v2.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.v2.IUpdateSourceRequest); - - /** UpdateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v2.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.v2.IUpdateSourceRequest): google.cloud.securitycenter.v2.UpdateSourceRequest; - - /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSourceRequest to JSON. - * @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 a Simulation. */ - interface ISimulation { - - /** Simulation name */ - name?: (string|null); - - /** Simulation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Simulation resourceValueConfigsMetadata */ - resourceValueConfigsMetadata?: (google.cloud.securitycenter.v2.IResourceValueConfigMetadata[]|null); - - /** Simulation cloudProvider */ - cloudProvider?: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider|null); - } - - /** Represents a Simulation. */ - class Simulation implements ISimulation { - - /** - * Constructs a new Simulation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.ISimulation); - - /** Simulation name. */ - public name: string; - - /** Simulation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Simulation resourceValueConfigsMetadata. */ - public resourceValueConfigsMetadata: google.cloud.securitycenter.v2.IResourceValueConfigMetadata[]; - - /** Simulation cloudProvider. */ - public cloudProvider: (google.cloud.securitycenter.v2.CloudProvider|keyof typeof google.cloud.securitycenter.v2.CloudProvider); - - /** - * Creates a new Simulation instance using the specified properties. - * @param [properties] Properties to set - * @returns Simulation instance - */ - public static create(properties?: google.cloud.securitycenter.v2.ISimulation): google.cloud.securitycenter.v2.Simulation; - - /** - * Encodes the specified Simulation message. Does not implicitly {@link google.cloud.securitycenter.v2.Simulation.verify|verify} messages. - * @param message Simulation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.ISimulation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Simulation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Simulation.verify|verify} messages. - * @param message Simulation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.ISimulation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Simulation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Simulation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.Simulation; - - /** - * Decodes a Simulation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Simulation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.Simulation; - - /** - * Verifies a Simulation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Simulation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Simulation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.Simulation; - - /** - * Creates a plain object from a Simulation message. Also converts values to other types if specified. - * @param message Simulation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.Simulation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Simulation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Simulation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValuedResource. */ - interface IValuedResource { - - /** ValuedResource name */ - name?: (string|null); - - /** ValuedResource resource */ - resource?: (string|null); - - /** ValuedResource resourceType */ - resourceType?: (string|null); - - /** ValuedResource displayName */ - displayName?: (string|null); - - /** ValuedResource resourceValue */ - resourceValue?: (google.cloud.securitycenter.v2.ValuedResource.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ValuedResource.ResourceValue|null); - - /** ValuedResource exposedScore */ - exposedScore?: (number|null); - - /** ValuedResource resourceValueConfigsUsed */ - resourceValueConfigsUsed?: (google.cloud.securitycenter.v2.IResourceValueConfigMetadata[]|null); - } - - /** Represents a ValuedResource. */ - class ValuedResource implements IValuedResource { - - /** - * Constructs a new ValuedResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IValuedResource); - - /** ValuedResource name. */ - public name: string; - - /** ValuedResource resource. */ - public resource: string; - - /** ValuedResource resourceType. */ - public resourceType: string; - - /** ValuedResource displayName. */ - public displayName: string; - - /** ValuedResource resourceValue. */ - public resourceValue: (google.cloud.securitycenter.v2.ValuedResource.ResourceValue|keyof typeof google.cloud.securitycenter.v2.ValuedResource.ResourceValue); - - /** ValuedResource exposedScore. */ - public exposedScore: number; - - /** ValuedResource resourceValueConfigsUsed. */ - public resourceValueConfigsUsed: google.cloud.securitycenter.v2.IResourceValueConfigMetadata[]; - - /** - * Creates a new ValuedResource instance using the specified properties. - * @param [properties] Properties to set - * @returns ValuedResource instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IValuedResource): google.cloud.securitycenter.v2.ValuedResource; - - /** - * Encodes the specified ValuedResource message. Does not implicitly {@link google.cloud.securitycenter.v2.ValuedResource.verify|verify} messages. - * @param message ValuedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IValuedResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValuedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ValuedResource.verify|verify} messages. - * @param message ValuedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IValuedResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValuedResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValuedResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ValuedResource; - - /** - * Decodes a ValuedResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValuedResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ValuedResource; - - /** - * Verifies a ValuedResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValuedResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValuedResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ValuedResource; - - /** - * Creates a plain object from a ValuedResource message. Also converts values to other types if specified. - * @param message ValuedResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ValuedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValuedResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValuedResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ValuedResource { - - /** ResourceValue enum. */ - enum ResourceValue { - RESOURCE_VALUE_UNSPECIFIED = 0, - RESOURCE_VALUE_LOW = 1, - RESOURCE_VALUE_MEDIUM = 2, - RESOURCE_VALUE_HIGH = 3 - } - } - - /** Properties of a ResourceValueConfigMetadata. */ - interface IResourceValueConfigMetadata { - - /** ResourceValueConfigMetadata name */ - name?: (string|null); - } - - /** Represents a ResourceValueConfigMetadata. */ - class ResourceValueConfigMetadata implements IResourceValueConfigMetadata { - - /** - * Constructs a new ResourceValueConfigMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v2.IResourceValueConfigMetadata); - - /** ResourceValueConfigMetadata name. */ - public name: string; - - /** - * Creates a new ResourceValueConfigMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceValueConfigMetadata instance - */ - public static create(properties?: google.cloud.securitycenter.v2.IResourceValueConfigMetadata): google.cloud.securitycenter.v2.ResourceValueConfigMetadata; - - /** - * Encodes the specified ResourceValueConfigMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify|verify} messages. - * @param message ResourceValueConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v2.IResourceValueConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceValueConfigMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify|verify} messages. - * @param message ResourceValueConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v2.IResourceValueConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceValueConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ResourceValueConfigMetadata; - - /** - * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceValueConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ResourceValueConfigMetadata; - - /** - * Verifies a ResourceValueConfigMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceValueConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceValueConfigMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ResourceValueConfigMetadata; - - /** - * Creates a plain object from a ResourceValueConfigMetadata message. Also converts values to other types if specified. - * @param message ResourceValueConfigMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v2.ResourceValueConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceValueConfigMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceValueConfigMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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.v2.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.v2.ISource): google.cloud.securitycenter.v2.Source; - - /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.ISource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Source to JSON. - * @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; - } - } - } - } - - /** 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 }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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, - IDENTIFIER = 8 - } - - /** Properties of a FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not 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.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload 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.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not 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.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload 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.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not 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.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload 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.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not 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.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload 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.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not 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.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload 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.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not 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.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload 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.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not 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.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload 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.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not 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.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload 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.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not 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.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload 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.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not 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.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload 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.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not 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.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload 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.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not 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.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload 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.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not 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.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload 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.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not 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.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload 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.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** Properties of a RoutingRule. */ - interface IRoutingRule { - - /** RoutingRule routingParameters */ - routingParameters?: (google.api.IRoutingParameter[]|null); - } - - /** Represents a RoutingRule. */ - class RoutingRule implements IRoutingRule { - - /** - * Constructs a new RoutingRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRoutingRule); - - /** RoutingRule routingParameters. */ - public routingParameters: google.api.IRoutingParameter[]; - - /** - * Creates a new RoutingRule instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingRule instance - */ - public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; - - /** - * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @param message RoutingRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @param message RoutingRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingRule - * @throws {Error} If the payload is not 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.RoutingRule; - - /** - * Decodes a RoutingRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingRule - * @throws {Error} If the payload 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.RoutingRule; - - /** - * Verifies a RoutingRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingRule - */ - public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; - - /** - * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. - * @param message RoutingRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingParameter. */ - interface IRoutingParameter { - - /** RoutingParameter field */ - field?: (string|null); - - /** RoutingParameter pathTemplate */ - pathTemplate?: (string|null); - } - - /** Represents a RoutingParameter. */ - class RoutingParameter implements IRoutingParameter { - - /** - * Constructs a new RoutingParameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRoutingParameter); - - /** RoutingParameter field. */ - public field: string; - - /** RoutingParameter pathTemplate. */ - public pathTemplate: string; - - /** - * Creates a new RoutingParameter instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingParameter instance - */ - public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; - - /** - * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @param message RoutingParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @param message RoutingParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingParameter - * @throws {Error} If the payload is not 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.RoutingParameter; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingParameter - * @throws {Error} If the payload 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.RoutingParameter; - - /** - * Verifies a RoutingParameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingParameter - */ - public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; - - /** - * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. - * @param message RoutingParameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingParameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingParameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 }; - - /** - * 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; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not 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.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload 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.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions 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 features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions 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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not 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.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload 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.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain 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 EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** 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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|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 deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** 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); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|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); - - /** MethodOptions .google.api.routing */ - ".google.api.routing"?: (google.api.IRoutingRule|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not 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.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload 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.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not 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.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload 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.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not 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.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload 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.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** 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 }; - - /** - * 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. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof 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|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|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|string); - - /** 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 }; - - /** - * 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. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a 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. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|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|Buffer|string); - - /** - * 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 }; - - /** - * 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. */ - 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 }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 }; - - /** - * 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; - } - } - - /** 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); - - /** SetIamPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|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); - - /** SetIamPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy auditConfigs */ - auditConfigs?: (google.iam.v1.IAuditConfig[]|null); - - /** Policy etag */ - etag?: (Uint8Array|Buffer|string|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 auditConfigs. */ - public auditConfigs: google.iam.v1.IAuditConfig[]; - - /** Policy etag. */ - public etag: (Uint8Array|Buffer|string); - - /** - * 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof 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|keyof typeof 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 }; - - /** - * 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 { - - /** 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|keyof typeof 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|keyof typeof 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 }; - - /** - * 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 { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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. */ - 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 }; - - /** - * 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; - } - } - - /** 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 }; - - /** - * 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/owl-bot-staging/google-cloud-securitycenter/protos/protos.js b/owl-bot-staging/google-cloud-securitycenter/protos/protos.js deleted file mode 100644 index 46fdeb4b05c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/protos.js +++ /dev/null @@ -1,165024 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_security_center_protos || ($protobuf.roots._google_cloud_security_center_protos = {}); - - $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.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} [userAgent] Access userAgent - * @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 - * @property {string|null} [userName] Access userName - */ - - /** - * 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) { - this.serviceAccountDelegationInfo = []; - if (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 userAgent. - * @member {string} userAgent - * @memberof google.cloud.securitycenter.v1.Access - * @instance - */ - Access.prototype.userAgent = ""; - - /** - * 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 = ""; - - /** - * 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; - - /** - * Access userName. - * @member {string} userName - * @memberof google.cloud.securitycenter.v1.Access - * @instance - */ - Access.prototype.userName = ""; - - /** - * 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); - 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(); - if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.userName); - if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.userAgent); - 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, error) { - 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(); - if (tag === error) - break; - 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 12: { - message.userAgent = reader.string(); - break; - } - case 5: { - message.serviceName = reader.string(); - break; - } - case 6: { - 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; - } - case 11: { - message.userName = 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.userAgent != null && message.hasOwnProperty("userAgent")) - if (!$util.isString(message.userAgent)) - return "userAgent: 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"; - 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; - } - } - if (message.userName != null && message.hasOwnProperty("userName")) - if (!$util.isString(message.userName)) - return "userName: 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.userAgent != null) - message.userAgent = String(object.userAgent); - if (object.serviceName != null) - 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]); - } - } - if (object.userName != null) - message.userName = String(object.userName); - 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.arrays || options.defaults) - object.serviceAccountDelegationInfo = []; - if (options.defaults) { - object.principalEmail = ""; - object.callerIp = ""; - object.callerIpGeo = null; - object.userAgentFamily = ""; - object.serviceName = ""; - object.methodName = ""; - object.principalSubject = ""; - object.serviceAccountKeyName = ""; - object.userName = ""; - object.userAgent = ""; - } - 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; - 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); - } - if (message.userName != null && message.hasOwnProperty("userName")) - object.userName = message.userName; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - object.userAgent = message.userAgent; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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() { - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.Application = (function() { - - /** - * Properties of an Application. - * @memberof google.cloud.securitycenter.v1 - * @interface IApplication - * @property {string|null} [baseUri] Application baseUri - * @property {string|null} [fullUri] Application fullUri - */ - - /** - * Constructs a new Application. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an Application. - * @implements IApplication - * @constructor - * @param {google.cloud.securitycenter.v1.IApplication=} [properties] Properties to set - */ - function Application(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Application baseUri. - * @member {string} baseUri - * @memberof google.cloud.securitycenter.v1.Application - * @instance - */ - Application.prototype.baseUri = ""; - - /** - * Application fullUri. - * @member {string} fullUri - * @memberof google.cloud.securitycenter.v1.Application - * @instance - */ - Application.prototype.fullUri = ""; - - /** - * Creates a new Application instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {google.cloud.securitycenter.v1.IApplication=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Application} Application instance - */ - Application.create = function create(properties) { - return new Application(properties); - }; - - /** - * Encodes the specified Application message. Does not implicitly {@link google.cloud.securitycenter.v1.Application.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {google.cloud.securitycenter.v1.IApplication} message Application message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Application.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.baseUri != null && Object.hasOwnProperty.call(message, "baseUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseUri); - if (message.fullUri != null && Object.hasOwnProperty.call(message, "fullUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullUri); - return writer; - }; - - /** - * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Application.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {google.cloud.securitycenter.v1.IApplication} message Application message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Application.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Application message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Application} Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Application.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Application(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.baseUri = reader.string(); - break; - } - case 2: { - message.fullUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Application message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Application} Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Application.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Application message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Application.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.baseUri != null && message.hasOwnProperty("baseUri")) - if (!$util.isString(message.baseUri)) - return "baseUri: string expected"; - if (message.fullUri != null && message.hasOwnProperty("fullUri")) - if (!$util.isString(message.fullUri)) - return "fullUri: string expected"; - return null; - }; - - /** - * Creates an Application message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Application} Application - */ - Application.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Application) - return object; - var message = new $root.google.cloud.securitycenter.v1.Application(); - if (object.baseUri != null) - message.baseUri = String(object.baseUri); - if (object.fullUri != null) - message.fullUri = String(object.fullUri); - return message; - }; - - /** - * Creates a plain object from an Application message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {google.cloud.securitycenter.v1.Application} message Application - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Application.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.baseUri = ""; - object.fullUri = ""; - } - if (message.baseUri != null && message.hasOwnProperty("baseUri")) - object.baseUri = message.baseUri; - if (message.fullUri != null && message.hasOwnProperty("fullUri")) - object.fullUri = message.fullUri; - return object; - }; - - /** - * Converts this Application to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Application - * @instance - * @returns {Object.} JSON object - */ - Application.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Application - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Application - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Application.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Application"; - }; - - return Application; - })(); - - 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 - * @property {string|null} [canonicalName] Asset canonicalName - */ - - /** - * 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; - - /** - * 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 - * @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 && 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.v1.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.v1.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.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; - }; - - /** - * 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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - } - 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; - } - } - 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; - } - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - if (!$util.isString(message.canonicalName)) - return "canonicalName: string expected"; - 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); - } - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); - 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; - object.canonicalName = ""; - } - 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); - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; - 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); - }; - - /** - * 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() { - - /** - * 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 - * @property {Array.|null} [folders] SecurityCenterProperties folders - */ - - /** - * 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 = []; - 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]]; - } - - /** - * 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; - - /** - * SecurityCenterProperties resourceDisplayName. - * @member {string} resourceDisplayName - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceDisplayName = ""; - - /** - * SecurityCenterProperties resourceParentDisplayName. - * @member {string} resourceParentDisplayName - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceParentDisplayName = ""; - - /** - * SecurityCenterProperties resourceProjectDisplayName. - * @member {string} resourceProjectDisplayName - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - 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 - * @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 && Object.hasOwnProperty.call(message, "resourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - 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 && Object.hasOwnProperty.call(message, "resourceDisplayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); - if (message.resourceParentDisplayName != null && Object.hasOwnProperty.call(message, "resourceParentDisplayName")) - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - 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"; - } - 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"; - 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; - }; - - /** - * 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); - 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; - }; - - /** - * 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 = []; - object.folders = []; - } - 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; - 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 - * @property {string|null} [canonicalName] SecurityMarks canonicalName - */ - - /** - * 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; - - /** - * 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 - * @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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - 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; - }; - - /** - * 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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - } - message.marks[key] = value; - break; - } - case 3: { - message.canonicalName = 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"; - } - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - if (!$util.isString(message.canonicalName)) - return "canonicalName: 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]]); - } - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); - 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 = ""; - object.canonicalName = ""; - } - 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.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; - 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); - }; - - /** - * 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; - })(); - - v1.AttackExposure = (function() { - - /** - * Properties of an AttackExposure. - * @memberof google.cloud.securitycenter.v1 - * @interface IAttackExposure - * @property {number|null} [score] AttackExposure score - * @property {google.protobuf.ITimestamp|null} [latestCalculationTime] AttackExposure latestCalculationTime - * @property {string|null} [attackExposureResult] AttackExposure attackExposureResult - * @property {google.cloud.securitycenter.v1.AttackExposure.State|null} [state] AttackExposure state - * @property {number|null} [exposedHighValueResourcesCount] AttackExposure exposedHighValueResourcesCount - * @property {number|null} [exposedMediumValueResourcesCount] AttackExposure exposedMediumValueResourcesCount - * @property {number|null} [exposedLowValueResourcesCount] AttackExposure exposedLowValueResourcesCount - */ - - /** - * Constructs a new AttackExposure. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an AttackExposure. - * @implements IAttackExposure - * @constructor - * @param {google.cloud.securitycenter.v1.IAttackExposure=} [properties] Properties to set - */ - function AttackExposure(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackExposure score. - * @member {number} score - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @instance - */ - AttackExposure.prototype.score = 0; - - /** - * AttackExposure latestCalculationTime. - * @member {google.protobuf.ITimestamp|null|undefined} latestCalculationTime - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @instance - */ - AttackExposure.prototype.latestCalculationTime = null; - - /** - * AttackExposure attackExposureResult. - * @member {string} attackExposureResult - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @instance - */ - AttackExposure.prototype.attackExposureResult = ""; - - /** - * AttackExposure state. - * @member {google.cloud.securitycenter.v1.AttackExposure.State} state - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @instance - */ - AttackExposure.prototype.state = 0; - - /** - * AttackExposure exposedHighValueResourcesCount. - * @member {number} exposedHighValueResourcesCount - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @instance - */ - AttackExposure.prototype.exposedHighValueResourcesCount = 0; - - /** - * AttackExposure exposedMediumValueResourcesCount. - * @member {number} exposedMediumValueResourcesCount - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @instance - */ - AttackExposure.prototype.exposedMediumValueResourcesCount = 0; - - /** - * AttackExposure exposedLowValueResourcesCount. - * @member {number} exposedLowValueResourcesCount - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @instance - */ - AttackExposure.prototype.exposedLowValueResourcesCount = 0; - - /** - * Creates a new AttackExposure instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {google.cloud.securitycenter.v1.IAttackExposure=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AttackExposure} AttackExposure instance - */ - AttackExposure.create = function create(properties) { - return new AttackExposure(properties); - }; - - /** - * Encodes the specified AttackExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackExposure.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {google.cloud.securitycenter.v1.IAttackExposure} message AttackExposure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackExposure.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.score); - if (message.latestCalculationTime != null && Object.hasOwnProperty.call(message, "latestCalculationTime")) - $root.google.protobuf.Timestamp.encode(message.latestCalculationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.attackExposureResult != null && Object.hasOwnProperty.call(message, "attackExposureResult")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.attackExposureResult); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.exposedHighValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedHighValueResourcesCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.exposedHighValueResourcesCount); - if (message.exposedMediumValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedMediumValueResourcesCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.exposedMediumValueResourcesCount); - if (message.exposedLowValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedLowValueResourcesCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.exposedLowValueResourcesCount); - return writer; - }; - - /** - * Encodes the specified AttackExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackExposure.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {google.cloud.securitycenter.v1.IAttackExposure} message AttackExposure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackExposure.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackExposure message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AttackExposure} AttackExposure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackExposure.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackExposure(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.double(); - break; - } - case 2: { - message.latestCalculationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.attackExposureResult = reader.string(); - break; - } - case 4: { - message.state = reader.int32(); - break; - } - case 5: { - message.exposedHighValueResourcesCount = reader.int32(); - break; - } - case 6: { - message.exposedMediumValueResourcesCount = reader.int32(); - break; - } - case 7: { - message.exposedLowValueResourcesCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackExposure message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AttackExposure} AttackExposure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackExposure.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackExposure message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackExposure.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - if (message.latestCalculationTime != null && message.hasOwnProperty("latestCalculationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.latestCalculationTime); - if (error) - return "latestCalculationTime." + error; - } - if (message.attackExposureResult != null && message.hasOwnProperty("attackExposureResult")) - if (!$util.isString(message.attackExposureResult)) - return "attackExposureResult: 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.exposedHighValueResourcesCount != null && message.hasOwnProperty("exposedHighValueResourcesCount")) - if (!$util.isInteger(message.exposedHighValueResourcesCount)) - return "exposedHighValueResourcesCount: integer expected"; - if (message.exposedMediumValueResourcesCount != null && message.hasOwnProperty("exposedMediumValueResourcesCount")) - if (!$util.isInteger(message.exposedMediumValueResourcesCount)) - return "exposedMediumValueResourcesCount: integer expected"; - if (message.exposedLowValueResourcesCount != null && message.hasOwnProperty("exposedLowValueResourcesCount")) - if (!$util.isInteger(message.exposedLowValueResourcesCount)) - return "exposedLowValueResourcesCount: integer expected"; - return null; - }; - - /** - * Creates an AttackExposure message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AttackExposure} AttackExposure - */ - AttackExposure.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AttackExposure) - return object; - var message = new $root.google.cloud.securitycenter.v1.AttackExposure(); - if (object.score != null) - message.score = Number(object.score); - if (object.latestCalculationTime != null) { - if (typeof object.latestCalculationTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AttackExposure.latestCalculationTime: object expected"); - message.latestCalculationTime = $root.google.protobuf.Timestamp.fromObject(object.latestCalculationTime); - } - if (object.attackExposureResult != null) - message.attackExposureResult = String(object.attackExposureResult); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CALCULATED": - case 1: - message.state = 1; - break; - case "NOT_CALCULATED": - case 2: - message.state = 2; - break; - } - if (object.exposedHighValueResourcesCount != null) - message.exposedHighValueResourcesCount = object.exposedHighValueResourcesCount | 0; - if (object.exposedMediumValueResourcesCount != null) - message.exposedMediumValueResourcesCount = object.exposedMediumValueResourcesCount | 0; - if (object.exposedLowValueResourcesCount != null) - message.exposedLowValueResourcesCount = object.exposedLowValueResourcesCount | 0; - return message; - }; - - /** - * Creates a plain object from an AttackExposure message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {google.cloud.securitycenter.v1.AttackExposure} message AttackExposure - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackExposure.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.score = 0; - object.latestCalculationTime = null; - object.attackExposureResult = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.exposedHighValueResourcesCount = 0; - object.exposedMediumValueResourcesCount = 0; - object.exposedLowValueResourcesCount = 0; - } - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - if (message.latestCalculationTime != null && message.hasOwnProperty("latestCalculationTime")) - object.latestCalculationTime = $root.google.protobuf.Timestamp.toObject(message.latestCalculationTime, options); - if (message.attackExposureResult != null && message.hasOwnProperty("attackExposureResult")) - object.attackExposureResult = message.attackExposureResult; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.AttackExposure.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.AttackExposure.State[message.state] : message.state; - if (message.exposedHighValueResourcesCount != null && message.hasOwnProperty("exposedHighValueResourcesCount")) - object.exposedHighValueResourcesCount = message.exposedHighValueResourcesCount; - if (message.exposedMediumValueResourcesCount != null && message.hasOwnProperty("exposedMediumValueResourcesCount")) - object.exposedMediumValueResourcesCount = message.exposedMediumValueResourcesCount; - if (message.exposedLowValueResourcesCount != null && message.hasOwnProperty("exposedLowValueResourcesCount")) - object.exposedLowValueResourcesCount = message.exposedLowValueResourcesCount; - return object; - }; - - /** - * Converts this AttackExposure to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @instance - * @returns {Object.} JSON object - */ - AttackExposure.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackExposure - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AttackExposure - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackExposure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackExposure"; - }; - - /** - * State enum. - * @name google.cloud.securitycenter.v1.AttackExposure.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CALCULATED=1 CALCULATED value - * @property {number} NOT_CALCULATED=2 NOT_CALCULATED value - */ - AttackExposure.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CALCULATED"] = 1; - values[valuesById[2] = "NOT_CALCULATED"] = 2; - return values; - })(); - - return AttackExposure; - })(); - - v1.AttackPath = (function() { - - /** - * Properties of an AttackPath. - * @memberof google.cloud.securitycenter.v1 - * @interface IAttackPath - * @property {string|null} [name] AttackPath name - * @property {Array.|null} [pathNodes] AttackPath pathNodes - * @property {Array.|null} [edges] AttackPath edges - */ - - /** - * Constructs a new AttackPath. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an AttackPath. - * @implements IAttackPath - * @constructor - * @param {google.cloud.securitycenter.v1.IAttackPath=} [properties] Properties to set - */ - function AttackPath(properties) { - this.pathNodes = []; - this.edges = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackPath name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.AttackPath - * @instance - */ - AttackPath.prototype.name = ""; - - /** - * AttackPath pathNodes. - * @member {Array.} pathNodes - * @memberof google.cloud.securitycenter.v1.AttackPath - * @instance - */ - AttackPath.prototype.pathNodes = $util.emptyArray; - - /** - * AttackPath edges. - * @member {Array.} edges - * @memberof google.cloud.securitycenter.v1.AttackPath - * @instance - */ - AttackPath.prototype.edges = $util.emptyArray; - - /** - * Creates a new AttackPath instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {google.cloud.securitycenter.v1.IAttackPath=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AttackPath} AttackPath instance - */ - AttackPath.create = function create(properties) { - return new AttackPath(properties); - }; - - /** - * Encodes the specified AttackPath message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {google.cloud.securitycenter.v1.IAttackPath} message AttackPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPath.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.pathNodes != null && message.pathNodes.length) - for (var i = 0; i < message.pathNodes.length; ++i) - $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.encode(message.pathNodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edges != null && message.edges.length) - for (var i = 0; i < message.edges.length; ++i) - $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.encode(message.edges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttackPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {google.cloud.securitycenter.v1.IAttackPath} message AttackPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackPath message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AttackPath} AttackPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPath.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.pathNodes && message.pathNodes.length)) - message.pathNodes = []; - message.pathNodes.push($root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.edges && message.edges.length)) - message.edges = []; - message.edges.push($root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackPath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AttackPath} AttackPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackPath message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackPath.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.pathNodes != null && message.hasOwnProperty("pathNodes")) { - if (!Array.isArray(message.pathNodes)) - return "pathNodes: array expected"; - for (var i = 0; i < message.pathNodes.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify(message.pathNodes[i]); - if (error) - return "pathNodes." + error; - } - } - if (message.edges != null && message.hasOwnProperty("edges")) { - if (!Array.isArray(message.edges)) - return "edges: array expected"; - for (var i = 0; i < message.edges.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify(message.edges[i]); - if (error) - return "edges." + error; - } - } - return null; - }; - - /** - * Creates an AttackPath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AttackPath} AttackPath - */ - AttackPath.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath) - return object; - var message = new $root.google.cloud.securitycenter.v1.AttackPath(); - if (object.name != null) - message.name = String(object.name); - if (object.pathNodes) { - if (!Array.isArray(object.pathNodes)) - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.pathNodes: array expected"); - message.pathNodes = []; - for (var i = 0; i < object.pathNodes.length; ++i) { - if (typeof object.pathNodes[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.pathNodes: object expected"); - message.pathNodes[i] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.fromObject(object.pathNodes[i]); - } - } - if (object.edges) { - if (!Array.isArray(object.edges)) - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.edges: array expected"); - message.edges = []; - for (var i = 0; i < object.edges.length; ++i) { - if (typeof object.edges[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.edges: object expected"); - message.edges[i] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.fromObject(object.edges[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AttackPath message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {google.cloud.securitycenter.v1.AttackPath} message AttackPath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackPath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pathNodes = []; - object.edges = []; - } - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pathNodes && message.pathNodes.length) { - object.pathNodes = []; - for (var j = 0; j < message.pathNodes.length; ++j) - object.pathNodes[j] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.toObject(message.pathNodes[j], options); - } - if (message.edges && message.edges.length) { - object.edges = []; - for (var j = 0; j < message.edges.length; ++j) - object.edges[j] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.toObject(message.edges[j], options); - } - return object; - }; - - /** - * Converts this AttackPath to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AttackPath - * @instance - * @returns {Object.} JSON object - */ - AttackPath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackPath - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AttackPath - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath"; - }; - - AttackPath.AttackPathNode = (function() { - - /** - * Properties of an AttackPathNode. - * @memberof google.cloud.securitycenter.v1.AttackPath - * @interface IAttackPathNode - * @property {string|null} [resource] AttackPathNode resource - * @property {string|null} [resourceType] AttackPathNode resourceType - * @property {string|null} [displayName] AttackPathNode displayName - * @property {Array.|null} [associatedFindings] AttackPathNode associatedFindings - * @property {string|null} [uuid] AttackPathNode uuid - * @property {Array.|null} [attackSteps] AttackPathNode attackSteps - */ - - /** - * Constructs a new AttackPathNode. - * @memberof google.cloud.securitycenter.v1.AttackPath - * @classdesc Represents an AttackPathNode. - * @implements IAttackPathNode - * @constructor - * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathNode=} [properties] Properties to set - */ - function AttackPathNode(properties) { - this.associatedFindings = []; - this.attackSteps = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackPathNode resource. - * @member {string} resource - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.resource = ""; - - /** - * AttackPathNode resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.resourceType = ""; - - /** - * AttackPathNode displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.displayName = ""; - - /** - * AttackPathNode associatedFindings. - * @member {Array.} associatedFindings - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.associatedFindings = $util.emptyArray; - - /** - * AttackPathNode uuid. - * @member {string} uuid - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.uuid = ""; - - /** - * AttackPathNode attackSteps. - * @member {Array.} attackSteps - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.attackSteps = $util.emptyArray; - - /** - * Creates a new AttackPathNode instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathNode=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} AttackPathNode instance - */ - AttackPathNode.create = function create(properties) { - return new AttackPathNode(properties); - }; - - /** - * Encodes the specified AttackPathNode message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathNode} message AttackPathNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPathNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.associatedFindings != null && message.associatedFindings.length) - for (var i = 0; i < message.associatedFindings.length; ++i) - $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.encode(message.associatedFindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.uuid); - if (message.attackSteps != null && message.attackSteps.length) - for (var i = 0; i < message.attackSteps.length; ++i) - $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.encode(message.attackSteps[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttackPathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathNode} message AttackPathNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPathNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackPathNode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} AttackPathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPathNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.resourceType = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - if (!(message.associatedFindings && message.associatedFindings.length)) - message.associatedFindings = []; - message.associatedFindings.push($root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.decode(reader, reader.uint32())); - break; - } - case 5: { - message.uuid = reader.string(); - break; - } - case 6: { - if (!(message.attackSteps && message.attackSteps.length)) - message.attackSteps = []; - message.attackSteps.push($root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackPathNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} AttackPathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPathNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackPathNode message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackPathNode.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.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.associatedFindings != null && message.hasOwnProperty("associatedFindings")) { - if (!Array.isArray(message.associatedFindings)) - return "associatedFindings: array expected"; - for (var i = 0; i < message.associatedFindings.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify(message.associatedFindings[i]); - if (error) - return "associatedFindings." + error; - } - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: string expected"; - if (message.attackSteps != null && message.hasOwnProperty("attackSteps")) { - if (!Array.isArray(message.attackSteps)) - return "attackSteps: array expected"; - for (var i = 0; i < message.attackSteps.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify(message.attackSteps[i]); - if (error) - return "attackSteps." + error; - } - } - return null; - }; - - /** - * Creates an AttackPathNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} AttackPathNode - */ - AttackPathNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode) - return object; - var message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.associatedFindings) { - if (!Array.isArray(object.associatedFindings)) - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.associatedFindings: array expected"); - message.associatedFindings = []; - for (var i = 0; i < object.associatedFindings.length; ++i) { - if (typeof object.associatedFindings[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.associatedFindings: object expected"); - message.associatedFindings[i] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.fromObject(object.associatedFindings[i]); - } - } - if (object.uuid != null) - message.uuid = String(object.uuid); - if (object.attackSteps) { - if (!Array.isArray(object.attackSteps)) - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.attackSteps: array expected"); - message.attackSteps = []; - for (var i = 0; i < object.attackSteps.length; ++i) { - if (typeof object.attackSteps[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.attackSteps: object expected"); - message.attackSteps[i] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.fromObject(object.attackSteps[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AttackPathNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode} message AttackPathNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackPathNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.associatedFindings = []; - object.attackSteps = []; - } - if (options.defaults) { - object.resource = ""; - object.resourceType = ""; - object.displayName = ""; - object.uuid = ""; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.associatedFindings && message.associatedFindings.length) { - object.associatedFindings = []; - for (var j = 0; j < message.associatedFindings.length; ++j) - object.associatedFindings[j] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.toObject(message.associatedFindings[j], options); - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - if (message.attackSteps && message.attackSteps.length) { - object.attackSteps = []; - for (var j = 0; j < message.attackSteps.length; ++j) - object.attackSteps[j] = $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.toObject(message.attackSteps[j], options); - } - return object; - }; - - /** - * Converts this AttackPathNode to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @instance - * @returns {Object.} JSON object - */ - AttackPathNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackPathNode - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackPathNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath.AttackPathNode"; - }; - - AttackPathNode.PathNodeAssociatedFinding = (function() { - - /** - * Properties of a PathNodeAssociatedFinding. - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @interface IPathNodeAssociatedFinding - * @property {string|null} [canonicalFinding] PathNodeAssociatedFinding canonicalFinding - * @property {string|null} [findingCategory] PathNodeAssociatedFinding findingCategory - * @property {string|null} [name] PathNodeAssociatedFinding name - */ - - /** - * Constructs a new PathNodeAssociatedFinding. - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @classdesc Represents a PathNodeAssociatedFinding. - * @implements IPathNodeAssociatedFinding - * @constructor - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding=} [properties] Properties to set - */ - function PathNodeAssociatedFinding(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PathNodeAssociatedFinding canonicalFinding. - * @member {string} canonicalFinding - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @instance - */ - PathNodeAssociatedFinding.prototype.canonicalFinding = ""; - - /** - * PathNodeAssociatedFinding findingCategory. - * @member {string} findingCategory - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @instance - */ - PathNodeAssociatedFinding.prototype.findingCategory = ""; - - /** - * PathNodeAssociatedFinding name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @instance - */ - PathNodeAssociatedFinding.prototype.name = ""; - - /** - * Creates a new PathNodeAssociatedFinding instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding instance - */ - PathNodeAssociatedFinding.create = function create(properties) { - return new PathNodeAssociatedFinding(properties); - }; - - /** - * Encodes the specified PathNodeAssociatedFinding message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding} message PathNodeAssociatedFinding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PathNodeAssociatedFinding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.canonicalFinding != null && Object.hasOwnProperty.call(message, "canonicalFinding")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.canonicalFinding); - if (message.findingCategory != null && Object.hasOwnProperty.call(message, "findingCategory")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingCategory); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - return writer; - }; - - /** - * Encodes the specified PathNodeAssociatedFinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IPathNodeAssociatedFinding} message PathNodeAssociatedFinding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PathNodeAssociatedFinding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PathNodeAssociatedFinding.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.canonicalFinding = reader.string(); - break; - } - case 2: { - message.findingCategory = reader.string(); - break; - } - case 3: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PathNodeAssociatedFinding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PathNodeAssociatedFinding message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PathNodeAssociatedFinding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.canonicalFinding != null && message.hasOwnProperty("canonicalFinding")) - if (!$util.isString(message.canonicalFinding)) - return "canonicalFinding: string expected"; - if (message.findingCategory != null && message.hasOwnProperty("findingCategory")) - if (!$util.isString(message.findingCategory)) - return "findingCategory: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a PathNodeAssociatedFinding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding - */ - PathNodeAssociatedFinding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding) - return object; - var message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding(); - if (object.canonicalFinding != null) - message.canonicalFinding = String(object.canonicalFinding); - if (object.findingCategory != null) - message.findingCategory = String(object.findingCategory); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a PathNodeAssociatedFinding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding} message PathNodeAssociatedFinding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PathNodeAssociatedFinding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.canonicalFinding = ""; - object.findingCategory = ""; - object.name = ""; - } - if (message.canonicalFinding != null && message.hasOwnProperty("canonicalFinding")) - object.canonicalFinding = message.canonicalFinding; - if (message.findingCategory != null && message.hasOwnProperty("findingCategory")) - object.findingCategory = message.findingCategory; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this PathNodeAssociatedFinding to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @instance - * @returns {Object.} JSON object - */ - PathNodeAssociatedFinding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PathNodeAssociatedFinding - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PathNodeAssociatedFinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding"; - }; - - return PathNodeAssociatedFinding; - })(); - - /** - * NodeType enum. - * @name google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType - * @enum {number} - * @property {number} NODE_TYPE_UNSPECIFIED=0 NODE_TYPE_UNSPECIFIED value - * @property {number} NODE_TYPE_AND=1 NODE_TYPE_AND value - * @property {number} NODE_TYPE_OR=2 NODE_TYPE_OR value - * @property {number} NODE_TYPE_DEFENSE=3 NODE_TYPE_DEFENSE value - * @property {number} NODE_TYPE_ATTACKER=4 NODE_TYPE_ATTACKER value - */ - AttackPathNode.NodeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NODE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NODE_TYPE_AND"] = 1; - values[valuesById[2] = "NODE_TYPE_OR"] = 2; - values[valuesById[3] = "NODE_TYPE_DEFENSE"] = 3; - values[valuesById[4] = "NODE_TYPE_ATTACKER"] = 4; - return values; - })(); - - AttackPathNode.AttackStepNode = (function() { - - /** - * Properties of an AttackStepNode. - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @interface IAttackStepNode - * @property {string|null} [uuid] AttackStepNode uuid - * @property {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType|null} [type] AttackStepNode type - * @property {string|null} [displayName] AttackStepNode displayName - * @property {Object.|null} [labels] AttackStepNode labels - * @property {string|null} [description] AttackStepNode description - */ - - /** - * Constructs a new AttackStepNode. - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode - * @classdesc Represents an AttackStepNode. - * @implements IAttackStepNode - * @constructor - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode=} [properties] Properties to set - */ - function AttackStepNode(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackStepNode uuid. - * @member {string} uuid - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.uuid = ""; - - /** - * AttackStepNode type. - * @member {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType} type - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.type = 0; - - /** - * AttackStepNode displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.displayName = ""; - - /** - * AttackStepNode labels. - * @member {Object.} labels - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.labels = $util.emptyObject; - - /** - * AttackStepNode description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.description = ""; - - /** - * Creates a new AttackStepNode instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode instance - */ - AttackStepNode.create = function create(properties) { - return new AttackStepNode(properties); - }; - - /** - * Encodes the specified AttackStepNode message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode} message AttackStepNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackStepNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uuid); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - return writer; - }; - - /** - * Encodes the specified AttackStepNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.IAttackStepNode} message AttackStepNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackStepNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackStepNode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackStepNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.uuid = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - 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.labels[key] = value; - break; - } - case 5: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackStepNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackStepNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackStepNode message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackStepNode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates an AttackStepNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode - */ - AttackStepNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode) - return object; - var message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode(); - if (object.uuid != null) - message.uuid = String(object.uuid); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "NODE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "NODE_TYPE_AND": - case 1: - message.type = 1; - break; - case "NODE_TYPE_OR": - case 2: - message.type = 2; - break; - case "NODE_TYPE_DEFENSE": - case 3: - message.type = 3; - break; - case "NODE_TYPE_ATTACKER": - case 4: - message.type = 4; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from an AttackStepNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode} message AttackStepNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackStepNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.uuid = ""; - object.type = options.enums === String ? "NODE_TYPE_UNSPECIFIED" : 0; - object.displayName = ""; - object.description = ""; - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType[message.type] : message.type; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this AttackStepNode to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @instance - * @returns {Object.} JSON object - */ - AttackStepNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackStepNode - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackStepNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode"; - }; - - return AttackStepNode; - })(); - - return AttackPathNode; - })(); - - AttackPath.AttackPathEdge = (function() { - - /** - * Properties of an AttackPathEdge. - * @memberof google.cloud.securitycenter.v1.AttackPath - * @interface IAttackPathEdge - * @property {string|null} [source] AttackPathEdge source - * @property {string|null} [destination] AttackPathEdge destination - */ - - /** - * Constructs a new AttackPathEdge. - * @memberof google.cloud.securitycenter.v1.AttackPath - * @classdesc Represents an AttackPathEdge. - * @implements IAttackPathEdge - * @constructor - * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge=} [properties] Properties to set - */ - function AttackPathEdge(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackPathEdge source. - * @member {string} source - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @instance - */ - AttackPathEdge.prototype.source = ""; - - /** - * AttackPathEdge destination. - * @member {string} destination - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @instance - */ - AttackPathEdge.prototype.destination = ""; - - /** - * Creates a new AttackPathEdge instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} AttackPathEdge instance - */ - AttackPathEdge.create = function create(properties) { - return new AttackPathEdge(properties); - }; - - /** - * Encodes the specified AttackPathEdge message. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge} message AttackPathEdge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPathEdge.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.destination != null && Object.hasOwnProperty.call(message, "destination")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.destination); - return writer; - }; - - /** - * Encodes the specified AttackPathEdge message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AttackPath.AttackPathEdge.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.IAttackPathEdge} message AttackPathEdge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPathEdge.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackPathEdge message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} AttackPathEdge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPathEdge.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.source = reader.string(); - break; - } - case 2: { - message.destination = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackPathEdge message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} AttackPathEdge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPathEdge.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackPathEdge message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackPathEdge.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.destination != null && message.hasOwnProperty("destination")) - if (!$util.isString(message.destination)) - return "destination: string expected"; - return null; - }; - - /** - * Creates an AttackPathEdge message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} AttackPathEdge - */ - AttackPathEdge.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge) - return object; - var message = new $root.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge(); - if (object.source != null) - message.source = String(object.source); - if (object.destination != null) - message.destination = String(object.destination); - return message; - }; - - /** - * Creates a plain object from an AttackPathEdge message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {google.cloud.securitycenter.v1.AttackPath.AttackPathEdge} message AttackPathEdge - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackPathEdge.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.source = ""; - object.destination = ""; - } - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = message.destination; - return object; - }; - - /** - * Converts this AttackPathEdge to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @instance - * @returns {Object.} JSON object - */ - AttackPathEdge.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackPathEdge - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AttackPath.AttackPathEdge - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackPathEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AttackPath.AttackPathEdge"; - }; - - return AttackPathEdge; - })(); - - return AttackPath; - })(); - - v1.BackupDisasterRecovery = (function() { - - /** - * Properties of a BackupDisasterRecovery. - * @memberof google.cloud.securitycenter.v1 - * @interface IBackupDisasterRecovery - * @property {string|null} [backupTemplate] BackupDisasterRecovery backupTemplate - * @property {Array.|null} [policies] BackupDisasterRecovery policies - * @property {string|null} [host] BackupDisasterRecovery host - * @property {Array.|null} [applications] BackupDisasterRecovery applications - * @property {string|null} [storagePool] BackupDisasterRecovery storagePool - * @property {Array.|null} [policyOptions] BackupDisasterRecovery policyOptions - * @property {string|null} [profile] BackupDisasterRecovery profile - * @property {string|null} [appliance] BackupDisasterRecovery appliance - * @property {string|null} [backupType] BackupDisasterRecovery backupType - * @property {google.protobuf.ITimestamp|null} [backupCreateTime] BackupDisasterRecovery backupCreateTime - */ - - /** - * Constructs a new BackupDisasterRecovery. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a BackupDisasterRecovery. - * @implements IBackupDisasterRecovery - * @constructor - * @param {google.cloud.securitycenter.v1.IBackupDisasterRecovery=} [properties] Properties to set - */ - function BackupDisasterRecovery(properties) { - this.policies = []; - this.applications = []; - this.policyOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupDisasterRecovery backupTemplate. - * @member {string} backupTemplate - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.backupTemplate = ""; - - /** - * BackupDisasterRecovery policies. - * @member {Array.} policies - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.policies = $util.emptyArray; - - /** - * BackupDisasterRecovery host. - * @member {string} host - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.host = ""; - - /** - * BackupDisasterRecovery applications. - * @member {Array.} applications - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.applications = $util.emptyArray; - - /** - * BackupDisasterRecovery storagePool. - * @member {string} storagePool - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.storagePool = ""; - - /** - * BackupDisasterRecovery policyOptions. - * @member {Array.} policyOptions - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.policyOptions = $util.emptyArray; - - /** - * BackupDisasterRecovery profile. - * @member {string} profile - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.profile = ""; - - /** - * BackupDisasterRecovery appliance. - * @member {string} appliance - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.appliance = ""; - - /** - * BackupDisasterRecovery backupType. - * @member {string} backupType - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.backupType = ""; - - /** - * BackupDisasterRecovery backupCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} backupCreateTime - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.backupCreateTime = null; - - /** - * Creates a new BackupDisasterRecovery instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {google.cloud.securitycenter.v1.IBackupDisasterRecovery=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.BackupDisasterRecovery} BackupDisasterRecovery instance - */ - BackupDisasterRecovery.create = function create(properties) { - return new BackupDisasterRecovery(properties); - }; - - /** - * Encodes the specified BackupDisasterRecovery message. Does not implicitly {@link google.cloud.securitycenter.v1.BackupDisasterRecovery.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {google.cloud.securitycenter.v1.IBackupDisasterRecovery} message BackupDisasterRecovery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDisasterRecovery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupTemplate != null && Object.hasOwnProperty.call(message, "backupTemplate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupTemplate); - if (message.policies != null && message.policies.length) - for (var i = 0; i < message.policies.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.policies[i]); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.host); - if (message.applications != null && message.applications.length) - for (var i = 0; i < message.applications.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.applications[i]); - if (message.storagePool != null && Object.hasOwnProperty.call(message, "storagePool")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.storagePool); - if (message.policyOptions != null && message.policyOptions.length) - for (var i = 0; i < message.policyOptions.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.policyOptions[i]); - if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.profile); - if (message.appliance != null && Object.hasOwnProperty.call(message, "appliance")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.appliance); - if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.backupType); - if (message.backupCreateTime != null && Object.hasOwnProperty.call(message, "backupCreateTime")) - $root.google.protobuf.Timestamp.encode(message.backupCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupDisasterRecovery message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BackupDisasterRecovery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {google.cloud.securitycenter.v1.IBackupDisasterRecovery} message BackupDisasterRecovery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDisasterRecovery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupDisasterRecovery message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.BackupDisasterRecovery} BackupDisasterRecovery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDisasterRecovery.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BackupDisasterRecovery(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupTemplate = reader.string(); - break; - } - case 2: { - if (!(message.policies && message.policies.length)) - message.policies = []; - message.policies.push(reader.string()); - break; - } - case 3: { - message.host = reader.string(); - break; - } - case 4: { - if (!(message.applications && message.applications.length)) - message.applications = []; - message.applications.push(reader.string()); - break; - } - case 5: { - message.storagePool = reader.string(); - break; - } - case 6: { - if (!(message.policyOptions && message.policyOptions.length)) - message.policyOptions = []; - message.policyOptions.push(reader.string()); - break; - } - case 7: { - message.profile = reader.string(); - break; - } - case 8: { - message.appliance = reader.string(); - break; - } - case 9: { - message.backupType = reader.string(); - break; - } - case 10: { - message.backupCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupDisasterRecovery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.BackupDisasterRecovery} BackupDisasterRecovery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDisasterRecovery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupDisasterRecovery message. - * @function verify - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupDisasterRecovery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupTemplate != null && message.hasOwnProperty("backupTemplate")) - if (!$util.isString(message.backupTemplate)) - return "backupTemplate: string expected"; - if (message.policies != null && message.hasOwnProperty("policies")) { - if (!Array.isArray(message.policies)) - return "policies: array expected"; - for (var i = 0; i < message.policies.length; ++i) - if (!$util.isString(message.policies[i])) - return "policies: string[] expected"; - } - if (message.host != null && message.hasOwnProperty("host")) - if (!$util.isString(message.host)) - return "host: string expected"; - if (message.applications != null && message.hasOwnProperty("applications")) { - if (!Array.isArray(message.applications)) - return "applications: array expected"; - for (var i = 0; i < message.applications.length; ++i) - if (!$util.isString(message.applications[i])) - return "applications: string[] expected"; - } - if (message.storagePool != null && message.hasOwnProperty("storagePool")) - if (!$util.isString(message.storagePool)) - return "storagePool: string expected"; - if (message.policyOptions != null && message.hasOwnProperty("policyOptions")) { - if (!Array.isArray(message.policyOptions)) - return "policyOptions: array expected"; - for (var i = 0; i < message.policyOptions.length; ++i) - if (!$util.isString(message.policyOptions[i])) - return "policyOptions: string[] expected"; - } - if (message.profile != null && message.hasOwnProperty("profile")) - if (!$util.isString(message.profile)) - return "profile: string expected"; - if (message.appliance != null && message.hasOwnProperty("appliance")) - if (!$util.isString(message.appliance)) - return "appliance: string expected"; - if (message.backupType != null && message.hasOwnProperty("backupType")) - if (!$util.isString(message.backupType)) - return "backupType: string expected"; - if (message.backupCreateTime != null && message.hasOwnProperty("backupCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.backupCreateTime); - if (error) - return "backupCreateTime." + error; - } - return null; - }; - - /** - * Creates a BackupDisasterRecovery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.BackupDisasterRecovery} BackupDisasterRecovery - */ - BackupDisasterRecovery.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.BackupDisasterRecovery) - return object; - var message = new $root.google.cloud.securitycenter.v1.BackupDisasterRecovery(); - if (object.backupTemplate != null) - message.backupTemplate = String(object.backupTemplate); - if (object.policies) { - if (!Array.isArray(object.policies)) - throw TypeError(".google.cloud.securitycenter.v1.BackupDisasterRecovery.policies: array expected"); - message.policies = []; - for (var i = 0; i < object.policies.length; ++i) - message.policies[i] = String(object.policies[i]); - } - if (object.host != null) - message.host = String(object.host); - if (object.applications) { - if (!Array.isArray(object.applications)) - throw TypeError(".google.cloud.securitycenter.v1.BackupDisasterRecovery.applications: array expected"); - message.applications = []; - for (var i = 0; i < object.applications.length; ++i) - message.applications[i] = String(object.applications[i]); - } - if (object.storagePool != null) - message.storagePool = String(object.storagePool); - if (object.policyOptions) { - if (!Array.isArray(object.policyOptions)) - throw TypeError(".google.cloud.securitycenter.v1.BackupDisasterRecovery.policyOptions: array expected"); - message.policyOptions = []; - for (var i = 0; i < object.policyOptions.length; ++i) - message.policyOptions[i] = String(object.policyOptions[i]); - } - if (object.profile != null) - message.profile = String(object.profile); - if (object.appliance != null) - message.appliance = String(object.appliance); - if (object.backupType != null) - message.backupType = String(object.backupType); - if (object.backupCreateTime != null) { - if (typeof object.backupCreateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.BackupDisasterRecovery.backupCreateTime: object expected"); - message.backupCreateTime = $root.google.protobuf.Timestamp.fromObject(object.backupCreateTime); - } - return message; - }; - - /** - * Creates a plain object from a BackupDisasterRecovery message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {google.cloud.securitycenter.v1.BackupDisasterRecovery} message BackupDisasterRecovery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupDisasterRecovery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.policies = []; - object.applications = []; - object.policyOptions = []; - } - if (options.defaults) { - object.backupTemplate = ""; - object.host = ""; - object.storagePool = ""; - object.profile = ""; - object.appliance = ""; - object.backupType = ""; - object.backupCreateTime = null; - } - if (message.backupTemplate != null && message.hasOwnProperty("backupTemplate")) - object.backupTemplate = message.backupTemplate; - if (message.policies && message.policies.length) { - object.policies = []; - for (var j = 0; j < message.policies.length; ++j) - object.policies[j] = message.policies[j]; - } - if (message.host != null && message.hasOwnProperty("host")) - object.host = message.host; - if (message.applications && message.applications.length) { - object.applications = []; - for (var j = 0; j < message.applications.length; ++j) - object.applications[j] = message.applications[j]; - } - if (message.storagePool != null && message.hasOwnProperty("storagePool")) - object.storagePool = message.storagePool; - if (message.policyOptions && message.policyOptions.length) { - object.policyOptions = []; - for (var j = 0; j < message.policyOptions.length; ++j) - object.policyOptions[j] = message.policyOptions[j]; - } - if (message.profile != null && message.hasOwnProperty("profile")) - object.profile = message.profile; - if (message.appliance != null && message.hasOwnProperty("appliance")) - object.appliance = message.appliance; - if (message.backupType != null && message.hasOwnProperty("backupType")) - object.backupType = message.backupType; - if (message.backupCreateTime != null && message.hasOwnProperty("backupCreateTime")) - object.backupCreateTime = $root.google.protobuf.Timestamp.toObject(message.backupCreateTime, options); - return object; - }; - - /** - * Converts this BackupDisasterRecovery to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @instance - * @returns {Object.} JSON object - */ - BackupDisasterRecovery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupDisasterRecovery - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.BackupDisasterRecovery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupDisasterRecovery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.BackupDisasterRecovery"; - }; - - return BackupDisasterRecovery; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.Chokepoint = (function() { - - /** - * Properties of a Chokepoint. - * @memberof google.cloud.securitycenter.v1 - * @interface IChokepoint - * @property {Array.|null} [relatedFindings] Chokepoint relatedFindings - */ - - /** - * Constructs a new Chokepoint. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Chokepoint. - * @implements IChokepoint - * @constructor - * @param {google.cloud.securitycenter.v1.IChokepoint=} [properties] Properties to set - */ - function Chokepoint(properties) { - this.relatedFindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Chokepoint relatedFindings. - * @member {Array.} relatedFindings - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @instance - */ - Chokepoint.prototype.relatedFindings = $util.emptyArray; - - /** - * Creates a new Chokepoint instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {google.cloud.securitycenter.v1.IChokepoint=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint instance - */ - Chokepoint.create = function create(properties) { - return new Chokepoint(properties); - }; - - /** - * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {google.cloud.securitycenter.v1.IChokepoint} message Chokepoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chokepoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.relatedFindings != null && message.relatedFindings.length) - for (var i = 0; i < message.relatedFindings.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.relatedFindings[i]); - return writer; - }; - - /** - * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {google.cloud.securitycenter.v1.IChokepoint} message Chokepoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chokepoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chokepoint message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chokepoint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Chokepoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.relatedFindings && message.relatedFindings.length)) - message.relatedFindings = []; - message.relatedFindings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chokepoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chokepoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chokepoint message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chokepoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { - if (!Array.isArray(message.relatedFindings)) - return "relatedFindings: array expected"; - for (var i = 0; i < message.relatedFindings.length; ++i) - if (!$util.isString(message.relatedFindings[i])) - return "relatedFindings: string[] expected"; - } - return null; - }; - - /** - * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint - */ - Chokepoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Chokepoint) - return object; - var message = new $root.google.cloud.securitycenter.v1.Chokepoint(); - if (object.relatedFindings) { - if (!Array.isArray(object.relatedFindings)) - throw TypeError(".google.cloud.securitycenter.v1.Chokepoint.relatedFindings: array expected"); - message.relatedFindings = []; - for (var i = 0; i < object.relatedFindings.length; ++i) - message.relatedFindings[i] = String(object.relatedFindings[i]); - } - return message; - }; - - /** - * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {google.cloud.securitycenter.v1.Chokepoint} message Chokepoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chokepoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.relatedFindings = []; - if (message.relatedFindings && message.relatedFindings.length) { - object.relatedFindings = []; - for (var j = 0; j < message.relatedFindings.length; ++j) - object.relatedFindings[j] = message.relatedFindings[j]; - } - return object; - }; - - /** - * Converts this Chokepoint to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @instance - * @returns {Object.} JSON object - */ - Chokepoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Chokepoint - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Chokepoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Chokepoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Chokepoint"; - }; - - return Chokepoint; - })(); - - v1.CloudArmor = (function() { - - /** - * Properties of a CloudArmor. - * @memberof google.cloud.securitycenter.v1 - * @interface ICloudArmor - * @property {google.cloud.securitycenter.v1.ISecurityPolicy|null} [securityPolicy] CloudArmor securityPolicy - * @property {google.cloud.securitycenter.v1.IRequests|null} [requests] CloudArmor requests - * @property {google.cloud.securitycenter.v1.IAdaptiveProtection|null} [adaptiveProtection] CloudArmor adaptiveProtection - * @property {google.cloud.securitycenter.v1.IAttack|null} [attack] CloudArmor attack - * @property {string|null} [threatVector] CloudArmor threatVector - * @property {google.protobuf.IDuration|null} [duration] CloudArmor duration - */ - - /** - * Constructs a new CloudArmor. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CloudArmor. - * @implements ICloudArmor - * @constructor - * @param {google.cloud.securitycenter.v1.ICloudArmor=} [properties] Properties to set - */ - function CloudArmor(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudArmor securityPolicy. - * @member {google.cloud.securitycenter.v1.ISecurityPolicy|null|undefined} securityPolicy - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @instance - */ - CloudArmor.prototype.securityPolicy = null; - - /** - * CloudArmor requests. - * @member {google.cloud.securitycenter.v1.IRequests|null|undefined} requests - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @instance - */ - CloudArmor.prototype.requests = null; - - /** - * CloudArmor adaptiveProtection. - * @member {google.cloud.securitycenter.v1.IAdaptiveProtection|null|undefined} adaptiveProtection - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @instance - */ - CloudArmor.prototype.adaptiveProtection = null; - - /** - * CloudArmor attack. - * @member {google.cloud.securitycenter.v1.IAttack|null|undefined} attack - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @instance - */ - CloudArmor.prototype.attack = null; - - /** - * CloudArmor threatVector. - * @member {string} threatVector - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @instance - */ - CloudArmor.prototype.threatVector = ""; - - /** - * CloudArmor duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @instance - */ - CloudArmor.prototype.duration = null; - - /** - * Creates a new CloudArmor instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {google.cloud.securitycenter.v1.ICloudArmor=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CloudArmor} CloudArmor instance - */ - CloudArmor.create = function create(properties) { - return new CloudArmor(properties); - }; - - /** - * Encodes the specified CloudArmor message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudArmor.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {google.cloud.securitycenter.v1.ICloudArmor} message CloudArmor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudArmor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) - $root.google.cloud.securitycenter.v1.SecurityPolicy.encode(message.securityPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) - $root.google.cloud.securitycenter.v1.Requests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.adaptiveProtection != null && Object.hasOwnProperty.call(message, "adaptiveProtection")) - $root.google.cloud.securitycenter.v1.AdaptiveProtection.encode(message.adaptiveProtection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.attack != null && Object.hasOwnProperty.call(message, "attack")) - $root.google.cloud.securitycenter.v1.Attack.encode(message.attack, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.threatVector != null && Object.hasOwnProperty.call(message, "threatVector")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.threatVector); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudArmor message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudArmor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {google.cloud.securitycenter.v1.ICloudArmor} message CloudArmor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudArmor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudArmor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CloudArmor} CloudArmor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudArmor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CloudArmor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.securityPolicy = $root.google.cloud.securitycenter.v1.SecurityPolicy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.requests = $root.google.cloud.securitycenter.v1.Requests.decode(reader, reader.uint32()); - break; - } - case 3: { - message.adaptiveProtection = $root.google.cloud.securitycenter.v1.AdaptiveProtection.decode(reader, reader.uint32()); - break; - } - case 4: { - message.attack = $root.google.cloud.securitycenter.v1.Attack.decode(reader, reader.uint32()); - break; - } - case 5: { - message.threatVector = reader.string(); - break; - } - case 6: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudArmor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CloudArmor} CloudArmor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudArmor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudArmor message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudArmor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) { - var error = $root.google.cloud.securitycenter.v1.SecurityPolicy.verify(message.securityPolicy); - if (error) - return "securityPolicy." + error; - } - if (message.requests != null && message.hasOwnProperty("requests")) { - var error = $root.google.cloud.securitycenter.v1.Requests.verify(message.requests); - if (error) - return "requests." + error; - } - if (message.adaptiveProtection != null && message.hasOwnProperty("adaptiveProtection")) { - var error = $root.google.cloud.securitycenter.v1.AdaptiveProtection.verify(message.adaptiveProtection); - if (error) - return "adaptiveProtection." + error; - } - if (message.attack != null && message.hasOwnProperty("attack")) { - var error = $root.google.cloud.securitycenter.v1.Attack.verify(message.attack); - if (error) - return "attack." + error; - } - if (message.threatVector != null && message.hasOwnProperty("threatVector")) - if (!$util.isString(message.threatVector)) - return "threatVector: string expected"; - 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 CloudArmor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CloudArmor} CloudArmor - */ - CloudArmor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CloudArmor) - return object; - var message = new $root.google.cloud.securitycenter.v1.CloudArmor(); - if (object.securityPolicy != null) { - if (typeof object.securityPolicy !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.securityPolicy: object expected"); - message.securityPolicy = $root.google.cloud.securitycenter.v1.SecurityPolicy.fromObject(object.securityPolicy); - } - if (object.requests != null) { - if (typeof object.requests !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.requests: object expected"); - message.requests = $root.google.cloud.securitycenter.v1.Requests.fromObject(object.requests); - } - if (object.adaptiveProtection != null) { - if (typeof object.adaptiveProtection !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.adaptiveProtection: object expected"); - message.adaptiveProtection = $root.google.cloud.securitycenter.v1.AdaptiveProtection.fromObject(object.adaptiveProtection); - } - if (object.attack != null) { - if (typeof object.attack !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.attack: object expected"); - message.attack = $root.google.cloud.securitycenter.v1.Attack.fromObject(object.attack); - } - if (object.threatVector != null) - message.threatVector = String(object.threatVector); - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CloudArmor.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - return message; - }; - - /** - * Creates a plain object from a CloudArmor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {google.cloud.securitycenter.v1.CloudArmor} message CloudArmor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudArmor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.securityPolicy = null; - object.requests = null; - object.adaptiveProtection = null; - object.attack = null; - object.threatVector = ""; - object.duration = null; - } - if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) - object.securityPolicy = $root.google.cloud.securitycenter.v1.SecurityPolicy.toObject(message.securityPolicy, options); - if (message.requests != null && message.hasOwnProperty("requests")) - object.requests = $root.google.cloud.securitycenter.v1.Requests.toObject(message.requests, options); - if (message.adaptiveProtection != null && message.hasOwnProperty("adaptiveProtection")) - object.adaptiveProtection = $root.google.cloud.securitycenter.v1.AdaptiveProtection.toObject(message.adaptiveProtection, options); - if (message.attack != null && message.hasOwnProperty("attack")) - object.attack = $root.google.cloud.securitycenter.v1.Attack.toObject(message.attack, options); - if (message.threatVector != null && message.hasOwnProperty("threatVector")) - object.threatVector = message.threatVector; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - return object; - }; - - /** - * Converts this CloudArmor to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @instance - * @returns {Object.} JSON object - */ - CloudArmor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudArmor - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CloudArmor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudArmor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudArmor"; - }; - - return CloudArmor; - })(); - - v1.SecurityPolicy = (function() { - - /** - * Properties of a SecurityPolicy. - * @memberof google.cloud.securitycenter.v1 - * @interface ISecurityPolicy - * @property {string|null} [name] SecurityPolicy name - * @property {string|null} [type] SecurityPolicy type - * @property {boolean|null} [preview] SecurityPolicy preview - */ - - /** - * Constructs a new SecurityPolicy. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityPolicy. - * @implements ISecurityPolicy - * @constructor - * @param {google.cloud.securitycenter.v1.ISecurityPolicy=} [properties] Properties to set - */ - function SecurityPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityPolicy name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @instance - */ - SecurityPolicy.prototype.name = ""; - - /** - * SecurityPolicy type. - * @member {string} type - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @instance - */ - SecurityPolicy.prototype.type = ""; - - /** - * SecurityPolicy preview. - * @member {boolean} preview - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @instance - */ - SecurityPolicy.prototype.preview = false; - - /** - * Creates a new SecurityPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {google.cloud.securitycenter.v1.ISecurityPolicy=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SecurityPolicy} SecurityPolicy instance - */ - SecurityPolicy.create = function create(properties) { - return new SecurityPolicy(properties); - }; - - /** - * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {google.cloud.securitycenter.v1.ISecurityPolicy} message SecurityPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.preview != null && Object.hasOwnProperty.call(message, "preview")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.preview); - return writer; - }; - - /** - * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {google.cloud.securitycenter.v1.ISecurityPolicy} message SecurityPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SecurityPolicy} SecurityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - message.preview = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SecurityPolicy} SecurityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityPolicy message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.preview != null && message.hasOwnProperty("preview")) - if (typeof message.preview !== "boolean") - return "preview: boolean expected"; - return null; - }; - - /** - * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SecurityPolicy} SecurityPolicy - */ - SecurityPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SecurityPolicy) - return object; - var message = new $root.google.cloud.securitycenter.v1.SecurityPolicy(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.preview != null) - message.preview = Boolean(object.preview); - return message; - }; - - /** - * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {google.cloud.securitycenter.v1.SecurityPolicy} message SecurityPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = ""; - object.preview = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.preview != null && message.hasOwnProperty("preview")) - object.preview = message.preview; - return object; - }; - - /** - * Converts this SecurityPolicy to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @instance - * @returns {Object.} JSON object - */ - SecurityPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityPolicy - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SecurityPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecurityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityPolicy"; - }; - - return SecurityPolicy; - })(); - - v1.Requests = (function() { - - /** - * Properties of a Requests. - * @memberof google.cloud.securitycenter.v1 - * @interface IRequests - * @property {number|null} [ratio] Requests ratio - * @property {number|null} [shortTermAllowed] Requests shortTermAllowed - * @property {number|null} [longTermAllowed] Requests longTermAllowed - * @property {number|null} [longTermDenied] Requests longTermDenied - */ - - /** - * Constructs a new Requests. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Requests. - * @implements IRequests - * @constructor - * @param {google.cloud.securitycenter.v1.IRequests=} [properties] Properties to set - */ - function Requests(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Requests ratio. - * @member {number} ratio - * @memberof google.cloud.securitycenter.v1.Requests - * @instance - */ - Requests.prototype.ratio = 0; - - /** - * Requests shortTermAllowed. - * @member {number} shortTermAllowed - * @memberof google.cloud.securitycenter.v1.Requests - * @instance - */ - Requests.prototype.shortTermAllowed = 0; - - /** - * Requests longTermAllowed. - * @member {number} longTermAllowed - * @memberof google.cloud.securitycenter.v1.Requests - * @instance - */ - Requests.prototype.longTermAllowed = 0; - - /** - * Requests longTermDenied. - * @member {number} longTermDenied - * @memberof google.cloud.securitycenter.v1.Requests - * @instance - */ - Requests.prototype.longTermDenied = 0; - - /** - * Creates a new Requests instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {google.cloud.securitycenter.v1.IRequests=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Requests} Requests instance - */ - Requests.create = function create(properties) { - return new Requests(properties); - }; - - /** - * Encodes the specified Requests message. Does not implicitly {@link google.cloud.securitycenter.v1.Requests.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {google.cloud.securitycenter.v1.IRequests} message Requests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Requests.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.ratio); - if (message.shortTermAllowed != null && Object.hasOwnProperty.call(message, "shortTermAllowed")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.shortTermAllowed); - if (message.longTermAllowed != null && Object.hasOwnProperty.call(message, "longTermAllowed")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.longTermAllowed); - if (message.longTermDenied != null && Object.hasOwnProperty.call(message, "longTermDenied")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.longTermDenied); - return writer; - }; - - /** - * Encodes the specified Requests message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Requests.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {google.cloud.securitycenter.v1.IRequests} message Requests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Requests.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Requests message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Requests} Requests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Requests.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Requests(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ratio = reader.double(); - break; - } - case 2: { - message.shortTermAllowed = reader.int32(); - break; - } - case 3: { - message.longTermAllowed = reader.int32(); - break; - } - case 4: { - message.longTermDenied = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Requests message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Requests} Requests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Requests.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Requests message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Requests.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ratio != null && message.hasOwnProperty("ratio")) - if (typeof message.ratio !== "number") - return "ratio: number expected"; - if (message.shortTermAllowed != null && message.hasOwnProperty("shortTermAllowed")) - if (!$util.isInteger(message.shortTermAllowed)) - return "shortTermAllowed: integer expected"; - if (message.longTermAllowed != null && message.hasOwnProperty("longTermAllowed")) - if (!$util.isInteger(message.longTermAllowed)) - return "longTermAllowed: integer expected"; - if (message.longTermDenied != null && message.hasOwnProperty("longTermDenied")) - if (!$util.isInteger(message.longTermDenied)) - return "longTermDenied: integer expected"; - return null; - }; - - /** - * Creates a Requests message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Requests} Requests - */ - Requests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Requests) - return object; - var message = new $root.google.cloud.securitycenter.v1.Requests(); - if (object.ratio != null) - message.ratio = Number(object.ratio); - if (object.shortTermAllowed != null) - message.shortTermAllowed = object.shortTermAllowed | 0; - if (object.longTermAllowed != null) - message.longTermAllowed = object.longTermAllowed | 0; - if (object.longTermDenied != null) - message.longTermDenied = object.longTermDenied | 0; - return message; - }; - - /** - * Creates a plain object from a Requests message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {google.cloud.securitycenter.v1.Requests} message Requests - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Requests.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ratio = 0; - object.shortTermAllowed = 0; - object.longTermAllowed = 0; - object.longTermDenied = 0; - } - if (message.ratio != null && message.hasOwnProperty("ratio")) - object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; - if (message.shortTermAllowed != null && message.hasOwnProperty("shortTermAllowed")) - object.shortTermAllowed = message.shortTermAllowed; - if (message.longTermAllowed != null && message.hasOwnProperty("longTermAllowed")) - object.longTermAllowed = message.longTermAllowed; - if (message.longTermDenied != null && message.hasOwnProperty("longTermDenied")) - object.longTermDenied = message.longTermDenied; - return object; - }; - - /** - * Converts this Requests to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Requests - * @instance - * @returns {Object.} JSON object - */ - Requests.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Requests - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Requests - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Requests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Requests"; - }; - - return Requests; - })(); - - v1.AdaptiveProtection = (function() { - - /** - * Properties of an AdaptiveProtection. - * @memberof google.cloud.securitycenter.v1 - * @interface IAdaptiveProtection - * @property {number|null} [confidence] AdaptiveProtection confidence - */ - - /** - * Constructs a new AdaptiveProtection. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an AdaptiveProtection. - * @implements IAdaptiveProtection - * @constructor - * @param {google.cloud.securitycenter.v1.IAdaptiveProtection=} [properties] Properties to set - */ - function AdaptiveProtection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AdaptiveProtection confidence. - * @member {number} confidence - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @instance - */ - AdaptiveProtection.prototype.confidence = 0; - - /** - * Creates a new AdaptiveProtection instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {google.cloud.securitycenter.v1.IAdaptiveProtection=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AdaptiveProtection} AdaptiveProtection instance - */ - AdaptiveProtection.create = function create(properties) { - return new AdaptiveProtection(properties); - }; - - /** - * Encodes the specified AdaptiveProtection message. Does not implicitly {@link google.cloud.securitycenter.v1.AdaptiveProtection.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {google.cloud.securitycenter.v1.IAdaptiveProtection} message AdaptiveProtection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdaptiveProtection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.confidence); - return writer; - }; - - /** - * Encodes the specified AdaptiveProtection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AdaptiveProtection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {google.cloud.securitycenter.v1.IAdaptiveProtection} message AdaptiveProtection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdaptiveProtection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AdaptiveProtection message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AdaptiveProtection} AdaptiveProtection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdaptiveProtection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AdaptiveProtection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.confidence = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AdaptiveProtection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AdaptiveProtection} AdaptiveProtection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdaptiveProtection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AdaptiveProtection message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AdaptiveProtection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - return null; - }; - - /** - * Creates an AdaptiveProtection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AdaptiveProtection} AdaptiveProtection - */ - AdaptiveProtection.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AdaptiveProtection) - return object; - var message = new $root.google.cloud.securitycenter.v1.AdaptiveProtection(); - if (object.confidence != null) - message.confidence = Number(object.confidence); - return message; - }; - - /** - * Creates a plain object from an AdaptiveProtection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {google.cloud.securitycenter.v1.AdaptiveProtection} message AdaptiveProtection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AdaptiveProtection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.confidence = 0; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - return object; - }; - - /** - * Converts this AdaptiveProtection to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @instance - * @returns {Object.} JSON object - */ - AdaptiveProtection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AdaptiveProtection - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AdaptiveProtection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AdaptiveProtection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AdaptiveProtection"; - }; - - return AdaptiveProtection; - })(); - - v1.Attack = (function() { - - /** - * Properties of an Attack. - * @memberof google.cloud.securitycenter.v1 - * @interface IAttack - * @property {number|null} [volumePps] Attack volumePps - * @property {number|null} [volumeBps] Attack volumeBps - * @property {string|null} [classification] Attack classification - */ - - /** - * Constructs a new Attack. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an Attack. - * @implements IAttack - * @constructor - * @param {google.cloud.securitycenter.v1.IAttack=} [properties] Properties to set - */ - function Attack(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Attack volumePps. - * @member {number} volumePps - * @memberof google.cloud.securitycenter.v1.Attack - * @instance - */ - Attack.prototype.volumePps = 0; - - /** - * Attack volumeBps. - * @member {number} volumeBps - * @memberof google.cloud.securitycenter.v1.Attack - * @instance - */ - Attack.prototype.volumeBps = 0; - - /** - * Attack classification. - * @member {string} classification - * @memberof google.cloud.securitycenter.v1.Attack - * @instance - */ - Attack.prototype.classification = ""; - - /** - * Creates a new Attack instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {google.cloud.securitycenter.v1.IAttack=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Attack} Attack instance - */ - Attack.create = function create(properties) { - return new Attack(properties); - }; - - /** - * Encodes the specified Attack message. Does not implicitly {@link google.cloud.securitycenter.v1.Attack.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {google.cloud.securitycenter.v1.IAttack} message Attack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attack.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.volumePps != null && Object.hasOwnProperty.call(message, "volumePps")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.volumePps); - if (message.volumeBps != null && Object.hasOwnProperty.call(message, "volumeBps")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.volumeBps); - if (message.classification != null && Object.hasOwnProperty.call(message, "classification")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.classification); - return writer; - }; - - /** - * Encodes the specified Attack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Attack.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {google.cloud.securitycenter.v1.IAttack} message Attack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attack.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Attack message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Attack} Attack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attack.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Attack(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.volumePps = reader.int32(); - break; - } - case 2: { - message.volumeBps = reader.int32(); - break; - } - case 3: { - message.classification = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Attack message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Attack} Attack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attack.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Attack message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Attack.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.volumePps != null && message.hasOwnProperty("volumePps")) - if (!$util.isInteger(message.volumePps)) - return "volumePps: integer expected"; - if (message.volumeBps != null && message.hasOwnProperty("volumeBps")) - if (!$util.isInteger(message.volumeBps)) - return "volumeBps: integer expected"; - if (message.classification != null && message.hasOwnProperty("classification")) - if (!$util.isString(message.classification)) - return "classification: string expected"; - return null; - }; - - /** - * Creates an Attack message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Attack} Attack - */ - Attack.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Attack) - return object; - var message = new $root.google.cloud.securitycenter.v1.Attack(); - if (object.volumePps != null) - message.volumePps = object.volumePps | 0; - if (object.volumeBps != null) - message.volumeBps = object.volumeBps | 0; - if (object.classification != null) - message.classification = String(object.classification); - return message; - }; - - /** - * Creates a plain object from an Attack message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {google.cloud.securitycenter.v1.Attack} message Attack - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Attack.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.volumePps = 0; - object.volumeBps = 0; - object.classification = ""; - } - if (message.volumePps != null && message.hasOwnProperty("volumePps")) - object.volumePps = message.volumePps; - if (message.volumeBps != null && message.hasOwnProperty("volumeBps")) - object.volumeBps = message.volumeBps; - if (message.classification != null && message.hasOwnProperty("classification")) - object.classification = message.classification; - return object; - }; - - /** - * Converts this Attack to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Attack - * @instance - * @returns {Object.} JSON object - */ - Attack.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Attack - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Attack - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Attack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Attack"; - }; - - return Attack; - })(); - - v1.CloudDlpDataProfile = (function() { - - /** - * Properties of a CloudDlpDataProfile. - * @memberof google.cloud.securitycenter.v1 - * @interface ICloudDlpDataProfile - * @property {string|null} [dataProfile] CloudDlpDataProfile dataProfile - * @property {google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|null} [parentType] CloudDlpDataProfile parentType - * @property {Array.|null} [infoTypes] CloudDlpDataProfile infoTypes - */ - - /** - * Constructs a new CloudDlpDataProfile. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CloudDlpDataProfile. - * @implements ICloudDlpDataProfile - * @constructor - * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile=} [properties] Properties to set - */ - function CloudDlpDataProfile(properties) { - this.infoTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudDlpDataProfile dataProfile. - * @member {string} dataProfile - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @instance - */ - CloudDlpDataProfile.prototype.dataProfile = ""; - - /** - * CloudDlpDataProfile parentType. - * @member {google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType} parentType - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @instance - */ - CloudDlpDataProfile.prototype.parentType = 0; - - /** - * CloudDlpDataProfile infoTypes. - * @member {Array.} infoTypes - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @instance - */ - CloudDlpDataProfile.prototype.infoTypes = $util.emptyArray; - - /** - * Creates a new CloudDlpDataProfile instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CloudDlpDataProfile} CloudDlpDataProfile instance - */ - CloudDlpDataProfile.create = function create(properties) { - return new CloudDlpDataProfile(properties); - }; - - /** - * Encodes the specified CloudDlpDataProfile message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpDataProfile.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile} message CloudDlpDataProfile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDlpDataProfile.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataProfile != null && Object.hasOwnProperty.call(message, "dataProfile")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataProfile); - if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.parentType); - if (message.infoTypes != null && message.infoTypes.length) - for (var i = 0; i < message.infoTypes.length; ++i) - $root.google.cloud.securitycenter.v1.InfoType.encode(message.infoTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudDlpDataProfile message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpDataProfile.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile} message CloudDlpDataProfile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDlpDataProfile.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudDlpDataProfile message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CloudDlpDataProfile} CloudDlpDataProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDlpDataProfile.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CloudDlpDataProfile(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataProfile = reader.string(); - break; - } - case 2: { - message.parentType = reader.int32(); - break; - } - case 3: { - if (!(message.infoTypes && message.infoTypes.length)) - message.infoTypes = []; - message.infoTypes.push($root.google.cloud.securitycenter.v1.InfoType.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudDlpDataProfile message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CloudDlpDataProfile} CloudDlpDataProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDlpDataProfile.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudDlpDataProfile message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudDlpDataProfile.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) - if (!$util.isString(message.dataProfile)) - return "dataProfile: string expected"; - if (message.parentType != null && message.hasOwnProperty("parentType")) - switch (message.parentType) { - default: - return "parentType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.infoTypes != null && message.hasOwnProperty("infoTypes")) { - if (!Array.isArray(message.infoTypes)) - return "infoTypes: array expected"; - for (var i = 0; i < message.infoTypes.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.InfoType.verify(message.infoTypes[i]); - if (error) - return "infoTypes." + error; - } - } - return null; - }; - - /** - * Creates a CloudDlpDataProfile message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CloudDlpDataProfile} CloudDlpDataProfile - */ - CloudDlpDataProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CloudDlpDataProfile) - return object; - var message = new $root.google.cloud.securitycenter.v1.CloudDlpDataProfile(); - if (object.dataProfile != null) - message.dataProfile = String(object.dataProfile); - switch (object.parentType) { - default: - if (typeof object.parentType === "number") { - message.parentType = object.parentType; - break; - } - break; - case "PARENT_TYPE_UNSPECIFIED": - case 0: - message.parentType = 0; - break; - case "ORGANIZATION": - case 1: - message.parentType = 1; - break; - case "PROJECT": - case 2: - message.parentType = 2; - break; - } - if (object.infoTypes) { - if (!Array.isArray(object.infoTypes)) - throw TypeError(".google.cloud.securitycenter.v1.CloudDlpDataProfile.infoTypes: array expected"); - message.infoTypes = []; - for (var i = 0; i < object.infoTypes.length; ++i) { - if (typeof object.infoTypes[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CloudDlpDataProfile.infoTypes: object expected"); - message.infoTypes[i] = $root.google.cloud.securitycenter.v1.InfoType.fromObject(object.infoTypes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CloudDlpDataProfile message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {google.cloud.securitycenter.v1.CloudDlpDataProfile} message CloudDlpDataProfile - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudDlpDataProfile.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.infoTypes = []; - if (options.defaults) { - object.dataProfile = ""; - object.parentType = options.enums === String ? "PARENT_TYPE_UNSPECIFIED" : 0; - } - if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) - object.dataProfile = message.dataProfile; - if (message.parentType != null && message.hasOwnProperty("parentType")) - object.parentType = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType[message.parentType] === undefined ? message.parentType : $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType[message.parentType] : message.parentType; - if (message.infoTypes && message.infoTypes.length) { - object.infoTypes = []; - for (var j = 0; j < message.infoTypes.length; ++j) - object.infoTypes[j] = $root.google.cloud.securitycenter.v1.InfoType.toObject(message.infoTypes[j], options); - } - return object; - }; - - /** - * Converts this CloudDlpDataProfile to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @instance - * @returns {Object.} JSON object - */ - CloudDlpDataProfile.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudDlpDataProfile - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudDlpDataProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudDlpDataProfile"; - }; - - /** - * ParentType enum. - * @name google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType - * @enum {number} - * @property {number} PARENT_TYPE_UNSPECIFIED=0 PARENT_TYPE_UNSPECIFIED value - * @property {number} ORGANIZATION=1 ORGANIZATION value - * @property {number} PROJECT=2 PROJECT value - */ - CloudDlpDataProfile.ParentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PARENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORGANIZATION"] = 1; - values[valuesById[2] = "PROJECT"] = 2; - return values; - })(); - - return CloudDlpDataProfile; - })(); - - v1.InfoType = (function() { - - /** - * Properties of an InfoType. - * @memberof google.cloud.securitycenter.v1 - * @interface IInfoType - * @property {string|null} [name] InfoType name - * @property {string|null} [version] InfoType version - * @property {google.cloud.securitycenter.v1.ISensitivityScore|null} [sensitivityScore] InfoType sensitivityScore - */ - - /** - * Constructs a new InfoType. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an InfoType. - * @implements IInfoType - * @constructor - * @param {google.cloud.securitycenter.v1.IInfoType=} [properties] Properties to set - */ - function InfoType(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InfoType name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.InfoType - * @instance - */ - InfoType.prototype.name = ""; - - /** - * InfoType version. - * @member {string} version - * @memberof google.cloud.securitycenter.v1.InfoType - * @instance - */ - InfoType.prototype.version = ""; - - /** - * InfoType sensitivityScore. - * @member {google.cloud.securitycenter.v1.ISensitivityScore|null|undefined} sensitivityScore - * @memberof google.cloud.securitycenter.v1.InfoType - * @instance - */ - InfoType.prototype.sensitivityScore = null; - - /** - * Creates a new InfoType instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {google.cloud.securitycenter.v1.IInfoType=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.InfoType} InfoType instance - */ - InfoType.create = function create(properties) { - return new InfoType(properties); - }; - - /** - * Encodes the specified InfoType message. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {google.cloud.securitycenter.v1.IInfoType} message InfoType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InfoType.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.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.sensitivityScore != null && Object.hasOwnProperty.call(message, "sensitivityScore")) - $root.google.cloud.securitycenter.v1.SensitivityScore.encode(message.sensitivityScore, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InfoType message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {google.cloud.securitycenter.v1.IInfoType} message InfoType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InfoType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InfoType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.InfoType} InfoType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InfoType.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.InfoType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - case 3: { - message.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InfoType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.InfoType} InfoType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InfoType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InfoType message. - * @function verify - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InfoType.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.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.sensitivityScore != null && message.hasOwnProperty("sensitivityScore")) { - var error = $root.google.cloud.securitycenter.v1.SensitivityScore.verify(message.sensitivityScore); - if (error) - return "sensitivityScore." + error; - } - return null; - }; - - /** - * Creates an InfoType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.InfoType} InfoType - */ - InfoType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.InfoType) - return object; - var message = new $root.google.cloud.securitycenter.v1.InfoType(); - if (object.name != null) - message.name = String(object.name); - if (object.version != null) - message.version = String(object.version); - if (object.sensitivityScore != null) { - if (typeof object.sensitivityScore !== "object") - throw TypeError(".google.cloud.securitycenter.v1.InfoType.sensitivityScore: object expected"); - message.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.fromObject(object.sensitivityScore); - } - return message; - }; - - /** - * Creates a plain object from an InfoType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {google.cloud.securitycenter.v1.InfoType} message InfoType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InfoType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.version = ""; - object.sensitivityScore = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.sensitivityScore != null && message.hasOwnProperty("sensitivityScore")) - object.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.toObject(message.sensitivityScore, options); - return object; - }; - - /** - * Converts this InfoType to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.InfoType - * @instance - * @returns {Object.} JSON object - */ - InfoType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InfoType - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.InfoType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InfoType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.InfoType"; - }; - - return InfoType; - })(); - - v1.SensitivityScore = (function() { - - /** - * Properties of a SensitivityScore. - * @memberof google.cloud.securitycenter.v1 - * @interface ISensitivityScore - * @property {google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|null} [score] SensitivityScore score - */ - - /** - * Constructs a new SensitivityScore. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SensitivityScore. - * @implements ISensitivityScore - * @constructor - * @param {google.cloud.securitycenter.v1.ISensitivityScore=} [properties] Properties to set - */ - function SensitivityScore(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SensitivityScore score. - * @member {google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel} score - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @instance - */ - SensitivityScore.prototype.score = 0; - - /** - * Creates a new SensitivityScore instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {google.cloud.securitycenter.v1.ISensitivityScore=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore instance - */ - SensitivityScore.create = function create(properties) { - return new SensitivityScore(properties); - }; - - /** - * Encodes the specified SensitivityScore message. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {google.cloud.securitycenter.v1.ISensitivityScore} message SensitivityScore message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SensitivityScore.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); - return writer; - }; - - /** - * Encodes the specified SensitivityScore message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {google.cloud.securitycenter.v1.ISensitivityScore} message SensitivityScore message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SensitivityScore.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SensitivityScore message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SensitivityScore.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SensitivityScore(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SensitivityScore message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SensitivityScore.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SensitivityScore message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SensitivityScore.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - switch (message.score) { - default: - return "score: enum value expected"; - case 0: - case 10: - case 12: - case 20: - case 30: - break; - } - return null; - }; - - /** - * Creates a SensitivityScore message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore - */ - SensitivityScore.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SensitivityScore) - return object; - var message = new $root.google.cloud.securitycenter.v1.SensitivityScore(); - switch (object.score) { - default: - if (typeof object.score === "number") { - message.score = object.score; - break; - } - break; - case "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED": - case 0: - message.score = 0; - break; - case "SENSITIVITY_LOW": - case 10: - message.score = 10; - break; - case "SENSITIVITY_UNKNOWN": - case 12: - message.score = 12; - break; - case "SENSITIVITY_MODERATE": - case 20: - message.score = 20; - break; - case "SENSITIVITY_HIGH": - case 30: - message.score = 30; - break; - } - return message; - }; - - /** - * Creates a plain object from a SensitivityScore message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {google.cloud.securitycenter.v1.SensitivityScore} message SensitivityScore - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SensitivityScore.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.score = options.enums === String ? "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED" : 0; - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.enums === String ? $root.google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel[message.score] === undefined ? message.score : $root.google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel[message.score] : message.score; - return object; - }; - - /** - * Converts this SensitivityScore to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @instance - * @returns {Object.} JSON object - */ - SensitivityScore.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SensitivityScore - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SensitivityScore - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SensitivityScore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SensitivityScore"; - }; - - /** - * SensitivityScoreLevel enum. - * @name google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel - * @enum {number} - * @property {number} SENSITIVITY_SCORE_LEVEL_UNSPECIFIED=0 SENSITIVITY_SCORE_LEVEL_UNSPECIFIED value - * @property {number} SENSITIVITY_LOW=10 SENSITIVITY_LOW value - * @property {number} SENSITIVITY_UNKNOWN=12 SENSITIVITY_UNKNOWN value - * @property {number} SENSITIVITY_MODERATE=20 SENSITIVITY_MODERATE value - * @property {number} SENSITIVITY_HIGH=30 SENSITIVITY_HIGH value - */ - SensitivityScore.SensitivityScoreLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED"] = 0; - values[valuesById[10] = "SENSITIVITY_LOW"] = 10; - values[valuesById[12] = "SENSITIVITY_UNKNOWN"] = 12; - values[valuesById[20] = "SENSITIVITY_MODERATE"] = 20; - values[valuesById[30] = "SENSITIVITY_HIGH"] = 30; - return values; - })(); - - return SensitivityScore; - })(); - - v1.CloudDlpInspection = (function() { - - /** - * Properties of a CloudDlpInspection. - * @memberof google.cloud.securitycenter.v1 - * @interface ICloudDlpInspection - * @property {string|null} [inspectJob] CloudDlpInspection inspectJob - * @property {string|null} [infoType] CloudDlpInspection infoType - * @property {number|Long|null} [infoTypeCount] CloudDlpInspection infoTypeCount - * @property {boolean|null} [fullScan] CloudDlpInspection fullScan - */ - - /** - * Constructs a new CloudDlpInspection. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CloudDlpInspection. - * @implements ICloudDlpInspection - * @constructor - * @param {google.cloud.securitycenter.v1.ICloudDlpInspection=} [properties] Properties to set - */ - function CloudDlpInspection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudDlpInspection inspectJob. - * @member {string} inspectJob - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @instance - */ - CloudDlpInspection.prototype.inspectJob = ""; - - /** - * CloudDlpInspection infoType. - * @member {string} infoType - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @instance - */ - CloudDlpInspection.prototype.infoType = ""; - - /** - * CloudDlpInspection infoTypeCount. - * @member {number|Long} infoTypeCount - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @instance - */ - CloudDlpInspection.prototype.infoTypeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * CloudDlpInspection fullScan. - * @member {boolean} fullScan - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @instance - */ - CloudDlpInspection.prototype.fullScan = false; - - /** - * Creates a new CloudDlpInspection instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {google.cloud.securitycenter.v1.ICloudDlpInspection=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CloudDlpInspection} CloudDlpInspection instance - */ - CloudDlpInspection.create = function create(properties) { - return new CloudDlpInspection(properties); - }; - - /** - * Encodes the specified CloudDlpInspection message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpInspection.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {google.cloud.securitycenter.v1.ICloudDlpInspection} message CloudDlpInspection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDlpInspection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inspectJob != null && Object.hasOwnProperty.call(message, "inspectJob")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inspectJob); - if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.infoType); - if (message.infoTypeCount != null && Object.hasOwnProperty.call(message, "infoTypeCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.infoTypeCount); - if (message.fullScan != null && Object.hasOwnProperty.call(message, "fullScan")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.fullScan); - return writer; - }; - - /** - * Encodes the specified CloudDlpInspection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudDlpInspection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {google.cloud.securitycenter.v1.ICloudDlpInspection} message CloudDlpInspection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDlpInspection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudDlpInspection message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CloudDlpInspection} CloudDlpInspection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDlpInspection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CloudDlpInspection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inspectJob = reader.string(); - break; - } - case 2: { - message.infoType = reader.string(); - break; - } - case 3: { - message.infoTypeCount = reader.int64(); - break; - } - case 4: { - message.fullScan = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudDlpInspection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CloudDlpInspection} CloudDlpInspection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDlpInspection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudDlpInspection message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudDlpInspection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) - if (!$util.isString(message.inspectJob)) - return "inspectJob: string expected"; - if (message.infoType != null && message.hasOwnProperty("infoType")) - if (!$util.isString(message.infoType)) - return "infoType: string expected"; - if (message.infoTypeCount != null && message.hasOwnProperty("infoTypeCount")) - if (!$util.isInteger(message.infoTypeCount) && !(message.infoTypeCount && $util.isInteger(message.infoTypeCount.low) && $util.isInteger(message.infoTypeCount.high))) - return "infoTypeCount: integer|Long expected"; - if (message.fullScan != null && message.hasOwnProperty("fullScan")) - if (typeof message.fullScan !== "boolean") - return "fullScan: boolean expected"; - return null; - }; - - /** - * Creates a CloudDlpInspection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CloudDlpInspection} CloudDlpInspection - */ - CloudDlpInspection.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CloudDlpInspection) - return object; - var message = new $root.google.cloud.securitycenter.v1.CloudDlpInspection(); - if (object.inspectJob != null) - message.inspectJob = String(object.inspectJob); - if (object.infoType != null) - message.infoType = String(object.infoType); - if (object.infoTypeCount != null) - if ($util.Long) - (message.infoTypeCount = $util.Long.fromValue(object.infoTypeCount)).unsigned = false; - else if (typeof object.infoTypeCount === "string") - message.infoTypeCount = parseInt(object.infoTypeCount, 10); - else if (typeof object.infoTypeCount === "number") - message.infoTypeCount = object.infoTypeCount; - else if (typeof object.infoTypeCount === "object") - message.infoTypeCount = new $util.LongBits(object.infoTypeCount.low >>> 0, object.infoTypeCount.high >>> 0).toNumber(); - if (object.fullScan != null) - message.fullScan = Boolean(object.fullScan); - return message; - }; - - /** - * Creates a plain object from a CloudDlpInspection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {google.cloud.securitycenter.v1.CloudDlpInspection} message CloudDlpInspection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudDlpInspection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inspectJob = ""; - object.infoType = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.infoTypeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.infoTypeCount = options.longs === String ? "0" : 0; - object.fullScan = false; - } - if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) - object.inspectJob = message.inspectJob; - if (message.infoType != null && message.hasOwnProperty("infoType")) - object.infoType = message.infoType; - if (message.infoTypeCount != null && message.hasOwnProperty("infoTypeCount")) - if (typeof message.infoTypeCount === "number") - object.infoTypeCount = options.longs === String ? String(message.infoTypeCount) : message.infoTypeCount; - else - object.infoTypeCount = options.longs === String ? $util.Long.prototype.toString.call(message.infoTypeCount) : options.longs === Number ? new $util.LongBits(message.infoTypeCount.low >>> 0, message.infoTypeCount.high >>> 0).toNumber() : message.infoTypeCount; - if (message.fullScan != null && message.hasOwnProperty("fullScan")) - object.fullScan = message.fullScan; - return object; - }; - - /** - * Converts this CloudDlpInspection to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @instance - * @returns {Object.} JSON object - */ - CloudDlpInspection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudDlpInspection - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CloudDlpInspection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudDlpInspection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudDlpInspection"; - }; - - return CloudDlpInspection; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.protocol === "number") { - message.protocol = object.protocol; - break; - } - break; - 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] === undefined ? message.protocol : $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); - }; - - /** - * 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 - * @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.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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.Container = (function() { - - /** - * Properties of a Container. - * @memberof google.cloud.securitycenter.v1 - * @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 - * @property {google.protobuf.ITimestamp|null} [createTime] Container createTime - */ - - /** - * Constructs a new Container. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Container. - * @implements IContainer - * @constructor - * @param {google.cloud.securitycenter.v1.IContainer=} [properties] Properties to set - */ - function Container(properties) { - this.labels = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Container name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Container - * @instance - */ - Container.prototype.name = ""; - - /** - * Container uri. - * @member {string} uri - * @memberof google.cloud.securitycenter.v1.Container - * @instance - */ - Container.prototype.uri = ""; - - /** - * 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; - - /** - * Container createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.Container - * @instance - */ - Container.prototype.createTime = null; - - /** - * Creates a new Container instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Container - * @static - * @param {google.cloud.securitycenter.v1.IContainer=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Container} Container instance - */ - Container.create = function create(properties) { - return new Container(properties); - }; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Container - * @static - * @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 - */ - Container.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.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(); - 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(); - return writer; - }; - - /** - * 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.Container - * @static - * @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 - */ - Container.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Container message from the specified reader or buffer. - * @function decode - * @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.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Container.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Container message. - * @function verify - * @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 - */ - Container.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.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 "labels." + 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 Container message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Container - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Container} Container - */ - Container.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Container) - return object; - 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]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Container.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - return message; - }; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Container - * @static - * @param {google.cloud.securitycenter.v1.Container} message Container - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Container.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.labels = []; - if (options.defaults) { - object.name = ""; - object.uri = ""; - object.imageId = ""; - object.createTime = null; - } - 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); - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - return object; - }; - - /** - * Converts this Container to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Container - * @instance - * @returns {Object.} JSON object - */ - Container.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.Label = (function() { - - /** - * Properties of a Label. - * @memberof google.cloud.securitycenter.v1 - * @interface ILabel - * @property {string|null} [name] Label name - * @property {string|null} [value] Label value - */ - - /** - * Constructs a new Label. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Label. - * @implements ILabel - * @constructor - * @param {google.cloud.securitycenter.v1.ILabel=} [properties] Properties to set - */ - function Label(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Label name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Label - * @instance - */ - Label.prototype.name = ""; - - /** - * Label value. - * @member {string} value - * @memberof google.cloud.securitycenter.v1.Label - * @instance - */ - Label.prototype.value = ""; - - /** - * Creates a new Label instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Label - * @static - * @param {google.cloud.securitycenter.v1.ILabel=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Label} Label instance - */ - Label.create = function create(properties) { - return new Label(properties); - }; - - /** - * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Label - * @static - * @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 - */ - 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.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - return writer; - }; - - /** - * 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.Label - * @static - * @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 - */ - Label.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Label message from the specified reader or buffer. - * @function decode - * @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.Label} Label - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Label.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Label message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Label - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Label.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Label message. - * @function verify - * @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 - */ - 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.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a Label message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Label - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Label} Label - */ - Label.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Label) - return object; - var message = new $root.google.cloud.securitycenter.v1.Label(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a Label message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Label - * @static - * @param {google.cloud.securitycenter.v1.Label} message Label - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Label.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.value = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Label to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Label - * @instance - * @returns {Object.} JSON object - */ - Label.prototype.toJSON = function toJSON() { - 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; - })(); - - 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 - * @property {string|null} [version] Database version - */ - - /** - * 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; - - /** - * Database version. - * @member {string} version - * @memberof google.cloud.securitycenter.v1.Database - * @instance - */ - Database.prototype.version = ""; - - /** - * 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]); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.version); - 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 6: { - message.version = 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"; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: 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]); - } - if (object.version != null) - message.version = String(object.version); - 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 = ""; - object.version = ""; - } - 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]; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - 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.EffectiveEventThreatDetectionCustomModule = (function() { - - /** - * Properties of an EffectiveEventThreatDetectionCustomModule. - * @memberof google.cloud.securitycenter.v1 - * @interface IEffectiveEventThreatDetectionCustomModule - * @property {string|null} [name] EffectiveEventThreatDetectionCustomModule name - * @property {google.protobuf.IStruct|null} [config] EffectiveEventThreatDetectionCustomModule config - * @property {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState|null} [enablementState] EffectiveEventThreatDetectionCustomModule enablementState - * @property {string|null} [type] EffectiveEventThreatDetectionCustomModule type - * @property {string|null} [displayName] EffectiveEventThreatDetectionCustomModule displayName - * @property {string|null} [description] EffectiveEventThreatDetectionCustomModule description - */ - - /** - * Constructs a new EffectiveEventThreatDetectionCustomModule. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an EffectiveEventThreatDetectionCustomModule. - * @implements IEffectiveEventThreatDetectionCustomModule - * @constructor - * @param {google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule=} [properties] Properties to set - */ - function EffectiveEventThreatDetectionCustomModule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EffectiveEventThreatDetectionCustomModule name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @instance - */ - EffectiveEventThreatDetectionCustomModule.prototype.name = ""; - - /** - * EffectiveEventThreatDetectionCustomModule config. - * @member {google.protobuf.IStruct|null|undefined} config - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @instance - */ - EffectiveEventThreatDetectionCustomModule.prototype.config = null; - - /** - * EffectiveEventThreatDetectionCustomModule enablementState. - * @member {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState} enablementState - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @instance - */ - EffectiveEventThreatDetectionCustomModule.prototype.enablementState = 0; - - /** - * EffectiveEventThreatDetectionCustomModule type. - * @member {string} type - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @instance - */ - EffectiveEventThreatDetectionCustomModule.prototype.type = ""; - - /** - * EffectiveEventThreatDetectionCustomModule displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @instance - */ - EffectiveEventThreatDetectionCustomModule.prototype.displayName = ""; - - /** - * EffectiveEventThreatDetectionCustomModule description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @instance - */ - EffectiveEventThreatDetectionCustomModule.prototype.description = ""; - - /** - * Creates a new EffectiveEventThreatDetectionCustomModule instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} EffectiveEventThreatDetectionCustomModule instance - */ - EffectiveEventThreatDetectionCustomModule.create = function create(properties) { - return new EffectiveEventThreatDetectionCustomModule(properties); - }; - - /** - * Encodes the specified EffectiveEventThreatDetectionCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule} message EffectiveEventThreatDetectionCustomModule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EffectiveEventThreatDetectionCustomModule.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.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.protobuf.Struct.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.enablementState != null && Object.hasOwnProperty.call(message, "enablementState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.enablementState); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); - return writer; - }; - - /** - * Encodes the specified EffectiveEventThreatDetectionCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule} message EffectiveEventThreatDetectionCustomModule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EffectiveEventThreatDetectionCustomModule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EffectiveEventThreatDetectionCustomModule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} EffectiveEventThreatDetectionCustomModule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EffectiveEventThreatDetectionCustomModule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.config = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - message.enablementState = reader.int32(); - break; - } - case 4: { - message.type = reader.string(); - break; - } - case 5: { - message.displayName = reader.string(); - break; - } - case 6: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EffectiveEventThreatDetectionCustomModule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} EffectiveEventThreatDetectionCustomModule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EffectiveEventThreatDetectionCustomModule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EffectiveEventThreatDetectionCustomModule message. - * @function verify - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EffectiveEventThreatDetectionCustomModule.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.config != null && message.hasOwnProperty("config")) { - var error = $root.google.protobuf.Struct.verify(message.config); - if (error) - return "config." + error; - } - if (message.enablementState != null && message.hasOwnProperty("enablementState")) - switch (message.enablementState) { - default: - return "enablementState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: 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 EffectiveEventThreatDetectionCustomModule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} EffectiveEventThreatDetectionCustomModule - */ - EffectiveEventThreatDetectionCustomModule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule) - return object; - var message = new $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule(); - if (object.name != null) - message.name = String(object.name); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.config: object expected"); - message.config = $root.google.protobuf.Struct.fromObject(object.config); - } - switch (object.enablementState) { - default: - if (typeof object.enablementState === "number") { - message.enablementState = object.enablementState; - break; - } - break; - case "ENABLEMENT_STATE_UNSPECIFIED": - case 0: - message.enablementState = 0; - break; - case "ENABLED": - case 1: - message.enablementState = 1; - break; - case "DISABLED": - case 2: - message.enablementState = 2; - break; - } - if (object.type != null) - message.type = String(object.type); - 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 EffectiveEventThreatDetectionCustomModule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} message EffectiveEventThreatDetectionCustomModule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EffectiveEventThreatDetectionCustomModule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.config = null; - object.enablementState = options.enums === String ? "ENABLEMENT_STATE_UNSPECIFIED" : 0; - object.type = ""; - object.displayName = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.protobuf.Struct.toObject(message.config, options); - if (message.enablementState != null && message.hasOwnProperty("enablementState")) - object.enablementState = options.enums === String ? $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState[message.enablementState] : message.enablementState; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - 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 EffectiveEventThreatDetectionCustomModule to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @instance - * @returns {Object.} JSON object - */ - EffectiveEventThreatDetectionCustomModule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EffectiveEventThreatDetectionCustomModule - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EffectiveEventThreatDetectionCustomModule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule"; - }; - - /** - * EnablementState enum. - * @name google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState - * @enum {number} - * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - */ - EffectiveEventThreatDetectionCustomModule.EnablementState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENABLEMENT_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - return values; - })(); - - return EffectiveEventThreatDetectionCustomModule; - })(); - - v1.EffectiveSecurityHealthAnalyticsCustomModule = (function() { - - /** - * Properties of an EffectiveSecurityHealthAnalyticsCustomModule. - * @memberof google.cloud.securitycenter.v1 - * @interface IEffectiveSecurityHealthAnalyticsCustomModule - * @property {string|null} [name] EffectiveSecurityHealthAnalyticsCustomModule name - * @property {google.cloud.securitycenter.v1.ICustomConfig|null} [customConfig] EffectiveSecurityHealthAnalyticsCustomModule customConfig - * @property {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState|null} [enablementState] EffectiveSecurityHealthAnalyticsCustomModule enablementState - * @property {string|null} [displayName] EffectiveSecurityHealthAnalyticsCustomModule displayName - */ - - /** - * Constructs a new EffectiveSecurityHealthAnalyticsCustomModule. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an EffectiveSecurityHealthAnalyticsCustomModule. - * @implements IEffectiveSecurityHealthAnalyticsCustomModule - * @constructor - * @param {google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule=} [properties] Properties to set - */ - function EffectiveSecurityHealthAnalyticsCustomModule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EffectiveSecurityHealthAnalyticsCustomModule name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @instance - */ - EffectiveSecurityHealthAnalyticsCustomModule.prototype.name = ""; - - /** - * EffectiveSecurityHealthAnalyticsCustomModule customConfig. - * @member {google.cloud.securitycenter.v1.ICustomConfig|null|undefined} customConfig - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @instance - */ - EffectiveSecurityHealthAnalyticsCustomModule.prototype.customConfig = null; - - /** - * EffectiveSecurityHealthAnalyticsCustomModule enablementState. - * @member {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState} enablementState - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @instance - */ - EffectiveSecurityHealthAnalyticsCustomModule.prototype.enablementState = 0; - - /** - * EffectiveSecurityHealthAnalyticsCustomModule displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @instance - */ - EffectiveSecurityHealthAnalyticsCustomModule.prototype.displayName = ""; - - /** - * Creates a new EffectiveSecurityHealthAnalyticsCustomModule instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} EffectiveSecurityHealthAnalyticsCustomModule instance - */ - EffectiveSecurityHealthAnalyticsCustomModule.create = function create(properties) { - return new EffectiveSecurityHealthAnalyticsCustomModule(properties); - }; - - /** - * Encodes the specified EffectiveSecurityHealthAnalyticsCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule} message EffectiveSecurityHealthAnalyticsCustomModule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EffectiveSecurityHealthAnalyticsCustomModule.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.customConfig != null && Object.hasOwnProperty.call(message, "customConfig")) - $root.google.cloud.securitycenter.v1.CustomConfig.encode(message.customConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.enablementState != null && Object.hasOwnProperty.call(message, "enablementState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.enablementState); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified EffectiveSecurityHealthAnalyticsCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule} message EffectiveSecurityHealthAnalyticsCustomModule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EffectiveSecurityHealthAnalyticsCustomModule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EffectiveSecurityHealthAnalyticsCustomModule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} EffectiveSecurityHealthAnalyticsCustomModule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EffectiveSecurityHealthAnalyticsCustomModule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.enablementState = reader.int32(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EffectiveSecurityHealthAnalyticsCustomModule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} EffectiveSecurityHealthAnalyticsCustomModule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EffectiveSecurityHealthAnalyticsCustomModule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EffectiveSecurityHealthAnalyticsCustomModule message. - * @function verify - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EffectiveSecurityHealthAnalyticsCustomModule.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.customConfig != null && message.hasOwnProperty("customConfig")) { - var error = $root.google.cloud.securitycenter.v1.CustomConfig.verify(message.customConfig); - if (error) - return "customConfig." + error; - } - if (message.enablementState != null && message.hasOwnProperty("enablementState")) - switch (message.enablementState) { - default: - return "enablementState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an EffectiveSecurityHealthAnalyticsCustomModule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} EffectiveSecurityHealthAnalyticsCustomModule - */ - EffectiveSecurityHealthAnalyticsCustomModule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule) - return object; - var message = new $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule(); - if (object.name != null) - message.name = String(object.name); - if (object.customConfig != null) { - if (typeof object.customConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.customConfig: object expected"); - message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.fromObject(object.customConfig); - } - switch (object.enablementState) { - default: - if (typeof object.enablementState === "number") { - message.enablementState = object.enablementState; - break; - } - break; - case "ENABLEMENT_STATE_UNSPECIFIED": - case 0: - message.enablementState = 0; - break; - case "ENABLED": - case 1: - message.enablementState = 1; - break; - case "DISABLED": - case 2: - message.enablementState = 2; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an EffectiveSecurityHealthAnalyticsCustomModule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} message EffectiveSecurityHealthAnalyticsCustomModule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EffectiveSecurityHealthAnalyticsCustomModule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.customConfig = null; - object.enablementState = options.enums === String ? "ENABLEMENT_STATE_UNSPECIFIED" : 0; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.customConfig != null && message.hasOwnProperty("customConfig")) - object.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.toObject(message.customConfig, options); - if (message.enablementState != null && message.hasOwnProperty("enablementState")) - object.enablementState = options.enums === String ? $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState[message.enablementState] : message.enablementState; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this EffectiveSecurityHealthAnalyticsCustomModule to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @instance - * @returns {Object.} JSON object - */ - EffectiveSecurityHealthAnalyticsCustomModule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EffectiveSecurityHealthAnalyticsCustomModule - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EffectiveSecurityHealthAnalyticsCustomModule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule"; - }; - - /** - * EnablementState enum. - * @name google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState - * @enum {number} - * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - */ - EffectiveSecurityHealthAnalyticsCustomModule.EnablementState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENABLEMENT_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - return values; - })(); - - return EffectiveSecurityHealthAnalyticsCustomModule; - })(); - - v1.CustomConfig = (function() { - - /** - * Properties of a CustomConfig. - * @memberof google.cloud.securitycenter.v1 - * @interface ICustomConfig - * @property {google.type.IExpr|null} [predicate] CustomConfig predicate - * @property {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec|null} [customOutput] CustomConfig customOutput - * @property {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector|null} [resourceSelector] CustomConfig resourceSelector - * @property {google.cloud.securitycenter.v1.CustomConfig.Severity|null} [severity] CustomConfig severity - * @property {string|null} [description] CustomConfig description - * @property {string|null} [recommendation] CustomConfig recommendation - */ - - /** - * Constructs a new CustomConfig. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CustomConfig. - * @implements ICustomConfig - * @constructor - * @param {google.cloud.securitycenter.v1.ICustomConfig=} [properties] Properties to set - */ - function CustomConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomConfig predicate. - * @member {google.type.IExpr|null|undefined} predicate - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @instance - */ - CustomConfig.prototype.predicate = null; - - /** - * CustomConfig customOutput. - * @member {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec|null|undefined} customOutput - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @instance - */ - CustomConfig.prototype.customOutput = null; - - /** - * CustomConfig resourceSelector. - * @member {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector|null|undefined} resourceSelector - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @instance - */ - CustomConfig.prototype.resourceSelector = null; - - /** - * CustomConfig severity. - * @member {google.cloud.securitycenter.v1.CustomConfig.Severity} severity - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @instance - */ - CustomConfig.prototype.severity = 0; - - /** - * CustomConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @instance - */ - CustomConfig.prototype.description = ""; - - /** - * CustomConfig recommendation. - * @member {string} recommendation - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @instance - */ - CustomConfig.prototype.recommendation = ""; - - /** - * Creates a new CustomConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {google.cloud.securitycenter.v1.ICustomConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CustomConfig} CustomConfig instance - */ - CustomConfig.create = function create(properties) { - return new CustomConfig(properties); - }; - - /** - * Encodes the specified CustomConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {google.cloud.securitycenter.v1.ICustomConfig} message CustomConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.predicate != null && Object.hasOwnProperty.call(message, "predicate")) - $root.google.type.Expr.encode(message.predicate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.customOutput != null && Object.hasOwnProperty.call(message, "customOutput")) - $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.encode(message.customOutput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceSelector != null && Object.hasOwnProperty.call(message, "resourceSelector")) - $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.severity); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.recommendation != null && Object.hasOwnProperty.call(message, "recommendation")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.recommendation); - return writer; - }; - - /** - * Encodes the specified CustomConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {google.cloud.securitycenter.v1.ICustomConfig} message CustomConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CustomConfig} CustomConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.predicate = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - case 2: { - message.customOutput = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.decode(reader, reader.uint32()); - break; - } - case 3: { - message.resourceSelector = $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.decode(reader, reader.uint32()); - break; - } - case 4: { - message.severity = reader.int32(); - break; - } - case 5: { - message.description = reader.string(); - break; - } - case 6: { - message.recommendation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CustomConfig} CustomConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.predicate != null && message.hasOwnProperty("predicate")) { - var error = $root.google.type.Expr.verify(message.predicate); - if (error) - return "predicate." + error; - } - if (message.customOutput != null && message.hasOwnProperty("customOutput")) { - var error = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify(message.customOutput); - if (error) - return "customOutput." + error; - } - if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) { - var error = $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify(message.resourceSelector); - if (error) - return "resourceSelector." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.recommendation != null && message.hasOwnProperty("recommendation")) - if (!$util.isString(message.recommendation)) - return "recommendation: string expected"; - return null; - }; - - /** - * Creates a CustomConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CustomConfig} CustomConfig - */ - CustomConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CustomConfig) - return object; - var message = new $root.google.cloud.securitycenter.v1.CustomConfig(); - if (object.predicate != null) { - if (typeof object.predicate !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.predicate: object expected"); - message.predicate = $root.google.type.Expr.fromObject(object.predicate); - } - if (object.customOutput != null) { - if (typeof object.customOutput !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.customOutput: object expected"); - message.customOutput = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.fromObject(object.customOutput); - } - if (object.resourceSelector != null) { - if (typeof object.resourceSelector !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.resourceSelector: object expected"); - message.resourceSelector = $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.fromObject(object.resourceSelector); - } - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - 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.description != null) - message.description = String(object.description); - if (object.recommendation != null) - message.recommendation = String(object.recommendation); - return message; - }; - - /** - * Creates a plain object from a CustomConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig} message CustomConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.predicate = null; - object.customOutput = null; - object.resourceSelector = null; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - object.description = ""; - object.recommendation = ""; - } - if (message.predicate != null && message.hasOwnProperty("predicate")) - object.predicate = $root.google.type.Expr.toObject(message.predicate, options); - if (message.customOutput != null && message.hasOwnProperty("customOutput")) - object.customOutput = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.toObject(message.customOutput, options); - if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) - object.resourceSelector = $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.toObject(message.resourceSelector, options); - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.CustomConfig.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.securitycenter.v1.CustomConfig.Severity[message.severity] : message.severity; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.recommendation != null && message.hasOwnProperty("recommendation")) - object.recommendation = message.recommendation; - return object; - }; - - /** - * Converts this CustomConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @instance - * @returns {Object.} JSON object - */ - CustomConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomConfig - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomConfig"; - }; - - CustomConfig.CustomOutputSpec = (function() { - - /** - * Properties of a CustomOutputSpec. - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @interface ICustomOutputSpec - * @property {Array.|null} [properties] CustomOutputSpec properties - */ - - /** - * Constructs a new CustomOutputSpec. - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @classdesc Represents a CustomOutputSpec. - * @implements ICustomOutputSpec - * @constructor - * @param {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec=} [properties] Properties to set - */ - function CustomOutputSpec(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]]; - } - - /** - * CustomOutputSpec properties. - * @member {Array.} properties - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @instance - */ - CustomOutputSpec.prototype.properties = $util.emptyArray; - - /** - * Creates a new CustomOutputSpec instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} CustomOutputSpec instance - */ - CustomOutputSpec.create = function create(properties) { - return new CustomOutputSpec(properties); - }; - - /** - * Encodes the specified CustomOutputSpec message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec} message CustomOutputSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomOutputSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.properties != null && message.properties.length) - for (var i = 0; i < message.properties.length; ++i) - $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.encode(message.properties[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CustomOutputSpec message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.ICustomOutputSpec} message CustomOutputSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomOutputSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomOutputSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} CustomOutputSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomOutputSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.properties && message.properties.length)) - message.properties = []; - message.properties.push($root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomOutputSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} CustomOutputSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomOutputSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomOutputSpec message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomOutputSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!Array.isArray(message.properties)) - return "properties: array expected"; - for (var i = 0; i < message.properties.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - return null; - }; - - /** - * Creates a CustomOutputSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} CustomOutputSpec - */ - CustomOutputSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec) - return object; - var message = new $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec(); - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.properties: array expected"); - message.properties = []; - for (var i = 0; i < object.properties.length; ++i) { - if (typeof object.properties[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.properties: object expected"); - message.properties[i] = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.fromObject(object.properties[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CustomOutputSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec} message CustomOutputSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomOutputSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.properties = []; - if (message.properties && message.properties.length) { - object.properties = []; - for (var j = 0; j < message.properties.length; ++j) - object.properties[j] = $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.toObject(message.properties[j], options); - } - return object; - }; - - /** - * Converts this CustomOutputSpec to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @instance - * @returns {Object.} JSON object - */ - CustomOutputSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomOutputSpec - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomOutputSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec"; - }; - - CustomOutputSpec.Property = (function() { - - /** - * Properties of a Property. - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @interface IProperty - * @property {string|null} [name] Property name - * @property {google.type.IExpr|null} [valueExpression] Property valueExpression - */ - - /** - * Constructs a new Property. - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec - * @classdesc Represents a Property. - * @implements IProperty - * @constructor - * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty=} [properties] Properties to set - */ - function Property(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Property name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @instance - */ - Property.prototype.name = ""; - - /** - * Property valueExpression. - * @member {google.type.IExpr|null|undefined} valueExpression - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @instance - */ - Property.prototype.valueExpression = null; - - /** - * Creates a new Property instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} Property instance - */ - Property.create = function create(properties) { - return new Property(properties); - }; - - /** - * Encodes the specified Property message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty} message Property message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Property.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.valueExpression != null && Object.hasOwnProperty.call(message, "valueExpression")) - $root.google.type.Expr.encode(message.valueExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.IProperty} message Property message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Property.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Property message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} Property - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Property.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.valueExpression = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Property message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} Property - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Property.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Property message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Property.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.valueExpression != null && message.hasOwnProperty("valueExpression")) { - var error = $root.google.type.Expr.verify(message.valueExpression); - if (error) - return "valueExpression." + error; - } - return null; - }; - - /** - * Creates a Property message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} Property - */ - Property.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property) - return object; - var message = new $root.google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property(); - if (object.name != null) - message.name = String(object.name); - if (object.valueExpression != null) { - if (typeof object.valueExpression !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property.valueExpression: object expected"); - message.valueExpression = $root.google.type.Expr.fromObject(object.valueExpression); - } - return message; - }; - - /** - * Creates a plain object from a Property message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property} message Property - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Property.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.valueExpression = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.valueExpression != null && message.hasOwnProperty("valueExpression")) - object.valueExpression = $root.google.type.Expr.toObject(message.valueExpression, options); - return object; - }; - - /** - * Converts this Property to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @instance - * @returns {Object.} JSON object - */ - Property.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Property - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Property.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomConfig.CustomOutputSpec.Property"; - }; - - return Property; - })(); - - return CustomOutputSpec; - })(); - - CustomConfig.ResourceSelector = (function() { - - /** - * Properties of a ResourceSelector. - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @interface IResourceSelector - * @property {Array.|null} [resourceTypes] ResourceSelector resourceTypes - */ - - /** - * Constructs a new ResourceSelector. - * @memberof google.cloud.securitycenter.v1.CustomConfig - * @classdesc Represents a ResourceSelector. - * @implements IResourceSelector - * @constructor - * @param {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector=} [properties] Properties to set - */ - function ResourceSelector(properties) { - this.resourceTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceSelector resourceTypes. - * @member {Array.} resourceTypes - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @instance - */ - ResourceSelector.prototype.resourceTypes = $util.emptyArray; - - /** - * Creates a new ResourceSelector instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} ResourceSelector instance - */ - ResourceSelector.create = function create(properties) { - return new ResourceSelector(properties); - }; - - /** - * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector} message ResourceSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceTypes != null && message.resourceTypes.length) - for (var i = 0; i < message.resourceTypes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceTypes[i]); - return writer; - }; - - /** - * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.IResourceSelector} message ResourceSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceSelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} ResourceSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSelector.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.resourceTypes && message.resourceTypes.length)) - message.resourceTypes = []; - message.resourceTypes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} ResourceSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceSelector message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceTypes != null && message.hasOwnProperty("resourceTypes")) { - if (!Array.isArray(message.resourceTypes)) - return "resourceTypes: array expected"; - for (var i = 0; i < message.resourceTypes.length; ++i) - if (!$util.isString(message.resourceTypes[i])) - return "resourceTypes: string[] expected"; - } - return null; - }; - - /** - * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} ResourceSelector - */ - ResourceSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector) - return object; - var message = new $root.google.cloud.securitycenter.v1.CustomConfig.ResourceSelector(); - if (object.resourceTypes) { - if (!Array.isArray(object.resourceTypes)) - throw TypeError(".google.cloud.securitycenter.v1.CustomConfig.ResourceSelector.resourceTypes: array expected"); - message.resourceTypes = []; - for (var i = 0; i < object.resourceTypes.length; ++i) - message.resourceTypes[i] = String(object.resourceTypes[i]); - } - return message; - }; - - /** - * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {google.cloud.securitycenter.v1.CustomConfig.ResourceSelector} message ResourceSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceTypes = []; - if (message.resourceTypes && message.resourceTypes.length) { - object.resourceTypes = []; - for (var j = 0; j < message.resourceTypes.length; ++j) - object.resourceTypes[j] = message.resourceTypes[j]; - } - return object; - }; - - /** - * Converts this ResourceSelector to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @instance - * @returns {Object.} JSON object - */ - ResourceSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceSelector - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CustomConfig.ResourceSelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomConfig.ResourceSelector"; - }; - - return ResourceSelector; - })(); - - /** - * Severity enum. - * @name google.cloud.securitycenter.v1.CustomConfig.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 - */ - CustomConfig.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 CustomConfig; - })(); - - v1.EventThreatDetectionCustomModule = (function() { - - /** - * Properties of an EventThreatDetectionCustomModule. - * @memberof google.cloud.securitycenter.v1 - * @interface IEventThreatDetectionCustomModule - * @property {string|null} [name] EventThreatDetectionCustomModule name - * @property {google.protobuf.IStruct|null} [config] EventThreatDetectionCustomModule config - * @property {string|null} [ancestorModule] EventThreatDetectionCustomModule ancestorModule - * @property {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState|null} [enablementState] EventThreatDetectionCustomModule enablementState - * @property {string|null} [type] EventThreatDetectionCustomModule type - * @property {string|null} [displayName] EventThreatDetectionCustomModule displayName - * @property {string|null} [description] EventThreatDetectionCustomModule description - * @property {google.protobuf.ITimestamp|null} [updateTime] EventThreatDetectionCustomModule updateTime - * @property {string|null} [lastEditor] EventThreatDetectionCustomModule lastEditor - */ - - /** - * Constructs a new EventThreatDetectionCustomModule. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an EventThreatDetectionCustomModule. - * @implements IEventThreatDetectionCustomModule - * @constructor - * @param {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule=} [properties] Properties to set - */ - function EventThreatDetectionCustomModule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EventThreatDetectionCustomModule name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.name = ""; - - /** - * EventThreatDetectionCustomModule config. - * @member {google.protobuf.IStruct|null|undefined} config - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.config = null; - - /** - * EventThreatDetectionCustomModule ancestorModule. - * @member {string} ancestorModule - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.ancestorModule = ""; - - /** - * EventThreatDetectionCustomModule enablementState. - * @member {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState} enablementState - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.enablementState = 0; - - /** - * EventThreatDetectionCustomModule type. - * @member {string} type - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.type = ""; - - /** - * EventThreatDetectionCustomModule displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.displayName = ""; - - /** - * EventThreatDetectionCustomModule description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.description = ""; - - /** - * EventThreatDetectionCustomModule updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.updateTime = null; - - /** - * EventThreatDetectionCustomModule lastEditor. - * @member {string} lastEditor - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - */ - EventThreatDetectionCustomModule.prototype.lastEditor = ""; - - /** - * Creates a new EventThreatDetectionCustomModule instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} EventThreatDetectionCustomModule instance - */ - EventThreatDetectionCustomModule.create = function create(properties) { - return new EventThreatDetectionCustomModule(properties); - }; - - /** - * Encodes the specified EventThreatDetectionCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule} message EventThreatDetectionCustomModule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EventThreatDetectionCustomModule.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.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.protobuf.Struct.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ancestorModule != null && Object.hasOwnProperty.call(message, "ancestorModule")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestorModule); - if (message.enablementState != null && Object.hasOwnProperty.call(message, "enablementState")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.enablementState); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.type); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.lastEditor != null && Object.hasOwnProperty.call(message, "lastEditor")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.lastEditor); - return writer; - }; - - /** - * Encodes the specified EventThreatDetectionCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule} message EventThreatDetectionCustomModule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EventThreatDetectionCustomModule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EventThreatDetectionCustomModule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} EventThreatDetectionCustomModule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EventThreatDetectionCustomModule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.config = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - message.ancestorModule = reader.string(); - break; - } - case 4: { - message.enablementState = reader.int32(); - break; - } - case 5: { - message.type = reader.string(); - break; - } - case 6: { - message.displayName = reader.string(); - break; - } - case 7: { - message.description = reader.string(); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.lastEditor = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EventThreatDetectionCustomModule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} EventThreatDetectionCustomModule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EventThreatDetectionCustomModule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EventThreatDetectionCustomModule message. - * @function verify - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EventThreatDetectionCustomModule.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.config != null && message.hasOwnProperty("config")) { - var error = $root.google.protobuf.Struct.verify(message.config); - if (error) - return "config." + error; - } - if (message.ancestorModule != null && message.hasOwnProperty("ancestorModule")) - if (!$util.isString(message.ancestorModule)) - return "ancestorModule: string expected"; - if (message.enablementState != null && message.hasOwnProperty("enablementState")) - switch (message.enablementState) { - default: - return "enablementState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: 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.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.lastEditor != null && message.hasOwnProperty("lastEditor")) - if (!$util.isString(message.lastEditor)) - return "lastEditor: string expected"; - return null; - }; - - /** - * Creates an EventThreatDetectionCustomModule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} EventThreatDetectionCustomModule - */ - EventThreatDetectionCustomModule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) - return object; - var message = new $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule(); - if (object.name != null) - message.name = String(object.name); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.config: object expected"); - message.config = $root.google.protobuf.Struct.fromObject(object.config); - } - if (object.ancestorModule != null) - message.ancestorModule = String(object.ancestorModule); - switch (object.enablementState) { - default: - if (typeof object.enablementState === "number") { - message.enablementState = object.enablementState; - break; - } - break; - case "ENABLEMENT_STATE_UNSPECIFIED": - case 0: - message.enablementState = 0; - break; - case "ENABLED": - case 1: - message.enablementState = 1; - break; - case "DISABLED": - case 2: - message.enablementState = 2; - break; - case "INHERITED": - case 3: - message.enablementState = 3; - break; - } - if (object.type != null) - message.type = String(object.type); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.lastEditor != null) - message.lastEditor = String(object.lastEditor); - return message; - }; - - /** - * Creates a plain object from an EventThreatDetectionCustomModule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} message EventThreatDetectionCustomModule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EventThreatDetectionCustomModule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.config = null; - object.ancestorModule = ""; - object.enablementState = options.enums === String ? "ENABLEMENT_STATE_UNSPECIFIED" : 0; - object.type = ""; - object.displayName = ""; - object.description = ""; - object.updateTime = null; - object.lastEditor = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.protobuf.Struct.toObject(message.config, options); - if (message.ancestorModule != null && message.hasOwnProperty("ancestorModule")) - object.ancestorModule = message.ancestorModule; - if (message.enablementState != null && message.hasOwnProperty("enablementState")) - object.enablementState = options.enums === String ? $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState[message.enablementState] : message.enablementState; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.lastEditor != null && message.hasOwnProperty("lastEditor")) - object.lastEditor = message.lastEditor; - return object; - }; - - /** - * Converts this EventThreatDetectionCustomModule to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @instance - * @returns {Object.} JSON object - */ - EventThreatDetectionCustomModule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EventThreatDetectionCustomModule - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.EventThreatDetectionCustomModule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EventThreatDetectionCustomModule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.EventThreatDetectionCustomModule"; - }; - - /** - * EnablementState enum. - * @name google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState - * @enum {number} - * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - * @property {number} INHERITED=3 INHERITED value - */ - EventThreatDetectionCustomModule.EnablementState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENABLEMENT_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - values[valuesById[3] = "INHERITED"] = 3; - return values; - })(); - - return EventThreatDetectionCustomModule; - })(); - - v1.CustomModuleValidationErrors = (function() { - - /** - * Properties of a CustomModuleValidationErrors. - * @memberof google.cloud.securitycenter.v1 - * @interface ICustomModuleValidationErrors - * @property {Array.|null} [errors] CustomModuleValidationErrors errors - */ - - /** - * Constructs a new CustomModuleValidationErrors. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CustomModuleValidationErrors. - * @implements ICustomModuleValidationErrors - * @constructor - * @param {google.cloud.securitycenter.v1.ICustomModuleValidationErrors=} [properties] Properties to set - */ - function CustomModuleValidationErrors(properties) { - this.errors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomModuleValidationErrors errors. - * @member {Array.} errors - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @instance - */ - CustomModuleValidationErrors.prototype.errors = $util.emptyArray; - - /** - * Creates a new CustomModuleValidationErrors instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {google.cloud.securitycenter.v1.ICustomModuleValidationErrors=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CustomModuleValidationErrors} CustomModuleValidationErrors instance - */ - CustomModuleValidationErrors.create = function create(properties) { - return new CustomModuleValidationErrors(properties); - }; - - /** - * Encodes the specified CustomModuleValidationErrors message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {google.cloud.securitycenter.v1.ICustomModuleValidationErrors} message CustomModuleValidationErrors message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomModuleValidationErrors.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.errors != null && message.errors.length) - for (var i = 0; i < message.errors.length; ++i) - $root.google.cloud.securitycenter.v1.CustomModuleValidationError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CustomModuleValidationErrors message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {google.cloud.securitycenter.v1.ICustomModuleValidationErrors} message CustomModuleValidationErrors message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomModuleValidationErrors.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomModuleValidationErrors message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CustomModuleValidationErrors} CustomModuleValidationErrors - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomModuleValidationErrors.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.errors && message.errors.length)) - message.errors = []; - message.errors.push($root.google.cloud.securitycenter.v1.CustomModuleValidationError.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomModuleValidationErrors message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CustomModuleValidationErrors} CustomModuleValidationErrors - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomModuleValidationErrors.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomModuleValidationErrors message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomModuleValidationErrors.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.errors != null && message.hasOwnProperty("errors")) { - if (!Array.isArray(message.errors)) - return "errors: array expected"; - for (var i = 0; i < message.errors.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.CustomModuleValidationError.verify(message.errors[i]); - if (error) - return "errors." + error; - } - } - return null; - }; - - /** - * Creates a CustomModuleValidationErrors message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CustomModuleValidationErrors} CustomModuleValidationErrors - */ - CustomModuleValidationErrors.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors) - return object; - var message = new $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors(); - if (object.errors) { - if (!Array.isArray(object.errors)) - throw TypeError(".google.cloud.securitycenter.v1.CustomModuleValidationErrors.errors: array expected"); - message.errors = []; - for (var i = 0; i < object.errors.length; ++i) { - if (typeof object.errors[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CustomModuleValidationErrors.errors: object expected"); - message.errors[i] = $root.google.cloud.securitycenter.v1.CustomModuleValidationError.fromObject(object.errors[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CustomModuleValidationErrors message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {google.cloud.securitycenter.v1.CustomModuleValidationErrors} message CustomModuleValidationErrors - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomModuleValidationErrors.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.errors = []; - if (message.errors && message.errors.length) { - object.errors = []; - for (var j = 0; j < message.errors.length; ++j) - object.errors[j] = $root.google.cloud.securitycenter.v1.CustomModuleValidationError.toObject(message.errors[j], options); - } - return object; - }; - - /** - * Converts this CustomModuleValidationErrors to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @instance - * @returns {Object.} JSON object - */ - CustomModuleValidationErrors.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomModuleValidationErrors - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationErrors - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomModuleValidationErrors.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomModuleValidationErrors"; - }; - - return CustomModuleValidationErrors; - })(); - - v1.CustomModuleValidationError = (function() { - - /** - * Properties of a CustomModuleValidationError. - * @memberof google.cloud.securitycenter.v1 - * @interface ICustomModuleValidationError - * @property {string|null} [description] CustomModuleValidationError description - * @property {string|null} [fieldPath] CustomModuleValidationError fieldPath - * @property {google.cloud.securitycenter.v1.IPosition|null} [start] CustomModuleValidationError start - * @property {google.cloud.securitycenter.v1.IPosition|null} [end] CustomModuleValidationError end - */ - - /** - * Constructs a new CustomModuleValidationError. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CustomModuleValidationError. - * @implements ICustomModuleValidationError - * @constructor - * @param {google.cloud.securitycenter.v1.ICustomModuleValidationError=} [properties] Properties to set - */ - function CustomModuleValidationError(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomModuleValidationError description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @instance - */ - CustomModuleValidationError.prototype.description = ""; - - /** - * CustomModuleValidationError fieldPath. - * @member {string} fieldPath - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @instance - */ - CustomModuleValidationError.prototype.fieldPath = ""; - - /** - * CustomModuleValidationError start. - * @member {google.cloud.securitycenter.v1.IPosition|null|undefined} start - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @instance - */ - CustomModuleValidationError.prototype.start = null; - - /** - * CustomModuleValidationError end. - * @member {google.cloud.securitycenter.v1.IPosition|null|undefined} end - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @instance - */ - CustomModuleValidationError.prototype.end = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CustomModuleValidationError.prototype, "_start", { - get: $util.oneOfGetter($oneOfFields = ["start"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CustomModuleValidationError.prototype, "_end", { - get: $util.oneOfGetter($oneOfFields = ["end"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CustomModuleValidationError instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {google.cloud.securitycenter.v1.ICustomModuleValidationError=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CustomModuleValidationError} CustomModuleValidationError instance - */ - CustomModuleValidationError.create = function create(properties) { - return new CustomModuleValidationError(properties); - }; - - /** - * Encodes the specified CustomModuleValidationError message. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationError.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {google.cloud.securitycenter.v1.ICustomModuleValidationError} message CustomModuleValidationError message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomModuleValidationError.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.fieldPath != null && Object.hasOwnProperty.call(message, "fieldPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldPath); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - $root.google.cloud.securitycenter.v1.Position.encode(message.start, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - $root.google.cloud.securitycenter.v1.Position.encode(message.end, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CustomModuleValidationError message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CustomModuleValidationError.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {google.cloud.securitycenter.v1.ICustomModuleValidationError} message CustomModuleValidationError message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomModuleValidationError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomModuleValidationError message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CustomModuleValidationError} CustomModuleValidationError - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomModuleValidationError.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CustomModuleValidationError(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.fieldPath = reader.string(); - break; - } - case 3: { - message.start = $root.google.cloud.securitycenter.v1.Position.decode(reader, reader.uint32()); - break; - } - case 4: { - message.end = $root.google.cloud.securitycenter.v1.Position.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomModuleValidationError message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CustomModuleValidationError} CustomModuleValidationError - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomModuleValidationError.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomModuleValidationError message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomModuleValidationError.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.fieldPath != null && message.hasOwnProperty("fieldPath")) - if (!$util.isString(message.fieldPath)) - return "fieldPath: string expected"; - if (message.start != null && message.hasOwnProperty("start")) { - properties._start = 1; - { - var error = $root.google.cloud.securitycenter.v1.Position.verify(message.start); - if (error) - return "start." + error; - } - } - if (message.end != null && message.hasOwnProperty("end")) { - properties._end = 1; - { - var error = $root.google.cloud.securitycenter.v1.Position.verify(message.end); - if (error) - return "end." + error; - } - } - return null; - }; - - /** - * Creates a CustomModuleValidationError message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CustomModuleValidationError} CustomModuleValidationError - */ - CustomModuleValidationError.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CustomModuleValidationError) - return object; - var message = new $root.google.cloud.securitycenter.v1.CustomModuleValidationError(); - if (object.description != null) - message.description = String(object.description); - if (object.fieldPath != null) - message.fieldPath = String(object.fieldPath); - if (object.start != null) { - if (typeof object.start !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CustomModuleValidationError.start: object expected"); - message.start = $root.google.cloud.securitycenter.v1.Position.fromObject(object.start); - } - if (object.end != null) { - if (typeof object.end !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CustomModuleValidationError.end: object expected"); - message.end = $root.google.cloud.securitycenter.v1.Position.fromObject(object.end); - } - return message; - }; - - /** - * Creates a plain object from a CustomModuleValidationError message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {google.cloud.securitycenter.v1.CustomModuleValidationError} message CustomModuleValidationError - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomModuleValidationError.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.description = ""; - object.fieldPath = ""; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.fieldPath != null && message.hasOwnProperty("fieldPath")) - object.fieldPath = message.fieldPath; - if (message.start != null && message.hasOwnProperty("start")) { - object.start = $root.google.cloud.securitycenter.v1.Position.toObject(message.start, options); - if (options.oneofs) - object._start = "start"; - } - if (message.end != null && message.hasOwnProperty("end")) { - object.end = $root.google.cloud.securitycenter.v1.Position.toObject(message.end, options); - if (options.oneofs) - object._end = "end"; - } - return object; - }; - - /** - * Converts this CustomModuleValidationError to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @instance - * @returns {Object.} JSON object - */ - CustomModuleValidationError.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomModuleValidationError - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CustomModuleValidationError - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomModuleValidationError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CustomModuleValidationError"; - }; - - return CustomModuleValidationError; - })(); - - v1.Position = (function() { - - /** - * Properties of a Position. - * @memberof google.cloud.securitycenter.v1 - * @interface IPosition - * @property {number|null} [lineNumber] Position lineNumber - * @property {number|null} [columnNumber] Position columnNumber - */ - - /** - * Constructs a new Position. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Position. - * @implements IPosition - * @constructor - * @param {google.cloud.securitycenter.v1.IPosition=} [properties] Properties to set - */ - function Position(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Position lineNumber. - * @member {number} lineNumber - * @memberof google.cloud.securitycenter.v1.Position - * @instance - */ - Position.prototype.lineNumber = 0; - - /** - * Position columnNumber. - * @member {number} columnNumber - * @memberof google.cloud.securitycenter.v1.Position - * @instance - */ - Position.prototype.columnNumber = 0; - - /** - * Creates a new Position instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {google.cloud.securitycenter.v1.IPosition=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Position} Position instance - */ - Position.create = function create(properties) { - return new Position(properties); - }; - - /** - * Encodes the specified Position message. Does not implicitly {@link google.cloud.securitycenter.v1.Position.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {google.cloud.securitycenter.v1.IPosition} message Position message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Position.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.lineNumber != null && Object.hasOwnProperty.call(message, "lineNumber")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lineNumber); - if (message.columnNumber != null && Object.hasOwnProperty.call(message, "columnNumber")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.columnNumber); - return writer; - }; - - /** - * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Position.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {google.cloud.securitycenter.v1.IPosition} message Position message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Position.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Position message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Position} Position - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Position.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Position(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.lineNumber = reader.int32(); - break; - } - case 2: { - message.columnNumber = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Position message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Position} Position - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Position.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Position message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Position.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) - if (!$util.isInteger(message.lineNumber)) - return "lineNumber: integer expected"; - if (message.columnNumber != null && message.hasOwnProperty("columnNumber")) - if (!$util.isInteger(message.columnNumber)) - return "columnNumber: integer expected"; - return null; - }; - - /** - * Creates a Position message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Position} Position - */ - Position.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Position) - return object; - var message = new $root.google.cloud.securitycenter.v1.Position(); - if (object.lineNumber != null) - message.lineNumber = object.lineNumber | 0; - if (object.columnNumber != null) - message.columnNumber = object.columnNumber | 0; - return message; - }; - - /** - * Creates a plain object from a Position message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {google.cloud.securitycenter.v1.Position} message Position - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Position.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.lineNumber = 0; - object.columnNumber = 0; - } - if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) - object.lineNumber = message.lineNumber; - if (message.columnNumber != null && message.hasOwnProperty("columnNumber")) - object.columnNumber = message.columnNumber; - return object; - }; - - /** - * Converts this Position to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Position - * @instance - * @returns {Object.} JSON object - */ - Position.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Position - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Position - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Position.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Position"; - }; - - return Position; - })(); - - v1.Exfiltration = (function() { - - /** - * Properties of an Exfiltration. - * @memberof google.cloud.securitycenter.v1 - * @interface IExfiltration - * @property {Array.|null} [sources] Exfiltration sources - * @property {Array.|null} [targets] Exfiltration targets - * @property {number|Long|null} [totalExfiltratedBytes] Exfiltration totalExfiltratedBytes - */ - - /** - * Constructs a new Exfiltration. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an Exfiltration. - * @implements IExfiltration - * @constructor - * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set - */ - 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) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Exfiltration sources. - * @member {Array.} sources - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @instance - */ - Exfiltration.prototype.sources = $util.emptyArray; - - /** - * Exfiltration targets. - * @member {Array.} targets - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @instance - */ - Exfiltration.prototype.targets = $util.emptyArray; - - /** - * Exfiltration totalExfiltratedBytes. - * @member {number|Long} totalExfiltratedBytes - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @instance - */ - Exfiltration.prototype.totalExfiltratedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Exfiltration instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @static - * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration instance - */ - Exfiltration.create = function create(properties) { - return new Exfiltration(properties); - }; - - /** - * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @static - * @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 - */ - Exfiltration.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.totalExfiltratedBytes != null && Object.hasOwnProperty.call(message, "totalExfiltratedBytes")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalExfiltratedBytes); - return writer; - }; - - /** - * 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.Exfiltration - * @static - * @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 - */ - Exfiltration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Exfiltration message from the specified reader or buffer. - * @function decode - * @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.Exfiltration} Exfiltration - * @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, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 3: { - message.totalExfiltratedBytes = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Exfiltration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Exfiltration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Exfiltration message. - * @function verify - * @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 - */ - Exfiltration.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 (error) - return "targets." + error; - } - } - if (message.totalExfiltratedBytes != null && message.hasOwnProperty("totalExfiltratedBytes")) - if (!$util.isInteger(message.totalExfiltratedBytes) && !(message.totalExfiltratedBytes && $util.isInteger(message.totalExfiltratedBytes.low) && $util.isInteger(message.totalExfiltratedBytes.high))) - return "totalExfiltratedBytes: integer|Long expected"; - return null; - }; - - /** - * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration - */ - Exfiltration.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Exfiltration) - 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]); - } - } - if (object.totalExfiltratedBytes != null) - if ($util.Long) - (message.totalExfiltratedBytes = $util.Long.fromValue(object.totalExfiltratedBytes)).unsigned = false; - else if (typeof object.totalExfiltratedBytes === "string") - message.totalExfiltratedBytes = parseInt(object.totalExfiltratedBytes, 10); - else if (typeof object.totalExfiltratedBytes === "number") - message.totalExfiltratedBytes = object.totalExfiltratedBytes; - else if (typeof object.totalExfiltratedBytes === "object") - message.totalExfiltratedBytes = new $util.LongBits(object.totalExfiltratedBytes.low >>> 0, object.totalExfiltratedBytes.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @static - * @param {google.cloud.securitycenter.v1.Exfiltration} message Exfiltration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Exfiltration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.sources = []; - object.targets = []; - } - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalExfiltratedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalExfiltratedBytes = options.longs === String ? "0" : 0; - 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.totalExfiltratedBytes != null && message.hasOwnProperty("totalExfiltratedBytes")) - if (typeof message.totalExfiltratedBytes === "number") - object.totalExfiltratedBytes = options.longs === String ? String(message.totalExfiltratedBytes) : message.totalExfiltratedBytes; - else - object.totalExfiltratedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalExfiltratedBytes) : options.longs === Number ? new $util.LongBits(message.totalExfiltratedBytes.low >>> 0, message.totalExfiltratedBytes.high >>> 0).toNumber() : message.totalExfiltratedBytes; - return object; - }; - - /** - * Converts this Exfiltration to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Exfiltration - * @instance - * @returns {Object.} JSON object - */ - Exfiltration.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.ExfilResource = (function() { - - /** - * Properties of an ExfilResource. - * @memberof google.cloud.securitycenter.v1 - * @interface IExfilResource - * @property {string|null} [name] ExfilResource name - * @property {Array.|null} [components] ExfilResource components - */ - - /** - * Constructs a new ExfilResource. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an ExfilResource. - * @implements IExfilResource - * @constructor - * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set - */ - function ExfilResource(properties) { - this.components = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExfilResource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.ExfilResource - * @instance - */ - ExfilResource.prototype.name = ""; - - /** - * ExfilResource components. - * @member {Array.} components - * @memberof google.cloud.securitycenter.v1.ExfilResource - * @instance - */ - ExfilResource.prototype.components = $util.emptyArray; - - /** - * 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 - */ - ExfilResource.create = function create(properties) { - return new ExfilResource(properties); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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 - */ - ExfilResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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 - */ - ExfilResource.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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 - */ - ExfilResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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 - */ - 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; - }; - - /** - * Converts this ExfilResource to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ExfilResource - * @instance - * @returns {Object.} JSON object - */ - ExfilResource.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.ExternalExposure = (function() { - - /** - * Properties of an ExternalExposure. - * @memberof google.cloud.securitycenter.v1 - * @interface IExternalExposure - * @property {string|null} [privateIpAddress] ExternalExposure privateIpAddress - * @property {string|null} [privatePort] ExternalExposure privatePort - * @property {string|null} [exposedService] ExternalExposure exposedService - * @property {string|null} [publicIpAddress] ExternalExposure publicIpAddress - * @property {string|null} [publicPort] ExternalExposure publicPort - * @property {string|null} [exposedEndpoint] ExternalExposure exposedEndpoint - * @property {string|null} [loadBalancerFirewallPolicy] ExternalExposure loadBalancerFirewallPolicy - * @property {string|null} [serviceFirewallPolicy] ExternalExposure serviceFirewallPolicy - * @property {string|null} [forwardingRule] ExternalExposure forwardingRule - * @property {string|null} [backendService] ExternalExposure backendService - * @property {string|null} [instanceGroup] ExternalExposure instanceGroup - * @property {string|null} [networkEndpointGroup] ExternalExposure networkEndpointGroup - */ - - /** - * Constructs a new ExternalExposure. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an ExternalExposure. - * @implements IExternalExposure - * @constructor - * @param {google.cloud.securitycenter.v1.IExternalExposure=} [properties] Properties to set - */ - function ExternalExposure(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExternalExposure privateIpAddress. - * @member {string} privateIpAddress - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.privateIpAddress = ""; - - /** - * ExternalExposure privatePort. - * @member {string} privatePort - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.privatePort = ""; - - /** - * ExternalExposure exposedService. - * @member {string} exposedService - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.exposedService = ""; - - /** - * ExternalExposure publicIpAddress. - * @member {string} publicIpAddress - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.publicIpAddress = ""; - - /** - * ExternalExposure publicPort. - * @member {string} publicPort - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.publicPort = ""; - - /** - * ExternalExposure exposedEndpoint. - * @member {string} exposedEndpoint - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.exposedEndpoint = ""; - - /** - * ExternalExposure loadBalancerFirewallPolicy. - * @member {string} loadBalancerFirewallPolicy - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.loadBalancerFirewallPolicy = ""; - - /** - * ExternalExposure serviceFirewallPolicy. - * @member {string} serviceFirewallPolicy - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.serviceFirewallPolicy = ""; - - /** - * ExternalExposure forwardingRule. - * @member {string} forwardingRule - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.forwardingRule = ""; - - /** - * ExternalExposure backendService. - * @member {string} backendService - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.backendService = ""; - - /** - * ExternalExposure instanceGroup. - * @member {string} instanceGroup - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.instanceGroup = ""; - - /** - * ExternalExposure networkEndpointGroup. - * @member {string} networkEndpointGroup - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - */ - ExternalExposure.prototype.networkEndpointGroup = ""; - - /** - * Creates a new ExternalExposure instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {google.cloud.securitycenter.v1.IExternalExposure=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure instance - */ - ExternalExposure.create = function create(properties) { - return new ExternalExposure(properties); - }; - - /** - * Encodes the specified ExternalExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {google.cloud.securitycenter.v1.IExternalExposure} message ExternalExposure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExternalExposure.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.privateIpAddress != null && Object.hasOwnProperty.call(message, "privateIpAddress")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateIpAddress); - if (message.privatePort != null && Object.hasOwnProperty.call(message, "privatePort")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.privatePort); - if (message.exposedService != null && Object.hasOwnProperty.call(message, "exposedService")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exposedService); - if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicIpAddress); - if (message.publicPort != null && Object.hasOwnProperty.call(message, "publicPort")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicPort); - if (message.exposedEndpoint != null && Object.hasOwnProperty.call(message, "exposedEndpoint")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.exposedEndpoint); - if (message.loadBalancerFirewallPolicy != null && Object.hasOwnProperty.call(message, "loadBalancerFirewallPolicy")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.loadBalancerFirewallPolicy); - if (message.serviceFirewallPolicy != null && Object.hasOwnProperty.call(message, "serviceFirewallPolicy")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceFirewallPolicy); - if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.forwardingRule); - if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.backendService); - if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.instanceGroup); - if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.networkEndpointGroup); - return writer; - }; - - /** - * Encodes the specified ExternalExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {google.cloud.securitycenter.v1.IExternalExposure} message ExternalExposure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExternalExposure.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExternalExposure message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExternalExposure.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ExternalExposure(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.privateIpAddress = reader.string(); - break; - } - case 2: { - message.privatePort = reader.string(); - break; - } - case 3: { - message.exposedService = reader.string(); - break; - } - case 4: { - message.publicIpAddress = reader.string(); - break; - } - case 5: { - message.publicPort = reader.string(); - break; - } - case 6: { - message.exposedEndpoint = reader.string(); - break; - } - case 7: { - message.loadBalancerFirewallPolicy = reader.string(); - break; - } - case 8: { - message.serviceFirewallPolicy = reader.string(); - break; - } - case 9: { - message.forwardingRule = reader.string(); - break; - } - case 10: { - message.backendService = reader.string(); - break; - } - case 11: { - message.instanceGroup = reader.string(); - break; - } - case 12: { - message.networkEndpointGroup = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExternalExposure message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExternalExposure.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExternalExposure message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExternalExposure.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.privateIpAddress != null && message.hasOwnProperty("privateIpAddress")) - if (!$util.isString(message.privateIpAddress)) - return "privateIpAddress: string expected"; - if (message.privatePort != null && message.hasOwnProperty("privatePort")) - if (!$util.isString(message.privatePort)) - return "privatePort: string expected"; - if (message.exposedService != null && message.hasOwnProperty("exposedService")) - if (!$util.isString(message.exposedService)) - return "exposedService: string expected"; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - if (!$util.isString(message.publicIpAddress)) - return "publicIpAddress: string expected"; - if (message.publicPort != null && message.hasOwnProperty("publicPort")) - if (!$util.isString(message.publicPort)) - return "publicPort: string expected"; - if (message.exposedEndpoint != null && message.hasOwnProperty("exposedEndpoint")) - if (!$util.isString(message.exposedEndpoint)) - return "exposedEndpoint: string expected"; - if (message.loadBalancerFirewallPolicy != null && message.hasOwnProperty("loadBalancerFirewallPolicy")) - if (!$util.isString(message.loadBalancerFirewallPolicy)) - return "loadBalancerFirewallPolicy: string expected"; - if (message.serviceFirewallPolicy != null && message.hasOwnProperty("serviceFirewallPolicy")) - if (!$util.isString(message.serviceFirewallPolicy)) - return "serviceFirewallPolicy: string expected"; - if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) - if (!$util.isString(message.forwardingRule)) - return "forwardingRule: string expected"; - if (message.backendService != null && message.hasOwnProperty("backendService")) - if (!$util.isString(message.backendService)) - return "backendService: string expected"; - if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) - if (!$util.isString(message.instanceGroup)) - return "instanceGroup: string expected"; - if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) - if (!$util.isString(message.networkEndpointGroup)) - return "networkEndpointGroup: string expected"; - return null; - }; - - /** - * Creates an ExternalExposure message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure - */ - ExternalExposure.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ExternalExposure) - return object; - var message = new $root.google.cloud.securitycenter.v1.ExternalExposure(); - if (object.privateIpAddress != null) - message.privateIpAddress = String(object.privateIpAddress); - if (object.privatePort != null) - message.privatePort = String(object.privatePort); - if (object.exposedService != null) - message.exposedService = String(object.exposedService); - if (object.publicIpAddress != null) - message.publicIpAddress = String(object.publicIpAddress); - if (object.publicPort != null) - message.publicPort = String(object.publicPort); - if (object.exposedEndpoint != null) - message.exposedEndpoint = String(object.exposedEndpoint); - if (object.loadBalancerFirewallPolicy != null) - message.loadBalancerFirewallPolicy = String(object.loadBalancerFirewallPolicy); - if (object.serviceFirewallPolicy != null) - message.serviceFirewallPolicy = String(object.serviceFirewallPolicy); - if (object.forwardingRule != null) - message.forwardingRule = String(object.forwardingRule); - if (object.backendService != null) - message.backendService = String(object.backendService); - if (object.instanceGroup != null) - message.instanceGroup = String(object.instanceGroup); - if (object.networkEndpointGroup != null) - message.networkEndpointGroup = String(object.networkEndpointGroup); - return message; - }; - - /** - * Creates a plain object from an ExternalExposure message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {google.cloud.securitycenter.v1.ExternalExposure} message ExternalExposure - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExternalExposure.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.privateIpAddress = ""; - object.privatePort = ""; - object.exposedService = ""; - object.publicIpAddress = ""; - object.publicPort = ""; - object.exposedEndpoint = ""; - object.loadBalancerFirewallPolicy = ""; - object.serviceFirewallPolicy = ""; - object.forwardingRule = ""; - object.backendService = ""; - object.instanceGroup = ""; - object.networkEndpointGroup = ""; - } - if (message.privateIpAddress != null && message.hasOwnProperty("privateIpAddress")) - object.privateIpAddress = message.privateIpAddress; - if (message.privatePort != null && message.hasOwnProperty("privatePort")) - object.privatePort = message.privatePort; - if (message.exposedService != null && message.hasOwnProperty("exposedService")) - object.exposedService = message.exposedService; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - object.publicIpAddress = message.publicIpAddress; - if (message.publicPort != null && message.hasOwnProperty("publicPort")) - object.publicPort = message.publicPort; - if (message.exposedEndpoint != null && message.hasOwnProperty("exposedEndpoint")) - object.exposedEndpoint = message.exposedEndpoint; - if (message.loadBalancerFirewallPolicy != null && message.hasOwnProperty("loadBalancerFirewallPolicy")) - object.loadBalancerFirewallPolicy = message.loadBalancerFirewallPolicy; - if (message.serviceFirewallPolicy != null && message.hasOwnProperty("serviceFirewallPolicy")) - object.serviceFirewallPolicy = message.serviceFirewallPolicy; - if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) - object.forwardingRule = message.forwardingRule; - if (message.backendService != null && message.hasOwnProperty("backendService")) - object.backendService = message.backendService; - if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) - object.instanceGroup = message.instanceGroup; - if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) - object.networkEndpointGroup = message.networkEndpointGroup; - return object; - }; - - /** - * Converts this ExternalExposure to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @instance - * @returns {Object.} JSON object - */ - ExternalExposure.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExternalExposure - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ExternalExposure - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExternalExposure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExternalExposure"; - }; - - return ExternalExposure; - })(); - - 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 - * @property {string|null} [caseUri] ExternalSystem caseUri - * @property {string|null} [casePriority] ExternalSystem casePriority - * @property {google.protobuf.ITimestamp|null} [caseSla] ExternalSystem caseSla - * @property {google.protobuf.ITimestamp|null} [caseCreateTime] ExternalSystem caseCreateTime - * @property {google.protobuf.ITimestamp|null} [caseCloseTime] ExternalSystem caseCloseTime - * @property {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo|null} [ticketInfo] ExternalSystem ticketInfo - */ - - /** - * 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; - - /** - * ExternalSystem caseUri. - * @member {string} caseUri - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.caseUri = ""; - - /** - * ExternalSystem casePriority. - * @member {string} casePriority - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.casePriority = ""; - - /** - * ExternalSystem caseSla. - * @member {google.protobuf.ITimestamp|null|undefined} caseSla - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.caseSla = null; - - /** - * ExternalSystem caseCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} caseCreateTime - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.caseCreateTime = null; - - /** - * ExternalSystem caseCloseTime. - * @member {google.protobuf.ITimestamp|null|undefined} caseCloseTime - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.caseCloseTime = null; - - /** - * ExternalSystem ticketInfo. - * @member {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo|null|undefined} ticketInfo - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.ticketInfo = 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(); - if (message.caseUri != null && Object.hasOwnProperty.call(message, "caseUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.caseUri); - if (message.casePriority != null && Object.hasOwnProperty.call(message, "casePriority")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.casePriority); - if (message.ticketInfo != null && Object.hasOwnProperty.call(message, "ticketInfo")) - $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.encode(message.ticketInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.caseSla != null && Object.hasOwnProperty.call(message, "caseSla")) - $root.google.protobuf.Timestamp.encode(message.caseSla, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.caseCreateTime != null && Object.hasOwnProperty.call(message, "caseCreateTime")) - $root.google.protobuf.Timestamp.encode(message.caseCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.caseCloseTime != null && Object.hasOwnProperty.call(message, "caseCloseTime")) - $root.google.protobuf.Timestamp.encode(message.caseCloseTime, writer.uint32(/* id 11, wireType 2 =*/90).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, error) { - 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(); - if (tag === error) - break; - 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 6: { - message.caseUri = reader.string(); - break; - } - case 7: { - message.casePriority = reader.string(); - break; - } - case 9: { - message.caseSla = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.caseCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.caseCloseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.ticketInfo = $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.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; - } - if (message.caseUri != null && message.hasOwnProperty("caseUri")) - if (!$util.isString(message.caseUri)) - return "caseUri: string expected"; - if (message.casePriority != null && message.hasOwnProperty("casePriority")) - if (!$util.isString(message.casePriority)) - return "casePriority: string expected"; - if (message.caseSla != null && message.hasOwnProperty("caseSla")) { - var error = $root.google.protobuf.Timestamp.verify(message.caseSla); - if (error) - return "caseSla." + error; - } - if (message.caseCreateTime != null && message.hasOwnProperty("caseCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.caseCreateTime); - if (error) - return "caseCreateTime." + error; - } - if (message.caseCloseTime != null && message.hasOwnProperty("caseCloseTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.caseCloseTime); - if (error) - return "caseCloseTime." + error; - } - if (message.ticketInfo != null && message.hasOwnProperty("ticketInfo")) { - var error = $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify(message.ticketInfo); - if (error) - return "ticketInfo." + 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); - } - if (object.caseUri != null) - message.caseUri = String(object.caseUri); - if (object.casePriority != null) - message.casePriority = String(object.casePriority); - if (object.caseSla != null) { - if (typeof object.caseSla !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.caseSla: object expected"); - message.caseSla = $root.google.protobuf.Timestamp.fromObject(object.caseSla); - } - if (object.caseCreateTime != null) { - if (typeof object.caseCreateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.caseCreateTime: object expected"); - message.caseCreateTime = $root.google.protobuf.Timestamp.fromObject(object.caseCreateTime); - } - if (object.caseCloseTime != null) { - if (typeof object.caseCloseTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.caseCloseTime: object expected"); - message.caseCloseTime = $root.google.protobuf.Timestamp.fromObject(object.caseCloseTime); - } - if (object.ticketInfo != null) { - if (typeof object.ticketInfo !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.ticketInfo: object expected"); - message.ticketInfo = $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.fromObject(object.ticketInfo); - } - 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; - object.caseUri = ""; - object.casePriority = ""; - object.ticketInfo = null; - object.caseSla = null; - object.caseCreateTime = null; - object.caseCloseTime = 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); - if (message.caseUri != null && message.hasOwnProperty("caseUri")) - object.caseUri = message.caseUri; - if (message.casePriority != null && message.hasOwnProperty("casePriority")) - object.casePriority = message.casePriority; - if (message.ticketInfo != null && message.hasOwnProperty("ticketInfo")) - object.ticketInfo = $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.toObject(message.ticketInfo, options); - if (message.caseSla != null && message.hasOwnProperty("caseSla")) - object.caseSla = $root.google.protobuf.Timestamp.toObject(message.caseSla, options); - if (message.caseCreateTime != null && message.hasOwnProperty("caseCreateTime")) - object.caseCreateTime = $root.google.protobuf.Timestamp.toObject(message.caseCreateTime, options); - if (message.caseCloseTime != null && message.hasOwnProperty("caseCloseTime")) - object.caseCloseTime = $root.google.protobuf.Timestamp.toObject(message.caseCloseTime, 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); - }; - - /** - * 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"; - }; - - ExternalSystem.TicketInfo = (function() { - - /** - * Properties of a TicketInfo. - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @interface ITicketInfo - * @property {string|null} [id] TicketInfo id - * @property {string|null} [assignee] TicketInfo assignee - * @property {string|null} [description] TicketInfo description - * @property {string|null} [uri] TicketInfo uri - * @property {string|null} [status] TicketInfo status - * @property {google.protobuf.ITimestamp|null} [updateTime] TicketInfo updateTime - */ - - /** - * Constructs a new TicketInfo. - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @classdesc Represents a TicketInfo. - * @implements ITicketInfo - * @constructor - * @param {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo=} [properties] Properties to set - */ - function TicketInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TicketInfo id. - * @member {string} id - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.id = ""; - - /** - * TicketInfo assignee. - * @member {string} assignee - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.assignee = ""; - - /** - * TicketInfo description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.description = ""; - - /** - * TicketInfo uri. - * @member {string} uri - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.uri = ""; - - /** - * TicketInfo status. - * @member {string} status - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.status = ""; - - /** - * TicketInfo updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.updateTime = null; - - /** - * Creates a new TicketInfo instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @param {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ExternalSystem.TicketInfo} TicketInfo instance - */ - TicketInfo.create = function create(properties) { - return new TicketInfo(properties); - }; - - /** - * Encodes the specified TicketInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @param {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo} message TicketInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TicketInfo.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.assignee != null && Object.hasOwnProperty.call(message, "assignee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignee); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.status); - 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(); - return writer; - }; - - /** - * Encodes the specified TicketInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @param {google.cloud.securitycenter.v1.ExternalSystem.ITicketInfo} message TicketInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TicketInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TicketInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @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.TicketInfo} TicketInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TicketInfo.decode = function decode(reader, length, error) { - 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.TicketInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.assignee = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.uri = reader.string(); - break; - } - case 5: { - message.status = reader.string(); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TicketInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ExternalSystem.TicketInfo} TicketInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TicketInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TicketInfo message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TicketInfo.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.assignee != null && message.hasOwnProperty("assignee")) - if (!$util.isString(message.assignee)) - return "assignee: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - return null; - }; - - /** - * Creates a TicketInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ExternalSystem.TicketInfo} TicketInfo - */ - TicketInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo) - return object; - var message = new $root.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo(); - if (object.id != null) - message.id = String(object.id); - if (object.assignee != null) - message.assignee = String(object.assignee); - if (object.description != null) - message.description = String(object.description); - if (object.uri != null) - message.uri = String(object.uri); - if (object.status != null) - message.status = String(object.status); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.TicketInfo.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from a TicketInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @param {google.cloud.securitycenter.v1.ExternalSystem.TicketInfo} message TicketInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TicketInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.assignee = ""; - object.description = ""; - object.uri = ""; - object.status = ""; - object.updateTime = null; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.assignee != null && message.hasOwnProperty("assignee")) - object.assignee = message.assignee; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - return object; - }; - - /** - * Converts this TicketInfo to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @instance - * @returns {Object.} JSON object - */ - TicketInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TicketInfo - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ExternalSystem.TicketInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TicketInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExternalSystem.TicketInfo"; - }; - - return TicketInfo; - })(); - - return ExternalSystem; - })(); - - v1.File = (function() { - - /** - * 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 - * @property {google.cloud.securitycenter.v1.File.IDiskPath|null} [diskPath] File diskPath - */ - - /** - * 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 - */ - 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]]; - } - - /** - * 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 - * @instance - */ - File.prototype.partiallyHashed = false; - - /** - * File contents. - * @member {string} contents - * @memberof google.cloud.securitycenter.v1.File - * @instance - */ - File.prototype.contents = ""; - - /** - * File diskPath. - * @member {google.cloud.securitycenter.v1.File.IDiskPath|null|undefined} diskPath - * @memberof google.cloud.securitycenter.v1.File - * @instance - */ - File.prototype.diskPath = null; - - /** - * 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 - */ - File.create = function create(properties) { - return new File(properties); - }; - - /** - * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.File - * @static - * @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 - */ - File.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.diskPath != null && Object.hasOwnProperty.call(message, "diskPath")) - $root.google.cloud.securitycenter.v1.File.DiskPath.encode(message.diskPath, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * 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.File - * @static - * @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 - */ - File.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a File message from the specified reader or buffer. - * @function decode - * @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.File} File - * @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, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 7: { - message.diskPath = $root.google.cloud.securitycenter.v1.File.DiskPath.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a File message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.File - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - File.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a File message. - * @function verify - * @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 - */ - File.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.diskPath != null && message.hasOwnProperty("diskPath")) { - var error = $root.google.cloud.securitycenter.v1.File.DiskPath.verify(message.diskPath); - if (error) - return "diskPath." + error; - } - return null; - }; - - /** - * Creates a File message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.File - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.File} File - */ - File.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.File) - 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); - if (object.diskPath != null) { - if (typeof object.diskPath !== "object") - throw TypeError(".google.cloud.securitycenter.v1.File.diskPath: object expected"); - message.diskPath = $root.google.cloud.securitycenter.v1.File.DiskPath.fromObject(object.diskPath); - } - return message; - }; - - /** - * Creates a plain object from a File message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.File - * @static - * @param {google.cloud.securitycenter.v1.File} message File - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - File.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 = ""; - object.diskPath = null; - } - 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; - if (message.diskPath != null && message.hasOwnProperty("diskPath")) - object.diskPath = $root.google.cloud.securitycenter.v1.File.DiskPath.toObject(message.diskPath, options); - return object; - }; - - /** - * Converts this File to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.File - * @instance - * @returns {Object.} JSON object - */ - File.prototype.toJSON = function toJSON() { - 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"; - }; - - File.DiskPath = (function() { - - /** - * Properties of a DiskPath. - * @memberof google.cloud.securitycenter.v1.File - * @interface IDiskPath - * @property {string|null} [partitionUuid] DiskPath partitionUuid - * @property {string|null} [relativePath] DiskPath relativePath - */ - - /** - * Constructs a new DiskPath. - * @memberof google.cloud.securitycenter.v1.File - * @classdesc Represents a DiskPath. - * @implements IDiskPath - * @constructor - * @param {google.cloud.securitycenter.v1.File.IDiskPath=} [properties] Properties to set - */ - function DiskPath(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiskPath partitionUuid. - * @member {string} partitionUuid - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @instance - */ - DiskPath.prototype.partitionUuid = ""; - - /** - * DiskPath relativePath. - * @member {string} relativePath - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @instance - */ - DiskPath.prototype.relativePath = ""; - - /** - * Creates a new DiskPath instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @param {google.cloud.securitycenter.v1.File.IDiskPath=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.File.DiskPath} DiskPath instance - */ - DiskPath.create = function create(properties) { - return new DiskPath(properties); - }; - - /** - * Encodes the specified DiskPath message. Does not implicitly {@link google.cloud.securitycenter.v1.File.DiskPath.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @param {google.cloud.securitycenter.v1.File.IDiskPath} message DiskPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskPath.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitionUuid != null && Object.hasOwnProperty.call(message, "partitionUuid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.partitionUuid); - if (message.relativePath != null && Object.hasOwnProperty.call(message, "relativePath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relativePath); - return writer; - }; - - /** - * Encodes the specified DiskPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.DiskPath.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @param {google.cloud.securitycenter.v1.File.IDiskPath} message DiskPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskPath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiskPath message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @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.DiskPath} DiskPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskPath.decode = function decode(reader, length, error) { - 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.DiskPath(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partitionUuid = reader.string(); - break; - } - case 2: { - message.relativePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiskPath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.File.DiskPath} DiskPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskPath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiskPath message. - * @function verify - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiskPath.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitionUuid != null && message.hasOwnProperty("partitionUuid")) - if (!$util.isString(message.partitionUuid)) - return "partitionUuid: string expected"; - if (message.relativePath != null && message.hasOwnProperty("relativePath")) - if (!$util.isString(message.relativePath)) - return "relativePath: string expected"; - return null; - }; - - /** - * Creates a DiskPath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.File.DiskPath} DiskPath - */ - DiskPath.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.File.DiskPath) - return object; - var message = new $root.google.cloud.securitycenter.v1.File.DiskPath(); - if (object.partitionUuid != null) - message.partitionUuid = String(object.partitionUuid); - if (object.relativePath != null) - message.relativePath = String(object.relativePath); - return message; - }; - - /** - * Creates a plain object from a DiskPath message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @param {google.cloud.securitycenter.v1.File.DiskPath} message DiskPath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiskPath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.partitionUuid = ""; - object.relativePath = ""; - } - if (message.partitionUuid != null && message.hasOwnProperty("partitionUuid")) - object.partitionUuid = message.partitionUuid; - if (message.relativePath != null && message.hasOwnProperty("relativePath")) - object.relativePath = message.relativePath; - return object; - }; - - /** - * Converts this DiskPath to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @instance - * @returns {Object.} JSON object - */ - DiskPath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiskPath - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.File.DiskPath - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiskPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.File.DiskPath"; - }; - - return DiskPath; - })(); - - return File; - })(); - - 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 - * @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 {google.cloud.securitycenter.v1.Finding.IMuteInfo|null} [muteInfo] Finding muteInfo - * @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 - * @property {string|null} [nextSteps] Finding nextSteps - * @property {string|null} [moduleName] Finding moduleName - * @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 {google.cloud.securitycenter.v1.IAttackExposure|null} [attackExposure] Finding attackExposure - * @property {Array.|null} [files] Finding files - * @property {google.cloud.securitycenter.v1.ICloudDlpInspection|null} [cloudDlpInspection] Finding cloudDlpInspection - * @property {google.cloud.securitycenter.v1.ICloudDlpDataProfile|null} [cloudDlpDataProfile] Finding cloudDlpDataProfile - * @property {google.cloud.securitycenter.v1.IKernelRootkit|null} [kernelRootkit] Finding kernelRootkit - * @property {Array.|null} [orgPolicies] Finding orgPolicies - * @property {google.cloud.securitycenter.v1.IApplication|null} [application] Finding application - * @property {google.cloud.securitycenter.v1.IBackupDisasterRecovery|null} [backupDisasterRecovery] Finding backupDisasterRecovery - * @property {google.cloud.securitycenter.v1.ISecurityPosture|null} [securityPosture] Finding securityPosture - * @property {Array.|null} [logEntries] Finding logEntries - * @property {Array.|null} [loadBalancers] Finding loadBalancers - * @property {google.cloud.securitycenter.v1.ICloudArmor|null} [cloudArmor] Finding cloudArmor - * @property {google.cloud.securitycenter.v1.INotebook|null} [notebook] Finding notebook - * @property {google.cloud.securitycenter.v1.IToxicCombination|null} [toxicCombination] Finding toxicCombination - * @property {Array.|null} [groupMemberships] Finding groupMemberships - * @property {google.cloud.securitycenter.v1.IChokepoint|null} [chokepoint] Finding chokepoint - * @property {google.cloud.securitycenter.v1.IExternalExposure|null} [externalExposure] Finding externalExposure - */ - - /** - * 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 = {}; - this.externalSystems = {}; - this.connections = []; - this.processes = []; - this.contacts = {}; - this.compliances = []; - this.iamBindings = []; - this.containers = []; - this.files = []; - this.orgPolicies = []; - this.logEntries = []; - this.loadBalancers = []; - this.groupMemberships = []; - if (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; - - /** - * Finding severity. - * @member {google.cloud.securitycenter.v1.Finding.Severity} severity - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - 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; - - /** - * Finding vulnerability. - * @member {google.cloud.securitycenter.v1.IVulnerability|null|undefined} vulnerability - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - 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 externalSystems. - * @member {Object.} externalSystems - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - 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 - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - 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 - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.muteInitiator = ""; - - /** - * Finding muteInfo. - * @member {google.cloud.securitycenter.v1.Finding.IMuteInfo|null|undefined} muteInfo - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.muteInfo = null; - - /** - * Finding processes. - * @member {Array.} processes - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.processes = $util.emptyArray; - - /** - * Finding contacts. - * @member {Object.} contacts - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.contacts = $util.emptyObject; - - /** - * Finding compliances. - * @member {Array.} compliances - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - 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 - * @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 = ""; - - /** - * Finding moduleName. - * @member {string} moduleName - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.moduleName = ""; - - /** - * Finding containers. - * @member {Array.} containers - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.containers = $util.emptyArray; - - /** - * Finding kubernetes. - * @member {google.cloud.securitycenter.v1.IKubernetes|null|undefined} kubernetes - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - 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; - - /** - * Finding attackExposure. - * @member {google.cloud.securitycenter.v1.IAttackExposure|null|undefined} attackExposure - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.attackExposure = null; - - /** - * Finding files. - * @member {Array.} files - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.files = $util.emptyArray; - - /** - * Finding cloudDlpInspection. - * @member {google.cloud.securitycenter.v1.ICloudDlpInspection|null|undefined} cloudDlpInspection - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.cloudDlpInspection = null; - - /** - * Finding cloudDlpDataProfile. - * @member {google.cloud.securitycenter.v1.ICloudDlpDataProfile|null|undefined} cloudDlpDataProfile - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.cloudDlpDataProfile = null; - - /** - * Finding kernelRootkit. - * @member {google.cloud.securitycenter.v1.IKernelRootkit|null|undefined} kernelRootkit - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.kernelRootkit = null; - - /** - * Finding orgPolicies. - * @member {Array.} orgPolicies - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.orgPolicies = $util.emptyArray; - - /** - * Finding application. - * @member {google.cloud.securitycenter.v1.IApplication|null|undefined} application - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.application = null; - - /** - * Finding backupDisasterRecovery. - * @member {google.cloud.securitycenter.v1.IBackupDisasterRecovery|null|undefined} backupDisasterRecovery - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.backupDisasterRecovery = null; - - /** - * Finding securityPosture. - * @member {google.cloud.securitycenter.v1.ISecurityPosture|null|undefined} securityPosture - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.securityPosture = null; - - /** - * Finding logEntries. - * @member {Array.} logEntries - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.logEntries = $util.emptyArray; - - /** - * Finding loadBalancers. - * @member {Array.} loadBalancers - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.loadBalancers = $util.emptyArray; - - /** - * Finding cloudArmor. - * @member {google.cloud.securitycenter.v1.ICloudArmor|null|undefined} cloudArmor - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.cloudArmor = null; - - /** - * Finding notebook. - * @member {google.cloud.securitycenter.v1.INotebook|null|undefined} notebook - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.notebook = null; - - /** - * Finding toxicCombination. - * @member {google.cloud.securitycenter.v1.IToxicCombination|null|undefined} toxicCombination - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.toxicCombination = null; - - /** - * Finding groupMemberships. - * @member {Array.} groupMemberships - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.groupMemberships = $util.emptyArray; - - /** - * Finding chokepoint. - * @member {google.cloud.securitycenter.v1.IChokepoint|null|undefined} chokepoint - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.chokepoint = null; - - /** - * Finding externalExposure. - * @member {google.cloud.securitycenter.v1.IExternalExposure|null|undefined} externalExposure - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.externalExposure = 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 && 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.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")) - $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.moduleName != null && Object.hasOwnProperty.call(message, "moduleName")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.moduleName); - 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(); - 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.attackExposure != null && Object.hasOwnProperty.call(message, "attackExposure")) - $root.google.cloud.securitycenter.v1.AttackExposure.encode(message.attackExposure, writer.uint32(/* id 45, wireType 2 =*/362).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(); - if (message.cloudDlpInspection != null && Object.hasOwnProperty.call(message, "cloudDlpInspection")) - $root.google.cloud.securitycenter.v1.CloudDlpInspection.encode(message.cloudDlpInspection, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); - if (message.cloudDlpDataProfile != null && Object.hasOwnProperty.call(message, "cloudDlpDataProfile")) - $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.encode(message.cloudDlpDataProfile, writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); - if (message.kernelRootkit != null && Object.hasOwnProperty.call(message, "kernelRootkit")) - $root.google.cloud.securitycenter.v1.KernelRootkit.encode(message.kernelRootkit, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.orgPolicies != null && message.orgPolicies.length) - for (var i = 0; i < message.orgPolicies.length; ++i) - $root.google.cloud.securitycenter.v1.OrgPolicy.encode(message.orgPolicies[i], writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); - if (message.application != null && Object.hasOwnProperty.call(message, "application")) - $root.google.cloud.securitycenter.v1.Application.encode(message.application, writer.uint32(/* id 53, wireType 2 =*/426).fork()).ldelim(); - if (message.backupDisasterRecovery != null && Object.hasOwnProperty.call(message, "backupDisasterRecovery")) - $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.encode(message.backupDisasterRecovery, writer.uint32(/* id 55, wireType 2 =*/442).fork()).ldelim(); - if (message.securityPosture != null && Object.hasOwnProperty.call(message, "securityPosture")) - $root.google.cloud.securitycenter.v1.SecurityPosture.encode(message.securityPosture, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); - if (message.logEntries != null && message.logEntries.length) - for (var i = 0; i < message.logEntries.length; ++i) - $root.google.cloud.securitycenter.v1.LogEntry.encode(message.logEntries[i], writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); - if (message.loadBalancers != null && message.loadBalancers.length) - for (var i = 0; i < message.loadBalancers.length; ++i) - $root.google.cloud.securitycenter.v1.LoadBalancer.encode(message.loadBalancers[i], writer.uint32(/* id 58, wireType 2 =*/466).fork()).ldelim(); - if (message.cloudArmor != null && Object.hasOwnProperty.call(message, "cloudArmor")) - $root.google.cloud.securitycenter.v1.CloudArmor.encode(message.cloudArmor, writer.uint32(/* id 59, wireType 2 =*/474).fork()).ldelim(); - if (message.muteInfo != null && Object.hasOwnProperty.call(message, "muteInfo")) - $root.google.cloud.securitycenter.v1.Finding.MuteInfo.encode(message.muteInfo, writer.uint32(/* id 61, wireType 2 =*/490).fork()).ldelim(); - if (message.notebook != null && Object.hasOwnProperty.call(message, "notebook")) - $root.google.cloud.securitycenter.v1.Notebook.encode(message.notebook, writer.uint32(/* id 63, wireType 2 =*/506).fork()).ldelim(); - if (message.toxicCombination != null && Object.hasOwnProperty.call(message, "toxicCombination")) - $root.google.cloud.securitycenter.v1.ToxicCombination.encode(message.toxicCombination, writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); - if (message.groupMemberships != null && message.groupMemberships.length) - for (var i = 0; i < message.groupMemberships.length; ++i) - $root.google.cloud.securitycenter.v1.GroupMembership.encode(message.groupMemberships[i], writer.uint32(/* id 65, wireType 2 =*/522).fork()).ldelim(); - if (message.chokepoint != null && Object.hasOwnProperty.call(message, "chokepoint")) - $root.google.cloud.securitycenter.v1.Chokepoint.encode(message.chokepoint, writer.uint32(/* id 77, wireType 2 =*/618).fork()).ldelim(); - if (message.externalExposure != null && Object.hasOwnProperty.call(message, "externalExposure")) - $root.google.cloud.securitycenter.v1.ExternalExposure.encode(message.externalExposure, writer.uint32(/* id 84, wireType 2 =*/674).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, error) { - 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(); - if (tag === error) - break; - 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 61: { - message.muteInfo = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.decode(reader, reader.uint32()); - 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 36: { - message.parentDisplayName = reader.string(); - 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 41: { - message.moduleName = 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; - } - case 44: { - message.database = $root.google.cloud.securitycenter.v1.Database.decode(reader, reader.uint32()); - break; - } - case 45: { - message.attackExposure = $root.google.cloud.securitycenter.v1.AttackExposure.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; - } - case 48: { - message.cloudDlpInspection = $root.google.cloud.securitycenter.v1.CloudDlpInspection.decode(reader, reader.uint32()); - break; - } - case 49: { - message.cloudDlpDataProfile = $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.decode(reader, reader.uint32()); - break; - } - case 50: { - message.kernelRootkit = $root.google.cloud.securitycenter.v1.KernelRootkit.decode(reader, reader.uint32()); - break; - } - case 51: { - if (!(message.orgPolicies && message.orgPolicies.length)) - message.orgPolicies = []; - message.orgPolicies.push($root.google.cloud.securitycenter.v1.OrgPolicy.decode(reader, reader.uint32())); - break; - } - case 53: { - message.application = $root.google.cloud.securitycenter.v1.Application.decode(reader, reader.uint32()); - break; - } - case 55: { - message.backupDisasterRecovery = $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.decode(reader, reader.uint32()); - break; - } - case 56: { - message.securityPosture = $root.google.cloud.securitycenter.v1.SecurityPosture.decode(reader, reader.uint32()); - break; - } - case 57: { - if (!(message.logEntries && message.logEntries.length)) - message.logEntries = []; - message.logEntries.push($root.google.cloud.securitycenter.v1.LogEntry.decode(reader, reader.uint32())); - break; - } - case 58: { - if (!(message.loadBalancers && message.loadBalancers.length)) - message.loadBalancers = []; - message.loadBalancers.push($root.google.cloud.securitycenter.v1.LoadBalancer.decode(reader, reader.uint32())); - break; - } - case 59: { - message.cloudArmor = $root.google.cloud.securitycenter.v1.CloudArmor.decode(reader, reader.uint32()); - break; - } - case 63: { - message.notebook = $root.google.cloud.securitycenter.v1.Notebook.decode(reader, reader.uint32()); - break; - } - case 64: { - message.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.decode(reader, reader.uint32()); - break; - } - case 65: { - if (!(message.groupMemberships && message.groupMemberships.length)) - message.groupMemberships = []; - message.groupMemberships.push($root.google.cloud.securitycenter.v1.GroupMembership.decode(reader, reader.uint32())); - break; - } - case 77: { - message.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.decode(reader, reader.uint32()); - break; - } - case 84: { - message.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.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: - case 6: - case 7: - case 8: - case 9: - case 10: - 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.muteInfo != null && message.hasOwnProperty("muteInfo")) { - var error = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.verify(message.muteInfo); - if (error) - return "muteInfo." + error; - } - 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.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"; - 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.moduleName != null && message.hasOwnProperty("moduleName")) - if (!$util.isString(message.moduleName)) - return "moduleName: 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; - } - if (message.database != null && message.hasOwnProperty("database")) { - var error = $root.google.cloud.securitycenter.v1.Database.verify(message.database); - if (error) - return "database." + error; - } - if (message.attackExposure != null && message.hasOwnProperty("attackExposure")) { - var error = $root.google.cloud.securitycenter.v1.AttackExposure.verify(message.attackExposure); - if (error) - return "attackExposure." + 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; - } - } - if (message.cloudDlpInspection != null && message.hasOwnProperty("cloudDlpInspection")) { - var error = $root.google.cloud.securitycenter.v1.CloudDlpInspection.verify(message.cloudDlpInspection); - if (error) - return "cloudDlpInspection." + error; - } - if (message.cloudDlpDataProfile != null && message.hasOwnProperty("cloudDlpDataProfile")) { - var error = $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.verify(message.cloudDlpDataProfile); - if (error) - return "cloudDlpDataProfile." + error; - } - if (message.kernelRootkit != null && message.hasOwnProperty("kernelRootkit")) { - var error = $root.google.cloud.securitycenter.v1.KernelRootkit.verify(message.kernelRootkit); - if (error) - return "kernelRootkit." + error; - } - if (message.orgPolicies != null && message.hasOwnProperty("orgPolicies")) { - if (!Array.isArray(message.orgPolicies)) - return "orgPolicies: array expected"; - for (var i = 0; i < message.orgPolicies.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.OrgPolicy.verify(message.orgPolicies[i]); - if (error) - return "orgPolicies." + error; - } - } - if (message.application != null && message.hasOwnProperty("application")) { - var error = $root.google.cloud.securitycenter.v1.Application.verify(message.application); - if (error) - return "application." + error; - } - if (message.backupDisasterRecovery != null && message.hasOwnProperty("backupDisasterRecovery")) { - var error = $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.verify(message.backupDisasterRecovery); - if (error) - return "backupDisasterRecovery." + error; - } - if (message.securityPosture != null && message.hasOwnProperty("securityPosture")) { - var error = $root.google.cloud.securitycenter.v1.SecurityPosture.verify(message.securityPosture); - if (error) - return "securityPosture." + error; - } - if (message.logEntries != null && message.hasOwnProperty("logEntries")) { - if (!Array.isArray(message.logEntries)) - return "logEntries: array expected"; - for (var i = 0; i < message.logEntries.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.LogEntry.verify(message.logEntries[i]); - if (error) - return "logEntries." + error; - } - } - if (message.loadBalancers != null && message.hasOwnProperty("loadBalancers")) { - if (!Array.isArray(message.loadBalancers)) - return "loadBalancers: array expected"; - for (var i = 0; i < message.loadBalancers.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.LoadBalancer.verify(message.loadBalancers[i]); - if (error) - return "loadBalancers." + error; - } - } - if (message.cloudArmor != null && message.hasOwnProperty("cloudArmor")) { - var error = $root.google.cloud.securitycenter.v1.CloudArmor.verify(message.cloudArmor); - if (error) - return "cloudArmor." + error; - } - if (message.notebook != null && message.hasOwnProperty("notebook")) { - var error = $root.google.cloud.securitycenter.v1.Notebook.verify(message.notebook); - if (error) - return "notebook." + error; - } - if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) { - var error = $root.google.cloud.securitycenter.v1.ToxicCombination.verify(message.toxicCombination); - if (error) - return "toxicCombination." + error; - } - if (message.groupMemberships != null && message.hasOwnProperty("groupMemberships")) { - if (!Array.isArray(message.groupMemberships)) - return "groupMemberships: array expected"; - for (var i = 0; i < message.groupMemberships.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.GroupMembership.verify(message.groupMemberships[i]); - if (error) - return "groupMemberships." + error; - } - } - if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) { - var error = $root.google.cloud.securitycenter.v1.Chokepoint.verify(message.chokepoint); - if (error) - return "chokepoint." + error; - } - if (message.externalExposure != null && message.hasOwnProperty("externalExposure")) { - var error = $root.google.cloud.securitycenter.v1.ExternalExposure.verify(message.externalExposure); - if (error) - return "externalExposure." + 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) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - 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) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - 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) { - default: - if (typeof object.mute === "number") { - message.mute = object.mute; - break; - } - break; - 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) { - default: - if (typeof object.findingClass === "number") { - message.findingClass = object.findingClass; - break; - } - break; - 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; - case "POSTURE_VIOLATION": - case 6: - message.findingClass = 6; - break; - case "TOXIC_COMBINATION": - case 7: - message.findingClass = 7; - break; - case "SENSITIVE_DATA_RISK": - case 8: - message.findingClass = 8; - break; - case "CHOKEPOINT": - case 9: - message.findingClass = 9; - break; - case "EXTERNAL_EXPOSURE": - case 10: - message.findingClass = 10; - 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.muteInfo != null) { - if (typeof object.muteInfo !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.muteInfo: object expected"); - message.muteInfo = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.fromObject(object.muteInfo); - } - 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.parentDisplayName != null) - message.parentDisplayName = String(object.parentDisplayName); - 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.moduleName != null) - message.moduleName = String(object.moduleName); - 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); - } - 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); - } - if (object.attackExposure != null) { - if (typeof object.attackExposure !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.attackExposure: object expected"); - message.attackExposure = $root.google.cloud.securitycenter.v1.AttackExposure.fromObject(object.attackExposure); - } - 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]); - } - } - if (object.cloudDlpInspection != null) { - if (typeof object.cloudDlpInspection !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.cloudDlpInspection: object expected"); - message.cloudDlpInspection = $root.google.cloud.securitycenter.v1.CloudDlpInspection.fromObject(object.cloudDlpInspection); - } - if (object.cloudDlpDataProfile != null) { - if (typeof object.cloudDlpDataProfile !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.cloudDlpDataProfile: object expected"); - message.cloudDlpDataProfile = $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.fromObject(object.cloudDlpDataProfile); - } - if (object.kernelRootkit != null) { - if (typeof object.kernelRootkit !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.kernelRootkit: object expected"); - message.kernelRootkit = $root.google.cloud.securitycenter.v1.KernelRootkit.fromObject(object.kernelRootkit); - } - if (object.orgPolicies) { - if (!Array.isArray(object.orgPolicies)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.orgPolicies: array expected"); - message.orgPolicies = []; - for (var i = 0; i < object.orgPolicies.length; ++i) { - if (typeof object.orgPolicies[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.orgPolicies: object expected"); - message.orgPolicies[i] = $root.google.cloud.securitycenter.v1.OrgPolicy.fromObject(object.orgPolicies[i]); - } - } - if (object.application != null) { - if (typeof object.application !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.application: object expected"); - message.application = $root.google.cloud.securitycenter.v1.Application.fromObject(object.application); - } - if (object.backupDisasterRecovery != null) { - if (typeof object.backupDisasterRecovery !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.backupDisasterRecovery: object expected"); - message.backupDisasterRecovery = $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.fromObject(object.backupDisasterRecovery); - } - if (object.securityPosture != null) { - if (typeof object.securityPosture !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.securityPosture: object expected"); - message.securityPosture = $root.google.cloud.securitycenter.v1.SecurityPosture.fromObject(object.securityPosture); - } - if (object.logEntries) { - if (!Array.isArray(object.logEntries)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.logEntries: array expected"); - message.logEntries = []; - for (var i = 0; i < object.logEntries.length; ++i) { - if (typeof object.logEntries[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.logEntries: object expected"); - message.logEntries[i] = $root.google.cloud.securitycenter.v1.LogEntry.fromObject(object.logEntries[i]); - } - } - if (object.loadBalancers) { - if (!Array.isArray(object.loadBalancers)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.loadBalancers: array expected"); - message.loadBalancers = []; - for (var i = 0; i < object.loadBalancers.length; ++i) { - if (typeof object.loadBalancers[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.loadBalancers: object expected"); - message.loadBalancers[i] = $root.google.cloud.securitycenter.v1.LoadBalancer.fromObject(object.loadBalancers[i]); - } - } - if (object.cloudArmor != null) { - if (typeof object.cloudArmor !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.cloudArmor: object expected"); - message.cloudArmor = $root.google.cloud.securitycenter.v1.CloudArmor.fromObject(object.cloudArmor); - } - if (object.notebook != null) { - if (typeof object.notebook !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.notebook: object expected"); - message.notebook = $root.google.cloud.securitycenter.v1.Notebook.fromObject(object.notebook); - } - if (object.toxicCombination != null) { - if (typeof object.toxicCombination !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.toxicCombination: object expected"); - message.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.fromObject(object.toxicCombination); - } - if (object.groupMemberships) { - if (!Array.isArray(object.groupMemberships)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.groupMemberships: array expected"); - message.groupMemberships = []; - for (var i = 0; i < object.groupMemberships.length; ++i) { - if (typeof object.groupMemberships[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.groupMemberships: object expected"); - message.groupMemberships[i] = $root.google.cloud.securitycenter.v1.GroupMembership.fromObject(object.groupMemberships[i]); - } - } - if (object.chokepoint != null) { - if (typeof object.chokepoint !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.chokepoint: object expected"); - message.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.fromObject(object.chokepoint); - } - if (object.externalExposure != null) { - if (typeof object.externalExposure !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.externalExposure: object expected"); - message.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.fromObject(object.externalExposure); - } - 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 = []; - object.files = []; - object.orgPolicies = []; - object.logEntries = []; - object.loadBalancers = []; - object.groupMemberships = []; - } - 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.parentDisplayName = ""; - object.description = ""; - object.exfiltration = null; - object.nextSteps = ""; - object.moduleName = ""; - object.kubernetes = null; - object.database = null; - object.attackExposure = null; - object.cloudDlpInspection = null; - object.cloudDlpDataProfile = null; - object.kernelRootkit = null; - object.application = null; - object.backupDisasterRecovery = null; - object.securityPosture = null; - object.cloudArmor = null; - object.muteInfo = null; - object.notebook = null; - object.toxicCombination = null; - object.chokepoint = null; - object.externalExposure = 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] === 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")) - 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] === 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] === 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] === 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")) - 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.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")) - 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.moduleName != null && message.hasOwnProperty("moduleName")) - object.moduleName = message.moduleName; - 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); - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.cloud.securitycenter.v1.Database.toObject(message.database, options); - if (message.attackExposure != null && message.hasOwnProperty("attackExposure")) - object.attackExposure = $root.google.cloud.securitycenter.v1.AttackExposure.toObject(message.attackExposure, 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); - } - if (message.cloudDlpInspection != null && message.hasOwnProperty("cloudDlpInspection")) - object.cloudDlpInspection = $root.google.cloud.securitycenter.v1.CloudDlpInspection.toObject(message.cloudDlpInspection, options); - if (message.cloudDlpDataProfile != null && message.hasOwnProperty("cloudDlpDataProfile")) - object.cloudDlpDataProfile = $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.toObject(message.cloudDlpDataProfile, options); - if (message.kernelRootkit != null && message.hasOwnProperty("kernelRootkit")) - object.kernelRootkit = $root.google.cloud.securitycenter.v1.KernelRootkit.toObject(message.kernelRootkit, options); - if (message.orgPolicies && message.orgPolicies.length) { - object.orgPolicies = []; - for (var j = 0; j < message.orgPolicies.length; ++j) - object.orgPolicies[j] = $root.google.cloud.securitycenter.v1.OrgPolicy.toObject(message.orgPolicies[j], options); - } - if (message.application != null && message.hasOwnProperty("application")) - object.application = $root.google.cloud.securitycenter.v1.Application.toObject(message.application, options); - if (message.backupDisasterRecovery != null && message.hasOwnProperty("backupDisasterRecovery")) - object.backupDisasterRecovery = $root.google.cloud.securitycenter.v1.BackupDisasterRecovery.toObject(message.backupDisasterRecovery, options); - if (message.securityPosture != null && message.hasOwnProperty("securityPosture")) - object.securityPosture = $root.google.cloud.securitycenter.v1.SecurityPosture.toObject(message.securityPosture, options); - if (message.logEntries && message.logEntries.length) { - object.logEntries = []; - for (var j = 0; j < message.logEntries.length; ++j) - object.logEntries[j] = $root.google.cloud.securitycenter.v1.LogEntry.toObject(message.logEntries[j], options); - } - if (message.loadBalancers && message.loadBalancers.length) { - object.loadBalancers = []; - for (var j = 0; j < message.loadBalancers.length; ++j) - object.loadBalancers[j] = $root.google.cloud.securitycenter.v1.LoadBalancer.toObject(message.loadBalancers[j], options); - } - if (message.cloudArmor != null && message.hasOwnProperty("cloudArmor")) - object.cloudArmor = $root.google.cloud.securitycenter.v1.CloudArmor.toObject(message.cloudArmor, options); - if (message.muteInfo != null && message.hasOwnProperty("muteInfo")) - object.muteInfo = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.toObject(message.muteInfo, options); - if (message.notebook != null && message.hasOwnProperty("notebook")) - object.notebook = $root.google.cloud.securitycenter.v1.Notebook.toObject(message.notebook, options); - if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) - object.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.toObject(message.toxicCombination, options); - if (message.groupMemberships && message.groupMemberships.length) { - object.groupMemberships = []; - for (var j = 0; j < message.groupMemberships.length; ++j) - object.groupMemberships[j] = $root.google.cloud.securitycenter.v1.GroupMembership.toObject(message.groupMemberships[j], options); - } - if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) - object.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.toObject(message.chokepoint, options); - if (message.externalExposure != null && message.hasOwnProperty("externalExposure")) - object.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.toObject(message.externalExposure, 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); - }; - - /** - * 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 - * @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 - * @property {number} POSTURE_VIOLATION=6 POSTURE_VIOLATION value - * @property {number} TOXIC_COMBINATION=7 TOXIC_COMBINATION value - * @property {number} SENSITIVE_DATA_RISK=8 SENSITIVE_DATA_RISK value - * @property {number} CHOKEPOINT=9 CHOKEPOINT value - * @property {number} EXTERNAL_EXPOSURE=10 EXTERNAL_EXPOSURE 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; - values[valuesById[6] = "POSTURE_VIOLATION"] = 6; - values[valuesById[7] = "TOXIC_COMBINATION"] = 7; - values[valuesById[8] = "SENSITIVE_DATA_RISK"] = 8; - values[valuesById[9] = "CHOKEPOINT"] = 9; - values[valuesById[10] = "EXTERNAL_EXPOSURE"] = 10; - return values; - })(); - - Finding.MuteInfo = (function() { - - /** - * Properties of a MuteInfo. - * @memberof google.cloud.securitycenter.v1.Finding - * @interface IMuteInfo - * @property {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute|null} [staticMute] MuteInfo staticMute - * @property {Array.|null} [dynamicMuteRecords] MuteInfo dynamicMuteRecords - */ - - /** - * Constructs a new MuteInfo. - * @memberof google.cloud.securitycenter.v1.Finding - * @classdesc Represents a MuteInfo. - * @implements IMuteInfo - * @constructor - * @param {google.cloud.securitycenter.v1.Finding.IMuteInfo=} [properties] Properties to set - */ - function MuteInfo(properties) { - this.dynamicMuteRecords = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MuteInfo staticMute. - * @member {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute|null|undefined} staticMute - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @instance - */ - MuteInfo.prototype.staticMute = null; - - /** - * MuteInfo dynamicMuteRecords. - * @member {Array.} dynamicMuteRecords - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @instance - */ - MuteInfo.prototype.dynamicMuteRecords = $util.emptyArray; - - /** - * Creates a new MuteInfo instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @param {google.cloud.securitycenter.v1.Finding.IMuteInfo=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo} MuteInfo instance - */ - MuteInfo.create = function create(properties) { - return new MuteInfo(properties); - }; - - /** - * Encodes the specified MuteInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @param {google.cloud.securitycenter.v1.Finding.IMuteInfo} message MuteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MuteInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.staticMute != null && Object.hasOwnProperty.call(message, "staticMute")) - $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.encode(message.staticMute, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dynamicMuteRecords != null && message.dynamicMuteRecords.length) - for (var i = 0; i < message.dynamicMuteRecords.length; ++i) - $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.encode(message.dynamicMuteRecords[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MuteInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @param {google.cloud.securitycenter.v1.Finding.IMuteInfo} message MuteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MuteInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MuteInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @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.MuteInfo} MuteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MuteInfo.decode = function decode(reader, length, error) { - 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.MuteInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.staticMute = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.dynamicMuteRecords && message.dynamicMuteRecords.length)) - message.dynamicMuteRecords = []; - message.dynamicMuteRecords.push($root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MuteInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo} MuteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MuteInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MuteInfo message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MuteInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.staticMute != null && message.hasOwnProperty("staticMute")) { - var error = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify(message.staticMute); - if (error) - return "staticMute." + error; - } - if (message.dynamicMuteRecords != null && message.hasOwnProperty("dynamicMuteRecords")) { - if (!Array.isArray(message.dynamicMuteRecords)) - return "dynamicMuteRecords: array expected"; - for (var i = 0; i < message.dynamicMuteRecords.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify(message.dynamicMuteRecords[i]); - if (error) - return "dynamicMuteRecords." + error; - } - } - return null; - }; - - /** - * Creates a MuteInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo} MuteInfo - */ - MuteInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Finding.MuteInfo) - return object; - var message = new $root.google.cloud.securitycenter.v1.Finding.MuteInfo(); - if (object.staticMute != null) { - if (typeof object.staticMute !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.staticMute: object expected"); - message.staticMute = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.fromObject(object.staticMute); - } - if (object.dynamicMuteRecords) { - if (!Array.isArray(object.dynamicMuteRecords)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.dynamicMuteRecords: array expected"); - message.dynamicMuteRecords = []; - for (var i = 0; i < object.dynamicMuteRecords.length; ++i) { - if (typeof object.dynamicMuteRecords[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.dynamicMuteRecords: object expected"); - message.dynamicMuteRecords[i] = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.fromObject(object.dynamicMuteRecords[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MuteInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo} message MuteInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MuteInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dynamicMuteRecords = []; - if (options.defaults) - object.staticMute = null; - if (message.staticMute != null && message.hasOwnProperty("staticMute")) - object.staticMute = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.toObject(message.staticMute, options); - if (message.dynamicMuteRecords && message.dynamicMuteRecords.length) { - object.dynamicMuteRecords = []; - for (var j = 0; j < message.dynamicMuteRecords.length; ++j) - object.dynamicMuteRecords[j] = $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.toObject(message.dynamicMuteRecords[j], options); - } - return object; - }; - - /** - * Converts this MuteInfo to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @instance - * @returns {Object.} JSON object - */ - MuteInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MuteInfo - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MuteInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Finding.MuteInfo"; - }; - - MuteInfo.StaticMute = (function() { - - /** - * Properties of a StaticMute. - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @interface IStaticMute - * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [state] StaticMute state - * @property {google.protobuf.ITimestamp|null} [applyTime] StaticMute applyTime - */ - - /** - * Constructs a new StaticMute. - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @classdesc Represents a StaticMute. - * @implements IStaticMute - * @constructor - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute=} [properties] Properties to set - */ - function StaticMute(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StaticMute state. - * @member {google.cloud.securitycenter.v1.Finding.Mute} state - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @instance - */ - StaticMute.prototype.state = 0; - - /** - * StaticMute applyTime. - * @member {google.protobuf.ITimestamp|null|undefined} applyTime - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @instance - */ - StaticMute.prototype.applyTime = null; - - /** - * Creates a new StaticMute instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute} StaticMute instance - */ - StaticMute.create = function create(properties) { - return new StaticMute(properties); - }; - - /** - * Encodes the specified StaticMute message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute} message StaticMute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StaticMute.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.applyTime != null && Object.hasOwnProperty.call(message, "applyTime")) - $root.google.protobuf.Timestamp.encode(message.applyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StaticMute message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IStaticMute} message StaticMute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StaticMute.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StaticMute message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @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.MuteInfo.StaticMute} StaticMute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StaticMute.decode = function decode(reader, length, error) { - 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.MuteInfo.StaticMute(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.applyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StaticMute message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute} StaticMute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StaticMute.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StaticMute message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StaticMute.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 4: - break; - } - if (message.applyTime != null && message.hasOwnProperty("applyTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.applyTime); - if (error) - return "applyTime." + error; - } - return null; - }; - - /** - * Creates a StaticMute message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute} StaticMute - */ - StaticMute.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute) - return object; - var message = new $root.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "MUTE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "MUTED": - case 1: - message.state = 1; - break; - case "UNMUTED": - case 2: - message.state = 2; - break; - case "UNDEFINED": - case 4: - message.state = 4; - break; - } - if (object.applyTime != null) { - if (typeof object.applyTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute.applyTime: object expected"); - message.applyTime = $root.google.protobuf.Timestamp.fromObject(object.applyTime); - } - return message; - }; - - /** - * Creates a plain object from a StaticMute message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute} message StaticMute - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StaticMute.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "MUTE_UNSPECIFIED" : 0; - object.applyTime = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.Finding.Mute[message.state] : message.state; - if (message.applyTime != null && message.hasOwnProperty("applyTime")) - object.applyTime = $root.google.protobuf.Timestamp.toObject(message.applyTime, options); - return object; - }; - - /** - * Converts this StaticMute to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @instance - * @returns {Object.} JSON object - */ - StaticMute.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StaticMute - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StaticMute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute"; - }; - - return StaticMute; - })(); - - MuteInfo.DynamicMuteRecord = (function() { - - /** - * Properties of a DynamicMuteRecord. - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @interface IDynamicMuteRecord - * @property {string|null} [muteConfig] DynamicMuteRecord muteConfig - * @property {google.protobuf.ITimestamp|null} [matchTime] DynamicMuteRecord matchTime - */ - - /** - * Constructs a new DynamicMuteRecord. - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo - * @classdesc Represents a DynamicMuteRecord. - * @implements IDynamicMuteRecord - * @constructor - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord=} [properties] Properties to set - */ - function DynamicMuteRecord(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DynamicMuteRecord muteConfig. - * @member {string} muteConfig - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @instance - */ - DynamicMuteRecord.prototype.muteConfig = ""; - - /** - * DynamicMuteRecord matchTime. - * @member {google.protobuf.ITimestamp|null|undefined} matchTime - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @instance - */ - DynamicMuteRecord.prototype.matchTime = null; - - /** - * Creates a new DynamicMuteRecord instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord instance - */ - DynamicMuteRecord.create = function create(properties) { - return new DynamicMuteRecord(properties); - }; - - /** - * Encodes the specified DynamicMuteRecord message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord} message DynamicMuteRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicMuteRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.muteConfig); - if (message.matchTime != null && Object.hasOwnProperty.call(message, "matchTime")) - $root.google.protobuf.Timestamp.encode(message.matchTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DynamicMuteRecord message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.IDynamicMuteRecord} message DynamicMuteRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicMuteRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DynamicMuteRecord message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @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.MuteInfo.DynamicMuteRecord} DynamicMuteRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicMuteRecord.decode = function decode(reader, length, error) { - 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.MuteInfo.DynamicMuteRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.muteConfig = reader.string(); - break; - } - case 2: { - message.matchTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DynamicMuteRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicMuteRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DynamicMuteRecord message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DynamicMuteRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) - if (!$util.isString(message.muteConfig)) - return "muteConfig: string expected"; - if (message.matchTime != null && message.hasOwnProperty("matchTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.matchTime); - if (error) - return "matchTime." + error; - } - return null; - }; - - /** - * Creates a DynamicMuteRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord - */ - DynamicMuteRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord) - return object; - var message = new $root.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord(); - if (object.muteConfig != null) - message.muteConfig = String(object.muteConfig); - if (object.matchTime != null) { - if (typeof object.matchTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord.matchTime: object expected"); - message.matchTime = $root.google.protobuf.Timestamp.fromObject(object.matchTime); - } - return message; - }; - - /** - * Creates a plain object from a DynamicMuteRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord} message DynamicMuteRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DynamicMuteRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.muteConfig = ""; - object.matchTime = null; - } - if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) - object.muteConfig = message.muteConfig; - if (message.matchTime != null && message.hasOwnProperty("matchTime")) - object.matchTime = $root.google.protobuf.Timestamp.toObject(message.matchTime, options); - return object; - }; - - /** - * Converts this DynamicMuteRecord to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @instance - * @returns {Object.} JSON object - */ - DynamicMuteRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DynamicMuteRecord - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DynamicMuteRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord"; - }; - - return DynamicMuteRecord; - })(); - - return MuteInfo; - })(); - - return Finding; - })(); - - v1.GroupMembership = (function() { - - /** - * Properties of a GroupMembership. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupMembership - * @property {google.cloud.securitycenter.v1.GroupMembership.GroupType|null} [groupType] GroupMembership groupType - * @property {string|null} [groupId] GroupMembership groupId - */ - - /** - * Constructs a new GroupMembership. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupMembership. - * @implements IGroupMembership - * @constructor - * @param {google.cloud.securitycenter.v1.IGroupMembership=} [properties] Properties to set - */ - function GroupMembership(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupMembership groupType. - * @member {google.cloud.securitycenter.v1.GroupMembership.GroupType} groupType - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @instance - */ - GroupMembership.prototype.groupType = 0; - - /** - * GroupMembership groupId. - * @member {string} groupId - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @instance - */ - GroupMembership.prototype.groupId = ""; - - /** - * Creates a new GroupMembership instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {google.cloud.securitycenter.v1.IGroupMembership=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership instance - */ - GroupMembership.create = function create(properties) { - return new GroupMembership(properties); - }; - - /** - * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {google.cloud.securitycenter.v1.IGroupMembership} message GroupMembership message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMembership.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupType != null && Object.hasOwnProperty.call(message, "groupType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.groupType); - if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId); - return writer; - }; - - /** - * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {google.cloud.securitycenter.v1.IGroupMembership} message GroupMembership message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMembership.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupMembership message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMembership.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupMembership(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.groupType = reader.int32(); - break; - } - case 2: { - message.groupId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupMembership message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMembership.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupMembership message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupMembership.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupType != null && message.hasOwnProperty("groupType")) - switch (message.groupType) { - default: - return "groupType: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.groupId != null && message.hasOwnProperty("groupId")) - if (!$util.isString(message.groupId)) - return "groupId: string expected"; - return null; - }; - - /** - * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership - */ - GroupMembership.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupMembership) - return object; - var message = new $root.google.cloud.securitycenter.v1.GroupMembership(); - switch (object.groupType) { - default: - if (typeof object.groupType === "number") { - message.groupType = object.groupType; - break; - } - break; - case "GROUP_TYPE_UNSPECIFIED": - case 0: - message.groupType = 0; - break; - case "GROUP_TYPE_TOXIC_COMBINATION": - case 1: - message.groupType = 1; - break; - case "GROUP_TYPE_CHOKEPOINT": - case 3: - message.groupType = 3; - break; - } - if (object.groupId != null) - message.groupId = String(object.groupId); - return message; - }; - - /** - * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {google.cloud.securitycenter.v1.GroupMembership} message GroupMembership - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupMembership.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.groupType = options.enums === String ? "GROUP_TYPE_UNSPECIFIED" : 0; - object.groupId = ""; - } - if (message.groupType != null && message.hasOwnProperty("groupType")) - object.groupType = options.enums === String ? $root.google.cloud.securitycenter.v1.GroupMembership.GroupType[message.groupType] === undefined ? message.groupType : $root.google.cloud.securitycenter.v1.GroupMembership.GroupType[message.groupType] : message.groupType; - if (message.groupId != null && message.hasOwnProperty("groupId")) - object.groupId = message.groupId; - return object; - }; - - /** - * Converts this GroupMembership to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @instance - * @returns {Object.} JSON object - */ - GroupMembership.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GroupMembership - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.GroupMembership - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GroupMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupMembership"; - }; - - /** - * GroupType enum. - * @name google.cloud.securitycenter.v1.GroupMembership.GroupType - * @enum {number} - * @property {number} GROUP_TYPE_UNSPECIFIED=0 GROUP_TYPE_UNSPECIFIED value - * @property {number} GROUP_TYPE_TOXIC_COMBINATION=1 GROUP_TYPE_TOXIC_COMBINATION value - * @property {number} GROUP_TYPE_CHOKEPOINT=3 GROUP_TYPE_CHOKEPOINT value - */ - GroupMembership.GroupType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "GROUP_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GROUP_TYPE_TOXIC_COMBINATION"] = 1; - values[valuesById[3] = "GROUP_TYPE_CHOKEPOINT"] = 3; - return values; - })(); - - return GroupMembership; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - 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] === 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")) - 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); - }; - - /** - * 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 - * @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 - * @property {Array.|null} [uris] Indicator uris - */ - - /** - * 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 = []; - this.uris = []; - if (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; - - /** - * 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 - * @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(); - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - 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; - } - } - 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; - }; - - /** - * 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]); - } - } - 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; - }; - - /** - * 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 = []; - object.uris = []; - } - 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); - } - 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; - }; - - /** - * 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); - }; - - /** - * 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() { - - /** - * 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 - * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType|null} [signatureType] ProcessSignature signatureType - */ - - /** - * 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; - - /** - * ProcessSignature signatureType. - * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType} signatureType - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature - * @instance - */ - ProcessSignature.prototype.signatureType = 0; - - // 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(); - if (message.signatureType != null && Object.hasOwnProperty.call(message, "signatureType")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.signatureType); - 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, error) { - 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(); - if (tag === error) - break; - 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 8: { - message.signatureType = reader.int32(); - 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; - } - } - if (message.signatureType != null && message.hasOwnProperty("signatureType")) - switch (message.signatureType) { - default: - return "signatureType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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); - } - switch (object.signatureType) { - default: - if (typeof object.signatureType === "number") { - message.signatureType = object.signatureType; - break; - } - break; - case "SIGNATURE_TYPE_UNSPECIFIED": - case 0: - message.signatureType = 0; - break; - case "SIGNATURE_TYPE_PROCESS": - case 1: - message.signatureType = 1; - break; - case "SIGNATURE_TYPE_FILE": - case 2: - message.signatureType = 2; - break; - } - 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 (options.defaults) - object.signatureType = options.enums === String ? "SIGNATURE_TYPE_UNSPECIFIED" : 0; - 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 (message.signatureType != null && message.hasOwnProperty("signatureType")) - object.signatureType = options.enums === String ? $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType[message.signatureType] === undefined ? message.signatureType : $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType[message.signatureType] : message.signatureType; - 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); - }; - - /** - * 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() { - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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() { - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - /** - * SignatureType enum. - * @name google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType - * @enum {number} - * @property {number} SIGNATURE_TYPE_UNSPECIFIED=0 SIGNATURE_TYPE_UNSPECIFIED value - * @property {number} SIGNATURE_TYPE_PROCESS=1 SIGNATURE_TYPE_PROCESS value - * @property {number} SIGNATURE_TYPE_FILE=2 SIGNATURE_TYPE_FILE value - */ - ProcessSignature.SignatureType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SIGNATURE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SIGNATURE_TYPE_PROCESS"] = 1; - values[valuesById[2] = "SIGNATURE_TYPE_FILE"] = 2; - return values; - })(); - - return ProcessSignature; - })(); - - return Indicator; - })(); - - v1.KernelRootkit = (function() { - - /** - * Properties of a KernelRootkit. - * @memberof google.cloud.securitycenter.v1 - * @interface IKernelRootkit - * @property {string|null} [name] KernelRootkit name - * @property {boolean|null} [unexpectedCodeModification] KernelRootkit unexpectedCodeModification - * @property {boolean|null} [unexpectedReadOnlyDataModification] KernelRootkit unexpectedReadOnlyDataModification - * @property {boolean|null} [unexpectedFtraceHandler] KernelRootkit unexpectedFtraceHandler - * @property {boolean|null} [unexpectedKprobeHandler] KernelRootkit unexpectedKprobeHandler - * @property {boolean|null} [unexpectedKernelCodePages] KernelRootkit unexpectedKernelCodePages - * @property {boolean|null} [unexpectedSystemCallHandler] KernelRootkit unexpectedSystemCallHandler - * @property {boolean|null} [unexpectedInterruptHandler] KernelRootkit unexpectedInterruptHandler - * @property {boolean|null} [unexpectedProcessesInRunqueue] KernelRootkit unexpectedProcessesInRunqueue - */ - - /** - * Constructs a new KernelRootkit. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a KernelRootkit. - * @implements IKernelRootkit - * @constructor - * @param {google.cloud.securitycenter.v1.IKernelRootkit=} [properties] Properties to set - */ - function KernelRootkit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KernelRootkit name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.name = ""; - - /** - * KernelRootkit unexpectedCodeModification. - * @member {boolean} unexpectedCodeModification - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedCodeModification = false; - - /** - * KernelRootkit unexpectedReadOnlyDataModification. - * @member {boolean} unexpectedReadOnlyDataModification - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedReadOnlyDataModification = false; - - /** - * KernelRootkit unexpectedFtraceHandler. - * @member {boolean} unexpectedFtraceHandler - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedFtraceHandler = false; - - /** - * KernelRootkit unexpectedKprobeHandler. - * @member {boolean} unexpectedKprobeHandler - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedKprobeHandler = false; - - /** - * KernelRootkit unexpectedKernelCodePages. - * @member {boolean} unexpectedKernelCodePages - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedKernelCodePages = false; - - /** - * KernelRootkit unexpectedSystemCallHandler. - * @member {boolean} unexpectedSystemCallHandler - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedSystemCallHandler = false; - - /** - * KernelRootkit unexpectedInterruptHandler. - * @member {boolean} unexpectedInterruptHandler - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedInterruptHandler = false; - - /** - * KernelRootkit unexpectedProcessesInRunqueue. - * @member {boolean} unexpectedProcessesInRunqueue - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedProcessesInRunqueue = false; - - /** - * Creates a new KernelRootkit instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {google.cloud.securitycenter.v1.IKernelRootkit=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.KernelRootkit} KernelRootkit instance - */ - KernelRootkit.create = function create(properties) { - return new KernelRootkit(properties); - }; - - /** - * Encodes the specified KernelRootkit message. Does not implicitly {@link google.cloud.securitycenter.v1.KernelRootkit.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {google.cloud.securitycenter.v1.IKernelRootkit} message KernelRootkit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KernelRootkit.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.unexpectedCodeModification != null && Object.hasOwnProperty.call(message, "unexpectedCodeModification")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.unexpectedCodeModification); - if (message.unexpectedReadOnlyDataModification != null && Object.hasOwnProperty.call(message, "unexpectedReadOnlyDataModification")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unexpectedReadOnlyDataModification); - if (message.unexpectedFtraceHandler != null && Object.hasOwnProperty.call(message, "unexpectedFtraceHandler")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.unexpectedFtraceHandler); - if (message.unexpectedKprobeHandler != null && Object.hasOwnProperty.call(message, "unexpectedKprobeHandler")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.unexpectedKprobeHandler); - if (message.unexpectedKernelCodePages != null && Object.hasOwnProperty.call(message, "unexpectedKernelCodePages")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.unexpectedKernelCodePages); - if (message.unexpectedSystemCallHandler != null && Object.hasOwnProperty.call(message, "unexpectedSystemCallHandler")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.unexpectedSystemCallHandler); - if (message.unexpectedInterruptHandler != null && Object.hasOwnProperty.call(message, "unexpectedInterruptHandler")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.unexpectedInterruptHandler); - if (message.unexpectedProcessesInRunqueue != null && Object.hasOwnProperty.call(message, "unexpectedProcessesInRunqueue")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.unexpectedProcessesInRunqueue); - return writer; - }; - - /** - * Encodes the specified KernelRootkit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.KernelRootkit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {google.cloud.securitycenter.v1.IKernelRootkit} message KernelRootkit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KernelRootkit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KernelRootkit message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.KernelRootkit} KernelRootkit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KernelRootkit.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.KernelRootkit(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.unexpectedCodeModification = reader.bool(); - break; - } - case 3: { - message.unexpectedReadOnlyDataModification = reader.bool(); - break; - } - case 4: { - message.unexpectedFtraceHandler = reader.bool(); - break; - } - case 5: { - message.unexpectedKprobeHandler = reader.bool(); - break; - } - case 6: { - message.unexpectedKernelCodePages = reader.bool(); - break; - } - case 7: { - message.unexpectedSystemCallHandler = reader.bool(); - break; - } - case 8: { - message.unexpectedInterruptHandler = reader.bool(); - break; - } - case 9: { - message.unexpectedProcessesInRunqueue = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KernelRootkit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.KernelRootkit} KernelRootkit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KernelRootkit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KernelRootkit message. - * @function verify - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KernelRootkit.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.unexpectedCodeModification != null && message.hasOwnProperty("unexpectedCodeModification")) - if (typeof message.unexpectedCodeModification !== "boolean") - return "unexpectedCodeModification: boolean expected"; - if (message.unexpectedReadOnlyDataModification != null && message.hasOwnProperty("unexpectedReadOnlyDataModification")) - if (typeof message.unexpectedReadOnlyDataModification !== "boolean") - return "unexpectedReadOnlyDataModification: boolean expected"; - if (message.unexpectedFtraceHandler != null && message.hasOwnProperty("unexpectedFtraceHandler")) - if (typeof message.unexpectedFtraceHandler !== "boolean") - return "unexpectedFtraceHandler: boolean expected"; - if (message.unexpectedKprobeHandler != null && message.hasOwnProperty("unexpectedKprobeHandler")) - if (typeof message.unexpectedKprobeHandler !== "boolean") - return "unexpectedKprobeHandler: boolean expected"; - if (message.unexpectedKernelCodePages != null && message.hasOwnProperty("unexpectedKernelCodePages")) - if (typeof message.unexpectedKernelCodePages !== "boolean") - return "unexpectedKernelCodePages: boolean expected"; - if (message.unexpectedSystemCallHandler != null && message.hasOwnProperty("unexpectedSystemCallHandler")) - if (typeof message.unexpectedSystemCallHandler !== "boolean") - return "unexpectedSystemCallHandler: boolean expected"; - if (message.unexpectedInterruptHandler != null && message.hasOwnProperty("unexpectedInterruptHandler")) - if (typeof message.unexpectedInterruptHandler !== "boolean") - return "unexpectedInterruptHandler: boolean expected"; - if (message.unexpectedProcessesInRunqueue != null && message.hasOwnProperty("unexpectedProcessesInRunqueue")) - if (typeof message.unexpectedProcessesInRunqueue !== "boolean") - return "unexpectedProcessesInRunqueue: boolean expected"; - return null; - }; - - /** - * Creates a KernelRootkit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.KernelRootkit} KernelRootkit - */ - KernelRootkit.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.KernelRootkit) - return object; - var message = new $root.google.cloud.securitycenter.v1.KernelRootkit(); - if (object.name != null) - message.name = String(object.name); - if (object.unexpectedCodeModification != null) - message.unexpectedCodeModification = Boolean(object.unexpectedCodeModification); - if (object.unexpectedReadOnlyDataModification != null) - message.unexpectedReadOnlyDataModification = Boolean(object.unexpectedReadOnlyDataModification); - if (object.unexpectedFtraceHandler != null) - message.unexpectedFtraceHandler = Boolean(object.unexpectedFtraceHandler); - if (object.unexpectedKprobeHandler != null) - message.unexpectedKprobeHandler = Boolean(object.unexpectedKprobeHandler); - if (object.unexpectedKernelCodePages != null) - message.unexpectedKernelCodePages = Boolean(object.unexpectedKernelCodePages); - if (object.unexpectedSystemCallHandler != null) - message.unexpectedSystemCallHandler = Boolean(object.unexpectedSystemCallHandler); - if (object.unexpectedInterruptHandler != null) - message.unexpectedInterruptHandler = Boolean(object.unexpectedInterruptHandler); - if (object.unexpectedProcessesInRunqueue != null) - message.unexpectedProcessesInRunqueue = Boolean(object.unexpectedProcessesInRunqueue); - return message; - }; - - /** - * Creates a plain object from a KernelRootkit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {google.cloud.securitycenter.v1.KernelRootkit} message KernelRootkit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KernelRootkit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.unexpectedCodeModification = false; - object.unexpectedReadOnlyDataModification = false; - object.unexpectedFtraceHandler = false; - object.unexpectedKprobeHandler = false; - object.unexpectedKernelCodePages = false; - object.unexpectedSystemCallHandler = false; - object.unexpectedInterruptHandler = false; - object.unexpectedProcessesInRunqueue = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.unexpectedCodeModification != null && message.hasOwnProperty("unexpectedCodeModification")) - object.unexpectedCodeModification = message.unexpectedCodeModification; - if (message.unexpectedReadOnlyDataModification != null && message.hasOwnProperty("unexpectedReadOnlyDataModification")) - object.unexpectedReadOnlyDataModification = message.unexpectedReadOnlyDataModification; - if (message.unexpectedFtraceHandler != null && message.hasOwnProperty("unexpectedFtraceHandler")) - object.unexpectedFtraceHandler = message.unexpectedFtraceHandler; - if (message.unexpectedKprobeHandler != null && message.hasOwnProperty("unexpectedKprobeHandler")) - object.unexpectedKprobeHandler = message.unexpectedKprobeHandler; - if (message.unexpectedKernelCodePages != null && message.hasOwnProperty("unexpectedKernelCodePages")) - object.unexpectedKernelCodePages = message.unexpectedKernelCodePages; - if (message.unexpectedSystemCallHandler != null && message.hasOwnProperty("unexpectedSystemCallHandler")) - object.unexpectedSystemCallHandler = message.unexpectedSystemCallHandler; - if (message.unexpectedInterruptHandler != null && message.hasOwnProperty("unexpectedInterruptHandler")) - object.unexpectedInterruptHandler = message.unexpectedInterruptHandler; - if (message.unexpectedProcessesInRunqueue != null && message.hasOwnProperty("unexpectedProcessesInRunqueue")) - object.unexpectedProcessesInRunqueue = message.unexpectedProcessesInRunqueue; - return object; - }; - - /** - * Converts this KernelRootkit to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @instance - * @returns {Object.} JSON object - */ - KernelRootkit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KernelRootkit - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.KernelRootkit - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KernelRootkit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.KernelRootkit"; - }; - - return KernelRootkit; - })(); - - 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 - * @property {Array.|null} [objects] Kubernetes objects - */ - - /** - * 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 = []; - this.objects = []; - if (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; - - /** - * Kubernetes objects. - * @member {Array.} objects - * @memberof google.cloud.securitycenter.v1.Kubernetes - * @instance - */ - Kubernetes.prototype.objects = $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(); - if (message.objects != null && message.objects.length) - for (var i = 0; i < message.objects.length; ++i) - $root.google.cloud.securitycenter.v1.Kubernetes.Object.encode(message.objects[i], writer.uint32(/* id 7, wireType 2 =*/58).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, error) { - 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(); - if (tag === error) - break; - 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 7: { - if (!(message.objects && message.objects.length)) - message.objects = []; - message.objects.push($root.google.cloud.securitycenter.v1.Kubernetes.Object.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; - } - } - if (message.objects != null && message.hasOwnProperty("objects")) { - if (!Array.isArray(message.objects)) - return "objects: array expected"; - for (var i = 0; i < message.objects.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Kubernetes.Object.verify(message.objects[i]); - if (error) - return "objects." + 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]); - } - } - if (object.objects) { - if (!Array.isArray(object.objects)) - throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.objects: array expected"); - message.objects = []; - for (var i = 0; i < object.objects.length; ++i) { - if (typeof object.objects[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.objects: object expected"); - message.objects[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Object.fromObject(object.objects[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 = []; - object.objects = []; - } - 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); - } - if (message.objects && message.objects.length) { - object.objects = []; - for (var j = 0; j < message.objects.length; ++j) - object.objects[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Object.toObject(message.objects[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); - }; - - /** - * 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() { - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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.Kubernetes.NodePool - * @static - * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool instance - */ - NodePool.create = function create(properties) { - return new NodePool(properties); - }; - - /** - * 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.Kubernetes.NodePool - * @static - * @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 - */ - NodePool.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.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 NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool - * @static - * @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 - */ - NodePool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodePool message from the specified reader or buffer. - * @function decode - * @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.Kubernetes.NodePool} NodePool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodePool.decode = function decode(reader, length, error) { - 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.NodePool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodePool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - NodePool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodePool message. - * @function verify - * @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 - */ - NodePool.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.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; - } - } - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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 Role message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Kubernetes.Role - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role - */ - 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.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; - 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 Role message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Kubernetes.Role - * @static - * @param {google.cloud.securitycenter.v1.Kubernetes.Role} message Role - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Role.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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] === 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")) - object.name = message.name; - return object; - }; - - /** - * Converts this Role to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Kubernetes.Role - * @instance - * @returns {Object.} JSON object - */ - Role.prototype.toJSON = function toJSON() { - 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 - * @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; - })(); - - return Role; - })(); - - Kubernetes.Binding = (function() { - - /** - * 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 - */ - - /** - * 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]]; - } - - /** - * Binding ns. - * @member {string} ns - * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding - * @instance - */ - Binding.prototype.ns = ""; - - /** - * Binding name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding - * @instance - */ - Binding.prototype.name = ""; - - /** - * Binding role. - * @member {google.cloud.securitycenter.v1.Kubernetes.IRole|null|undefined} role - * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding - * @instance - */ - Binding.prototype.role = null; - - /** - * Binding subjects. - * @member {Array.} subjects - * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding - * @instance - */ - Binding.prototype.subjects = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - Kubernetes.Subject = (function() { - - /** - * 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 - */ - - /** - * 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]]; - } - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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) { - default: - if (typeof object.kind === "number") { - message.kind = object.kind; - break; - } - break; - 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; - }; - - /** - * 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] === 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")) - object.name = message.name; - return object; - }; - - /** - * 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); - }; - - /** - * 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 - * @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; - })(); - - return Subject; - })(); - - Kubernetes.AccessReview = (function() { - - /** - * 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 - */ - - /** - * 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]]; - } - - /** - * AccessReview group. - * @member {string} group - * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.group = ""; - - /** - * AccessReview ns. - * @member {string} ns - * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.ns = ""; - - /** - * AccessReview name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.name = ""; - - /** - * AccessReview resource. - * @member {string} resource - * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.resource = ""; - - /** - * AccessReview subresource. - * @member {string} subresource - * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.subresource = ""; - - /** - * 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 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 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 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 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, error) { - 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(); - if (tag === error) - break; - 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 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()); - }; - - /** - * 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 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - Kubernetes.Object = (function() { - - /** - * Properties of an Object. - * @memberof google.cloud.securitycenter.v1.Kubernetes - * @interface IObject - * @property {string|null} [group] Object group - * @property {string|null} [kind] Object kind - * @property {string|null} [ns] Object ns - * @property {string|null} [name] Object name - * @property {Array.|null} [containers] Object containers - */ - - /** - * Constructs a new Object. - * @memberof google.cloud.securitycenter.v1.Kubernetes - * @classdesc Represents an Object. - * @implements IObject - * @constructor - * @param {google.cloud.securitycenter.v1.Kubernetes.IObject=} [properties] Properties to set - */ - function Object(properties) { - 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]]; - } - - /** - * Object group. - * @member {string} group - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @instance - */ - Object.prototype.group = ""; - - /** - * Object kind. - * @member {string} kind - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @instance - */ - Object.prototype.kind = ""; - - /** - * Object ns. - * @member {string} ns - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @instance - */ - Object.prototype.ns = ""; - - /** - * Object name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @instance - */ - Object.prototype.name = ""; - - /** - * Object containers. - * @member {Array.} containers - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @instance - */ - Object.prototype.containers = $util.emptyArray; - - /** - * Creates a new Object instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @param {google.cloud.securitycenter.v1.Kubernetes.IObject=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Kubernetes.Object} Object instance - */ - Object.create = function create(properties) { - return new Object(properties); - }; - - /** - * Encodes the specified Object message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Object.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @param {google.cloud.securitycenter.v1.Kubernetes.IObject} message Object message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Object.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.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); - if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ns); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - 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 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Object message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Object.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @param {google.cloud.securitycenter.v1.Kubernetes.IObject} message Object message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Object.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Object message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @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.Object} Object - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Object.decode = function decode(reader, length, error) { - 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.Object(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.group = reader.string(); - break; - } - case 2: { - message.kind = reader.string(); - break; - } - case 3: { - message.ns = reader.string(); - break; - } - case 4: { - message.name = reader.string(); - break; - } - case 5: { - 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 an Object message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Kubernetes.Object} Object - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Object.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Object message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Object.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.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: 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.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 an Object message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Kubernetes.Object} Object - */ - Object.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Object) - return object; - var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Object(); - if (object.group != null) - message.group = String(object.group); - if (object.kind != null) - message.kind = String(object.kind); - if (object.ns != null) - message.ns = String(object.ns); - if (object.name != null) - message.name = String(object.name); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Object.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.Object.containers: object expected"); - message.containers[i] = $root.google.cloud.securitycenter.v1.Container.fromObject(object.containers[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Object message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @param {google.cloud.securitycenter.v1.Kubernetes.Object} message Object - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Object.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.containers = []; - if (options.defaults) { - object.group = ""; - object.kind = ""; - object.ns = ""; - object.name = ""; - } - if (message.group != null && message.hasOwnProperty("group")) - object.group = message.group; - if (message.kind != null && message.hasOwnProperty("kind")) - object.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; - 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 Object to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @instance - * @returns {Object.} JSON object - */ - Object.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Object - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Kubernetes.Object - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Object.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Object"; - }; - - return Object; - })(); - - return Kubernetes; - })(); - - v1.LoadBalancer = (function() { - - /** - * Properties of a LoadBalancer. - * @memberof google.cloud.securitycenter.v1 - * @interface ILoadBalancer - * @property {string|null} [name] LoadBalancer name - */ - - /** - * Constructs a new LoadBalancer. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a LoadBalancer. - * @implements ILoadBalancer - * @constructor - * @param {google.cloud.securitycenter.v1.ILoadBalancer=} [properties] Properties to set - */ - function LoadBalancer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LoadBalancer name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @instance - */ - LoadBalancer.prototype.name = ""; - - /** - * Creates a new LoadBalancer instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {google.cloud.securitycenter.v1.ILoadBalancer=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.LoadBalancer} LoadBalancer instance - */ - LoadBalancer.create = function create(properties) { - return new LoadBalancer(properties); - }; - - /** - * Encodes the specified LoadBalancer message. Does not implicitly {@link google.cloud.securitycenter.v1.LoadBalancer.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {google.cloud.securitycenter.v1.ILoadBalancer} message LoadBalancer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoadBalancer.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 LoadBalancer message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.LoadBalancer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {google.cloud.securitycenter.v1.ILoadBalancer} message LoadBalancer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoadBalancer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LoadBalancer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.LoadBalancer} LoadBalancer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoadBalancer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.LoadBalancer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LoadBalancer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.LoadBalancer} LoadBalancer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoadBalancer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LoadBalancer message. - * @function verify - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LoadBalancer.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 LoadBalancer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.LoadBalancer} LoadBalancer - */ - LoadBalancer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.LoadBalancer) - return object; - var message = new $root.google.cloud.securitycenter.v1.LoadBalancer(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a LoadBalancer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {google.cloud.securitycenter.v1.LoadBalancer} message LoadBalancer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LoadBalancer.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 LoadBalancer to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @instance - * @returns {Object.} JSON object - */ - LoadBalancer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LoadBalancer - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.LoadBalancer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LoadBalancer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.LoadBalancer"; - }; - - return LoadBalancer; - })(); - - v1.LogEntry = (function() { - - /** - * Properties of a LogEntry. - * @memberof google.cloud.securitycenter.v1 - * @interface ILogEntry - * @property {google.cloud.securitycenter.v1.ICloudLoggingEntry|null} [cloudLoggingEntry] LogEntry cloudLoggingEntry - */ - - /** - * Constructs a new LogEntry. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a LogEntry. - * @implements ILogEntry - * @constructor - * @param {google.cloud.securitycenter.v1.ILogEntry=} [properties] Properties to set - */ - function LogEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LogEntry cloudLoggingEntry. - * @member {google.cloud.securitycenter.v1.ICloudLoggingEntry|null|undefined} cloudLoggingEntry - * @memberof google.cloud.securitycenter.v1.LogEntry - * @instance - */ - LogEntry.prototype.cloudLoggingEntry = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LogEntry logEntry. - * @member {"cloudLoggingEntry"|undefined} logEntry - * @memberof google.cloud.securitycenter.v1.LogEntry - * @instance - */ - Object.defineProperty(LogEntry.prototype, "logEntry", { - get: $util.oneOfGetter($oneOfFields = ["cloudLoggingEntry"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LogEntry instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {google.cloud.securitycenter.v1.ILogEntry=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.LogEntry} LogEntry instance - */ - LogEntry.create = function create(properties) { - return new LogEntry(properties); - }; - - /** - * Encodes the specified LogEntry message. Does not implicitly {@link google.cloud.securitycenter.v1.LogEntry.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {google.cloud.securitycenter.v1.ILogEntry} message LogEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cloudLoggingEntry != null && Object.hasOwnProperty.call(message, "cloudLoggingEntry")) - $root.google.cloud.securitycenter.v1.CloudLoggingEntry.encode(message.cloudLoggingEntry, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.LogEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {google.cloud.securitycenter.v1.ILogEntry} message LogEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LogEntry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.LogEntry} LogEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogEntry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.LogEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cloudLoggingEntry = $root.google.cloud.securitycenter.v1.CloudLoggingEntry.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LogEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.LogEntry} LogEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LogEntry message. - * @function verify - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudLoggingEntry != null && message.hasOwnProperty("cloudLoggingEntry")) { - properties.logEntry = 1; - { - var error = $root.google.cloud.securitycenter.v1.CloudLoggingEntry.verify(message.cloudLoggingEntry); - if (error) - return "cloudLoggingEntry." + error; - } - } - return null; - }; - - /** - * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.LogEntry} LogEntry - */ - LogEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.LogEntry) - return object; - var message = new $root.google.cloud.securitycenter.v1.LogEntry(); - if (object.cloudLoggingEntry != null) { - if (typeof object.cloudLoggingEntry !== "object") - throw TypeError(".google.cloud.securitycenter.v1.LogEntry.cloudLoggingEntry: object expected"); - message.cloudLoggingEntry = $root.google.cloud.securitycenter.v1.CloudLoggingEntry.fromObject(object.cloudLoggingEntry); - } - return message; - }; - - /** - * Creates a plain object from a LogEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {google.cloud.securitycenter.v1.LogEntry} message LogEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cloudLoggingEntry != null && message.hasOwnProperty("cloudLoggingEntry")) { - object.cloudLoggingEntry = $root.google.cloud.securitycenter.v1.CloudLoggingEntry.toObject(message.cloudLoggingEntry, options); - if (options.oneofs) - object.logEntry = "cloudLoggingEntry"; - } - return object; - }; - - /** - * Converts this LogEntry to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.LogEntry - * @instance - * @returns {Object.} JSON object - */ - LogEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LogEntry - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.LogEntry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.LogEntry"; - }; - - return LogEntry; - })(); - - v1.CloudLoggingEntry = (function() { - - /** - * Properties of a CloudLoggingEntry. - * @memberof google.cloud.securitycenter.v1 - * @interface ICloudLoggingEntry - * @property {string|null} [insertId] CloudLoggingEntry insertId - * @property {string|null} [logId] CloudLoggingEntry logId - * @property {string|null} [resourceContainer] CloudLoggingEntry resourceContainer - * @property {google.protobuf.ITimestamp|null} [timestamp] CloudLoggingEntry timestamp - */ - - /** - * Constructs a new CloudLoggingEntry. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CloudLoggingEntry. - * @implements ICloudLoggingEntry - * @constructor - * @param {google.cloud.securitycenter.v1.ICloudLoggingEntry=} [properties] Properties to set - */ - function CloudLoggingEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudLoggingEntry insertId. - * @member {string} insertId - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @instance - */ - CloudLoggingEntry.prototype.insertId = ""; - - /** - * CloudLoggingEntry logId. - * @member {string} logId - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @instance - */ - CloudLoggingEntry.prototype.logId = ""; - - /** - * CloudLoggingEntry resourceContainer. - * @member {string} resourceContainer - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @instance - */ - CloudLoggingEntry.prototype.resourceContainer = ""; - - /** - * CloudLoggingEntry timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @instance - */ - CloudLoggingEntry.prototype.timestamp = null; - - /** - * Creates a new CloudLoggingEntry instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {google.cloud.securitycenter.v1.ICloudLoggingEntry=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CloudLoggingEntry} CloudLoggingEntry instance - */ - CloudLoggingEntry.create = function create(properties) { - return new CloudLoggingEntry(properties); - }; - - /** - * Encodes the specified CloudLoggingEntry message. Does not implicitly {@link google.cloud.securitycenter.v1.CloudLoggingEntry.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {google.cloud.securitycenter.v1.ICloudLoggingEntry} message CloudLoggingEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.insertId != null && Object.hasOwnProperty.call(message, "insertId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.insertId); - if (message.logId != null && Object.hasOwnProperty.call(message, "logId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.logId); - if (message.resourceContainer != null && Object.hasOwnProperty.call(message, "resourceContainer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceContainer); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudLoggingEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CloudLoggingEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {google.cloud.securitycenter.v1.ICloudLoggingEntry} message CloudLoggingEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudLoggingEntry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CloudLoggingEntry} CloudLoggingEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingEntry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CloudLoggingEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.insertId = reader.string(); - break; - } - case 2: { - message.logId = reader.string(); - break; - } - case 3: { - message.resourceContainer = reader.string(); - break; - } - case 4: { - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudLoggingEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CloudLoggingEntry} CloudLoggingEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudLoggingEntry message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudLoggingEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.insertId != null && message.hasOwnProperty("insertId")) - if (!$util.isString(message.insertId)) - return "insertId: string expected"; - if (message.logId != null && message.hasOwnProperty("logId")) - if (!$util.isString(message.logId)) - return "logId: string expected"; - if (message.resourceContainer != null && message.hasOwnProperty("resourceContainer")) - if (!$util.isString(message.resourceContainer)) - return "resourceContainer: string expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - return null; - }; - - /** - * Creates a CloudLoggingEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CloudLoggingEntry} CloudLoggingEntry - */ - CloudLoggingEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CloudLoggingEntry) - return object; - var message = new $root.google.cloud.securitycenter.v1.CloudLoggingEntry(); - if (object.insertId != null) - message.insertId = String(object.insertId); - if (object.logId != null) - message.logId = String(object.logId); - if (object.resourceContainer != null) - message.resourceContainer = String(object.resourceContainer); - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CloudLoggingEntry.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - return message; - }; - - /** - * Creates a plain object from a CloudLoggingEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {google.cloud.securitycenter.v1.CloudLoggingEntry} message CloudLoggingEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudLoggingEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.insertId = ""; - object.logId = ""; - object.resourceContainer = ""; - object.timestamp = null; - } - if (message.insertId != null && message.hasOwnProperty("insertId")) - object.insertId = message.insertId; - if (message.logId != null && message.hasOwnProperty("logId")) - object.logId = message.logId; - if (message.resourceContainer != null && message.hasOwnProperty("resourceContainer")) - object.resourceContainer = message.resourceContainer; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - return object; - }; - - /** - * Converts this CloudLoggingEntry to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @instance - * @returns {Object.} JSON object - */ - CloudLoggingEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudLoggingEntry - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CloudLoggingEntry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudLoggingEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudLoggingEntry"; - }; - - return CloudLoggingEntry; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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 49: - case 50: - case 37: - case 38: - case 32: - case 56: - case 6: - case 7: - case 59: - case 63: - case 18: - case 19: - case 64: - case 45: - case 46: - case 47: - case 14: - case 35: - case 15: - case 16: - case 9: - case 10: - case 11: - case 22: - case 40: - case 23: - case 58: - case 3: - case 4: - case 44: - case 5: - case 33: - case 39: - case 27: - case 30: - case 29: - case 52: - case 36: - case 8: - case 17: - case 48: - case 42: - case 51: - case 25: - case 24: - case 34: - case 13: - case 28: - case 31: - case 55: - case 20: - case 21: - case 12: - case 41: - case 26: - case 54: - case 53: - case 43: - case 1: - case 2: - case 60: - case 61: - case 57: - case 62: - 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 49: - case 50: - case 37: - case 38: - case 32: - case 56: - case 6: - case 7: - case 59: - case 63: - case 18: - case 19: - case 64: - case 45: - case 46: - case 47: - case 14: - case 35: - case 15: - case 16: - case 9: - case 10: - case 11: - case 22: - case 40: - case 23: - case 58: - case 3: - case 4: - case 44: - case 5: - case 33: - case 39: - case 27: - case 30: - case 29: - case 52: - case 36: - case 8: - case 17: - case 48: - case 42: - case 51: - case 25: - case 24: - case 34: - case 13: - case 28: - case 31: - case 55: - case 20: - case 21: - case 12: - case 41: - case 26: - case 54: - case 53: - case 43: - case 1: - case 2: - case 60: - case 61: - case 57: - case 62: - 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) { - default: - if (typeof object.primaryTactic === "number") { - message.primaryTactic = object.primaryTactic; - break; - } - break; - 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: - if (typeof object.primaryTechniques[i] === "number") { - message.primaryTechniques[i] = object.primaryTechniques[i]; - break; - } - case "TECHNIQUE_UNSPECIFIED": - case 0: - message.primaryTechniques[i] = 0; - break; - case "MASQUERADING": - case 49: - message.primaryTechniques[i] = 49; - break; - case "MATCH_LEGITIMATE_NAME_OR_LOCATION": - case 50: - message.primaryTechniques[i] = 50; - break; - case "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": - case 37: - message.primaryTechniques[i] = 37; - break; - case "STARTUP_ITEMS": - case 38: - message.primaryTechniques[i] = 38; - break; - case "NETWORK_SERVICE_DISCOVERY": - case 32: - message.primaryTechniques[i] = 32; - break; - case "PROCESS_DISCOVERY": - case 56: - message.primaryTechniques[i] = 56; - break; - case "COMMAND_AND_SCRIPTING_INTERPRETER": - case 6: - message.primaryTechniques[i] = 6; - break; - case "UNIX_SHELL": - case 7: - message.primaryTechniques[i] = 7; - break; - case "PYTHON": - case 59: - message.primaryTechniques[i] = 59; - break; - case "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": - case 63: - message.primaryTechniques[i] = 63; - break; - case "PERMISSION_GROUPS_DISCOVERY": - case 18: - message.primaryTechniques[i] = 18; - break; - case "CLOUD_GROUPS": - case 19: - message.primaryTechniques[i] = 19; - break; - case "INDICATOR_REMOVAL_FILE_DELETION": - case 64: - message.primaryTechniques[i] = 64; - break; - case "APPLICATION_LAYER_PROTOCOL": - case 45: - message.primaryTechniques[i] = 45; - break; - case "DNS": - case 46: - message.primaryTechniques[i] = 46; - break; - case "SOFTWARE_DEPLOYMENT_TOOLS": - case 47: - message.primaryTechniques[i] = 47; - break; - case "VALID_ACCOUNTS": - case 14: - message.primaryTechniques[i] = 14; - break; - case "DEFAULT_ACCOUNTS": - case 35: - message.primaryTechniques[i] = 35; - break; - case "LOCAL_ACCOUNTS": - case 15: - message.primaryTechniques[i] = 15; - break; - case "CLOUD_ACCOUNTS": - case 16: - message.primaryTechniques[i] = 16; - 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 "ACCOUNT_MANIPULATION": - case 22: - message.primaryTechniques[i] = 22; - break; - case "ADDITIONAL_CLOUD_CREDENTIALS": - case 40: - message.primaryTechniques[i] = 40; - break; - case "SSH_AUTHORIZED_KEYS": - case 23: - message.primaryTechniques[i] = 23; - break; - case "ADDITIONAL_CONTAINER_CLUSTER_ROLES": - case 58: - message.primaryTechniques[i] = 58; - break; - case "INGRESS_TOOL_TRANSFER": - case 3: - message.primaryTechniques[i] = 3; - break; - case "NATIVE_API": - case 4: - message.primaryTechniques[i] = 4; - break; - case "BRUTE_FORCE": - case 44: - message.primaryTechniques[i] = 44; - break; - case "SHARED_MODULES": - case 5: - message.primaryTechniques[i] = 5; - break; - case "ACCESS_TOKEN_MANIPULATION": - case 33: - message.primaryTechniques[i] = 33; - break; - case "TOKEN_IMPERSONATION_OR_THEFT": - case 39: - message.primaryTechniques[i] = 39; - break; - case "EXPLOIT_PUBLIC_FACING_APPLICATION": - case 27: - message.primaryTechniques[i] = 27; - break; - case "DOMAIN_POLICY_MODIFICATION": - case 30: - message.primaryTechniques[i] = 30; - break; - case "DATA_DESTRUCTION": - case 29: - message.primaryTechniques[i] = 29; - break; - case "SERVICE_STOP": - case 52: - message.primaryTechniques[i] = 52; - break; - case "INHIBIT_SYSTEM_RECOVERY": - case 36: - message.primaryTechniques[i] = 36; - break; - case "RESOURCE_HIJACKING": - case 8: - message.primaryTechniques[i] = 8; - break; - case "NETWORK_DENIAL_OF_SERVICE": - case 17: - message.primaryTechniques[i] = 17; - break; - case "CLOUD_SERVICE_DISCOVERY": - case 48: - message.primaryTechniques[i] = 48; - break; - case "STEAL_APPLICATION_ACCESS_TOKEN": - case 42: - message.primaryTechniques[i] = 42; - break; - case "ACCOUNT_ACCESS_REMOVAL": - case 51: - message.primaryTechniques[i] = 51; - break; - case "STEAL_WEB_SESSION_COOKIE": - case 25: - message.primaryTechniques[i] = 25; - break; - case "CREATE_OR_MODIFY_SYSTEM_PROCESS": - case 24: - message.primaryTechniques[i] = 24; - break; - case "ABUSE_ELEVATION_CONTROL_MECHANISM": - case 34: - message.primaryTechniques[i] = 34; - break; - case "UNSECURED_CREDENTIALS": - case 13: - message.primaryTechniques[i] = 13; - break; - case "MODIFY_AUTHENTICATION_PROCESS": - case 28: - message.primaryTechniques[i] = 28; - break; - case "IMPAIR_DEFENSES": - case 31: - message.primaryTechniques[i] = 31; - break; - case "DISABLE_OR_MODIFY_TOOLS": - case 55: - message.primaryTechniques[i] = 55; - 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 "DYNAMIC_RESOLUTION": - case 12: - message.primaryTechniques[i] = 12; - break; - case "LATERAL_TOOL_TRANSFER": - case 41: - message.primaryTechniques[i] = 41; - break; - case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": - case 26: - message.primaryTechniques[i] = 26; - break; - case "CREATE_SNAPSHOT": - case 54: - message.primaryTechniques[i] = 54; - break; - case "CLOUD_INFRASTRUCTURE_DISCOVERY": - case 53: - message.primaryTechniques[i] = 53; - break; - case "OBTAIN_CAPABILITIES": - case 43: - message.primaryTechniques[i] = 43; - break; - case "ACTIVE_SCANNING": - case 1: - message.primaryTechniques[i] = 1; - break; - case "SCANNING_IP_BLOCKS": - case 2: - message.primaryTechniques[i] = 2; - break; - case "CONTAINER_ADMINISTRATION_COMMAND": - case 60: - message.primaryTechniques[i] = 60; - break; - case "ESCAPE_TO_HOST": - case 61: - message.primaryTechniques[i] = 61; - break; - case "CONTAINER_AND_RESOURCE_DISCOVERY": - case 57: - message.primaryTechniques[i] = 57; - break; - case "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": - case 62: - message.primaryTechniques[i] = 62; - 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: - if (typeof object.additionalTactics[i] === "number") { - message.additionalTactics[i] = object.additionalTactics[i]; - break; - } - 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: - if (typeof object.additionalTechniques[i] === "number") { - message.additionalTechniques[i] = object.additionalTechniques[i]; - break; - } - case "TECHNIQUE_UNSPECIFIED": - case 0: - message.additionalTechniques[i] = 0; - break; - case "MASQUERADING": - case 49: - message.additionalTechniques[i] = 49; - break; - case "MATCH_LEGITIMATE_NAME_OR_LOCATION": - case 50: - message.additionalTechniques[i] = 50; - break; - case "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": - case 37: - message.additionalTechniques[i] = 37; - break; - case "STARTUP_ITEMS": - case 38: - message.additionalTechniques[i] = 38; - break; - case "NETWORK_SERVICE_DISCOVERY": - case 32: - message.additionalTechniques[i] = 32; - break; - case "PROCESS_DISCOVERY": - case 56: - message.additionalTechniques[i] = 56; - break; - case "COMMAND_AND_SCRIPTING_INTERPRETER": - case 6: - message.additionalTechniques[i] = 6; - break; - case "UNIX_SHELL": - case 7: - message.additionalTechniques[i] = 7; - break; - case "PYTHON": - case 59: - message.additionalTechniques[i] = 59; - break; - case "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": - case 63: - message.additionalTechniques[i] = 63; - break; - case "PERMISSION_GROUPS_DISCOVERY": - case 18: - message.additionalTechniques[i] = 18; - break; - case "CLOUD_GROUPS": - case 19: - message.additionalTechniques[i] = 19; - break; - case "INDICATOR_REMOVAL_FILE_DELETION": - case 64: - message.additionalTechniques[i] = 64; - break; - case "APPLICATION_LAYER_PROTOCOL": - case 45: - message.additionalTechniques[i] = 45; - break; - case "DNS": - case 46: - message.additionalTechniques[i] = 46; - break; - case "SOFTWARE_DEPLOYMENT_TOOLS": - case 47: - message.additionalTechniques[i] = 47; - break; - case "VALID_ACCOUNTS": - case 14: - message.additionalTechniques[i] = 14; - break; - case "DEFAULT_ACCOUNTS": - case 35: - message.additionalTechniques[i] = 35; - break; - case "LOCAL_ACCOUNTS": - case 15: - message.additionalTechniques[i] = 15; - break; - case "CLOUD_ACCOUNTS": - case 16: - message.additionalTechniques[i] = 16; - 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 "ACCOUNT_MANIPULATION": - case 22: - message.additionalTechniques[i] = 22; - break; - case "ADDITIONAL_CLOUD_CREDENTIALS": - case 40: - message.additionalTechniques[i] = 40; - break; - case "SSH_AUTHORIZED_KEYS": - case 23: - message.additionalTechniques[i] = 23; - break; - case "ADDITIONAL_CONTAINER_CLUSTER_ROLES": - case 58: - message.additionalTechniques[i] = 58; - break; - case "INGRESS_TOOL_TRANSFER": - case 3: - message.additionalTechniques[i] = 3; - break; - case "NATIVE_API": - case 4: - message.additionalTechniques[i] = 4; - break; - case "BRUTE_FORCE": - case 44: - message.additionalTechniques[i] = 44; - break; - case "SHARED_MODULES": - case 5: - message.additionalTechniques[i] = 5; - break; - case "ACCESS_TOKEN_MANIPULATION": - case 33: - message.additionalTechniques[i] = 33; - break; - case "TOKEN_IMPERSONATION_OR_THEFT": - case 39: - message.additionalTechniques[i] = 39; - break; - case "EXPLOIT_PUBLIC_FACING_APPLICATION": - case 27: - message.additionalTechniques[i] = 27; - break; - case "DOMAIN_POLICY_MODIFICATION": - case 30: - message.additionalTechniques[i] = 30; - break; - case "DATA_DESTRUCTION": - case 29: - message.additionalTechniques[i] = 29; - break; - case "SERVICE_STOP": - case 52: - message.additionalTechniques[i] = 52; - break; - case "INHIBIT_SYSTEM_RECOVERY": - case 36: - message.additionalTechniques[i] = 36; - break; - case "RESOURCE_HIJACKING": - case 8: - message.additionalTechniques[i] = 8; - break; - case "NETWORK_DENIAL_OF_SERVICE": - case 17: - message.additionalTechniques[i] = 17; - break; - case "CLOUD_SERVICE_DISCOVERY": - case 48: - message.additionalTechniques[i] = 48; - break; - case "STEAL_APPLICATION_ACCESS_TOKEN": - case 42: - message.additionalTechniques[i] = 42; - break; - case "ACCOUNT_ACCESS_REMOVAL": - case 51: - message.additionalTechniques[i] = 51; - break; - case "STEAL_WEB_SESSION_COOKIE": - case 25: - message.additionalTechniques[i] = 25; - break; - case "CREATE_OR_MODIFY_SYSTEM_PROCESS": - case 24: - message.additionalTechniques[i] = 24; - break; - case "ABUSE_ELEVATION_CONTROL_MECHANISM": - case 34: - message.additionalTechniques[i] = 34; - break; - case "UNSECURED_CREDENTIALS": - case 13: - message.additionalTechniques[i] = 13; - break; - case "MODIFY_AUTHENTICATION_PROCESS": - case 28: - message.additionalTechniques[i] = 28; - break; - case "IMPAIR_DEFENSES": - case 31: - message.additionalTechniques[i] = 31; - break; - case "DISABLE_OR_MODIFY_TOOLS": - case 55: - message.additionalTechniques[i] = 55; - 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 "DYNAMIC_RESOLUTION": - case 12: - message.additionalTechniques[i] = 12; - break; - case "LATERAL_TOOL_TRANSFER": - case 41: - message.additionalTechniques[i] = 41; - break; - case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": - case 26: - message.additionalTechniques[i] = 26; - break; - case "CREATE_SNAPSHOT": - case 54: - message.additionalTechniques[i] = 54; - break; - case "CLOUD_INFRASTRUCTURE_DISCOVERY": - case 53: - message.additionalTechniques[i] = 53; - break; - case "OBTAIN_CAPABILITIES": - case 43: - message.additionalTechniques[i] = 43; - break; - case "ACTIVE_SCANNING": - case 1: - message.additionalTechniques[i] = 1; - break; - case "SCANNING_IP_BLOCKS": - case 2: - message.additionalTechniques[i] = 2; - break; - case "CONTAINER_ADMINISTRATION_COMMAND": - case 60: - message.additionalTechniques[i] = 60; - break; - case "ESCAPE_TO_HOST": - case 61: - message.additionalTechniques[i] = 61; - break; - case "CONTAINER_AND_RESOURCE_DISCOVERY": - case 57: - message.additionalTechniques[i] = 57; - break; - case "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": - case 62: - message.additionalTechniques[i] = 62; - 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] === 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]] === 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]] === 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]] === 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; - 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); - }; - - /** - * 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 - * @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} MASQUERADING=49 MASQUERADING value - * @property {number} MATCH_LEGITIMATE_NAME_OR_LOCATION=50 MATCH_LEGITIMATE_NAME_OR_LOCATION value - * @property {number} BOOT_OR_LOGON_INITIALIZATION_SCRIPTS=37 BOOT_OR_LOGON_INITIALIZATION_SCRIPTS value - * @property {number} STARTUP_ITEMS=38 STARTUP_ITEMS value - * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value - * @property {number} PROCESS_DISCOVERY=56 PROCESS_DISCOVERY value - * @property {number} COMMAND_AND_SCRIPTING_INTERPRETER=6 COMMAND_AND_SCRIPTING_INTERPRETER value - * @property {number} UNIX_SHELL=7 UNIX_SHELL value - * @property {number} PYTHON=59 PYTHON value - * @property {number} EXPLOITATION_FOR_PRIVILEGE_ESCALATION=63 EXPLOITATION_FOR_PRIVILEGE_ESCALATION value - * @property {number} PERMISSION_GROUPS_DISCOVERY=18 PERMISSION_GROUPS_DISCOVERY value - * @property {number} CLOUD_GROUPS=19 CLOUD_GROUPS value - * @property {number} INDICATOR_REMOVAL_FILE_DELETION=64 INDICATOR_REMOVAL_FILE_DELETION value - * @property {number} APPLICATION_LAYER_PROTOCOL=45 APPLICATION_LAYER_PROTOCOL value - * @property {number} DNS=46 DNS value - * @property {number} SOFTWARE_DEPLOYMENT_TOOLS=47 SOFTWARE_DEPLOYMENT_TOOLS value - * @property {number} VALID_ACCOUNTS=14 VALID_ACCOUNTS value - * @property {number} DEFAULT_ACCOUNTS=35 DEFAULT_ACCOUNTS value - * @property {number} LOCAL_ACCOUNTS=15 LOCAL_ACCOUNTS value - * @property {number} CLOUD_ACCOUNTS=16 CLOUD_ACCOUNTS 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} ACCOUNT_MANIPULATION=22 ACCOUNT_MANIPULATION value - * @property {number} ADDITIONAL_CLOUD_CREDENTIALS=40 ADDITIONAL_CLOUD_CREDENTIALS value - * @property {number} SSH_AUTHORIZED_KEYS=23 SSH_AUTHORIZED_KEYS value - * @property {number} ADDITIONAL_CONTAINER_CLUSTER_ROLES=58 ADDITIONAL_CONTAINER_CLUSTER_ROLES value - * @property {number} INGRESS_TOOL_TRANSFER=3 INGRESS_TOOL_TRANSFER value - * @property {number} NATIVE_API=4 NATIVE_API value - * @property {number} BRUTE_FORCE=44 BRUTE_FORCE value - * @property {number} SHARED_MODULES=5 SHARED_MODULES value - * @property {number} ACCESS_TOKEN_MANIPULATION=33 ACCESS_TOKEN_MANIPULATION value - * @property {number} TOKEN_IMPERSONATION_OR_THEFT=39 TOKEN_IMPERSONATION_OR_THEFT value - * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value - * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value - * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value - * @property {number} SERVICE_STOP=52 SERVICE_STOP value - * @property {number} INHIBIT_SYSTEM_RECOVERY=36 INHIBIT_SYSTEM_RECOVERY value - * @property {number} RESOURCE_HIJACKING=8 RESOURCE_HIJACKING value - * @property {number} NETWORK_DENIAL_OF_SERVICE=17 NETWORK_DENIAL_OF_SERVICE value - * @property {number} CLOUD_SERVICE_DISCOVERY=48 CLOUD_SERVICE_DISCOVERY value - * @property {number} STEAL_APPLICATION_ACCESS_TOKEN=42 STEAL_APPLICATION_ACCESS_TOKEN value - * @property {number} ACCOUNT_ACCESS_REMOVAL=51 ACCOUNT_ACCESS_REMOVAL value - * @property {number} STEAL_WEB_SESSION_COOKIE=25 STEAL_WEB_SESSION_COOKIE value - * @property {number} CREATE_OR_MODIFY_SYSTEM_PROCESS=24 CREATE_OR_MODIFY_SYSTEM_PROCESS value - * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM=34 ABUSE_ELEVATION_CONTROL_MECHANISM value - * @property {number} UNSECURED_CREDENTIALS=13 UNSECURED_CREDENTIALS value - * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value - * @property {number} IMPAIR_DEFENSES=31 IMPAIR_DEFENSES value - * @property {number} DISABLE_OR_MODIFY_TOOLS=55 DISABLE_OR_MODIFY_TOOLS 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} DYNAMIC_RESOLUTION=12 DYNAMIC_RESOLUTION value - * @property {number} LATERAL_TOOL_TRANSFER=41 LATERAL_TOOL_TRANSFER value - * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value - * @property {number} CREATE_SNAPSHOT=54 CREATE_SNAPSHOT value - * @property {number} CLOUD_INFRASTRUCTURE_DISCOVERY=53 CLOUD_INFRASTRUCTURE_DISCOVERY value - * @property {number} OBTAIN_CAPABILITIES=43 OBTAIN_CAPABILITIES value - * @property {number} ACTIVE_SCANNING=1 ACTIVE_SCANNING value - * @property {number} SCANNING_IP_BLOCKS=2 SCANNING_IP_BLOCKS value - * @property {number} CONTAINER_ADMINISTRATION_COMMAND=60 CONTAINER_ADMINISTRATION_COMMAND value - * @property {number} ESCAPE_TO_HOST=61 ESCAPE_TO_HOST value - * @property {number} CONTAINER_AND_RESOURCE_DISCOVERY=57 CONTAINER_AND_RESOURCE_DISCOVERY value - * @property {number} STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES=62 STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES value - */ - MitreAttack.Technique = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TECHNIQUE_UNSPECIFIED"] = 0; - values[valuesById[49] = "MASQUERADING"] = 49; - values[valuesById[50] = "MATCH_LEGITIMATE_NAME_OR_LOCATION"] = 50; - values[valuesById[37] = "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS"] = 37; - values[valuesById[38] = "STARTUP_ITEMS"] = 38; - values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; - values[valuesById[56] = "PROCESS_DISCOVERY"] = 56; - values[valuesById[6] = "COMMAND_AND_SCRIPTING_INTERPRETER"] = 6; - values[valuesById[7] = "UNIX_SHELL"] = 7; - values[valuesById[59] = "PYTHON"] = 59; - values[valuesById[63] = "EXPLOITATION_FOR_PRIVILEGE_ESCALATION"] = 63; - values[valuesById[18] = "PERMISSION_GROUPS_DISCOVERY"] = 18; - values[valuesById[19] = "CLOUD_GROUPS"] = 19; - values[valuesById[64] = "INDICATOR_REMOVAL_FILE_DELETION"] = 64; - values[valuesById[45] = "APPLICATION_LAYER_PROTOCOL"] = 45; - values[valuesById[46] = "DNS"] = 46; - values[valuesById[47] = "SOFTWARE_DEPLOYMENT_TOOLS"] = 47; - values[valuesById[14] = "VALID_ACCOUNTS"] = 14; - values[valuesById[35] = "DEFAULT_ACCOUNTS"] = 35; - values[valuesById[15] = "LOCAL_ACCOUNTS"] = 15; - values[valuesById[16] = "CLOUD_ACCOUNTS"] = 16; - values[valuesById[9] = "PROXY"] = 9; - values[valuesById[10] = "EXTERNAL_PROXY"] = 10; - values[valuesById[11] = "MULTI_HOP_PROXY"] = 11; - values[valuesById[22] = "ACCOUNT_MANIPULATION"] = 22; - values[valuesById[40] = "ADDITIONAL_CLOUD_CREDENTIALS"] = 40; - values[valuesById[23] = "SSH_AUTHORIZED_KEYS"] = 23; - values[valuesById[58] = "ADDITIONAL_CONTAINER_CLUSTER_ROLES"] = 58; - values[valuesById[3] = "INGRESS_TOOL_TRANSFER"] = 3; - values[valuesById[4] = "NATIVE_API"] = 4; - values[valuesById[44] = "BRUTE_FORCE"] = 44; - values[valuesById[5] = "SHARED_MODULES"] = 5; - values[valuesById[33] = "ACCESS_TOKEN_MANIPULATION"] = 33; - values[valuesById[39] = "TOKEN_IMPERSONATION_OR_THEFT"] = 39; - values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; - values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; - values[valuesById[29] = "DATA_DESTRUCTION"] = 29; - values[valuesById[52] = "SERVICE_STOP"] = 52; - values[valuesById[36] = "INHIBIT_SYSTEM_RECOVERY"] = 36; - values[valuesById[8] = "RESOURCE_HIJACKING"] = 8; - values[valuesById[17] = "NETWORK_DENIAL_OF_SERVICE"] = 17; - values[valuesById[48] = "CLOUD_SERVICE_DISCOVERY"] = 48; - values[valuesById[42] = "STEAL_APPLICATION_ACCESS_TOKEN"] = 42; - values[valuesById[51] = "ACCOUNT_ACCESS_REMOVAL"] = 51; - values[valuesById[25] = "STEAL_WEB_SESSION_COOKIE"] = 25; - values[valuesById[24] = "CREATE_OR_MODIFY_SYSTEM_PROCESS"] = 24; - values[valuesById[34] = "ABUSE_ELEVATION_CONTROL_MECHANISM"] = 34; - values[valuesById[13] = "UNSECURED_CREDENTIALS"] = 13; - values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; - values[valuesById[31] = "IMPAIR_DEFENSES"] = 31; - values[valuesById[55] = "DISABLE_OR_MODIFY_TOOLS"] = 55; - values[valuesById[20] = "EXFILTRATION_OVER_WEB_SERVICE"] = 20; - values[valuesById[21] = "EXFILTRATION_TO_CLOUD_STORAGE"] = 21; - values[valuesById[12] = "DYNAMIC_RESOLUTION"] = 12; - values[valuesById[41] = "LATERAL_TOOL_TRANSFER"] = 41; - values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; - values[valuesById[54] = "CREATE_SNAPSHOT"] = 54; - values[valuesById[53] = "CLOUD_INFRASTRUCTURE_DISCOVERY"] = 53; - values[valuesById[43] = "OBTAIN_CAPABILITIES"] = 43; - values[valuesById[1] = "ACTIVE_SCANNING"] = 1; - values[valuesById[2] = "SCANNING_IP_BLOCKS"] = 2; - values[valuesById[60] = "CONTAINER_ADMINISTRATION_COMMAND"] = 60; - values[valuesById[61] = "ESCAPE_TO_HOST"] = 61; - values[valuesById[57] = "CONTAINER_AND_RESOURCE_DISCOVERY"] = 57; - values[valuesById[62] = "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES"] = 62; - return values; - })(); - - return MitreAttack; - })(); - - v1.Notebook = (function() { - - /** - * Properties of a Notebook. - * @memberof google.cloud.securitycenter.v1 - * @interface INotebook - * @property {string|null} [name] Notebook name - * @property {string|null} [service] Notebook service - * @property {string|null} [lastAuthor] Notebook lastAuthor - * @property {google.protobuf.ITimestamp|null} [notebookUpdateTime] Notebook notebookUpdateTime - */ - - /** - * Constructs a new Notebook. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Notebook. - * @implements INotebook - * @constructor - * @param {google.cloud.securitycenter.v1.INotebook=} [properties] Properties to set - */ - function Notebook(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Notebook name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Notebook - * @instance - */ - Notebook.prototype.name = ""; - - /** - * Notebook service. - * @member {string} service - * @memberof google.cloud.securitycenter.v1.Notebook - * @instance - */ - Notebook.prototype.service = ""; - - /** - * Notebook lastAuthor. - * @member {string} lastAuthor - * @memberof google.cloud.securitycenter.v1.Notebook - * @instance - */ - Notebook.prototype.lastAuthor = ""; - - /** - * Notebook notebookUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} notebookUpdateTime - * @memberof google.cloud.securitycenter.v1.Notebook - * @instance - */ - Notebook.prototype.notebookUpdateTime = null; - - /** - * Creates a new Notebook instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {google.cloud.securitycenter.v1.INotebook=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Notebook} Notebook instance - */ - Notebook.create = function create(properties) { - return new Notebook(properties); - }; - - /** - * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.securitycenter.v1.Notebook.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {google.cloud.securitycenter.v1.INotebook} message Notebook message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Notebook.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.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.lastAuthor != null && Object.hasOwnProperty.call(message, "lastAuthor")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.lastAuthor); - if (message.notebookUpdateTime != null && Object.hasOwnProperty.call(message, "notebookUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.notebookUpdateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Notebook.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {google.cloud.securitycenter.v1.INotebook} message Notebook message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Notebook.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Notebook message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Notebook} Notebook - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Notebook.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Notebook(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.lastAuthor = reader.string(); - break; - } - case 4: { - message.notebookUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Notebook message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Notebook} Notebook - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Notebook.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Notebook message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Notebook.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.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.lastAuthor != null && message.hasOwnProperty("lastAuthor")) - if (!$util.isString(message.lastAuthor)) - return "lastAuthor: string expected"; - if (message.notebookUpdateTime != null && message.hasOwnProperty("notebookUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.notebookUpdateTime); - if (error) - return "notebookUpdateTime." + error; - } - return null; - }; - - /** - * Creates a Notebook message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Notebook} Notebook - */ - Notebook.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Notebook) - return object; - var message = new $root.google.cloud.securitycenter.v1.Notebook(); - if (object.name != null) - message.name = String(object.name); - if (object.service != null) - message.service = String(object.service); - if (object.lastAuthor != null) - message.lastAuthor = String(object.lastAuthor); - if (object.notebookUpdateTime != null) { - if (typeof object.notebookUpdateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Notebook.notebookUpdateTime: object expected"); - message.notebookUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.notebookUpdateTime); - } - return message; - }; - - /** - * Creates a plain object from a Notebook message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {google.cloud.securitycenter.v1.Notebook} message Notebook - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Notebook.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.service = ""; - object.lastAuthor = ""; - object.notebookUpdateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.lastAuthor != null && message.hasOwnProperty("lastAuthor")) - object.lastAuthor = message.lastAuthor; - if (message.notebookUpdateTime != null && message.hasOwnProperty("notebookUpdateTime")) - object.notebookUpdateTime = $root.google.protobuf.Timestamp.toObject(message.notebookUpdateTime, options); - return object; - }; - - /** - * Converts this Notebook to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Notebook - * @instance - * @returns {Object.} JSON object - */ - Notebook.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Notebook - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Notebook - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Notebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Notebook"; - }; - - return Notebook; - })(); - - v1.OrgPolicy = (function() { - - /** - * Properties of an OrgPolicy. - * @memberof google.cloud.securitycenter.v1 - * @interface IOrgPolicy - * @property {string|null} [name] OrgPolicy name - */ - - /** - * Constructs a new OrgPolicy. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an OrgPolicy. - * @implements IOrgPolicy - * @constructor - * @param {google.cloud.securitycenter.v1.IOrgPolicy=} [properties] Properties to set - */ - function OrgPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OrgPolicy name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @instance - */ - OrgPolicy.prototype.name = ""; - - /** - * Creates a new OrgPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {google.cloud.securitycenter.v1.IOrgPolicy=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrgPolicy} OrgPolicy instance - */ - OrgPolicy.create = function create(properties) { - return new OrgPolicy(properties); - }; - - /** - * Encodes the specified OrgPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.OrgPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {google.cloud.securitycenter.v1.IOrgPolicy} message OrgPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrgPolicy.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 OrgPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrgPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {google.cloud.securitycenter.v1.IOrgPolicy} message OrgPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrgPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OrgPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrgPolicy} OrgPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrgPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.OrgPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OrgPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrgPolicy} OrgPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrgPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OrgPolicy message. - * @function verify - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OrgPolicy.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 an OrgPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrgPolicy} OrgPolicy - */ - OrgPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrgPolicy) - return object; - var message = new $root.google.cloud.securitycenter.v1.OrgPolicy(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an OrgPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {google.cloud.securitycenter.v1.OrgPolicy} message OrgPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OrgPolicy.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 OrgPolicy to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @instance - * @returns {Object.} JSON object - */ - OrgPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OrgPolicy - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.OrgPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OrgPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.OrgPolicy"; - }; - - return OrgPolicy; - })(); - - v1.Process = (function() { - - /** - * 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 - * @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 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 - * @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); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); - 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, error) { - 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(); - if (tag === error) - break; - 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; - } - 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.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) - 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.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"); - 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 (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; - object.name = ""; - } - 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; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.val = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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.EnvironmentVariable - * @static - * @param {google.cloud.securitycenter.v1.EnvironmentVariable} message EnvironmentVariable - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnvironmentVariable.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.val = ""; - } - 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 EnvironmentVariable to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.EnvironmentVariable - * @instance - * @returns {Object.} JSON object - */ - EnvironmentVariable.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.SecurityPosture = (function() { - - /** - * Properties of a SecurityPosture. - * @memberof google.cloud.securitycenter.v1 - * @interface ISecurityPosture - * @property {string|null} [name] SecurityPosture name - * @property {string|null} [revisionId] SecurityPosture revisionId - * @property {string|null} [postureDeploymentResource] SecurityPosture postureDeploymentResource - * @property {string|null} [postureDeployment] SecurityPosture postureDeployment - * @property {string|null} [changedPolicy] SecurityPosture changedPolicy - * @property {string|null} [policySet] SecurityPosture policySet - * @property {string|null} [policy] SecurityPosture policy - * @property {Array.|null} [policyDriftDetails] SecurityPosture policyDriftDetails - */ - - /** - * Constructs a new SecurityPosture. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityPosture. - * @implements ISecurityPosture - * @constructor - * @param {google.cloud.securitycenter.v1.ISecurityPosture=} [properties] Properties to set - */ - function SecurityPosture(properties) { - this.policyDriftDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityPosture name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - */ - SecurityPosture.prototype.name = ""; - - /** - * SecurityPosture revisionId. - * @member {string} revisionId - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - */ - SecurityPosture.prototype.revisionId = ""; - - /** - * SecurityPosture postureDeploymentResource. - * @member {string} postureDeploymentResource - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - */ - SecurityPosture.prototype.postureDeploymentResource = ""; - - /** - * SecurityPosture postureDeployment. - * @member {string} postureDeployment - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - */ - SecurityPosture.prototype.postureDeployment = ""; - - /** - * SecurityPosture changedPolicy. - * @member {string} changedPolicy - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - */ - SecurityPosture.prototype.changedPolicy = ""; - - /** - * SecurityPosture policySet. - * @member {string} policySet - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - */ - SecurityPosture.prototype.policySet = ""; - - /** - * SecurityPosture policy. - * @member {string} policy - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - */ - SecurityPosture.prototype.policy = ""; - - /** - * SecurityPosture policyDriftDetails. - * @member {Array.} policyDriftDetails - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - */ - SecurityPosture.prototype.policyDriftDetails = $util.emptyArray; - - /** - * Creates a new SecurityPosture instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {google.cloud.securitycenter.v1.ISecurityPosture=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SecurityPosture} SecurityPosture instance - */ - SecurityPosture.create = function create(properties) { - return new SecurityPosture(properties); - }; - - /** - * Encodes the specified SecurityPosture message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {google.cloud.securitycenter.v1.ISecurityPosture} message SecurityPosture message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityPosture.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); - if (message.postureDeploymentResource != null && Object.hasOwnProperty.call(message, "postureDeploymentResource")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.postureDeploymentResource); - if (message.postureDeployment != null && Object.hasOwnProperty.call(message, "postureDeployment")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.postureDeployment); - if (message.changedPolicy != null && Object.hasOwnProperty.call(message, "changedPolicy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.changedPolicy); - if (message.policySet != null && Object.hasOwnProperty.call(message, "policySet")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.policySet); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.policy); - if (message.policyDriftDetails != null && message.policyDriftDetails.length) - for (var i = 0; i < message.policyDriftDetails.length; ++i) - $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.encode(message.policyDriftDetails[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SecurityPosture message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {google.cloud.securitycenter.v1.ISecurityPosture} message SecurityPosture message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityPosture.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityPosture message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SecurityPosture} SecurityPosture - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityPosture.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityPosture(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.revisionId = reader.string(); - break; - } - case 3: { - message.postureDeploymentResource = reader.string(); - break; - } - case 4: { - message.postureDeployment = reader.string(); - break; - } - case 5: { - message.changedPolicy = reader.string(); - break; - } - case 6: { - message.policySet = reader.string(); - break; - } - case 7: { - message.policy = reader.string(); - break; - } - case 8: { - if (!(message.policyDriftDetails && message.policyDriftDetails.length)) - message.policyDriftDetails = []; - message.policyDriftDetails.push($root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityPosture message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SecurityPosture} SecurityPosture - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityPosture.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityPosture message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityPosture.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.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - if (message.postureDeploymentResource != null && message.hasOwnProperty("postureDeploymentResource")) - if (!$util.isString(message.postureDeploymentResource)) - return "postureDeploymentResource: string expected"; - if (message.postureDeployment != null && message.hasOwnProperty("postureDeployment")) - if (!$util.isString(message.postureDeployment)) - return "postureDeployment: string expected"; - if (message.changedPolicy != null && message.hasOwnProperty("changedPolicy")) - if (!$util.isString(message.changedPolicy)) - return "changedPolicy: string expected"; - if (message.policySet != null && message.hasOwnProperty("policySet")) - if (!$util.isString(message.policySet)) - return "policySet: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) - if (!$util.isString(message.policy)) - return "policy: string expected"; - if (message.policyDriftDetails != null && message.hasOwnProperty("policyDriftDetails")) { - if (!Array.isArray(message.policyDriftDetails)) - return "policyDriftDetails: array expected"; - for (var i = 0; i < message.policyDriftDetails.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify(message.policyDriftDetails[i]); - if (error) - return "policyDriftDetails." + error; - } - } - return null; - }; - - /** - * Creates a SecurityPosture message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SecurityPosture} SecurityPosture - */ - SecurityPosture.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SecurityPosture) - return object; - var message = new $root.google.cloud.securitycenter.v1.SecurityPosture(); - if (object.name != null) - message.name = String(object.name); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.postureDeploymentResource != null) - message.postureDeploymentResource = String(object.postureDeploymentResource); - if (object.postureDeployment != null) - message.postureDeployment = String(object.postureDeployment); - if (object.changedPolicy != null) - message.changedPolicy = String(object.changedPolicy); - if (object.policySet != null) - message.policySet = String(object.policySet); - if (object.policy != null) - message.policy = String(object.policy); - if (object.policyDriftDetails) { - if (!Array.isArray(object.policyDriftDetails)) - throw TypeError(".google.cloud.securitycenter.v1.SecurityPosture.policyDriftDetails: array expected"); - message.policyDriftDetails = []; - for (var i = 0; i < object.policyDriftDetails.length; ++i) { - if (typeof object.policyDriftDetails[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SecurityPosture.policyDriftDetails: object expected"); - message.policyDriftDetails[i] = $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.fromObject(object.policyDriftDetails[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SecurityPosture message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {google.cloud.securitycenter.v1.SecurityPosture} message SecurityPosture - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityPosture.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.policyDriftDetails = []; - if (options.defaults) { - object.name = ""; - object.revisionId = ""; - object.postureDeploymentResource = ""; - object.postureDeployment = ""; - object.changedPolicy = ""; - object.policySet = ""; - object.policy = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - if (message.postureDeploymentResource != null && message.hasOwnProperty("postureDeploymentResource")) - object.postureDeploymentResource = message.postureDeploymentResource; - if (message.postureDeployment != null && message.hasOwnProperty("postureDeployment")) - object.postureDeployment = message.postureDeployment; - if (message.changedPolicy != null && message.hasOwnProperty("changedPolicy")) - object.changedPolicy = message.changedPolicy; - if (message.policySet != null && message.hasOwnProperty("policySet")) - object.policySet = message.policySet; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = message.policy; - if (message.policyDriftDetails && message.policyDriftDetails.length) { - object.policyDriftDetails = []; - for (var j = 0; j < message.policyDriftDetails.length; ++j) - object.policyDriftDetails[j] = $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.toObject(message.policyDriftDetails[j], options); - } - return object; - }; - - /** - * Converts this SecurityPosture to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @instance - * @returns {Object.} JSON object - */ - SecurityPosture.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityPosture - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecurityPosture.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityPosture"; - }; - - SecurityPosture.PolicyDriftDetails = (function() { - - /** - * Properties of a PolicyDriftDetails. - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @interface IPolicyDriftDetails - * @property {string|null} [field] PolicyDriftDetails field - * @property {string|null} [expectedValue] PolicyDriftDetails expectedValue - * @property {string|null} [detectedValue] PolicyDriftDetails detectedValue - */ - - /** - * Constructs a new PolicyDriftDetails. - * @memberof google.cloud.securitycenter.v1.SecurityPosture - * @classdesc Represents a PolicyDriftDetails. - * @implements IPolicyDriftDetails - * @constructor - * @param {google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails=} [properties] Properties to set - */ - function PolicyDriftDetails(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolicyDriftDetails field. - * @member {string} field - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @instance - */ - PolicyDriftDetails.prototype.field = ""; - - /** - * PolicyDriftDetails expectedValue. - * @member {string} expectedValue - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @instance - */ - PolicyDriftDetails.prototype.expectedValue = ""; - - /** - * PolicyDriftDetails detectedValue. - * @member {string} detectedValue - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @instance - */ - PolicyDriftDetails.prototype.detectedValue = ""; - - /** - * Creates a new PolicyDriftDetails instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails instance - */ - PolicyDriftDetails.create = function create(properties) { - return new PolicyDriftDetails(properties); - }; - - /** - * Encodes the specified PolicyDriftDetails message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails} message PolicyDriftDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDriftDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.expectedValue != null && Object.hasOwnProperty.call(message, "expectedValue")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.expectedValue); - if (message.detectedValue != null && Object.hasOwnProperty.call(message, "detectedValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedValue); - return writer; - }; - - /** - * Encodes the specified PolicyDriftDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {google.cloud.securitycenter.v1.SecurityPosture.IPolicyDriftDetails} message PolicyDriftDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDriftDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDriftDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDriftDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.field = reader.string(); - break; - } - case 2: { - message.expectedValue = reader.string(); - break; - } - case 3: { - message.detectedValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDriftDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDriftDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDriftDetails message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDriftDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.expectedValue != null && message.hasOwnProperty("expectedValue")) - if (!$util.isString(message.expectedValue)) - return "expectedValue: string expected"; - if (message.detectedValue != null && message.hasOwnProperty("detectedValue")) - if (!$util.isString(message.detectedValue)) - return "detectedValue: string expected"; - return null; - }; - - /** - * Creates a PolicyDriftDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails - */ - PolicyDriftDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails) - return object; - var message = new $root.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails(); - if (object.field != null) - message.field = String(object.field); - if (object.expectedValue != null) - message.expectedValue = String(object.expectedValue); - if (object.detectedValue != null) - message.detectedValue = String(object.detectedValue); - return message; - }; - - /** - * Creates a plain object from a PolicyDriftDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails} message PolicyDriftDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDriftDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.field = ""; - object.expectedValue = ""; - object.detectedValue = ""; - } - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.expectedValue != null && message.hasOwnProperty("expectedValue")) - object.expectedValue = message.expectedValue; - if (message.detectedValue != null && message.hasOwnProperty("detectedValue")) - object.detectedValue = message.detectedValue; - return object; - }; - - /** - * Converts this PolicyDriftDetails to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @instance - * @returns {Object.} JSON object - */ - PolicyDriftDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDriftDetails - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDriftDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails"; - }; - - return PolicyDriftDetails; - })(); - - return SecurityPosture; - })(); - - v1.ToxicCombination = (function() { - - /** - * Properties of a ToxicCombination. - * @memberof google.cloud.securitycenter.v1 - * @interface IToxicCombination - * @property {number|null} [attackExposureScore] ToxicCombination attackExposureScore - * @property {Array.|null} [relatedFindings] ToxicCombination relatedFindings - */ - - /** - * Constructs a new ToxicCombination. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ToxicCombination. - * @implements IToxicCombination - * @constructor - * @param {google.cloud.securitycenter.v1.IToxicCombination=} [properties] Properties to set - */ - function ToxicCombination(properties) { - this.relatedFindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToxicCombination attackExposureScore. - * @member {number} attackExposureScore - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @instance - */ - ToxicCombination.prototype.attackExposureScore = 0; - - /** - * ToxicCombination relatedFindings. - * @member {Array.} relatedFindings - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @instance - */ - ToxicCombination.prototype.relatedFindings = $util.emptyArray; - - /** - * Creates a new ToxicCombination instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {google.cloud.securitycenter.v1.IToxicCombination=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination instance - */ - ToxicCombination.create = function create(properties) { - return new ToxicCombination(properties); - }; - - /** - * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {google.cloud.securitycenter.v1.IToxicCombination} message ToxicCombination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToxicCombination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attackExposureScore != null && Object.hasOwnProperty.call(message, "attackExposureScore")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.attackExposureScore); - if (message.relatedFindings != null && message.relatedFindings.length) - for (var i = 0; i < message.relatedFindings.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relatedFindings[i]); - return writer; - }; - - /** - * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {google.cloud.securitycenter.v1.IToxicCombination} message ToxicCombination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToxicCombination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToxicCombination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToxicCombination.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ToxicCombination(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.attackExposureScore = reader.double(); - break; - } - case 2: { - if (!(message.relatedFindings && message.relatedFindings.length)) - message.relatedFindings = []; - message.relatedFindings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToxicCombination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToxicCombination message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToxicCombination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) - if (typeof message.attackExposureScore !== "number") - return "attackExposureScore: number expected"; - if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { - if (!Array.isArray(message.relatedFindings)) - return "relatedFindings: array expected"; - for (var i = 0; i < message.relatedFindings.length; ++i) - if (!$util.isString(message.relatedFindings[i])) - return "relatedFindings: string[] expected"; - } - return null; - }; - - /** - * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination - */ - ToxicCombination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ToxicCombination) - return object; - var message = new $root.google.cloud.securitycenter.v1.ToxicCombination(); - if (object.attackExposureScore != null) - message.attackExposureScore = Number(object.attackExposureScore); - if (object.relatedFindings) { - if (!Array.isArray(object.relatedFindings)) - throw TypeError(".google.cloud.securitycenter.v1.ToxicCombination.relatedFindings: array expected"); - message.relatedFindings = []; - for (var i = 0; i < object.relatedFindings.length; ++i) - message.relatedFindings[i] = String(object.relatedFindings[i]); - } - return message; - }; - - /** - * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {google.cloud.securitycenter.v1.ToxicCombination} message ToxicCombination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToxicCombination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.relatedFindings = []; - if (options.defaults) - object.attackExposureScore = 0; - if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) - object.attackExposureScore = options.json && !isFinite(message.attackExposureScore) ? String(message.attackExposureScore) : message.attackExposureScore; - if (message.relatedFindings && message.relatedFindings.length) { - object.relatedFindings = []; - for (var j = 0; j < message.relatedFindings.length; ++j) - object.relatedFindings[j] = message.relatedFindings[j]; - } - return object; - }; - - /** - * Converts this ToxicCombination to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @instance - * @returns {Object.} JSON object - */ - ToxicCombination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToxicCombination - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ToxicCombination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToxicCombination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ToxicCombination"; - }; - - return ToxicCombination; - })(); - - v1.Vulnerability = (function() { - - /** - * Properties of a Vulnerability. - * @memberof google.cloud.securitycenter.v1 - * @interface IVulnerability - * @property {google.cloud.securitycenter.v1.ICve|null} [cve] Vulnerability cve - * @property {google.cloud.securitycenter.v1.IPackage|null} [offendingPackage] Vulnerability offendingPackage - * @property {google.cloud.securitycenter.v1.IPackage|null} [fixedPackage] Vulnerability fixedPackage - * @property {google.cloud.securitycenter.v1.ISecurityBulletin|null} [securityBulletin] Vulnerability securityBulletin - */ - - /** - * 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; - - /** - * Vulnerability offendingPackage. - * @member {google.cloud.securitycenter.v1.IPackage|null|undefined} offendingPackage - * @memberof google.cloud.securitycenter.v1.Vulnerability - * @instance - */ - Vulnerability.prototype.offendingPackage = null; - - /** - * Vulnerability fixedPackage. - * @member {google.cloud.securitycenter.v1.IPackage|null|undefined} fixedPackage - * @memberof google.cloud.securitycenter.v1.Vulnerability - * @instance - */ - Vulnerability.prototype.fixedPackage = null; - - /** - * Vulnerability securityBulletin. - * @member {google.cloud.securitycenter.v1.ISecurityBulletin|null|undefined} securityBulletin - * @memberof google.cloud.securitycenter.v1.Vulnerability - * @instance - */ - Vulnerability.prototype.securityBulletin = 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(); - if (message.offendingPackage != null && Object.hasOwnProperty.call(message, "offendingPackage")) - $root.google.cloud.securitycenter.v1.Package.encode(message.offendingPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.fixedPackage != null && Object.hasOwnProperty.call(message, "fixedPackage")) - $root.google.cloud.securitycenter.v1.Package.encode(message.fixedPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.securityBulletin != null && Object.hasOwnProperty.call(message, "securityBulletin")) - $root.google.cloud.securitycenter.v1.SecurityBulletin.encode(message.securityBulletin, writer.uint32(/* id 4, wireType 2 =*/34).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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cve = $root.google.cloud.securitycenter.v1.Cve.decode(reader, reader.uint32()); - break; - } - case 2: { - message.offendingPackage = $root.google.cloud.securitycenter.v1.Package.decode(reader, reader.uint32()); - break; - } - case 3: { - message.fixedPackage = $root.google.cloud.securitycenter.v1.Package.decode(reader, reader.uint32()); - break; - } - case 4: { - message.securityBulletin = $root.google.cloud.securitycenter.v1.SecurityBulletin.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; - } - if (message.offendingPackage != null && message.hasOwnProperty("offendingPackage")) { - var error = $root.google.cloud.securitycenter.v1.Package.verify(message.offendingPackage); - if (error) - return "offendingPackage." + error; - } - if (message.fixedPackage != null && message.hasOwnProperty("fixedPackage")) { - var error = $root.google.cloud.securitycenter.v1.Package.verify(message.fixedPackage); - if (error) - return "fixedPackage." + error; - } - if (message.securityBulletin != null && message.hasOwnProperty("securityBulletin")) { - var error = $root.google.cloud.securitycenter.v1.SecurityBulletin.verify(message.securityBulletin); - if (error) - return "securityBulletin." + 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); - } - if (object.offendingPackage != null) { - if (typeof object.offendingPackage !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Vulnerability.offendingPackage: object expected"); - message.offendingPackage = $root.google.cloud.securitycenter.v1.Package.fromObject(object.offendingPackage); - } - if (object.fixedPackage != null) { - if (typeof object.fixedPackage !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Vulnerability.fixedPackage: object expected"); - message.fixedPackage = $root.google.cloud.securitycenter.v1.Package.fromObject(object.fixedPackage); - } - if (object.securityBulletin != null) { - if (typeof object.securityBulletin !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Vulnerability.securityBulletin: object expected"); - message.securityBulletin = $root.google.cloud.securitycenter.v1.SecurityBulletin.fromObject(object.securityBulletin); - } - 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; - object.offendingPackage = null; - object.fixedPackage = null; - object.securityBulletin = null; - } - if (message.cve != null && message.hasOwnProperty("cve")) - object.cve = $root.google.cloud.securitycenter.v1.Cve.toObject(message.cve, options); - if (message.offendingPackage != null && message.hasOwnProperty("offendingPackage")) - object.offendingPackage = $root.google.cloud.securitycenter.v1.Package.toObject(message.offendingPackage, options); - if (message.fixedPackage != null && message.hasOwnProperty("fixedPackage")) - object.fixedPackage = $root.google.cloud.securitycenter.v1.Package.toObject(message.fixedPackage, options); - if (message.securityBulletin != null && message.hasOwnProperty("securityBulletin")) - object.securityBulletin = $root.google.cloud.securitycenter.v1.SecurityBulletin.toObject(message.securityBulletin, 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); - }; - - /** - * 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; - })(); - - 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 - * @property {boolean|null} [upstreamFixAvailable] Cve upstreamFixAvailable - * @property {google.cloud.securitycenter.v1.Cve.RiskRating|null} [impact] Cve impact - * @property {google.cloud.securitycenter.v1.Cve.ExploitationActivity|null} [exploitationActivity] Cve exploitationActivity - * @property {boolean|null} [observedInTheWild] Cve observedInTheWild - * @property {boolean|null} [zeroDay] Cve zeroDay - * @property {google.protobuf.ITimestamp|null} [exploitReleaseDate] Cve exploitReleaseDate - */ - - /** - * 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; - - /** - * Cve upstreamFixAvailable. - * @member {boolean} upstreamFixAvailable - * @memberof google.cloud.securitycenter.v1.Cve - * @instance - */ - Cve.prototype.upstreamFixAvailable = false; - - /** - * Cve impact. - * @member {google.cloud.securitycenter.v1.Cve.RiskRating} impact - * @memberof google.cloud.securitycenter.v1.Cve - * @instance - */ - Cve.prototype.impact = 0; - - /** - * Cve exploitationActivity. - * @member {google.cloud.securitycenter.v1.Cve.ExploitationActivity} exploitationActivity - * @memberof google.cloud.securitycenter.v1.Cve - * @instance - */ - Cve.prototype.exploitationActivity = 0; - - /** - * Cve observedInTheWild. - * @member {boolean} observedInTheWild - * @memberof google.cloud.securitycenter.v1.Cve - * @instance - */ - Cve.prototype.observedInTheWild = false; - - /** - * Cve zeroDay. - * @member {boolean} zeroDay - * @memberof google.cloud.securitycenter.v1.Cve - * @instance - */ - Cve.prototype.zeroDay = false; - - /** - * Cve exploitReleaseDate. - * @member {google.protobuf.ITimestamp|null|undefined} exploitReleaseDate - * @memberof google.cloud.securitycenter.v1.Cve - * @instance - */ - Cve.prototype.exploitReleaseDate = 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(); - if (message.upstreamFixAvailable != null && Object.hasOwnProperty.call(message, "upstreamFixAvailable")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.upstreamFixAvailable); - if (message.impact != null && Object.hasOwnProperty.call(message, "impact")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.impact); - if (message.exploitationActivity != null && Object.hasOwnProperty.call(message, "exploitationActivity")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.exploitationActivity); - if (message.observedInTheWild != null && Object.hasOwnProperty.call(message, "observedInTheWild")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.observedInTheWild); - if (message.zeroDay != null && Object.hasOwnProperty.call(message, "zeroDay")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.zeroDay); - if (message.exploitReleaseDate != null && Object.hasOwnProperty.call(message, "exploitReleaseDate")) - $root.google.protobuf.Timestamp.encode(message.exploitReleaseDate, writer.uint32(/* id 9, wireType 2 =*/74).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, error) { - 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(); - if (tag === error) - break; - 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 5: { - message.impact = reader.int32(); - break; - } - case 6: { - message.exploitationActivity = reader.int32(); - break; - } - case 7: { - message.observedInTheWild = reader.bool(); - break; - } - case 8: { - message.zeroDay = reader.bool(); - break; - } - case 9: { - message.exploitReleaseDate = $root.google.protobuf.Timestamp.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; - } - if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) - if (typeof message.upstreamFixAvailable !== "boolean") - return "upstreamFixAvailable: boolean expected"; - if (message.impact != null && message.hasOwnProperty("impact")) - switch (message.impact) { - default: - return "impact: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.exploitationActivity != null && message.hasOwnProperty("exploitationActivity")) - switch (message.exploitationActivity) { - default: - return "exploitationActivity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.observedInTheWild != null && message.hasOwnProperty("observedInTheWild")) - if (typeof message.observedInTheWild !== "boolean") - return "observedInTheWild: boolean expected"; - if (message.zeroDay != null && message.hasOwnProperty("zeroDay")) - if (typeof message.zeroDay !== "boolean") - return "zeroDay: boolean expected"; - if (message.exploitReleaseDate != null && message.hasOwnProperty("exploitReleaseDate")) { - var error = $root.google.protobuf.Timestamp.verify(message.exploitReleaseDate); - if (error) - return "exploitReleaseDate." + 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); - } - if (object.upstreamFixAvailable != null) - message.upstreamFixAvailable = Boolean(object.upstreamFixAvailable); - switch (object.impact) { - default: - if (typeof object.impact === "number") { - message.impact = object.impact; - break; - } - break; - case "RISK_RATING_UNSPECIFIED": - case 0: - message.impact = 0; - break; - case "LOW": - case 1: - message.impact = 1; - break; - case "MEDIUM": - case 2: - message.impact = 2; - break; - case "HIGH": - case 3: - message.impact = 3; - break; - case "CRITICAL": - case 4: - message.impact = 4; - break; - } - switch (object.exploitationActivity) { - default: - if (typeof object.exploitationActivity === "number") { - message.exploitationActivity = object.exploitationActivity; - break; - } - break; - case "EXPLOITATION_ACTIVITY_UNSPECIFIED": - case 0: - message.exploitationActivity = 0; - break; - case "WIDE": - case 1: - message.exploitationActivity = 1; - break; - case "CONFIRMED": - case 2: - message.exploitationActivity = 2; - break; - case "AVAILABLE": - case 3: - message.exploitationActivity = 3; - break; - case "ANTICIPATED": - case 4: - message.exploitationActivity = 4; - break; - case "NO_KNOWN": - case 5: - message.exploitationActivity = 5; - break; - } - if (object.observedInTheWild != null) - message.observedInTheWild = Boolean(object.observedInTheWild); - if (object.zeroDay != null) - message.zeroDay = Boolean(object.zeroDay); - if (object.exploitReleaseDate != null) { - if (typeof object.exploitReleaseDate !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Cve.exploitReleaseDate: object expected"); - message.exploitReleaseDate = $root.google.protobuf.Timestamp.fromObject(object.exploitReleaseDate); - } - 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; - object.upstreamFixAvailable = false; - object.impact = options.enums === String ? "RISK_RATING_UNSPECIFIED" : 0; - object.exploitationActivity = options.enums === String ? "EXPLOITATION_ACTIVITY_UNSPECIFIED" : 0; - object.observedInTheWild = false; - object.zeroDay = false; - object.exploitReleaseDate = 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); - if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) - object.upstreamFixAvailable = message.upstreamFixAvailable; - if (message.impact != null && message.hasOwnProperty("impact")) - object.impact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cve.RiskRating[message.impact] === undefined ? message.impact : $root.google.cloud.securitycenter.v1.Cve.RiskRating[message.impact] : message.impact; - if (message.exploitationActivity != null && message.hasOwnProperty("exploitationActivity")) - object.exploitationActivity = options.enums === String ? $root.google.cloud.securitycenter.v1.Cve.ExploitationActivity[message.exploitationActivity] === undefined ? message.exploitationActivity : $root.google.cloud.securitycenter.v1.Cve.ExploitationActivity[message.exploitationActivity] : message.exploitationActivity; - if (message.observedInTheWild != null && message.hasOwnProperty("observedInTheWild")) - object.observedInTheWild = message.observedInTheWild; - if (message.zeroDay != null && message.hasOwnProperty("zeroDay")) - object.zeroDay = message.zeroDay; - if (message.exploitReleaseDate != null && message.hasOwnProperty("exploitReleaseDate")) - object.exploitReleaseDate = $root.google.protobuf.Timestamp.toObject(message.exploitReleaseDate, 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); - }; - - /** - * 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"; - }; - - /** - * RiskRating enum. - * @name google.cloud.securitycenter.v1.Cve.RiskRating - * @enum {number} - * @property {number} RISK_RATING_UNSPECIFIED=0 RISK_RATING_UNSPECIFIED value - * @property {number} LOW=1 LOW value - * @property {number} MEDIUM=2 MEDIUM value - * @property {number} HIGH=3 HIGH value - * @property {number} CRITICAL=4 CRITICAL value - */ - Cve.RiskRating = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RISK_RATING_UNSPECIFIED"] = 0; - values[valuesById[1] = "LOW"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - values[valuesById[3] = "HIGH"] = 3; - values[valuesById[4] = "CRITICAL"] = 4; - return values; - })(); - - /** - * ExploitationActivity enum. - * @name google.cloud.securitycenter.v1.Cve.ExploitationActivity - * @enum {number} - * @property {number} EXPLOITATION_ACTIVITY_UNSPECIFIED=0 EXPLOITATION_ACTIVITY_UNSPECIFIED value - * @property {number} WIDE=1 WIDE value - * @property {number} CONFIRMED=2 CONFIRMED value - * @property {number} AVAILABLE=3 AVAILABLE value - * @property {number} ANTICIPATED=4 ANTICIPATED value - * @property {number} NO_KNOWN=5 NO_KNOWN value - */ - Cve.ExploitationActivity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXPLOITATION_ACTIVITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "WIDE"] = 1; - values[valuesById[2] = "CONFIRMED"] = 2; - values[valuesById[3] = "AVAILABLE"] = 3; - values[valuesById[4] = "ANTICIPATED"] = 4; - values[valuesById[5] = "NO_KNOWN"] = 5; - return values; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 - */ - Cvssv3.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Cvssv3 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Cvssv3 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Cvssv3.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Cvssv3 message. - * @function verify - * @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 - */ - Cvssv3.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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 a Cvssv3 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Cvssv3 - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 - */ - Cvssv3.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Cvssv3) - return object; - var message = new $root.google.cloud.securitycenter.v1.Cvssv3(); - 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; - 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; - } - switch (object.attackComplexity) { - default: - if (typeof object.attackComplexity === "number") { - message.attackComplexity = object.attackComplexity; - break; - } - break; - 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) { - default: - if (typeof object.privilegesRequired === "number") { - message.privilegesRequired = object.privilegesRequired; - break; - } - break; - 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) { - default: - if (typeof object.userInteraction === "number") { - message.userInteraction = object.userInteraction; - break; - } - break; - 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) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - 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) { - default: - if (typeof object.confidentialityImpact === "number") { - message.confidentialityImpact = object.confidentialityImpact; - break; - } - break; - 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) { - default: - if (typeof object.integrityImpact === "number") { - message.integrityImpact = object.integrityImpact; - break; - } - break; - 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) { - default: - if (typeof object.availabilityImpact === "number") { - message.availabilityImpact = object.availabilityImpact; - break; - } - break; - 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 a Cvssv3 message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Cvssv3 - * @static - * @param {google.cloud.securitycenter.v1.Cvssv3} message Cvssv3 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Cvssv3.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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] === 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] === 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] === 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] === 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] === 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] === 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] === 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] === undefined ? message.availabilityImpact : $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.availabilityImpact] : message.availabilityImpact; - return object; - }; - - /** - * Converts this Cvssv3 to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Cvssv3 - * @instance - * @returns {Object.} JSON object - */ - Cvssv3.prototype.toJSON = function toJSON() { - 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 - * @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.Package = (function() { - - /** - * Properties of a Package. - * @memberof google.cloud.securitycenter.v1 - * @interface IPackage - * @property {string|null} [packageName] Package packageName - * @property {string|null} [cpeUri] Package cpeUri - * @property {string|null} [packageType] Package packageType - * @property {string|null} [packageVersion] Package packageVersion - */ - - /** - * Constructs a new Package. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Package. - * @implements IPackage - * @constructor - * @param {google.cloud.securitycenter.v1.IPackage=} [properties] Properties to set - */ - function Package(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Package packageName. - * @member {string} packageName - * @memberof google.cloud.securitycenter.v1.Package - * @instance - */ - Package.prototype.packageName = ""; - - /** - * Package cpeUri. - * @member {string} cpeUri - * @memberof google.cloud.securitycenter.v1.Package - * @instance - */ - Package.prototype.cpeUri = ""; - - /** - * Package packageType. - * @member {string} packageType - * @memberof google.cloud.securitycenter.v1.Package - * @instance - */ - Package.prototype.packageType = ""; - - /** - * Package packageVersion. - * @member {string} packageVersion - * @memberof google.cloud.securitycenter.v1.Package - * @instance - */ - Package.prototype.packageVersion = ""; - - /** - * Creates a new Package instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {google.cloud.securitycenter.v1.IPackage=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Package} Package instance - */ - Package.create = function create(properties) { - return new Package(properties); - }; - - /** - * Encodes the specified Package message. Does not implicitly {@link google.cloud.securitycenter.v1.Package.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {google.cloud.securitycenter.v1.IPackage} message Package message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Package.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.packageName); - if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cpeUri); - if (message.packageType != null && Object.hasOwnProperty.call(message, "packageType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.packageType); - if (message.packageVersion != null && Object.hasOwnProperty.call(message, "packageVersion")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageVersion); - return writer; - }; - - /** - * Encodes the specified Package message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Package.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {google.cloud.securitycenter.v1.IPackage} message Package message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Package.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Package message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Package} Package - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Package.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Package(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.packageName = reader.string(); - break; - } - case 2: { - message.cpeUri = reader.string(); - break; - } - case 3: { - message.packageType = reader.string(); - break; - } - case 4: { - message.packageVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Package message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Package} Package - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Package.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Package message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Package.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packageName != null && message.hasOwnProperty("packageName")) - if (!$util.isString(message.packageName)) - return "packageName: string expected"; - if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) - if (!$util.isString(message.cpeUri)) - return "cpeUri: string expected"; - if (message.packageType != null && message.hasOwnProperty("packageType")) - if (!$util.isString(message.packageType)) - return "packageType: string expected"; - if (message.packageVersion != null && message.hasOwnProperty("packageVersion")) - if (!$util.isString(message.packageVersion)) - return "packageVersion: string expected"; - return null; - }; - - /** - * Creates a Package message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Package} Package - */ - Package.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Package) - return object; - var message = new $root.google.cloud.securitycenter.v1.Package(); - if (object.packageName != null) - message.packageName = String(object.packageName); - if (object.cpeUri != null) - message.cpeUri = String(object.cpeUri); - if (object.packageType != null) - message.packageType = String(object.packageType); - if (object.packageVersion != null) - message.packageVersion = String(object.packageVersion); - return message; - }; - - /** - * Creates a plain object from a Package message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {google.cloud.securitycenter.v1.Package} message Package - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Package.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packageName = ""; - object.cpeUri = ""; - object.packageType = ""; - object.packageVersion = ""; - } - if (message.packageName != null && message.hasOwnProperty("packageName")) - object.packageName = message.packageName; - if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) - object.cpeUri = message.cpeUri; - if (message.packageType != null && message.hasOwnProperty("packageType")) - object.packageType = message.packageType; - if (message.packageVersion != null && message.hasOwnProperty("packageVersion")) - object.packageVersion = message.packageVersion; - return object; - }; - - /** - * Converts this Package to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Package - * @instance - * @returns {Object.} JSON object - */ - Package.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Package - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Package - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Package.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Package"; - }; - - return Package; - })(); - - v1.SecurityBulletin = (function() { - - /** - * Properties of a SecurityBulletin. - * @memberof google.cloud.securitycenter.v1 - * @interface ISecurityBulletin - * @property {string|null} [bulletinId] SecurityBulletin bulletinId - * @property {google.protobuf.ITimestamp|null} [submissionTime] SecurityBulletin submissionTime - * @property {string|null} [suggestedUpgradeVersion] SecurityBulletin suggestedUpgradeVersion - */ - - /** - * Constructs a new SecurityBulletin. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityBulletin. - * @implements ISecurityBulletin - * @constructor - * @param {google.cloud.securitycenter.v1.ISecurityBulletin=} [properties] Properties to set - */ - function SecurityBulletin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityBulletin bulletinId. - * @member {string} bulletinId - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @instance - */ - SecurityBulletin.prototype.bulletinId = ""; - - /** - * SecurityBulletin submissionTime. - * @member {google.protobuf.ITimestamp|null|undefined} submissionTime - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @instance - */ - SecurityBulletin.prototype.submissionTime = null; - - /** - * SecurityBulletin suggestedUpgradeVersion. - * @member {string} suggestedUpgradeVersion - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @instance - */ - SecurityBulletin.prototype.suggestedUpgradeVersion = ""; - - /** - * Creates a new SecurityBulletin instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {google.cloud.securitycenter.v1.ISecurityBulletin=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SecurityBulletin} SecurityBulletin instance - */ - SecurityBulletin.create = function create(properties) { - return new SecurityBulletin(properties); - }; - - /** - * Encodes the specified SecurityBulletin message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityBulletin.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {google.cloud.securitycenter.v1.ISecurityBulletin} message SecurityBulletin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityBulletin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bulletinId != null && Object.hasOwnProperty.call(message, "bulletinId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bulletinId); - if (message.submissionTime != null && Object.hasOwnProperty.call(message, "submissionTime")) - $root.google.protobuf.Timestamp.encode(message.submissionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.suggestedUpgradeVersion != null && Object.hasOwnProperty.call(message, "suggestedUpgradeVersion")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.suggestedUpgradeVersion); - return writer; - }; - - /** - * Encodes the specified SecurityBulletin message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityBulletin.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {google.cloud.securitycenter.v1.ISecurityBulletin} message SecurityBulletin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityBulletin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityBulletin message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SecurityBulletin} SecurityBulletin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityBulletin.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityBulletin(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bulletinId = reader.string(); - break; - } - case 2: { - message.submissionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.suggestedUpgradeVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityBulletin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SecurityBulletin} SecurityBulletin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityBulletin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityBulletin message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityBulletin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bulletinId != null && message.hasOwnProperty("bulletinId")) - if (!$util.isString(message.bulletinId)) - return "bulletinId: string expected"; - if (message.submissionTime != null && message.hasOwnProperty("submissionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submissionTime); - if (error) - return "submissionTime." + error; - } - if (message.suggestedUpgradeVersion != null && message.hasOwnProperty("suggestedUpgradeVersion")) - if (!$util.isString(message.suggestedUpgradeVersion)) - return "suggestedUpgradeVersion: string expected"; - return null; - }; - - /** - * Creates a SecurityBulletin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SecurityBulletin} SecurityBulletin - */ - SecurityBulletin.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SecurityBulletin) - return object; - var message = new $root.google.cloud.securitycenter.v1.SecurityBulletin(); - if (object.bulletinId != null) - message.bulletinId = String(object.bulletinId); - if (object.submissionTime != null) { - if (typeof object.submissionTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SecurityBulletin.submissionTime: object expected"); - message.submissionTime = $root.google.protobuf.Timestamp.fromObject(object.submissionTime); - } - if (object.suggestedUpgradeVersion != null) - message.suggestedUpgradeVersion = String(object.suggestedUpgradeVersion); - return message; - }; - - /** - * Creates a plain object from a SecurityBulletin message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {google.cloud.securitycenter.v1.SecurityBulletin} message SecurityBulletin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityBulletin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bulletinId = ""; - object.submissionTime = null; - object.suggestedUpgradeVersion = ""; - } - if (message.bulletinId != null && message.hasOwnProperty("bulletinId")) - object.bulletinId = message.bulletinId; - if (message.submissionTime != null && message.hasOwnProperty("submissionTime")) - object.submissionTime = $root.google.protobuf.Timestamp.toObject(message.submissionTime, options); - if (message.suggestedUpgradeVersion != null && message.hasOwnProperty("suggestedUpgradeVersion")) - object.suggestedUpgradeVersion = message.suggestedUpgradeVersion; - return object; - }; - - /** - * Converts this SecurityBulletin to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @instance - * @returns {Object.} JSON object - */ - SecurityBulletin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityBulletin - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SecurityBulletin - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecurityBulletin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityBulletin"; - }; - - return SecurityBulletin; - })(); - - v1.MuteConfig = (function() { - - /** - * Properties of a MuteConfig. - * @memberof google.cloud.securitycenter.v1 - * @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 - * @property {google.cloud.securitycenter.v1.MuteConfig.MuteConfigType|null} [type] MuteConfig type - * @property {google.protobuf.ITimestamp|null} [expiryTime] MuteConfig expiryTime - */ - - /** - * Constructs a new MuteConfig. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a MuteConfig. - * @implements IMuteConfig - * @constructor - * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set - */ - function MuteConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MuteConfig name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.name = ""; - - /** - * MuteConfig displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.displayName = ""; - - /** - * MuteConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.description = ""; - - /** - * MuteConfig filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.filter = ""; - - /** - * MuteConfig createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.createTime = null; - - /** - * MuteConfig updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.updateTime = null; - - /** - * MuteConfig mostRecentEditor. - * @member {string} mostRecentEditor - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.mostRecentEditor = ""; - - /** - * MuteConfig type. - * @member {google.cloud.securitycenter.v1.MuteConfig.MuteConfigType} type - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.type = 0; - - /** - * MuteConfig expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - */ - MuteConfig.prototype.expiryTime = null; - - /** - * Creates a new MuteConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @static - * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig instance - */ - MuteConfig.create = function create(properties) { - return new MuteConfig(properties); - }; - - /** - * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @static - * @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 - */ - 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 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); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * 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.MuteConfig - * @static - * @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 - */ - MuteConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MuteConfig message from the specified reader or buffer. - * @function decode - * @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.MuteConfig} MuteConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MuteConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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 8: { - message.type = reader.int32(); - break; - } - case 9: { - message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MuteConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - MuteConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MuteConfig message. - * @function verify - * @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 - */ - MuteConfig.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.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"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); - if (error) - return "expiryTime." + error; - } - return null; - }; - - /** - * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig - */ - MuteConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.MuteConfig) - return object; - 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.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); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "MUTE_CONFIG_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "STATIC": - case 1: - message.type = 1; - break; - case "DYNAMIC": - case 2: - message.type = 2; - break; - } - if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.MuteConfig.expiryTime: object expected"); - message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); - } - return message; - }; - - /** - * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @static - * @param {google.cloud.securitycenter.v1.MuteConfig} message MuteConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MuteConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.filter = ""; - object.createTime = null; - object.updateTime = null; - object.mostRecentEditor = ""; - object.type = options.enums === String ? "MUTE_CONFIG_TYPE_UNSPECIFIED" : 0; - object.expiryTime = 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.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; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.securitycenter.v1.MuteConfig.MuteConfigType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v1.MuteConfig.MuteConfigType[message.type] : message.type; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); - return object; - }; - - /** - * Converts this MuteConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.MuteConfig - * @instance - * @returns {Object.} JSON object - */ - MuteConfig.prototype.toJSON = function toJSON() { - 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"; - }; - - /** - * MuteConfigType enum. - * @name google.cloud.securitycenter.v1.MuteConfig.MuteConfigType - * @enum {number} - * @property {number} MUTE_CONFIG_TYPE_UNSPECIFIED=0 MUTE_CONFIG_TYPE_UNSPECIFIED value - * @property {number} STATIC=1 STATIC value - * @property {number} DYNAMIC=2 DYNAMIC value - */ - MuteConfig.MuteConfigType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MUTE_CONFIG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STATIC"] = 1; - values[valuesById[2] = "DYNAMIC"] = 2; - return values; - })(); - - return MuteConfig; - })(); - - v1.NotificationConfig = (function() { - - /** - * Properties of a NotificationConfig. - * @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 - */ - - /** - * Constructs a new NotificationConfig. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a NotificationConfig. - * @implements INotificationConfig - * @constructor - * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set - */ - function NotificationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NotificationConfig name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @instance - */ - NotificationConfig.prototype.name = ""; - - /** - * NotificationConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @instance - */ - NotificationConfig.prototype.description = ""; - - /** - * NotificationConfig pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @instance - */ - 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; - - /** - * 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.NotificationConfig - * @static - * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig instance - */ - NotificationConfig.create = function create(properties) { - return new NotificationConfig(properties); - }; - - /** - * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @static - * @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 - */ - NotificationConfig.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.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 NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @static - * @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 - */ - NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NotificationConfig message from the specified reader or buffer. - * @function decode - * @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.NotificationConfig} NotificationConfig - * @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, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - NotificationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NotificationConfig message. - * @function verify - * @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 - */ - 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.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 a NotificationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig - */ - NotificationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig) - return object; - 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 NotificationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @static - * @param {google.cloud.securitycenter.v1.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.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.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 NotificationConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @instance - * @returns {Object.} JSON object - */ - NotificationConfig.prototype.toJSON = function toJSON() { - 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() { - - /** - * Properties of a StreamingConfig. - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @interface IStreamingConfig - * @property {string|null} [filter] StreamingConfig filter - */ - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 - */ - - /** - * 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 - */ - NotificationMessage.prototype.notificationConfigName = ""; - - /** - * NotificationMessage finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.NotificationMessage - * @instance - */ - 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; - - /** - * 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.NotificationMessage - * @static - * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage instance - */ - NotificationMessage.create = function create(properties) { - return new NotificationMessage(properties); - }; - - /** - * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.NotificationMessage - * @static - * @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 - */ - NotificationMessage.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(); - return writer; - }; - - /** - * 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.NotificationMessage - * @static - * @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 - */ - NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NotificationMessage message from the specified reader or buffer. - * @function decode - * @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.NotificationMessage} NotificationMessage - * @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, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - NotificationMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NotificationMessage message. - * @function verify - * @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 - */ - NotificationMessage.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; - { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - 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; - }; - - /** - * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.NotificationMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage - */ - NotificationMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.NotificationMessage) - 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); - } - return message; - }; - - /** - * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.NotificationMessage - * @static - * @param {google.cloud.securitycenter.v1.NotificationMessage} message NotificationMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NotificationMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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")) { - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); - 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; - }; - - /** - * Converts this NotificationMessage to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.NotificationMessage - * @instance - * @returns {Object.} JSON object - */ - NotificationMessage.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.Resource = (function() { - - /** - * Properties of a Resource. - * @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 {Array.|null} [folders] Resource folders - * @property {google.cloud.securitycenter.v1.CloudProvider|null} [cloudProvider] Resource cloudProvider - * @property {string|null} [organization] Resource organization - * @property {string|null} [service] Resource service - * @property {string|null} [location] Resource location - * @property {google.cloud.securitycenter.v1.IAwsMetadata|null} [awsMetadata] Resource awsMetadata - * @property {google.cloud.securitycenter.v1.IAzureMetadata|null} [azureMetadata] Resource azureMetadata - * @property {google.cloud.securitycenter.v1.IResourcePath|null} [resourcePath] Resource resourcePath - * @property {string|null} [resourcePathString] Resource resourcePathString - */ - - /** - * 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]]; - } - - /** - * Resource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - 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 - * @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 = ""; - - /** - * Resource folders. - * @member {Array.} folders - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.folders = $util.emptyArray; - - /** - * Resource cloudProvider. - * @member {google.cloud.securitycenter.v1.CloudProvider} cloudProvider - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.cloudProvider = 0; - - /** - * Resource organization. - * @member {string} organization - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.organization = ""; - - /** - * Resource service. - * @member {string} service - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.service = ""; - - /** - * Resource location. - * @member {string} location - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.location = ""; - - /** - * Resource awsMetadata. - * @member {google.cloud.securitycenter.v1.IAwsMetadata|null|undefined} awsMetadata - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.awsMetadata = null; - - /** - * Resource azureMetadata. - * @member {google.cloud.securitycenter.v1.IAzureMetadata|null|undefined} azureMetadata - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.azureMetadata = null; - - /** - * Resource resourcePath. - * @member {google.cloud.securitycenter.v1.IResourcePath|null|undefined} resourcePath - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.resourcePath = null; - - /** - * Resource resourcePathString. - * @member {string} resourcePathString - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.resourcePathString = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Resource cloudProviderMetadata. - * @member {"awsMetadata"|"azureMetadata"|undefined} cloudProviderMetadata - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Object.defineProperty(Resource.prototype, "cloudProviderMetadata", { - get: $util.oneOfGetter($oneOfFields = ["awsMetadata", "azureMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * 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); - 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.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.cloudProvider); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.organization); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.service); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.location); - if (message.awsMetadata != null && Object.hasOwnProperty.call(message, "awsMetadata")) - $root.google.cloud.securitycenter.v1.AwsMetadata.encode(message.awsMetadata, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.azureMetadata != null && Object.hasOwnProperty.call(message, "azureMetadata")) - $root.google.cloud.securitycenter.v1.AzureMetadata.encode(message.azureMetadata, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.resourcePath != null && Object.hasOwnProperty.call(message, "resourcePath")) - $root.google.cloud.securitycenter.v1.ResourcePath.encode(message.resourcePath, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.resourcePathString != null && Object.hasOwnProperty.call(message, "resourcePathString")) - writer.uint32(/* id 19, wireType 2 =*/154).string(message.resourcePathString); - 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, error) { - 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(); - if (tag === error) - break; - 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 9: { - message.cloudProvider = reader.int32(); - break; - } - case 10: { - message.organization = reader.string(); - break; - } - case 11: { - message.service = reader.string(); - break; - } - case 12: { - message.location = reader.string(); - break; - } - case 16: { - message.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.decode(reader, reader.uint32()); - break; - } - case 17: { - message.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.decode(reader, reader.uint32()); - break; - } - case 18: { - message.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.decode(reader, reader.uint32()); - break; - } - case 19: { - message.resourcePathString = 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"; - 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.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"; - 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.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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - switch (message.cloudProvider) { - default: - return "cloudProvider: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.organization != null && message.hasOwnProperty("organization")) - if (!$util.isString(message.organization)) - return "organization: string expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v1.AwsMetadata.verify(message.awsMetadata); - if (error) - return "awsMetadata." + error; - } - } - if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { - if (properties.cloudProviderMetadata === 1) - return "cloudProviderMetadata: multiple values"; - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v1.AzureMetadata.verify(message.azureMetadata); - if (error) - return "azureMetadata." + error; - } - } - if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) { - var error = $root.google.cloud.securitycenter.v1.ResourcePath.verify(message.resourcePath); - if (error) - return "resourcePath." + error; - } - if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) - if (!$util.isString(message.resourcePathString)) - return "resourcePathString: 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.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) - 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.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]); - } - } - switch (object.cloudProvider) { - default: - if (typeof object.cloudProvider === "number") { - message.cloudProvider = object.cloudProvider; - break; - } - break; - case "CLOUD_PROVIDER_UNSPECIFIED": - case 0: - message.cloudProvider = 0; - break; - case "GOOGLE_CLOUD_PLATFORM": - case 1: - message.cloudProvider = 1; - break; - case "AMAZON_WEB_SERVICES": - case 2: - message.cloudProvider = 2; - break; - case "MICROSOFT_AZURE": - case 3: - message.cloudProvider = 3; - break; - } - if (object.organization != null) - message.organization = String(object.organization); - if (object.service != null) - message.service = String(object.service); - if (object.location != null) - message.location = String(object.location); - if (object.awsMetadata != null) { - if (typeof object.awsMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Resource.awsMetadata: object expected"); - message.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.fromObject(object.awsMetadata); - } - if (object.azureMetadata != null) { - if (typeof object.azureMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Resource.azureMetadata: object expected"); - message.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.fromObject(object.azureMetadata); - } - if (object.resourcePath != null) { - if (typeof object.resourcePath !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Resource.resourcePath: object expected"); - message.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.fromObject(object.resourcePath); - } - if (object.resourcePathString != null) - message.resourcePathString = String(object.resourcePathString); - 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.arrays || options.defaults) - object.folders = []; - if (options.defaults) { - object.name = ""; - object.project = ""; - object.projectDisplayName = ""; - object.parent = ""; - object.parentDisplayName = ""; - object.type = ""; - object.displayName = ""; - object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; - object.organization = ""; - object.service = ""; - object.location = ""; - object.resourcePath = null; - object.resourcePathString = ""; - } - 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.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] : message.cloudProvider; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = message.organization; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { - object.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.toObject(message.awsMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "awsMetadata"; - } - if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { - object.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.toObject(message.azureMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "azureMetadata"; - } - if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) - object.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.toObject(message.resourcePath, options); - if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) - object.resourcePathString = message.resourcePathString; - 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); - }; - - /** - * 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; - })(); - - /** - * CloudProvider enum. - * @name google.cloud.securitycenter.v1.CloudProvider - * @enum {number} - * @property {number} CLOUD_PROVIDER_UNSPECIFIED=0 CLOUD_PROVIDER_UNSPECIFIED value - * @property {number} GOOGLE_CLOUD_PLATFORM=1 GOOGLE_CLOUD_PLATFORM value - * @property {number} AMAZON_WEB_SERVICES=2 AMAZON_WEB_SERVICES value - * @property {number} MICROSOFT_AZURE=3 MICROSOFT_AZURE value - */ - v1.CloudProvider = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLOUD_PROVIDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_CLOUD_PLATFORM"] = 1; - values[valuesById[2] = "AMAZON_WEB_SERVICES"] = 2; - values[valuesById[3] = "MICROSOFT_AZURE"] = 3; - return values; - })(); - - v1.AwsMetadata = (function() { - - /** - * Properties of an AwsMetadata. - * @memberof google.cloud.securitycenter.v1 - * @interface IAwsMetadata - * @property {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization|null} [organization] AwsMetadata organization - * @property {Array.|null} [organizationalUnits] AwsMetadata organizationalUnits - * @property {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount|null} [account] AwsMetadata account - */ - - /** - * Constructs a new AwsMetadata. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an AwsMetadata. - * @implements IAwsMetadata - * @constructor - * @param {google.cloud.securitycenter.v1.IAwsMetadata=} [properties] Properties to set - */ - function AwsMetadata(properties) { - this.organizationalUnits = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AwsMetadata organization. - * @member {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization|null|undefined} organization - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @instance - */ - AwsMetadata.prototype.organization = null; - - /** - * AwsMetadata organizationalUnits. - * @member {Array.} organizationalUnits - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @instance - */ - AwsMetadata.prototype.organizationalUnits = $util.emptyArray; - - /** - * AwsMetadata account. - * @member {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount|null|undefined} account - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @instance - */ - AwsMetadata.prototype.account = null; - - /** - * Creates a new AwsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {google.cloud.securitycenter.v1.IAwsMetadata=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AwsMetadata} AwsMetadata instance - */ - AwsMetadata.create = function create(properties) { - return new AwsMetadata(properties); - }; - - /** - * Encodes the specified AwsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {google.cloud.securitycenter.v1.IAwsMetadata} message AwsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.encode(message.organization, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.organizationalUnits != null && message.organizationalUnits.length) - for (var i = 0; i < message.organizationalUnits.length; ++i) - $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.encode(message.organizationalUnits[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.account != null && Object.hasOwnProperty.call(message, "account")) - $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.encode(message.account, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AwsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {google.cloud.securitycenter.v1.IAwsMetadata} message AwsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AwsMetadata} AwsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AwsMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.organization = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.organizationalUnits && message.organizationalUnits.length)) - message.organizationalUnits = []; - message.organizationalUnits.push($root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.decode(reader, reader.uint32())); - break; - } - case 4: { - message.account = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AwsMetadata} AwsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsMetadata message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.organization != null && message.hasOwnProperty("organization")) { - var error = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify(message.organization); - if (error) - return "organization." + error; - } - if (message.organizationalUnits != null && message.hasOwnProperty("organizationalUnits")) { - if (!Array.isArray(message.organizationalUnits)) - return "organizationalUnits: array expected"; - for (var i = 0; i < message.organizationalUnits.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify(message.organizationalUnits[i]); - if (error) - return "organizationalUnits." + error; - } - } - if (message.account != null && message.hasOwnProperty("account")) { - var error = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify(message.account); - if (error) - return "account." + error; - } - return null; - }; - - /** - * Creates an AwsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AwsMetadata} AwsMetadata - */ - AwsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AwsMetadata) - return object; - var message = new $root.google.cloud.securitycenter.v1.AwsMetadata(); - if (object.organization != null) { - if (typeof object.organization !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AwsMetadata.organization: object expected"); - message.organization = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.fromObject(object.organization); - } - if (object.organizationalUnits) { - if (!Array.isArray(object.organizationalUnits)) - throw TypeError(".google.cloud.securitycenter.v1.AwsMetadata.organizationalUnits: array expected"); - message.organizationalUnits = []; - for (var i = 0; i < object.organizationalUnits.length; ++i) { - if (typeof object.organizationalUnits[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AwsMetadata.organizationalUnits: object expected"); - message.organizationalUnits[i] = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.fromObject(object.organizationalUnits[i]); - } - } - if (object.account != null) { - if (typeof object.account !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AwsMetadata.account: object expected"); - message.account = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.fromObject(object.account); - } - return message; - }; - - /** - * Creates a plain object from an AwsMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata} message AwsMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.organizationalUnits = []; - if (options.defaults) { - object.organization = null; - object.account = null; - } - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.toObject(message.organization, options); - if (message.organizationalUnits && message.organizationalUnits.length) { - object.organizationalUnits = []; - for (var j = 0; j < message.organizationalUnits.length; ++j) - object.organizationalUnits[j] = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.toObject(message.organizationalUnits[j], options); - } - if (message.account != null && message.hasOwnProperty("account")) - object.account = $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.toObject(message.account, options); - return object; - }; - - /** - * Converts this AwsMetadata to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @instance - * @returns {Object.} JSON object - */ - AwsMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsMetadata - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AwsMetadata"; - }; - - AwsMetadata.AwsOrganization = (function() { - - /** - * Properties of an AwsOrganization. - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @interface IAwsOrganization - * @property {string|null} [id] AwsOrganization id - */ - - /** - * Constructs a new AwsOrganization. - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @classdesc Represents an AwsOrganization. - * @implements IAwsOrganization - * @constructor - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization=} [properties] Properties to set - */ - function AwsOrganization(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AwsOrganization id. - * @member {string} id - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @instance - */ - AwsOrganization.prototype.id = ""; - - /** - * Creates a new AwsOrganization instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} AwsOrganization instance - */ - AwsOrganization.create = function create(properties) { - return new AwsOrganization(properties); - }; - - /** - * Encodes the specified AwsOrganization message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization} message AwsOrganization message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsOrganization.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); - return writer; - }; - - /** - * Encodes the specified AwsOrganization message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganization} message AwsOrganization message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsOrganization.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsOrganization message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} AwsOrganization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsOrganization.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsOrganization message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} AwsOrganization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsOrganization.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsOrganization message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsOrganization.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"; - return null; - }; - - /** - * Creates an AwsOrganization message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} AwsOrganization - */ - AwsOrganization.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization) - return object; - var message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization(); - if (object.id != null) - message.id = String(object.id); - return message; - }; - - /** - * Creates a plain object from an AwsOrganization message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization} message AwsOrganization - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsOrganization.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - return object; - }; - - /** - * Converts this AwsOrganization to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @instance - * @returns {Object.} JSON object - */ - AwsOrganization.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsOrganization - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsOrganization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AwsMetadata.AwsOrganization"; - }; - - return AwsOrganization; - })(); - - AwsMetadata.AwsOrganizationalUnit = (function() { - - /** - * Properties of an AwsOrganizationalUnit. - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @interface IAwsOrganizationalUnit - * @property {string|null} [id] AwsOrganizationalUnit id - * @property {string|null} [name] AwsOrganizationalUnit name - */ - - /** - * Constructs a new AwsOrganizationalUnit. - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @classdesc Represents an AwsOrganizationalUnit. - * @implements IAwsOrganizationalUnit - * @constructor - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit=} [properties] Properties to set - */ - function AwsOrganizationalUnit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AwsOrganizationalUnit id. - * @member {string} id - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @instance - */ - AwsOrganizationalUnit.prototype.id = ""; - - /** - * AwsOrganizationalUnit name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @instance - */ - AwsOrganizationalUnit.prototype.name = ""; - - /** - * Creates a new AwsOrganizationalUnit instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit instance - */ - AwsOrganizationalUnit.create = function create(properties) { - return new AwsOrganizationalUnit(properties); - }; - - /** - * Encodes the specified AwsOrganizationalUnit message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit} message AwsOrganizationalUnit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsOrganizationalUnit.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - return writer; - }; - - /** - * Encodes the specified AwsOrganizationalUnit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsOrganizationalUnit} message AwsOrganizationalUnit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsOrganizationalUnit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsOrganizationalUnit message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsOrganizationalUnit.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsOrganizationalUnit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsOrganizationalUnit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsOrganizationalUnit message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsOrganizationalUnit.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an AwsOrganizationalUnit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit - */ - AwsOrganizationalUnit.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit) - return object; - var message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an AwsOrganizationalUnit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit} message AwsOrganizationalUnit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsOrganizationalUnit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.name = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this AwsOrganizationalUnit to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @instance - * @returns {Object.} JSON object - */ - AwsOrganizationalUnit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsOrganizationalUnit - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsOrganizationalUnit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AwsMetadata.AwsOrganizationalUnit"; - }; - - return AwsOrganizationalUnit; - })(); - - AwsMetadata.AwsAccount = (function() { - - /** - * Properties of an AwsAccount. - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @interface IAwsAccount - * @property {string|null} [id] AwsAccount id - * @property {string|null} [name] AwsAccount name - */ - - /** - * Constructs a new AwsAccount. - * @memberof google.cloud.securitycenter.v1.AwsMetadata - * @classdesc Represents an AwsAccount. - * @implements IAwsAccount - * @constructor - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount=} [properties] Properties to set - */ - function AwsAccount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AwsAccount id. - * @member {string} id - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @instance - */ - AwsAccount.prototype.id = ""; - - /** - * AwsAccount name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @instance - */ - AwsAccount.prototype.name = ""; - - /** - * Creates a new AwsAccount instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} AwsAccount instance - */ - AwsAccount.create = function create(properties) { - return new AwsAccount(properties); - }; - - /** - * Encodes the specified AwsAccount message. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount} message AwsAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsAccount.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - return writer; - }; - - /** - * Encodes the specified AwsAccount message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AwsMetadata.AwsAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.IAwsAccount} message AwsAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsAccount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} AwsAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsAccount.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} AwsAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsAccount message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsAccount.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an AwsAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} AwsAccount - */ - AwsAccount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount) - return object; - var message = new $root.google.cloud.securitycenter.v1.AwsMetadata.AwsAccount(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an AwsAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {google.cloud.securitycenter.v1.AwsMetadata.AwsAccount} message AwsAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.name = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this AwsAccount to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @instance - * @returns {Object.} JSON object - */ - AwsAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsAccount - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AwsMetadata.AwsAccount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AwsMetadata.AwsAccount"; - }; - - return AwsAccount; - })(); - - return AwsMetadata; - })(); - - v1.AzureMetadata = (function() { - - /** - * Properties of an AzureMetadata. - * @memberof google.cloud.securitycenter.v1 - * @interface IAzureMetadata - * @property {Array.|null} [managementGroups] AzureMetadata managementGroups - * @property {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription|null} [subscription] AzureMetadata subscription - * @property {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup|null} [resourceGroup] AzureMetadata resourceGroup - */ - - /** - * Constructs a new AzureMetadata. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an AzureMetadata. - * @implements IAzureMetadata - * @constructor - * @param {google.cloud.securitycenter.v1.IAzureMetadata=} [properties] Properties to set - */ - function AzureMetadata(properties) { - this.managementGroups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureMetadata managementGroups. - * @member {Array.} managementGroups - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @instance - */ - AzureMetadata.prototype.managementGroups = $util.emptyArray; - - /** - * AzureMetadata subscription. - * @member {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription|null|undefined} subscription - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @instance - */ - AzureMetadata.prototype.subscription = null; - - /** - * AzureMetadata resourceGroup. - * @member {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup|null|undefined} resourceGroup - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @instance - */ - AzureMetadata.prototype.resourceGroup = null; - - /** - * Creates a new AzureMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {google.cloud.securitycenter.v1.IAzureMetadata=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AzureMetadata} AzureMetadata instance - */ - AzureMetadata.create = function create(properties) { - return new AzureMetadata(properties); - }; - - /** - * Encodes the specified AzureMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {google.cloud.securitycenter.v1.IAzureMetadata} message AzureMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.managementGroups != null && message.managementGroups.length) - for (var i = 0; i < message.managementGroups.length; ++i) - $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.encode(message.managementGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.encode(message.subscription, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.resourceGroup != null && Object.hasOwnProperty.call(message, "resourceGroup")) - $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.encode(message.resourceGroup, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AzureMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {google.cloud.securitycenter.v1.IAzureMetadata} message AzureMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AzureMetadata} AzureMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AzureMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - if (!(message.managementGroups && message.managementGroups.length)) - message.managementGroups = []; - message.managementGroups.push($root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.decode(reader, reader.uint32())); - break; - } - case 5: { - message.subscription = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.decode(reader, reader.uint32()); - break; - } - case 6: { - message.resourceGroup = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AzureMetadata} AzureMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureMetadata message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.managementGroups != null && message.hasOwnProperty("managementGroups")) { - if (!Array.isArray(message.managementGroups)) - return "managementGroups: array expected"; - for (var i = 0; i < message.managementGroups.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify(message.managementGroups[i]); - if (error) - return "managementGroups." + error; - } - } - if (message.subscription != null && message.hasOwnProperty("subscription")) { - var error = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify(message.subscription); - if (error) - return "subscription." + error; - } - if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) { - var error = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify(message.resourceGroup); - if (error) - return "resourceGroup." + error; - } - return null; - }; - - /** - * Creates an AzureMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AzureMetadata} AzureMetadata - */ - AzureMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AzureMetadata) - return object; - var message = new $root.google.cloud.securitycenter.v1.AzureMetadata(); - if (object.managementGroups) { - if (!Array.isArray(object.managementGroups)) - throw TypeError(".google.cloud.securitycenter.v1.AzureMetadata.managementGroups: array expected"); - message.managementGroups = []; - for (var i = 0; i < object.managementGroups.length; ++i) { - if (typeof object.managementGroups[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AzureMetadata.managementGroups: object expected"); - message.managementGroups[i] = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.fromObject(object.managementGroups[i]); - } - } - if (object.subscription != null) { - if (typeof object.subscription !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AzureMetadata.subscription: object expected"); - message.subscription = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.fromObject(object.subscription); - } - if (object.resourceGroup != null) { - if (typeof object.resourceGroup !== "object") - throw TypeError(".google.cloud.securitycenter.v1.AzureMetadata.resourceGroup: object expected"); - message.resourceGroup = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.fromObject(object.resourceGroup); - } - return message; - }; - - /** - * Creates a plain object from an AzureMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata} message AzureMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.managementGroups = []; - if (options.defaults) { - object.subscription = null; - object.resourceGroup = null; - } - if (message.managementGroups && message.managementGroups.length) { - object.managementGroups = []; - for (var j = 0; j < message.managementGroups.length; ++j) - object.managementGroups[j] = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.toObject(message.managementGroups[j], options); - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.toObject(message.subscription, options); - if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) - object.resourceGroup = $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.toObject(message.resourceGroup, options); - return object; - }; - - /** - * Converts this AzureMetadata to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @instance - * @returns {Object.} JSON object - */ - AzureMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureMetadata - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AzureMetadata"; - }; - - AzureMetadata.AzureManagementGroup = (function() { - - /** - * Properties of an AzureManagementGroup. - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @interface IAzureManagementGroup - * @property {string|null} [id] AzureManagementGroup id - * @property {string|null} [displayName] AzureManagementGroup displayName - */ - - /** - * Constructs a new AzureManagementGroup. - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @classdesc Represents an AzureManagementGroup. - * @implements IAzureManagementGroup - * @constructor - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup=} [properties] Properties to set - */ - function AzureManagementGroup(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureManagementGroup id. - * @member {string} id - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @instance - */ - AzureManagementGroup.prototype.id = ""; - - /** - * AzureManagementGroup displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @instance - */ - AzureManagementGroup.prototype.displayName = ""; - - /** - * Creates a new AzureManagementGroup instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} AzureManagementGroup instance - */ - AzureManagementGroup.create = function create(properties) { - return new AzureManagementGroup(properties); - }; - - /** - * Encodes the specified AzureManagementGroup message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup} message AzureManagementGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureManagementGroup.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified AzureManagementGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureManagementGroup} message AzureManagementGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureManagementGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureManagementGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} AzureManagementGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureManagementGroup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureManagementGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} AzureManagementGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureManagementGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureManagementGroup message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureManagementGroup.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an AzureManagementGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} AzureManagementGroup - */ - AzureManagementGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup) - return object; - var message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup(); - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an AzureManagementGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup} message AzureManagementGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureManagementGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this AzureManagementGroup to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @instance - * @returns {Object.} JSON object - */ - AzureManagementGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureManagementGroup - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureManagementGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AzureMetadata.AzureManagementGroup"; - }; - - return AzureManagementGroup; - })(); - - AzureMetadata.AzureSubscription = (function() { - - /** - * Properties of an AzureSubscription. - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @interface IAzureSubscription - * @property {string|null} [id] AzureSubscription id - * @property {string|null} [displayName] AzureSubscription displayName - */ - - /** - * Constructs a new AzureSubscription. - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @classdesc Represents an AzureSubscription. - * @implements IAzureSubscription - * @constructor - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription=} [properties] Properties to set - */ - function AzureSubscription(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureSubscription id. - * @member {string} id - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @instance - */ - AzureSubscription.prototype.id = ""; - - /** - * AzureSubscription displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @instance - */ - AzureSubscription.prototype.displayName = ""; - - /** - * Creates a new AzureSubscription instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} AzureSubscription instance - */ - AzureSubscription.create = function create(properties) { - return new AzureSubscription(properties); - }; - - /** - * Encodes the specified AzureSubscription message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription} message AzureSubscription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureSubscription.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified AzureSubscription message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureSubscription} message AzureSubscription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureSubscription.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureSubscription message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} AzureSubscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureSubscription.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureSubscription message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} AzureSubscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureSubscription.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureSubscription message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureSubscription.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an AzureSubscription message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} AzureSubscription - */ - AzureSubscription.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription) - return object; - var message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription(); - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an AzureSubscription message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription} message AzureSubscription - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureSubscription.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this AzureSubscription to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @instance - * @returns {Object.} JSON object - */ - AzureSubscription.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureSubscription - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureSubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AzureMetadata.AzureSubscription"; - }; - - return AzureSubscription; - })(); - - AzureMetadata.AzureResourceGroup = (function() { - - /** - * Properties of an AzureResourceGroup. - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @interface IAzureResourceGroup - * @property {string|null} [name] AzureResourceGroup name - */ - - /** - * Constructs a new AzureResourceGroup. - * @memberof google.cloud.securitycenter.v1.AzureMetadata - * @classdesc Represents an AzureResourceGroup. - * @implements IAzureResourceGroup - * @constructor - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup=} [properties] Properties to set - */ - function AzureResourceGroup(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureResourceGroup name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @instance - */ - AzureResourceGroup.prototype.name = ""; - - /** - * Creates a new AzureResourceGroup instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} AzureResourceGroup instance - */ - AzureResourceGroup.create = function create(properties) { - return new AzureResourceGroup(properties); - }; - - /** - * Encodes the specified AzureResourceGroup message. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup} message AzureResourceGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureResourceGroup.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 AzureResourceGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.IAzureResourceGroup} message AzureResourceGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureResourceGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureResourceGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} AzureResourceGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureResourceGroup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureResourceGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} AzureResourceGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureResourceGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureResourceGroup message. - * @function verify - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureResourceGroup.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 an AzureResourceGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} AzureResourceGroup - */ - AzureResourceGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup) - return object; - var message = new $root.google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an AzureResourceGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup} message AzureResourceGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureResourceGroup.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 AzureResourceGroup to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @instance - * @returns {Object.} JSON object - */ - AzureResourceGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureResourceGroup - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureResourceGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.AzureMetadata.AzureResourceGroup"; - }; - - return AzureResourceGroup; - })(); - - return AzureMetadata; - })(); - - v1.ResourcePath = (function() { - - /** - * Properties of a ResourcePath. - * @memberof google.cloud.securitycenter.v1 - * @interface IResourcePath - * @property {Array.|null} [nodes] ResourcePath nodes - */ - - /** - * Constructs a new ResourcePath. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ResourcePath. - * @implements IResourcePath - * @constructor - * @param {google.cloud.securitycenter.v1.IResourcePath=} [properties] Properties to set - */ - function ResourcePath(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]]; - } - - /** - * ResourcePath nodes. - * @member {Array.} nodes - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @instance - */ - ResourcePath.prototype.nodes = $util.emptyArray; - - /** - * Creates a new ResourcePath instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {google.cloud.securitycenter.v1.IResourcePath=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ResourcePath} ResourcePath instance - */ - ResourcePath.create = function create(properties) { - return new ResourcePath(properties); - }; - - /** - * Encodes the specified ResourcePath message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {google.cloud.securitycenter.v1.IResourcePath} message ResourcePath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourcePath.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResourcePath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {google.cloud.securitycenter.v1.IResourcePath} message ResourcePath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourcePath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourcePath message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ResourcePath} ResourcePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourcePath.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourcePath(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourcePath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ResourcePath} ResourcePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourcePath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourcePath message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourcePath.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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.ResourcePath.ResourcePathNode.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - return null; - }; - - /** - * Creates a ResourcePath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ResourcePath} ResourcePath - */ - ResourcePath.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ResourcePath) - return object; - var message = new $root.google.cloud.securitycenter.v1.ResourcePath(); - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.securitycenter.v1.ResourcePath.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.ResourcePath.nodes: object expected"); - message.nodes[i] = $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.fromObject(object.nodes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ResourcePath message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {google.cloud.securitycenter.v1.ResourcePath} message ResourcePath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourcePath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.nodes = []; - 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.ResourcePath.ResourcePathNode.toObject(message.nodes[j], options); - } - return object; - }; - - /** - * Converts this ResourcePath to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @instance - * @returns {Object.} JSON object - */ - ResourcePath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourcePath - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourcePath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourcePath"; - }; - - /** - * ResourcePathNodeType enum. - * @name google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType - * @enum {number} - * @property {number} RESOURCE_PATH_NODE_TYPE_UNSPECIFIED=0 RESOURCE_PATH_NODE_TYPE_UNSPECIFIED value - * @property {number} GCP_ORGANIZATION=1 GCP_ORGANIZATION value - * @property {number} GCP_FOLDER=2 GCP_FOLDER value - * @property {number} GCP_PROJECT=3 GCP_PROJECT value - * @property {number} AWS_ORGANIZATION=4 AWS_ORGANIZATION value - * @property {number} AWS_ORGANIZATIONAL_UNIT=5 AWS_ORGANIZATIONAL_UNIT value - * @property {number} AWS_ACCOUNT=6 AWS_ACCOUNT value - * @property {number} AZURE_MANAGEMENT_GROUP=7 AZURE_MANAGEMENT_GROUP value - * @property {number} AZURE_SUBSCRIPTION=8 AZURE_SUBSCRIPTION value - * @property {number} AZURE_RESOURCE_GROUP=9 AZURE_RESOURCE_GROUP value - */ - ResourcePath.ResourcePathNodeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GCP_ORGANIZATION"] = 1; - values[valuesById[2] = "GCP_FOLDER"] = 2; - values[valuesById[3] = "GCP_PROJECT"] = 3; - values[valuesById[4] = "AWS_ORGANIZATION"] = 4; - values[valuesById[5] = "AWS_ORGANIZATIONAL_UNIT"] = 5; - values[valuesById[6] = "AWS_ACCOUNT"] = 6; - values[valuesById[7] = "AZURE_MANAGEMENT_GROUP"] = 7; - values[valuesById[8] = "AZURE_SUBSCRIPTION"] = 8; - values[valuesById[9] = "AZURE_RESOURCE_GROUP"] = 9; - return values; - })(); - - ResourcePath.ResourcePathNode = (function() { - - /** - * Properties of a ResourcePathNode. - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @interface IResourcePathNode - * @property {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType|null} [nodeType] ResourcePathNode nodeType - * @property {string|null} [id] ResourcePathNode id - * @property {string|null} [displayName] ResourcePathNode displayName - */ - - /** - * Constructs a new ResourcePathNode. - * @memberof google.cloud.securitycenter.v1.ResourcePath - * @classdesc Represents a ResourcePathNode. - * @implements IResourcePathNode - * @constructor - * @param {google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode=} [properties] Properties to set - */ - function ResourcePathNode(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourcePathNode nodeType. - * @member {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType} nodeType - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @instance - */ - ResourcePathNode.prototype.nodeType = 0; - - /** - * ResourcePathNode id. - * @member {string} id - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @instance - */ - ResourcePathNode.prototype.id = ""; - - /** - * ResourcePathNode displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @instance - */ - ResourcePathNode.prototype.displayName = ""; - - /** - * Creates a new ResourcePathNode instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} ResourcePathNode instance - */ - ResourcePathNode.create = function create(properties) { - return new ResourcePathNode(properties); - }; - - /** - * Encodes the specified ResourcePathNode message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode} message ResourcePathNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourcePathNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeType); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified ResourcePathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {google.cloud.securitycenter.v1.ResourcePath.IResourcePathNode} message ResourcePathNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourcePathNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourcePathNode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} ResourcePathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourcePathNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodeType = reader.int32(); - break; - } - case 2: { - message.id = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourcePathNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} ResourcePathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourcePathNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourcePathNode message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourcePathNode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeType != null && message.hasOwnProperty("nodeType")) - switch (message.nodeType) { - default: - return "nodeType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates a ResourcePathNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} ResourcePathNode - */ - ResourcePathNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode) - return object; - var message = new $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode(); - switch (object.nodeType) { - default: - if (typeof object.nodeType === "number") { - message.nodeType = object.nodeType; - break; - } - break; - case "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED": - case 0: - message.nodeType = 0; - break; - case "GCP_ORGANIZATION": - case 1: - message.nodeType = 1; - break; - case "GCP_FOLDER": - case 2: - message.nodeType = 2; - break; - case "GCP_PROJECT": - case 3: - message.nodeType = 3; - break; - case "AWS_ORGANIZATION": - case 4: - message.nodeType = 4; - break; - case "AWS_ORGANIZATIONAL_UNIT": - case 5: - message.nodeType = 5; - break; - case "AWS_ACCOUNT": - case 6: - message.nodeType = 6; - break; - case "AZURE_MANAGEMENT_GROUP": - case 7: - message.nodeType = 7; - break; - case "AZURE_SUBSCRIPTION": - case 8: - message.nodeType = 8; - break; - case "AZURE_RESOURCE_GROUP": - case 9: - message.nodeType = 9; - break; - } - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a ResourcePathNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode} message ResourcePathNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourcePathNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.nodeType = options.enums === String ? "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" : 0; - object.id = ""; - object.displayName = ""; - } - if (message.nodeType != null && message.hasOwnProperty("nodeType")) - object.nodeType = options.enums === String ? $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType[message.nodeType] === undefined ? message.nodeType : $root.google.cloud.securitycenter.v1.ResourcePath.ResourcePathNodeType[message.nodeType] : message.nodeType; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this ResourcePathNode to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @instance - * @returns {Object.} JSON object - */ - ResourcePathNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourcePathNode - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourcePathNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourcePath.ResourcePathNode"; - }; - - return ResourcePathNode; - })(); - - return ResourcePath; - })(); - - 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 && 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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() { - - /** - * 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 - * @constructor - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - */ - 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) - 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; - - /** - * 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 - * @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 && 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - 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; - } - 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; - }; - - /** - * 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) { - default: - if (typeof object.inclusionMode === "number") { - message.inclusionMode = object.inclusionMode; - break; - } - break; - 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; - } - 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; - }; - - /** - * 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 = []; - object.folderIds = []; - } - 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] === 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) - object.folderIds[j] = message.folderIds[j]; - } - 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); - }; - - /** - * 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 - * @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.ResourceValueConfig = (function() { - - /** - * Properties of a ResourceValueConfig. - * @memberof google.cloud.securitycenter.v1 - * @interface IResourceValueConfig - * @property {string|null} [name] ResourceValueConfig name - * @property {google.cloud.securitycenter.v1.ResourceValue|null} [resourceValue] ResourceValueConfig resourceValue - * @property {Array.|null} [tagValues] ResourceValueConfig tagValues - * @property {string|null} [resourceType] ResourceValueConfig resourceType - * @property {string|null} [scope] ResourceValueConfig scope - * @property {Object.|null} [resourceLabelsSelector] ResourceValueConfig resourceLabelsSelector - * @property {string|null} [description] ResourceValueConfig description - * @property {google.protobuf.ITimestamp|null} [createTime] ResourceValueConfig createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ResourceValueConfig updateTime - * @property {google.cloud.securitycenter.v1.CloudProvider|null} [cloudProvider] ResourceValueConfig cloudProvider - * @property {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping|null} [sensitiveDataProtectionMapping] ResourceValueConfig sensitiveDataProtectionMapping - */ - - /** - * Constructs a new ResourceValueConfig. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ResourceValueConfig. - * @implements IResourceValueConfig - * @constructor - * @param {google.cloud.securitycenter.v1.IResourceValueConfig=} [properties] Properties to set - */ - function ResourceValueConfig(properties) { - this.tagValues = []; - this.resourceLabelsSelector = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceValueConfig name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.name = ""; - - /** - * ResourceValueConfig resourceValue. - * @member {google.cloud.securitycenter.v1.ResourceValue} resourceValue - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.resourceValue = 0; - - /** - * ResourceValueConfig tagValues. - * @member {Array.} tagValues - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.tagValues = $util.emptyArray; - - /** - * ResourceValueConfig resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.resourceType = ""; - - /** - * ResourceValueConfig scope. - * @member {string} scope - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.scope = ""; - - /** - * ResourceValueConfig resourceLabelsSelector. - * @member {Object.} resourceLabelsSelector - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.resourceLabelsSelector = $util.emptyObject; - - /** - * ResourceValueConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.description = ""; - - /** - * ResourceValueConfig createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.createTime = null; - - /** - * ResourceValueConfig updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.updateTime = null; - - /** - * ResourceValueConfig cloudProvider. - * @member {google.cloud.securitycenter.v1.CloudProvider} cloudProvider - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.cloudProvider = 0; - - /** - * ResourceValueConfig sensitiveDataProtectionMapping. - * @member {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping|null|undefined} sensitiveDataProtectionMapping - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.sensitiveDataProtectionMapping = null; - - /** - * Creates a new ResourceValueConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {google.cloud.securitycenter.v1.IResourceValueConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ResourceValueConfig} ResourceValueConfig instance - */ - ResourceValueConfig.create = function create(properties) { - return new ResourceValueConfig(properties); - }; - - /** - * Encodes the specified ResourceValueConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {google.cloud.securitycenter.v1.IResourceValueConfig} message ResourceValueConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceValueConfig.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.resourceValue != null && Object.hasOwnProperty.call(message, "resourceValue")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceValue); - if (message.tagValues != null && message.tagValues.length) - for (var i = 0; i < message.tagValues.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tagValues[i]); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceType); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.scope); - if (message.resourceLabelsSelector != null && Object.hasOwnProperty.call(message, "resourceLabelsSelector")) - for (var keys = Object.keys(message.resourceLabelsSelector), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourceLabelsSelector[keys[i]]).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.cloudProvider); - if (message.sensitiveDataProtectionMapping != null && Object.hasOwnProperty.call(message, "sensitiveDataProtectionMapping")) - $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.encode(message.sensitiveDataProtectionMapping, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResourceValueConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {google.cloud.securitycenter.v1.IResourceValueConfig} message ResourceValueConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceValueConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceValueConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ResourceValueConfig} ResourceValueConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceValueConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourceValueConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.resourceValue = reader.int32(); - break; - } - case 3: { - if (!(message.tagValues && message.tagValues.length)) - message.tagValues = []; - message.tagValues.push(reader.string()); - break; - } - case 4: { - message.resourceType = reader.string(); - break; - } - case 5: { - message.scope = reader.string(); - break; - } - case 6: { - if (message.resourceLabelsSelector === $util.emptyObject) - message.resourceLabelsSelector = {}; - 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.resourceLabelsSelector[key] = value; - break; - } - case 7: { - message.description = reader.string(); - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.cloudProvider = reader.int32(); - break; - } - case 11: { - message.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceValueConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ResourceValueConfig} ResourceValueConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceValueConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceValueConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceValueConfig.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.resourceValue != null && message.hasOwnProperty("resourceValue")) - switch (message.resourceValue) { - default: - return "resourceValue: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.tagValues != null && message.hasOwnProperty("tagValues")) { - if (!Array.isArray(message.tagValues)) - return "tagValues: array expected"; - for (var i = 0; i < message.tagValues.length; ++i) - if (!$util.isString(message.tagValues[i])) - return "tagValues: string[] expected"; - } - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.resourceLabelsSelector != null && message.hasOwnProperty("resourceLabelsSelector")) { - if (!$util.isObject(message.resourceLabelsSelector)) - return "resourceLabelsSelector: object expected"; - var key = Object.keys(message.resourceLabelsSelector); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.resourceLabelsSelector[key[i]])) - return "resourceLabelsSelector: string{k:string} expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - switch (message.cloudProvider) { - default: - return "cloudProvider: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sensitiveDataProtectionMapping != null && message.hasOwnProperty("sensitiveDataProtectionMapping")) { - var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify(message.sensitiveDataProtectionMapping); - if (error) - return "sensitiveDataProtectionMapping." + error; - } - return null; - }; - - /** - * Creates a ResourceValueConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ResourceValueConfig} ResourceValueConfig - */ - ResourceValueConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ResourceValueConfig) - return object; - var message = new $root.google.cloud.securitycenter.v1.ResourceValueConfig(); - if (object.name != null) - message.name = String(object.name); - switch (object.resourceValue) { - default: - if (typeof object.resourceValue === "number") { - message.resourceValue = object.resourceValue; - break; - } - break; - case "RESOURCE_VALUE_UNSPECIFIED": - case 0: - message.resourceValue = 0; - break; - case "HIGH": - case 1: - message.resourceValue = 1; - break; - case "MEDIUM": - case 2: - message.resourceValue = 2; - break; - case "LOW": - case 3: - message.resourceValue = 3; - break; - case "NONE": - case 4: - message.resourceValue = 4; - break; - } - if (object.tagValues) { - if (!Array.isArray(object.tagValues)) - throw TypeError(".google.cloud.securitycenter.v1.ResourceValueConfig.tagValues: array expected"); - message.tagValues = []; - for (var i = 0; i < object.tagValues.length; ++i) - message.tagValues[i] = String(object.tagValues[i]); - } - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.scope != null) - message.scope = String(object.scope); - if (object.resourceLabelsSelector) { - if (typeof object.resourceLabelsSelector !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ResourceValueConfig.resourceLabelsSelector: object expected"); - message.resourceLabelsSelector = {}; - for (var keys = Object.keys(object.resourceLabelsSelector), i = 0; i < keys.length; ++i) - message.resourceLabelsSelector[keys[i]] = String(object.resourceLabelsSelector[keys[i]]); - } - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ResourceValueConfig.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.ResourceValueConfig.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - switch (object.cloudProvider) { - default: - if (typeof object.cloudProvider === "number") { - message.cloudProvider = object.cloudProvider; - break; - } - break; - case "CLOUD_PROVIDER_UNSPECIFIED": - case 0: - message.cloudProvider = 0; - break; - case "GOOGLE_CLOUD_PLATFORM": - case 1: - message.cloudProvider = 1; - break; - case "AMAZON_WEB_SERVICES": - case 2: - message.cloudProvider = 2; - break; - case "MICROSOFT_AZURE": - case 3: - message.cloudProvider = 3; - break; - } - if (object.sensitiveDataProtectionMapping != null) { - if (typeof object.sensitiveDataProtectionMapping !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ResourceValueConfig.sensitiveDataProtectionMapping: object expected"); - message.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.fromObject(object.sensitiveDataProtectionMapping); - } - return message; - }; - - /** - * Creates a plain object from a ResourceValueConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {google.cloud.securitycenter.v1.ResourceValueConfig} message ResourceValueConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceValueConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tagValues = []; - if (options.objects || options.defaults) - object.resourceLabelsSelector = {}; - if (options.defaults) { - object.name = ""; - object.resourceValue = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; - object.resourceType = ""; - object.scope = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; - object.sensitiveDataProtectionMapping = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) - object.resourceValue = options.enums === String ? $root.google.cloud.securitycenter.v1.ResourceValue[message.resourceValue] === undefined ? message.resourceValue : $root.google.cloud.securitycenter.v1.ResourceValue[message.resourceValue] : message.resourceValue; - if (message.tagValues && message.tagValues.length) { - object.tagValues = []; - for (var j = 0; j < message.tagValues.length; ++j) - object.tagValues[j] = message.tagValues[j]; - } - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - var keys2; - if (message.resourceLabelsSelector && (keys2 = Object.keys(message.resourceLabelsSelector)).length) { - object.resourceLabelsSelector = {}; - for (var j = 0; j < keys2.length; ++j) - object.resourceLabelsSelector[keys2[j]] = message.resourceLabelsSelector[keys2[j]]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] : message.cloudProvider; - if (message.sensitiveDataProtectionMapping != null && message.hasOwnProperty("sensitiveDataProtectionMapping")) - object.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.toObject(message.sensitiveDataProtectionMapping, options); - return object; - }; - - /** - * Converts this ResourceValueConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @instance - * @returns {Object.} JSON object - */ - ResourceValueConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceValueConfig - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceValueConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourceValueConfig"; - }; - - ResourceValueConfig.SensitiveDataProtectionMapping = (function() { - - /** - * Properties of a SensitiveDataProtectionMapping. - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @interface ISensitiveDataProtectionMapping - * @property {google.cloud.securitycenter.v1.ResourceValue|null} [highSensitivityMapping] SensitiveDataProtectionMapping highSensitivityMapping - * @property {google.cloud.securitycenter.v1.ResourceValue|null} [mediumSensitivityMapping] SensitiveDataProtectionMapping mediumSensitivityMapping - */ - - /** - * Constructs a new SensitiveDataProtectionMapping. - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig - * @classdesc Represents a SensitiveDataProtectionMapping. - * @implements ISensitiveDataProtectionMapping - * @constructor - * @param {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping=} [properties] Properties to set - */ - function SensitiveDataProtectionMapping(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SensitiveDataProtectionMapping highSensitivityMapping. - * @member {google.cloud.securitycenter.v1.ResourceValue} highSensitivityMapping - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @instance - */ - SensitiveDataProtectionMapping.prototype.highSensitivityMapping = 0; - - /** - * SensitiveDataProtectionMapping mediumSensitivityMapping. - * @member {google.cloud.securitycenter.v1.ResourceValue} mediumSensitivityMapping - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @instance - */ - SensitiveDataProtectionMapping.prototype.mediumSensitivityMapping = 0; - - /** - * Creates a new SensitiveDataProtectionMapping instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping instance - */ - SensitiveDataProtectionMapping.create = function create(properties) { - return new SensitiveDataProtectionMapping(properties); - }; - - /** - * Encodes the specified SensitiveDataProtectionMapping message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping} message SensitiveDataProtectionMapping message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SensitiveDataProtectionMapping.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.highSensitivityMapping != null && Object.hasOwnProperty.call(message, "highSensitivityMapping")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highSensitivityMapping); - if (message.mediumSensitivityMapping != null && Object.hasOwnProperty.call(message, "mediumSensitivityMapping")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediumSensitivityMapping); - return writer; - }; - - /** - * Encodes the specified SensitiveDataProtectionMapping message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {google.cloud.securitycenter.v1.ResourceValueConfig.ISensitiveDataProtectionMapping} message SensitiveDataProtectionMapping message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SensitiveDataProtectionMapping.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SensitiveDataProtectionMapping.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.highSensitivityMapping = reader.int32(); - break; - } - case 2: { - message.mediumSensitivityMapping = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SensitiveDataProtectionMapping.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SensitiveDataProtectionMapping message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SensitiveDataProtectionMapping.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.highSensitivityMapping != null && message.hasOwnProperty("highSensitivityMapping")) - switch (message.highSensitivityMapping) { - default: - return "highSensitivityMapping: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.mediumSensitivityMapping != null && message.hasOwnProperty("mediumSensitivityMapping")) - switch (message.mediumSensitivityMapping) { - default: - return "mediumSensitivityMapping: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a SensitiveDataProtectionMapping message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping - */ - SensitiveDataProtectionMapping.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping) - return object; - var message = new $root.google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping(); - switch (object.highSensitivityMapping) { - default: - if (typeof object.highSensitivityMapping === "number") { - message.highSensitivityMapping = object.highSensitivityMapping; - break; - } - break; - case "RESOURCE_VALUE_UNSPECIFIED": - case 0: - message.highSensitivityMapping = 0; - break; - case "HIGH": - case 1: - message.highSensitivityMapping = 1; - break; - case "MEDIUM": - case 2: - message.highSensitivityMapping = 2; - break; - case "LOW": - case 3: - message.highSensitivityMapping = 3; - break; - case "NONE": - case 4: - message.highSensitivityMapping = 4; - break; - } - switch (object.mediumSensitivityMapping) { - default: - if (typeof object.mediumSensitivityMapping === "number") { - message.mediumSensitivityMapping = object.mediumSensitivityMapping; - break; - } - break; - case "RESOURCE_VALUE_UNSPECIFIED": - case 0: - message.mediumSensitivityMapping = 0; - break; - case "HIGH": - case 1: - message.mediumSensitivityMapping = 1; - break; - case "MEDIUM": - case 2: - message.mediumSensitivityMapping = 2; - break; - case "LOW": - case 3: - message.mediumSensitivityMapping = 3; - break; - case "NONE": - case 4: - message.mediumSensitivityMapping = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a SensitiveDataProtectionMapping message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping} message SensitiveDataProtectionMapping - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SensitiveDataProtectionMapping.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.highSensitivityMapping = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; - object.mediumSensitivityMapping = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; - } - if (message.highSensitivityMapping != null && message.hasOwnProperty("highSensitivityMapping")) - object.highSensitivityMapping = options.enums === String ? $root.google.cloud.securitycenter.v1.ResourceValue[message.highSensitivityMapping] === undefined ? message.highSensitivityMapping : $root.google.cloud.securitycenter.v1.ResourceValue[message.highSensitivityMapping] : message.highSensitivityMapping; - if (message.mediumSensitivityMapping != null && message.hasOwnProperty("mediumSensitivityMapping")) - object.mediumSensitivityMapping = options.enums === String ? $root.google.cloud.securitycenter.v1.ResourceValue[message.mediumSensitivityMapping] === undefined ? message.mediumSensitivityMapping : $root.google.cloud.securitycenter.v1.ResourceValue[message.mediumSensitivityMapping] : message.mediumSensitivityMapping; - return object; - }; - - /** - * Converts this SensitiveDataProtectionMapping to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @instance - * @returns {Object.} JSON object - */ - SensitiveDataProtectionMapping.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SensitiveDataProtectionMapping - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SensitiveDataProtectionMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourceValueConfig.SensitiveDataProtectionMapping"; - }; - - return SensitiveDataProtectionMapping; - })(); - - return ResourceValueConfig; - })(); - - /** - * ResourceValue enum. - * @name google.cloud.securitycenter.v1.ResourceValue - * @enum {number} - * @property {number} RESOURCE_VALUE_UNSPECIFIED=0 RESOURCE_VALUE_UNSPECIFIED value - * @property {number} HIGH=1 HIGH value - * @property {number} MEDIUM=2 MEDIUM value - * @property {number} LOW=3 LOW value - * @property {number} NONE=4 NONE value - */ - v1.ResourceValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_VALUE_UNSPECIFIED"] = 0; - values[valuesById[1] = "HIGH"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - values[valuesById[3] = "LOW"] = 3; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - 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] === 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; - }; - - /** - * 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); - }; - - /** - * 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 - * @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.SecurityHealthAnalyticsCustomModule = (function() { - - /** - * Properties of a SecurityHealthAnalyticsCustomModule. - * @memberof google.cloud.securitycenter.v1 - * @interface ISecurityHealthAnalyticsCustomModule - * @property {string|null} [name] SecurityHealthAnalyticsCustomModule name - * @property {string|null} [displayName] SecurityHealthAnalyticsCustomModule displayName - * @property {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState|null} [enablementState] SecurityHealthAnalyticsCustomModule enablementState - * @property {google.protobuf.ITimestamp|null} [updateTime] SecurityHealthAnalyticsCustomModule updateTime - * @property {string|null} [lastEditor] SecurityHealthAnalyticsCustomModule lastEditor - * @property {string|null} [ancestorModule] SecurityHealthAnalyticsCustomModule ancestorModule - * @property {google.cloud.securitycenter.v1.ICustomConfig|null} [customConfig] SecurityHealthAnalyticsCustomModule customConfig - */ - - /** - * Constructs a new SecurityHealthAnalyticsCustomModule. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityHealthAnalyticsCustomModule. - * @implements ISecurityHealthAnalyticsCustomModule - * @constructor - * @param {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule=} [properties] Properties to set - */ - function SecurityHealthAnalyticsCustomModule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityHealthAnalyticsCustomModule name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @instance - */ - SecurityHealthAnalyticsCustomModule.prototype.name = ""; - - /** - * SecurityHealthAnalyticsCustomModule displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @instance - */ - SecurityHealthAnalyticsCustomModule.prototype.displayName = ""; - - /** - * SecurityHealthAnalyticsCustomModule enablementState. - * @member {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState} enablementState - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @instance - */ - SecurityHealthAnalyticsCustomModule.prototype.enablementState = 0; - - /** - * SecurityHealthAnalyticsCustomModule updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @instance - */ - SecurityHealthAnalyticsCustomModule.prototype.updateTime = null; - - /** - * SecurityHealthAnalyticsCustomModule lastEditor. - * @member {string} lastEditor - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @instance - */ - SecurityHealthAnalyticsCustomModule.prototype.lastEditor = ""; - - /** - * SecurityHealthAnalyticsCustomModule ancestorModule. - * @member {string} ancestorModule - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @instance - */ - SecurityHealthAnalyticsCustomModule.prototype.ancestorModule = ""; - - /** - * SecurityHealthAnalyticsCustomModule customConfig. - * @member {google.cloud.securitycenter.v1.ICustomConfig|null|undefined} customConfig - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @instance - */ - SecurityHealthAnalyticsCustomModule.prototype.customConfig = null; - - /** - * Creates a new SecurityHealthAnalyticsCustomModule instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} SecurityHealthAnalyticsCustomModule instance - */ - SecurityHealthAnalyticsCustomModule.create = function create(properties) { - return new SecurityHealthAnalyticsCustomModule(properties); - }; - - /** - * Encodes the specified SecurityHealthAnalyticsCustomModule message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule} message SecurityHealthAnalyticsCustomModule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityHealthAnalyticsCustomModule.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.enablementState != null && Object.hasOwnProperty.call(message, "enablementState")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.enablementState); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.lastEditor != null && Object.hasOwnProperty.call(message, "lastEditor")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastEditor); - if (message.ancestorModule != null && Object.hasOwnProperty.call(message, "ancestorModule")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.ancestorModule); - if (message.customConfig != null && Object.hasOwnProperty.call(message, "customConfig")) - $root.google.cloud.securitycenter.v1.CustomConfig.encode(message.customConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SecurityHealthAnalyticsCustomModule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule} message SecurityHealthAnalyticsCustomModule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityHealthAnalyticsCustomModule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityHealthAnalyticsCustomModule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} SecurityHealthAnalyticsCustomModule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityHealthAnalyticsCustomModule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 4: { - message.enablementState = reader.int32(); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.lastEditor = reader.string(); - break; - } - case 7: { - message.ancestorModule = reader.string(); - break; - } - case 8: { - message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityHealthAnalyticsCustomModule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} SecurityHealthAnalyticsCustomModule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityHealthAnalyticsCustomModule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityHealthAnalyticsCustomModule message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityHealthAnalyticsCustomModule.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.enablementState != null && message.hasOwnProperty("enablementState")) - switch (message.enablementState) { - default: - return "enablementState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.lastEditor != null && message.hasOwnProperty("lastEditor")) - if (!$util.isString(message.lastEditor)) - return "lastEditor: string expected"; - if (message.ancestorModule != null && message.hasOwnProperty("ancestorModule")) - if (!$util.isString(message.ancestorModule)) - return "ancestorModule: string expected"; - if (message.customConfig != null && message.hasOwnProperty("customConfig")) { - var error = $root.google.cloud.securitycenter.v1.CustomConfig.verify(message.customConfig); - if (error) - return "customConfig." + error; - } - return null; - }; - - /** - * Creates a SecurityHealthAnalyticsCustomModule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} SecurityHealthAnalyticsCustomModule - */ - SecurityHealthAnalyticsCustomModule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) - return object; - var message = new $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.enablementState) { - default: - if (typeof object.enablementState === "number") { - message.enablementState = object.enablementState; - break; - } - break; - case "ENABLEMENT_STATE_UNSPECIFIED": - case 0: - message.enablementState = 0; - break; - case "ENABLED": - case 1: - message.enablementState = 1; - break; - case "DISABLED": - case 2: - message.enablementState = 2; - break; - case "INHERITED": - case 3: - message.enablementState = 3; - break; - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.lastEditor != null) - message.lastEditor = String(object.lastEditor); - if (object.ancestorModule != null) - message.ancestorModule = String(object.ancestorModule); - if (object.customConfig != null) { - if (typeof object.customConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.customConfig: object expected"); - message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.fromObject(object.customConfig); - } - return message; - }; - - /** - * Creates a plain object from a SecurityHealthAnalyticsCustomModule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} message SecurityHealthAnalyticsCustomModule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityHealthAnalyticsCustomModule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.enablementState = options.enums === String ? "ENABLEMENT_STATE_UNSPECIFIED" : 0; - object.updateTime = null; - object.lastEditor = ""; - object.ancestorModule = ""; - object.customConfig = 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.enablementState != null && message.hasOwnProperty("enablementState")) - object.enablementState = options.enums === String ? $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState[message.enablementState] === undefined ? message.enablementState : $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState[message.enablementState] : message.enablementState; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.lastEditor != null && message.hasOwnProperty("lastEditor")) - object.lastEditor = message.lastEditor; - if (message.ancestorModule != null && message.hasOwnProperty("ancestorModule")) - object.ancestorModule = message.ancestorModule; - if (message.customConfig != null && message.hasOwnProperty("customConfig")) - object.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.toObject(message.customConfig, options); - return object; - }; - - /** - * Converts this SecurityHealthAnalyticsCustomModule to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @instance - * @returns {Object.} JSON object - */ - SecurityHealthAnalyticsCustomModule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityHealthAnalyticsCustomModule - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecurityHealthAnalyticsCustomModule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule"; - }; - - /** - * EnablementState enum. - * @name google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.EnablementState - * @enum {number} - * @property {number} ENABLEMENT_STATE_UNSPECIFIED=0 ENABLEMENT_STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - * @property {number} INHERITED=3 INHERITED value - */ - SecurityHealthAnalyticsCustomModule.EnablementState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENABLEMENT_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - values[valuesById[3] = "INHERITED"] = 3; - return values; - })(); - - return SecurityHealthAnalyticsCustomModule; - })(); - - 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|createSecurityHealthAnalyticsCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateSecurityHealthAnalyticsCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} [response] SecurityHealthAnalyticsCustomModule - */ - - /** - * Calls CreateSecurityHealthAnalyticsCustomModule. - * @function createSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest} request CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.createSecurityHealthAnalyticsCustomModule = function createSecurityHealthAnalyticsCustomModule(request, callback) { - return this.rpcCall(createSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule, request, callback); - }, "name", { value: "CreateSecurityHealthAnalyticsCustomModule" }); - - /** - * Calls CreateSecurityHealthAnalyticsCustomModule. - * @function createSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest} request CreateSecurityHealthAnalyticsCustomModuleRequest 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|deleteSecurityHealthAnalyticsCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef DeleteSecurityHealthAnalyticsCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSecurityHealthAnalyticsCustomModule. - * @function deleteSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest} request DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.deleteSecurityHealthAnalyticsCustomModule = function deleteSecurityHealthAnalyticsCustomModule(request, callback) { - return this.rpcCall(deleteSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSecurityHealthAnalyticsCustomModule" }); - - /** - * Calls DeleteSecurityHealthAnalyticsCustomModule. - * @function deleteSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest} request DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSimulation}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetSimulationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Simulation} [response] Simulation - */ - - /** - * Calls GetSimulation. - * @function getSimulation - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSimulationRequest} request GetSimulationRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSimulationCallback} callback Node-style callback called with the error, if any, and Simulation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getSimulation = function getSimulation(request, callback) { - return this.rpcCall(getSimulation, $root.google.cloud.securitycenter.v1.GetSimulationRequest, $root.google.cloud.securitycenter.v1.Simulation, request, callback); - }, "name", { value: "GetSimulation" }); - - /** - * Calls GetSimulation. - * @function getSimulation - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSimulationRequest} request GetSimulationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getValuedResource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetValuedResourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ValuedResource} [response] ValuedResource - */ - - /** - * Calls GetValuedResource. - * @function getValuedResource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest} request GetValuedResourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetValuedResourceCallback} callback Node-style callback called with the error, if any, and ValuedResource - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getValuedResource = function getValuedResource(request, callback) { - return this.rpcCall(getValuedResource, $root.google.cloud.securitycenter.v1.GetValuedResourceRequest, $root.google.cloud.securitycenter.v1.ValuedResource, request, callback); - }, "name", { value: "GetValuedResource" }); - - /** - * Calls GetValuedResource. - * @function getValuedResource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest} request GetValuedResourceRequest message or plain object - * @returns {Promise} Promise - * @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 - * @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|getEffectiveSecurityHealthAnalyticsCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetEffectiveSecurityHealthAnalyticsCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule} [response] EffectiveSecurityHealthAnalyticsCustomModule - */ - - /** - * Calls GetEffectiveSecurityHealthAnalyticsCustomModule. - * @function getEffectiveSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest} request GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and EffectiveSecurityHealthAnalyticsCustomModule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getEffectiveSecurityHealthAnalyticsCustomModule = function getEffectiveSecurityHealthAnalyticsCustomModule(request, callback) { - return this.rpcCall(getEffectiveSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule, request, callback); - }, "name", { value: "GetEffectiveSecurityHealthAnalyticsCustomModule" }); - - /** - * Calls GetEffectiveSecurityHealthAnalyticsCustomModule. - * @function getEffectiveSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest} request GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSecurityHealthAnalyticsCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetSecurityHealthAnalyticsCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} [response] SecurityHealthAnalyticsCustomModule - */ - - /** - * Calls GetSecurityHealthAnalyticsCustomModule. - * @function getSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest} request GetSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getSecurityHealthAnalyticsCustomModule = function getSecurityHealthAnalyticsCustomModule(request, callback) { - return this.rpcCall(getSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule, request, callback); - }, "name", { value: "GetSecurityHealthAnalyticsCustomModule" }); - - /** - * Calls GetSecurityHealthAnalyticsCustomModule. - * @function getSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest} request GetSecurityHealthAnalyticsCustomModuleRequest 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|listDescendantSecurityHealthAnalyticsCustomModules}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListDescendantSecurityHealthAnalyticsCustomModulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} [response] ListDescendantSecurityHealthAnalyticsCustomModulesResponse - */ - - /** - * Calls ListDescendantSecurityHealthAnalyticsCustomModules. - * @function listDescendantSecurityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest} request ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModulesCallback} callback Node-style callback called with the error, if any, and ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listDescendantSecurityHealthAnalyticsCustomModules = function listDescendantSecurityHealthAnalyticsCustomModules(request, callback) { - return this.rpcCall(listDescendantSecurityHealthAnalyticsCustomModules, $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse, request, callback); - }, "name", { value: "ListDescendantSecurityHealthAnalyticsCustomModules" }); - - /** - * Calls ListDescendantSecurityHealthAnalyticsCustomModules. - * @function listDescendantSecurityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest} request ListDescendantSecurityHealthAnalyticsCustomModulesRequest 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|listEffectiveSecurityHealthAnalyticsCustomModules}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListEffectiveSecurityHealthAnalyticsCustomModulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} [response] ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - */ - - /** - * Calls ListEffectiveSecurityHealthAnalyticsCustomModules. - * @function listEffectiveSecurityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest} request ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModulesCallback} callback Node-style callback called with the error, if any, and ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listEffectiveSecurityHealthAnalyticsCustomModules = function listEffectiveSecurityHealthAnalyticsCustomModules(request, callback) { - return this.rpcCall(listEffectiveSecurityHealthAnalyticsCustomModules, $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, request, callback); - }, "name", { value: "ListEffectiveSecurityHealthAnalyticsCustomModules" }); - - /** - * Calls ListEffectiveSecurityHealthAnalyticsCustomModules. - * @function listEffectiveSecurityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest} request ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listSecurityHealthAnalyticsCustomModules}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListSecurityHealthAnalyticsCustomModulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} [response] ListSecurityHealthAnalyticsCustomModulesResponse - */ - - /** - * Calls ListSecurityHealthAnalyticsCustomModules. - * @function listSecurityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest} request ListSecurityHealthAnalyticsCustomModulesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModulesCallback} callback Node-style callback called with the error, if any, and ListSecurityHealthAnalyticsCustomModulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listSecurityHealthAnalyticsCustomModules = function listSecurityHealthAnalyticsCustomModules(request, callback) { - return this.rpcCall(listSecurityHealthAnalyticsCustomModules, $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse, request, callback); - }, "name", { value: "ListSecurityHealthAnalyticsCustomModules" }); - - /** - * Calls ListSecurityHealthAnalyticsCustomModules. - * @function listSecurityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest} request ListSecurityHealthAnalyticsCustomModulesRequest 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|simulateSecurityHealthAnalyticsCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SimulateSecurityHealthAnalyticsCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} [response] SimulateSecurityHealthAnalyticsCustomModuleResponse - */ - - /** - * Calls SimulateSecurityHealthAnalyticsCustomModule. - * @function simulateSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest} request SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and SimulateSecurityHealthAnalyticsCustomModuleResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.simulateSecurityHealthAnalyticsCustomModule = function simulateSecurityHealthAnalyticsCustomModule(request, callback) { - return this.rpcCall(simulateSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse, request, callback); - }, "name", { value: "SimulateSecurityHealthAnalyticsCustomModule" }); - - /** - * Calls SimulateSecurityHealthAnalyticsCustomModule. - * @function simulateSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest} request SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @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 - * @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|updateSecurityHealthAnalyticsCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSecurityHealthAnalyticsCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} [response] SecurityHealthAnalyticsCustomModule - */ - - /** - * Calls UpdateSecurityHealthAnalyticsCustomModule. - * @function updateSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest} request UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModuleCallback} callback Node-style callback called with the error, if any, and SecurityHealthAnalyticsCustomModule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateSecurityHealthAnalyticsCustomModule = function updateSecurityHealthAnalyticsCustomModule(request, callback) { - return this.rpcCall(updateSecurityHealthAnalyticsCustomModule, $root.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest, $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule, request, callback); - }, "name", { value: "UpdateSecurityHealthAnalyticsCustomModule" }); - - /** - * Calls UpdateSecurityHealthAnalyticsCustomModule. - * @function updateSecurityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest} request UpdateSecurityHealthAnalyticsCustomModuleRequest 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 - */ - - /** - * 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 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createEventThreatDetectionCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateEventThreatDetectionCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} [response] EventThreatDetectionCustomModule - */ - - /** - * Calls CreateEventThreatDetectionCustomModule. - * @function createEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest} request CreateEventThreatDetectionCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.createEventThreatDetectionCustomModule = function createEventThreatDetectionCustomModule(request, callback) { - return this.rpcCall(createEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule, request, callback); - }, "name", { value: "CreateEventThreatDetectionCustomModule" }); - - /** - * Calls CreateEventThreatDetectionCustomModule. - * @function createEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest} request CreateEventThreatDetectionCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteEventThreatDetectionCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef DeleteEventThreatDetectionCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteEventThreatDetectionCustomModule. - * @function deleteEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest} request DeleteEventThreatDetectionCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.deleteEventThreatDetectionCustomModule = function deleteEventThreatDetectionCustomModule(request, callback) { - return this.rpcCall(deleteEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteEventThreatDetectionCustomModule" }); - - /** - * Calls DeleteEventThreatDetectionCustomModule. - * @function deleteEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest} request DeleteEventThreatDetectionCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getEventThreatDetectionCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetEventThreatDetectionCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} [response] EventThreatDetectionCustomModule - */ - - /** - * Calls GetEventThreatDetectionCustomModule. - * @function getEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest} request GetEventThreatDetectionCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getEventThreatDetectionCustomModule = function getEventThreatDetectionCustomModule(request, callback) { - return this.rpcCall(getEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule, request, callback); - }, "name", { value: "GetEventThreatDetectionCustomModule" }); - - /** - * Calls GetEventThreatDetectionCustomModule. - * @function getEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest} request GetEventThreatDetectionCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listDescendantEventThreatDetectionCustomModules}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListDescendantEventThreatDetectionCustomModulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} [response] ListDescendantEventThreatDetectionCustomModulesResponse - */ - - /** - * Calls ListDescendantEventThreatDetectionCustomModules. - * @function listDescendantEventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest} request ListDescendantEventThreatDetectionCustomModulesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModulesCallback} callback Node-style callback called with the error, if any, and ListDescendantEventThreatDetectionCustomModulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listDescendantEventThreatDetectionCustomModules = function listDescendantEventThreatDetectionCustomModules(request, callback) { - return this.rpcCall(listDescendantEventThreatDetectionCustomModules, $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse, request, callback); - }, "name", { value: "ListDescendantEventThreatDetectionCustomModules" }); - - /** - * Calls ListDescendantEventThreatDetectionCustomModules. - * @function listDescendantEventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest} request ListDescendantEventThreatDetectionCustomModulesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listEventThreatDetectionCustomModules}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListEventThreatDetectionCustomModulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} [response] ListEventThreatDetectionCustomModulesResponse - */ - - /** - * Calls ListEventThreatDetectionCustomModules. - * @function listEventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest} request ListEventThreatDetectionCustomModulesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModulesCallback} callback Node-style callback called with the error, if any, and ListEventThreatDetectionCustomModulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listEventThreatDetectionCustomModules = function listEventThreatDetectionCustomModules(request, callback) { - return this.rpcCall(listEventThreatDetectionCustomModules, $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse, request, callback); - }, "name", { value: "ListEventThreatDetectionCustomModules" }); - - /** - * Calls ListEventThreatDetectionCustomModules. - * @function listEventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest} request ListEventThreatDetectionCustomModulesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateEventThreatDetectionCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateEventThreatDetectionCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} [response] EventThreatDetectionCustomModule - */ - - /** - * Calls UpdateEventThreatDetectionCustomModule. - * @function updateEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest} request UpdateEventThreatDetectionCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and EventThreatDetectionCustomModule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateEventThreatDetectionCustomModule = function updateEventThreatDetectionCustomModule(request, callback) { - return this.rpcCall(updateEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule, request, callback); - }, "name", { value: "UpdateEventThreatDetectionCustomModule" }); - - /** - * Calls UpdateEventThreatDetectionCustomModule. - * @function updateEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest} request UpdateEventThreatDetectionCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|validateEventThreatDetectionCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ValidateEventThreatDetectionCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} [response] ValidateEventThreatDetectionCustomModuleResponse - */ - - /** - * Calls ValidateEventThreatDetectionCustomModule. - * @function validateEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest} request ValidateEventThreatDetectionCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and ValidateEventThreatDetectionCustomModuleResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.validateEventThreatDetectionCustomModule = function validateEventThreatDetectionCustomModule(request, callback) { - return this.rpcCall(validateEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse, request, callback); - }, "name", { value: "ValidateEventThreatDetectionCustomModule" }); - - /** - * Calls ValidateEventThreatDetectionCustomModule. - * @function validateEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest} request ValidateEventThreatDetectionCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getEffectiveEventThreatDetectionCustomModule}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetEffectiveEventThreatDetectionCustomModuleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule} [response] EffectiveEventThreatDetectionCustomModule - */ - - /** - * Calls GetEffectiveEventThreatDetectionCustomModule. - * @function getEffectiveEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest} request GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModuleCallback} callback Node-style callback called with the error, if any, and EffectiveEventThreatDetectionCustomModule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getEffectiveEventThreatDetectionCustomModule = function getEffectiveEventThreatDetectionCustomModule(request, callback) { - return this.rpcCall(getEffectiveEventThreatDetectionCustomModule, $root.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest, $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule, request, callback); - }, "name", { value: "GetEffectiveEventThreatDetectionCustomModule" }); - - /** - * Calls GetEffectiveEventThreatDetectionCustomModule. - * @function getEffectiveEventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest} request GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listEffectiveEventThreatDetectionCustomModules}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListEffectiveEventThreatDetectionCustomModulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} [response] ListEffectiveEventThreatDetectionCustomModulesResponse - */ - - /** - * Calls ListEffectiveEventThreatDetectionCustomModules. - * @function listEffectiveEventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest} request ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModulesCallback} callback Node-style callback called with the error, if any, and ListEffectiveEventThreatDetectionCustomModulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listEffectiveEventThreatDetectionCustomModules = function listEffectiveEventThreatDetectionCustomModules(request, callback) { - return this.rpcCall(listEffectiveEventThreatDetectionCustomModules, $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest, $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse, request, callback); - }, "name", { value: "ListEffectiveEventThreatDetectionCustomModules" }); - - /** - * Calls ListEffectiveEventThreatDetectionCustomModules. - * @function listEffectiveEventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest} request ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|batchCreateResourceValueConfigs}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef BatchCreateResourceValueConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} [response] BatchCreateResourceValueConfigsResponse - */ - - /** - * Calls BatchCreateResourceValueConfigs. - * @function batchCreateResourceValueConfigs - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest} request BatchCreateResourceValueConfigsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigsCallback} callback Node-style callback called with the error, if any, and BatchCreateResourceValueConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.batchCreateResourceValueConfigs = function batchCreateResourceValueConfigs(request, callback) { - return this.rpcCall(batchCreateResourceValueConfigs, $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest, $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse, request, callback); - }, "name", { value: "BatchCreateResourceValueConfigs" }); - - /** - * Calls BatchCreateResourceValueConfigs. - * @function batchCreateResourceValueConfigs - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest} request BatchCreateResourceValueConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteResourceValueConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef DeleteResourceValueConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteResourceValueConfig. - * @function deleteResourceValueConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest} request DeleteResourceValueConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.deleteResourceValueConfig = function deleteResourceValueConfig(request, callback) { - return this.rpcCall(deleteResourceValueConfig, $root.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteResourceValueConfig" }); - - /** - * Calls DeleteResourceValueConfig. - * @function deleteResourceValueConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest} request DeleteResourceValueConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getResourceValueConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetResourceValueConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ResourceValueConfig} [response] ResourceValueConfig - */ - - /** - * Calls GetResourceValueConfig. - * @function getResourceValueConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest} request GetResourceValueConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfigCallback} callback Node-style callback called with the error, if any, and ResourceValueConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getResourceValueConfig = function getResourceValueConfig(request, callback) { - return this.rpcCall(getResourceValueConfig, $root.google.cloud.securitycenter.v1.GetResourceValueConfigRequest, $root.google.cloud.securitycenter.v1.ResourceValueConfig, request, callback); - }, "name", { value: "GetResourceValueConfig" }); - - /** - * Calls GetResourceValueConfig. - * @function getResourceValueConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest} request GetResourceValueConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listResourceValueConfigs}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListResourceValueConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} [response] ListResourceValueConfigsResponse - */ - - /** - * Calls ListResourceValueConfigs. - * @function listResourceValueConfigs - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest} request ListResourceValueConfigsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigsCallback} callback Node-style callback called with the error, if any, and ListResourceValueConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listResourceValueConfigs = function listResourceValueConfigs(request, callback) { - return this.rpcCall(listResourceValueConfigs, $root.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest, $root.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse, request, callback); - }, "name", { value: "ListResourceValueConfigs" }); - - /** - * Calls ListResourceValueConfigs. - * @function listResourceValueConfigs - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest} request ListResourceValueConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateResourceValueConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateResourceValueConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ResourceValueConfig} [response] ResourceValueConfig - */ - - /** - * Calls UpdateResourceValueConfig. - * @function updateResourceValueConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest} request UpdateResourceValueConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfigCallback} callback Node-style callback called with the error, if any, and ResourceValueConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateResourceValueConfig = function updateResourceValueConfig(request, callback) { - return this.rpcCall(updateResourceValueConfig, $root.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest, $root.google.cloud.securitycenter.v1.ResourceValueConfig, request, callback); - }, "name", { value: "UpdateResourceValueConfig" }); - - /** - * Calls UpdateResourceValueConfig. - * @function updateResourceValueConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest} request UpdateResourceValueConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listValuedResources}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListValuedResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListValuedResourcesResponse} [response] ListValuedResourcesResponse - */ - - /** - * Calls ListValuedResources. - * @function listValuedResources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest} request ListValuedResourcesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListValuedResourcesCallback} callback Node-style callback called with the error, if any, and ListValuedResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listValuedResources = function listValuedResources(request, callback) { - return this.rpcCall(listValuedResources, $root.google.cloud.securitycenter.v1.ListValuedResourcesRequest, $root.google.cloud.securitycenter.v1.ListValuedResourcesResponse, request, callback); - }, "name", { value: "ListValuedResources" }); - - /** - * Calls ListValuedResources. - * @function listValuedResources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest} request ListValuedResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listAttackPaths}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListAttackPathsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListAttackPathsResponse} [response] ListAttackPathsResponse - */ - - /** - * Calls ListAttackPaths. - * @function listAttackPaths - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest} request ListAttackPathsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAttackPathsCallback} callback Node-style callback called with the error, if any, and ListAttackPathsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listAttackPaths = function listAttackPaths(request, callback) { - return this.rpcCall(listAttackPaths, $root.google.cloud.securitycenter.v1.ListAttackPathsRequest, $root.google.cloud.securitycenter.v1.ListAttackPathsResponse, request, callback); - }, "name", { value: "ListAttackPaths" }); - - /** - * Calls ListAttackPaths. - * @function listAttackPaths - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest} request ListAttackPathsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SecurityCenter; - })(); - - v1.BulkMuteFindingsRequest = (function() { - - /** - * Properties of a BulkMuteFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IBulkMuteFindingsRequest - * @property {string|null} [parent] BulkMuteFindingsRequest parent - * @property {string|null} [filter] BulkMuteFindingsRequest filter - * @property {string|null} [muteAnnotation] BulkMuteFindingsRequest muteAnnotation - * @property {google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState|null} [muteState] BulkMuteFindingsRequest muteState - */ - - /** - * Constructs a new BulkMuteFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a BulkMuteFindingsRequest. - * @implements IBulkMuteFindingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set - */ - function BulkMuteFindingsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BulkMuteFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest - * @instance - */ - BulkMuteFindingsRequest.prototype.parent = ""; - - /** - * BulkMuteFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest - * @instance - */ - BulkMuteFindingsRequest.prototype.filter = ""; - - /** - * BulkMuteFindingsRequest muteAnnotation. - * @member {string} muteAnnotation - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest - * @instance - */ - BulkMuteFindingsRequest.prototype.muteAnnotation = ""; - - /** - * BulkMuteFindingsRequest muteState. - * @member {google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState} muteState - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest - * @instance - */ - BulkMuteFindingsRequest.prototype.muteState = 0; - - /** - * Creates a new BulkMuteFindingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest instance - */ - BulkMuteFindingsRequest.create = function create(properties) { - return new BulkMuteFindingsRequest(properties); - }; - - /** - * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. - * @function encode - * @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.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.muteAnnotation != null && Object.hasOwnProperty.call(message, "muteAnnotation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.muteAnnotation); - if (message.muteState != null && Object.hasOwnProperty.call(message, "muteState")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.muteState); - return writer; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 4: { - message.muteState = reader.int32(); - 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"; - if (message.muteState != null && message.hasOwnProperty("muteState")) - switch (message.muteState) { - default: - return "muteState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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); - switch (object.muteState) { - default: - if (typeof object.muteState === "number") { - message.muteState = object.muteState; - break; - } - break; - case "MUTE_STATE_UNSPECIFIED": - case 0: - message.muteState = 0; - break; - case "MUTED": - case 1: - message.muteState = 1; - break; - case "UNDEFINED": - case 2: - message.muteState = 2; - break; - } - 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 = ""; - object.muteState = options.enums === String ? "MUTE_STATE_UNSPECIFIED" : 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.muteAnnotation != null && message.hasOwnProperty("muteAnnotation")) - object.muteAnnotation = message.muteAnnotation; - if (message.muteState != null && message.hasOwnProperty("muteState")) - object.muteState = options.enums === String ? $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState[message.muteState] === undefined ? message.muteState : $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState[message.muteState] : message.muteState; - 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); - }; - - /** - * 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"; - }; - - /** - * MuteState enum. - * @name google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState - * @enum {number} - * @property {number} MUTE_STATE_UNSPECIFIED=0 MUTE_STATE_UNSPECIFIED value - * @property {number} MUTED=1 MUTED value - * @property {number} UNDEFINED=2 UNDEFINED value - */ - BulkMuteFindingsRequest.MuteState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MUTE_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MUTED"] = 1; - values[valuesById[2] = "UNDEFINED"] = 2; - return values; - })(); - - 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.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.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. - * @function decode - * @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.BulkMuteFindingsResponse} BulkMuteFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BulkMuteFindingsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - BulkMuteFindingsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BulkMuteFindingsResponse message. - * @function verify - * @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 - */ - BulkMuteFindingsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse - */ - BulkMuteFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse) - return object; - return new $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse(); - }; - - /** - * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} message BulkMuteFindingsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BulkMuteFindingsResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this BulkMuteFindingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse - * @instance - * @returns {Object.} JSON object - */ - BulkMuteFindingsResponse.prototype.toJSON = function toJSON() { - 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; - })(); - - 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 && 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.CreateMuteConfigRequest = (function() { - - /** - * 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 - */ - - /** - * 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 - */ - 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]]; - } - - /** - * CreateMuteConfigRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest - * @instance - */ - CreateMuteConfigRequest.prototype.parent = ""; - - /** - * CreateMuteConfigRequest muteConfig. - * @member {google.cloud.securitycenter.v1.IMuteConfig|null|undefined} muteConfig - * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest - * @instance - */ - CreateMuteConfigRequest.prototype.muteConfig = null; - - /** - * CreateMuteConfigRequest muteConfigId. - * @member {string} muteConfigId - * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest - * @instance - */ - CreateMuteConfigRequest.prototype.muteConfigId = ""; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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 - */ - CreateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * Converts this CreateMuteConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest - * @instance - * @returns {Object.} JSON object - */ - CreateMuteConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.CreateResourceValueConfigRequest = (function() { - - /** - * Properties of a CreateResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ICreateResourceValueConfigRequest - * @property {string|null} [parent] CreateResourceValueConfigRequest parent - * @property {google.cloud.securitycenter.v1.IResourceValueConfig|null} [resourceValueConfig] CreateResourceValueConfigRequest resourceValueConfig - */ - - /** - * Constructs a new CreateResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateResourceValueConfigRequest. - * @implements ICreateResourceValueConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest=} [properties] Properties to set - */ - function CreateResourceValueConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateResourceValueConfigRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @instance - */ - CreateResourceValueConfigRequest.prototype.parent = ""; - - /** - * CreateResourceValueConfigRequest resourceValueConfig. - * @member {google.cloud.securitycenter.v1.IResourceValueConfig|null|undefined} resourceValueConfig - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @instance - */ - CreateResourceValueConfigRequest.prototype.resourceValueConfig = null; - - /** - * Creates a new CreateResourceValueConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest instance - */ - CreateResourceValueConfigRequest.create = function create(properties) { - return new CreateResourceValueConfigRequest(properties); - }; - - /** - * Encodes the specified CreateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest} message CreateResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateResourceValueConfigRequest.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.resourceValueConfig != null && Object.hasOwnProperty.call(message, "resourceValueConfig")) - $root.google.cloud.securitycenter.v1.ResourceValueConfig.encode(message.resourceValueConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateResourceValueConfigRequest} message CreateResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateResourceValueConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateResourceValueConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateResourceValueConfigRequest.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.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) { - var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.verify(message.resourceValueConfig); - if (error) - return "resourceValueConfig." + error; - } - return null; - }; - - /** - * Creates a CreateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest - */ - CreateResourceValueConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceValueConfig != null) { - if (typeof object.resourceValueConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.resourceValueConfig: object expected"); - message.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.fromObject(object.resourceValueConfig); - } - return message; - }; - - /** - * Creates a plain object from a CreateResourceValueConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.CreateResourceValueConfigRequest} message CreateResourceValueConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateResourceValueConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.resourceValueConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) - object.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.toObject(message.resourceValueConfig, options); - return object; - }; - - /** - * Converts this CreateResourceValueConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @instance - * @returns {Object.} JSON object - */ - CreateResourceValueConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateResourceValueConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CreateResourceValueConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateResourceValueConfigRequest"; - }; - - return CreateResourceValueConfigRequest; - })(); - - v1.BatchCreateResourceValueConfigsRequest = (function() { - - /** - * Properties of a BatchCreateResourceValueConfigsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IBatchCreateResourceValueConfigsRequest - * @property {string|null} [parent] BatchCreateResourceValueConfigsRequest parent - * @property {Array.|null} [requests] BatchCreateResourceValueConfigsRequest requests - */ - - /** - * Constructs a new BatchCreateResourceValueConfigsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a BatchCreateResourceValueConfigsRequest. - * @implements IBatchCreateResourceValueConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest=} [properties] Properties to set - */ - function BatchCreateResourceValueConfigsRequest(properties) { - this.requests = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateResourceValueConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @instance - */ - BatchCreateResourceValueConfigsRequest.prototype.parent = ""; - - /** - * BatchCreateResourceValueConfigsRequest requests. - * @member {Array.} requests - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @instance - */ - BatchCreateResourceValueConfigsRequest.prototype.requests = $util.emptyArray; - - /** - * Creates a new BatchCreateResourceValueConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest instance - */ - BatchCreateResourceValueConfigsRequest.create = function create(properties) { - return new BatchCreateResourceValueConfigsRequest(properties); - }; - - /** - * Encodes the specified BatchCreateResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateResourceValueConfigsRequest.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.requests != null && message.requests.length) - for (var i = 0; i < message.requests.length; ++i) - $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateResourceValueConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateResourceValueConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - if (!(message.requests && message.requests.length)) - message.requests = []; - message.requests.push($root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateResourceValueConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateResourceValueConfigsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateResourceValueConfigsRequest.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.requests != null && message.hasOwnProperty("requests")) { - if (!Array.isArray(message.requests)) - return "requests: array expected"; - for (var i = 0; i < message.requests.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.verify(message.requests[i]); - if (error) - return "requests." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest - */ - BatchCreateResourceValueConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests) { - if (!Array.isArray(object.requests)) - throw TypeError(".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.requests: array expected"); - message.requests = []; - for (var i = 0; i < object.requests.length; ++i) { - if (typeof object.requests[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest.requests: object expected"); - message.requests[i] = $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.fromObject(object.requests[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateResourceValueConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateResourceValueConfigsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.requests = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests && message.requests.length) { - object.requests = []; - for (var j = 0; j < message.requests.length; ++j) - object.requests[j] = $root.google.cloud.securitycenter.v1.CreateResourceValueConfigRequest.toObject(message.requests[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateResourceValueConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchCreateResourceValueConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateResourceValueConfigsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateResourceValueConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest"; - }; - - return BatchCreateResourceValueConfigsRequest; - })(); - - v1.BatchCreateResourceValueConfigsResponse = (function() { - - /** - * Properties of a BatchCreateResourceValueConfigsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IBatchCreateResourceValueConfigsResponse - * @property {Array.|null} [resourceValueConfigs] BatchCreateResourceValueConfigsResponse resourceValueConfigs - */ - - /** - * Constructs a new BatchCreateResourceValueConfigsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a BatchCreateResourceValueConfigsResponse. - * @implements IBatchCreateResourceValueConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse=} [properties] Properties to set - */ - function BatchCreateResourceValueConfigsResponse(properties) { - this.resourceValueConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateResourceValueConfigsResponse resourceValueConfigs. - * @member {Array.} resourceValueConfigs - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @instance - */ - BatchCreateResourceValueConfigsResponse.prototype.resourceValueConfigs = $util.emptyArray; - - /** - * Creates a new BatchCreateResourceValueConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse instance - */ - BatchCreateResourceValueConfigsResponse.create = function create(properties) { - return new BatchCreateResourceValueConfigsResponse(properties); - }; - - /** - * Encodes the specified BatchCreateResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateResourceValueConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceValueConfigs != null && message.resourceValueConfigs.length) - for (var i = 0; i < message.resourceValueConfigs.length; ++i) - $root.google.cloud.securitycenter.v1.ResourceValueConfig.encode(message.resourceValueConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateResourceValueConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateResourceValueConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.resourceValueConfigs && message.resourceValueConfigs.length)) - message.resourceValueConfigs = []; - message.resourceValueConfigs.push($root.google.cloud.securitycenter.v1.ResourceValueConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateResourceValueConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateResourceValueConfigsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateResourceValueConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceValueConfigs != null && message.hasOwnProperty("resourceValueConfigs")) { - if (!Array.isArray(message.resourceValueConfigs)) - return "resourceValueConfigs: array expected"; - for (var i = 0; i < message.resourceValueConfigs.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.verify(message.resourceValueConfigs[i]); - if (error) - return "resourceValueConfigs." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse - */ - BatchCreateResourceValueConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse(); - if (object.resourceValueConfigs) { - if (!Array.isArray(object.resourceValueConfigs)) - throw TypeError(".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.resourceValueConfigs: array expected"); - message.resourceValueConfigs = []; - for (var i = 0; i < object.resourceValueConfigs.length; ++i) { - if (typeof object.resourceValueConfigs[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse.resourceValueConfigs: object expected"); - message.resourceValueConfigs[i] = $root.google.cloud.securitycenter.v1.ResourceValueConfig.fromObject(object.resourceValueConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateResourceValueConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateResourceValueConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceValueConfigs = []; - if (message.resourceValueConfigs && message.resourceValueConfigs.length) { - object.resourceValueConfigs = []; - for (var j = 0; j < message.resourceValueConfigs.length; ++j) - object.resourceValueConfigs[j] = $root.google.cloud.securitycenter.v1.ResourceValueConfig.toObject(message.resourceValueConfigs[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateResourceValueConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchCreateResourceValueConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateResourceValueConfigsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateResourceValueConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse"; - }; - - return BatchCreateResourceValueConfigsResponse; - })(); - - v1.DeleteResourceValueConfigRequest = (function() { - - /** - * Properties of a DeleteResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IDeleteResourceValueConfigRequest - * @property {string|null} [name] DeleteResourceValueConfigRequest name - */ - - /** - * Constructs a new DeleteResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a DeleteResourceValueConfigRequest. - * @implements IDeleteResourceValueConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest=} [properties] Properties to set - */ - function DeleteResourceValueConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteResourceValueConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @instance - */ - DeleteResourceValueConfigRequest.prototype.name = ""; - - /** - * Creates a new DeleteResourceValueConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest instance - */ - DeleteResourceValueConfigRequest.create = function create(properties) { - return new DeleteResourceValueConfigRequest(properties); - }; - - /** - * Encodes the specified DeleteResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteResourceValueConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteResourceValueConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest - */ - DeleteResourceValueConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteResourceValueConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteResourceValueConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteResourceValueConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest"; - }; - - return DeleteResourceValueConfigRequest; - })(); - - v1.GetResourceValueConfigRequest = (function() { - - /** - * Properties of a GetResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetResourceValueConfigRequest - * @property {string|null} [name] GetResourceValueConfigRequest name - */ - - /** - * Constructs a new GetResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetResourceValueConfigRequest. - * @implements IGetResourceValueConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest=} [properties] Properties to set - */ - function GetResourceValueConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetResourceValueConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @instance - */ - GetResourceValueConfigRequest.prototype.name = ""; - - /** - * Creates a new GetResourceValueConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} GetResourceValueConfigRequest instance - */ - GetResourceValueConfigRequest.create = function create(properties) { - return new GetResourceValueConfigRequest(properties); - }; - - /** - * Encodes the specified GetResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetResourceValueConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest} message GetResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetResourceValueConfigRequest.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 GetResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetResourceValueConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetResourceValueConfigRequest} message GetResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} GetResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetResourceValueConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetResourceValueConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} GetResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetResourceValueConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetResourceValueConfigRequest.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 GetResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} GetResourceValueConfigRequest - */ - GetResourceValueConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetResourceValueConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.GetResourceValueConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetResourceValueConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.GetResourceValueConfigRequest} message GetResourceValueConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetResourceValueConfigRequest.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 GetResourceValueConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetResourceValueConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetResourceValueConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.GetResourceValueConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetResourceValueConfigRequest"; - }; - - return GetResourceValueConfigRequest; - })(); - - v1.ListResourceValueConfigsRequest = (function() { - - /** - * Properties of a ListResourceValueConfigsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListResourceValueConfigsRequest - * @property {string|null} [parent] ListResourceValueConfigsRequest parent - * @property {number|null} [pageSize] ListResourceValueConfigsRequest pageSize - * @property {string|null} [pageToken] ListResourceValueConfigsRequest pageToken - */ - - /** - * Constructs a new ListResourceValueConfigsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListResourceValueConfigsRequest. - * @implements IListResourceValueConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest=} [properties] Properties to set - */ - function ListResourceValueConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceValueConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @instance - */ - ListResourceValueConfigsRequest.prototype.parent = ""; - - /** - * ListResourceValueConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @instance - */ - ListResourceValueConfigsRequest.prototype.pageSize = 0; - - /** - * ListResourceValueConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @instance - */ - ListResourceValueConfigsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListResourceValueConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest instance - */ - ListResourceValueConfigsRequest.create = function create(properties) { - return new ListResourceValueConfigsRequest(properties); - }; - - /** - * Encodes the specified ListResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest} message ListResourceValueConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsRequest} message ListResourceValueConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceValueConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceValueConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListResourceValueConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceValueConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceValueConfigsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest - */ - ListResourceValueConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest(); - 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 ListResourceValueConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.ListResourceValueConfigsRequest} message ListResourceValueConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListResourceValueConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceValueConfigsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceValueConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListResourceValueConfigsRequest"; - }; - - return ListResourceValueConfigsRequest; - })(); - - v1.ListResourceValueConfigsResponse = (function() { - - /** - * Properties of a ListResourceValueConfigsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListResourceValueConfigsResponse - * @property {Array.|null} [resourceValueConfigs] ListResourceValueConfigsResponse resourceValueConfigs - * @property {string|null} [nextPageToken] ListResourceValueConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListResourceValueConfigsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListResourceValueConfigsResponse. - * @implements IListResourceValueConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsResponse=} [properties] Properties to set - */ - function ListResourceValueConfigsResponse(properties) { - this.resourceValueConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceValueConfigsResponse resourceValueConfigs. - * @member {Array.} resourceValueConfigs - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @instance - */ - ListResourceValueConfigsResponse.prototype.resourceValueConfigs = $util.emptyArray; - - /** - * ListResourceValueConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @instance - */ - ListResourceValueConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListResourceValueConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse instance - */ - ListResourceValueConfigsResponse.create = function create(properties) { - return new ListResourceValueConfigsResponse(properties); - }; - - /** - * Encodes the specified ListResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsResponse} message ListResourceValueConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceValueConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceValueConfigs != null && message.resourceValueConfigs.length) - for (var i = 0; i < message.resourceValueConfigs.length; ++i) - $root.google.cloud.securitycenter.v1.ResourceValueConfig.encode(message.resourceValueConfigs[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 ListResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.IListResourceValueConfigsResponse} message ListResourceValueConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceValueConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceValueConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.resourceValueConfigs && message.resourceValueConfigs.length)) - message.resourceValueConfigs = []; - message.resourceValueConfigs.push($root.google.cloud.securitycenter.v1.ResourceValueConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceValueConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceValueConfigsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceValueConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceValueConfigs != null && message.hasOwnProperty("resourceValueConfigs")) { - if (!Array.isArray(message.resourceValueConfigs)) - return "resourceValueConfigs: array expected"; - for (var i = 0; i < message.resourceValueConfigs.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.verify(message.resourceValueConfigs[i]); - if (error) - return "resourceValueConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse - */ - ListResourceValueConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse(); - if (object.resourceValueConfigs) { - if (!Array.isArray(object.resourceValueConfigs)) - throw TypeError(".google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.resourceValueConfigs: array expected"); - message.resourceValueConfigs = []; - for (var i = 0; i < object.resourceValueConfigs.length; ++i) { - if (typeof object.resourceValueConfigs[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListResourceValueConfigsResponse.resourceValueConfigs: object expected"); - message.resourceValueConfigs[i] = $root.google.cloud.securitycenter.v1.ResourceValueConfig.fromObject(object.resourceValueConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListResourceValueConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.ListResourceValueConfigsResponse} message ListResourceValueConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceValueConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceValueConfigs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.resourceValueConfigs && message.resourceValueConfigs.length) { - object.resourceValueConfigs = []; - for (var j = 0; j < message.resourceValueConfigs.length; ++j) - object.resourceValueConfigs[j] = $root.google.cloud.securitycenter.v1.ResourceValueConfig.toObject(message.resourceValueConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListResourceValueConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListResourceValueConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceValueConfigsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListResourceValueConfigsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceValueConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListResourceValueConfigsResponse"; - }; - - return ListResourceValueConfigsResponse; - })(); - - v1.UpdateResourceValueConfigRequest = (function() { - - /** - * Properties of an UpdateResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateResourceValueConfigRequest - * @property {google.cloud.securitycenter.v1.IResourceValueConfig|null} [resourceValueConfig] UpdateResourceValueConfigRequest resourceValueConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateResourceValueConfigRequest updateMask - */ - - /** - * Constructs a new UpdateResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateResourceValueConfigRequest. - * @implements IUpdateResourceValueConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest=} [properties] Properties to set - */ - function UpdateResourceValueConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateResourceValueConfigRequest resourceValueConfig. - * @member {google.cloud.securitycenter.v1.IResourceValueConfig|null|undefined} resourceValueConfig - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @instance - */ - UpdateResourceValueConfigRequest.prototype.resourceValueConfig = null; - - /** - * UpdateResourceValueConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @instance - */ - UpdateResourceValueConfigRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateResourceValueConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest instance - */ - UpdateResourceValueConfigRequest.create = function create(properties) { - return new UpdateResourceValueConfigRequest(properties); - }; - - /** - * Encodes the specified UpdateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateResourceValueConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceValueConfig != null && Object.hasOwnProperty.call(message, "resourceValueConfig")) - $root.google.cloud.securitycenter.v1.ResourceValueConfig.encode(message.resourceValueConfig, 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 UpdateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateResourceValueConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.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 UpdateResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateResourceValueConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateResourceValueConfigRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) { - var error = $root.google.cloud.securitycenter.v1.ResourceValueConfig.verify(message.resourceValueConfig); - if (error) - return "resourceValueConfig." + 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 UpdateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest - */ - UpdateResourceValueConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest(); - if (object.resourceValueConfig != null) { - if (typeof object.resourceValueConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.resourceValueConfig: object expected"); - message.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.fromObject(object.resourceValueConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateResourceValueConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateResourceValueConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resourceValueConfig = null; - object.updateMask = null; - } - if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) - object.resourceValueConfig = $root.google.cloud.securitycenter.v1.ResourceValueConfig.toObject(message.resourceValueConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateResourceValueConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateResourceValueConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateResourceValueConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest"; - }; - - return UpdateResourceValueConfigRequest; - })(); - - 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); - }; - - /** - * 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; - }; - - /** - * 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 - */ - CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * Converts this CreateNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.CreateSecurityHealthAnalyticsCustomModuleRequest = (function() { - - /** - * Properties of a CreateSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ICreateSecurityHealthAnalyticsCustomModuleRequest - * @property {string|null} [parent] CreateSecurityHealthAnalyticsCustomModuleRequest parent - * @property {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null} [securityHealthAnalyticsCustomModule] CreateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule - */ - - /** - * Constructs a new CreateSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateSecurityHealthAnalyticsCustomModuleRequest. - * @implements ICreateSecurityHealthAnalyticsCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - */ - function CreateSecurityHealthAnalyticsCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSecurityHealthAnalyticsCustomModuleRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.prototype.parent = ""; - - /** - * CreateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule. - * @member {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null|undefined} securityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.prototype.securityHealthAnalyticsCustomModule = null; - - /** - * Creates a new CreateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} CreateSecurityHealthAnalyticsCustomModuleRequest instance - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { - return new CreateSecurityHealthAnalyticsCustomModuleRequest(properties); - }; - - /** - * Encodes the specified CreateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest} message CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.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.securityHealthAnalyticsCustomModule != null && Object.hasOwnProperty.call(message, "securityHealthAnalyticsCustomModule")) - $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.encode(message.securityHealthAnalyticsCustomModule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest} message CreateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} CreateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} CreateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSecurityHealthAnalyticsCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.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.securityHealthAnalyticsCustomModule != null && message.hasOwnProperty("securityHealthAnalyticsCustomModule")) { - var error = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify(message.securityHealthAnalyticsCustomModule); - if (error) - return "securityHealthAnalyticsCustomModule." + error; - } - return null; - }; - - /** - * Creates a CreateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} CreateSecurityHealthAnalyticsCustomModuleRequest - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.securityHealthAnalyticsCustomModule != null) { - if (typeof object.securityHealthAnalyticsCustomModule !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest.securityHealthAnalyticsCustomModule: object expected"); - message.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.fromObject(object.securityHealthAnalyticsCustomModule); - } - return message; - }; - - /** - * Creates a plain object from a CreateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest} message CreateSecurityHealthAnalyticsCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.securityHealthAnalyticsCustomModule = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.securityHealthAnalyticsCustomModule != null && message.hasOwnProperty("securityHealthAnalyticsCustomModule")) - object.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.toObject(message.securityHealthAnalyticsCustomModule, options); - return object; - }; - - /** - * Converts this CreateSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSecurityHealthAnalyticsCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest"; - }; - - return CreateSecurityHealthAnalyticsCustomModuleRequest; - })(); - - 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 && 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.DeleteMuteConfigRequest = (function() { - - /** - * Properties of a DeleteMuteConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IDeleteMuteConfigRequest - * @property {string|null} [name] DeleteMuteConfigRequest name - */ - - /** - * 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 - */ - 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]]; - } - - /** - * DeleteMuteConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest - * @instance - */ - DeleteMuteConfigRequest.prototype.name = ""; - - /** - * 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); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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 - */ - DeleteMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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 - */ - 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; - }; - - /** - * Converts this DeleteMuteConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteMuteConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.DeleteNotificationConfigRequest = (function() { - - /** - * Properties of a DeleteNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IDeleteNotificationConfigRequest - * @property {string|null} [name] DeleteNotificationConfigRequest name - */ - - /** - * 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 - */ - 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]]; - } - - /** - * DeleteNotificationConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest - * @instance - */ - DeleteNotificationConfigRequest.prototype.name = ""; - - /** - * 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); - }; - - /** - * 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 - */ - DeleteNotificationConfigRequest.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 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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 - */ - DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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 - */ - 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; - }; - - /** - * Converts this DeleteNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.DeleteSecurityHealthAnalyticsCustomModuleRequest = (function() { - - /** - * Properties of a DeleteSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IDeleteSecurityHealthAnalyticsCustomModuleRequest - * @property {string|null} [name] DeleteSecurityHealthAnalyticsCustomModuleRequest name - */ - - /** - * Constructs a new DeleteSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a DeleteSecurityHealthAnalyticsCustomModuleRequest. - * @implements IDeleteSecurityHealthAnalyticsCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - */ - function DeleteSecurityHealthAnalyticsCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteSecurityHealthAnalyticsCustomModuleRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.prototype.name = ""; - - /** - * Creates a new DeleteSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} DeleteSecurityHealthAnalyticsCustomModuleRequest instance - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { - return new DeleteSecurityHealthAnalyticsCustomModuleRequest(properties); - }; - - /** - * Encodes the specified DeleteSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest} message DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.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 DeleteSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest} message DeleteSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} DeleteSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} DeleteSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSecurityHealthAnalyticsCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.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 DeleteSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} DeleteSecurityHealthAnalyticsCustomModuleRequest - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest} message DeleteSecurityHealthAnalyticsCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.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 DeleteSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSecurityHealthAnalyticsCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest"; - }; - - return DeleteSecurityHealthAnalyticsCustomModuleRequest; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.GetMuteConfigRequest = (function() { - - /** - * Properties of a GetMuteConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetMuteConfigRequest - * @property {string|null} [name] GetMuteConfigRequest name - */ - - /** - * Constructs a new GetMuteConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetMuteConfigRequest. - * @implements IGetMuteConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set - */ - function GetMuteConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetMuteConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest - * @instance - */ - GetMuteConfigRequest.prototype.name = ""; - - /** - * Creates a new GetMuteConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest instance - */ - GetMuteConfigRequest.create = function create(properties) { - return new GetMuteConfigRequest(properties); - }; - - /** - * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest - * @static - * @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 - */ - GetMuteConfigRequest.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 GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest - * @static - * @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 - */ - GetMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetMuteConfigRequest message from the specified reader or buffer. - * @function decode - * @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.GetMuteConfigRequest} GetMuteConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetMuteConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - GetMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetMuteConfigRequest message. - * @function verify - * @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 - */ - GetMuteConfigRequest.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 GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest - */ - GetMuteConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetMuteConfigRequest) - return object; - 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 GetMuteConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v1.GetMuteConfigRequest} message GetMuteConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetMuteConfigRequest.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 GetMuteConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetMuteConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.GetNotificationConfigRequest = (function() { - - /** - * Properties of a GetNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetNotificationConfigRequest - * @property {string|null} [name] GetNotificationConfigRequest name - */ - - /** - * 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 - */ - 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]]; - } - - /** - * GetNotificationConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest - * @instance - */ - GetNotificationConfigRequest.prototype.name = ""; - - /** - * 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); - }; - - /** - * 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 - */ - GetNotificationConfigRequest.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 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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 - */ - GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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 - */ - 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; - }; - - /** - * Converts this GetNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetNotificationConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest = (function() { - - /** - * Properties of a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @property {string|null} [name] GetEffectiveSecurityHealthAnalyticsCustomModuleRequest name - */ - - /** - * Constructs a new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. - * @implements IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - */ - function GetEffectiveSecurityHealthAnalyticsCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEffectiveSecurityHealthAnalyticsCustomModuleRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.prototype.name = ""; - - /** - * Creates a new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} GetEffectiveSecurityHealthAnalyticsCustomModuleRequest instance - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { - return new GetEffectiveSecurityHealthAnalyticsCustomModuleRequest(properties); - }; - - /** - * Encodes the specified GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest} message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest} message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEffectiveSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest"; - }; - - return GetEffectiveSecurityHealthAnalyticsCustomModuleRequest; - })(); - - v1.GetSecurityHealthAnalyticsCustomModuleRequest = (function() { - - /** - * Properties of a GetSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetSecurityHealthAnalyticsCustomModuleRequest - * @property {string|null} [name] GetSecurityHealthAnalyticsCustomModuleRequest name - */ - - /** - * Constructs a new GetSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetSecurityHealthAnalyticsCustomModuleRequest. - * @implements IGetSecurityHealthAnalyticsCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - */ - function GetSecurityHealthAnalyticsCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetSecurityHealthAnalyticsCustomModuleRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - GetSecurityHealthAnalyticsCustomModuleRequest.prototype.name = ""; - - /** - * Creates a new GetSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} GetSecurityHealthAnalyticsCustomModuleRequest instance - */ - GetSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { - return new GetSecurityHealthAnalyticsCustomModuleRequest(properties); - }; - - /** - * Encodes the specified GetSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest} message GetSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSecurityHealthAnalyticsCustomModuleRequest.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 GetSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest} message GetSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} GetSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} GetSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSecurityHealthAnalyticsCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSecurityHealthAnalyticsCustomModuleRequest.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 GetSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} GetSecurityHealthAnalyticsCustomModuleRequest - */ - GetSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest} message GetSecurityHealthAnalyticsCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSecurityHealthAnalyticsCustomModuleRequest.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 GetSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - GetSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSecurityHealthAnalyticsCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest"; - }; - - return GetSecurityHealthAnalyticsCustomModuleRequest; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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); - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - 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); - }; - - /** - * 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; - })(); - - v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest = (function() { - - /** - * Properties of a ListDescendantSecurityHealthAnalyticsCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @property {string|null} [parent] ListDescendantSecurityHealthAnalyticsCustomModulesRequest parent - * @property {number|null} [pageSize] ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageSize - * @property {string|null} [pageToken] ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageToken - */ - - /** - * Constructs a new ListDescendantSecurityHealthAnalyticsCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListDescendantSecurityHealthAnalyticsCustomModulesRequest. - * @implements IListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set - */ - function ListDescendantSecurityHealthAnalyticsCustomModulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDescendantSecurityHealthAnalyticsCustomModulesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.prototype.parent = ""; - - /** - * ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.prototype.pageSize = 0; - - /** - * ListDescendantSecurityHealthAnalyticsCustomModulesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDescendantSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} ListDescendantSecurityHealthAnalyticsCustomModulesRequest instance - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.create = function create(properties) { - return new ListDescendantSecurityHealthAnalyticsCustomModulesRequest(properties); - }; - - /** - * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest} message ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest} message ListDescendantSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} ListDescendantSecurityHealthAnalyticsCustomModulesRequest - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest(); - 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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest} message ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDescendantSecurityHealthAnalyticsCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest"; - }; - - return ListDescendantSecurityHealthAnalyticsCustomModulesRequest; - })(); - - v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse = (function() { - - /** - * Properties of a ListDescendantSecurityHealthAnalyticsCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @property {Array.|null} [securityHealthAnalyticsCustomModules] ListDescendantSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules - * @property {string|null} [nextPageToken] ListDescendantSecurityHealthAnalyticsCustomModulesResponse nextPageToken - */ - - /** - * Constructs a new ListDescendantSecurityHealthAnalyticsCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListDescendantSecurityHealthAnalyticsCustomModulesResponse. - * @implements IListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set - */ - function ListDescendantSecurityHealthAnalyticsCustomModulesResponse(properties) { - this.securityHealthAnalyticsCustomModules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDescendantSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules. - * @member {Array.} securityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @instance - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.prototype.securityHealthAnalyticsCustomModules = $util.emptyArray; - - /** - * ListDescendantSecurityHealthAnalyticsCustomModulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @instance - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDescendantSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} ListDescendantSecurityHealthAnalyticsCustomModulesResponse instance - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.create = function create(properties) { - return new ListDescendantSecurityHealthAnalyticsCustomModulesResponse(properties); - }; - - /** - * Encodes the specified ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse} message ListDescendantSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.securityHealthAnalyticsCustomModules != null && message.securityHealthAnalyticsCustomModules.length) - for (var i = 0; i < message.securityHealthAnalyticsCustomModules.length; ++i) - $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.encode(message.securityHealthAnalyticsCustomModules[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 ListDescendantSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse} message ListDescendantSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.securityHealthAnalyticsCustomModules && message.securityHealthAnalyticsCustomModules.length)) - message.securityHealthAnalyticsCustomModules = []; - message.securityHealthAnalyticsCustomModules.push($root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.securityHealthAnalyticsCustomModules != null && message.hasOwnProperty("securityHealthAnalyticsCustomModules")) { - if (!Array.isArray(message.securityHealthAnalyticsCustomModules)) - return "securityHealthAnalyticsCustomModules: array expected"; - for (var i = 0; i < message.securityHealthAnalyticsCustomModules.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify(message.securityHealthAnalyticsCustomModules[i]); - if (error) - return "securityHealthAnalyticsCustomModules." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} ListDescendantSecurityHealthAnalyticsCustomModulesResponse - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse(); - if (object.securityHealthAnalyticsCustomModules) { - if (!Array.isArray(object.securityHealthAnalyticsCustomModules)) - throw TypeError(".google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.securityHealthAnalyticsCustomModules: array expected"); - message.securityHealthAnalyticsCustomModules = []; - for (var i = 0; i < object.securityHealthAnalyticsCustomModules.length; ++i) { - if (typeof object.securityHealthAnalyticsCustomModules[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse.securityHealthAnalyticsCustomModules: object expected"); - message.securityHealthAnalyticsCustomModules[i] = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.fromObject(object.securityHealthAnalyticsCustomModules[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDescendantSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse} message ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.securityHealthAnalyticsCustomModules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.securityHealthAnalyticsCustomModules && message.securityHealthAnalyticsCustomModules.length) { - object.securityHealthAnalyticsCustomModules = []; - for (var j = 0; j < message.securityHealthAnalyticsCustomModules.length; ++j) - object.securityHealthAnalyticsCustomModules[j] = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.toObject(message.securityHealthAnalyticsCustomModules[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDescendantSecurityHealthAnalyticsCustomModulesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDescendantSecurityHealthAnalyticsCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse"; - }; - - return ListDescendantSecurityHealthAnalyticsCustomModulesResponse; - })(); - - v1.ListValuedResourcesRequest = (function() { - - /** - * Properties of a ListValuedResourcesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListValuedResourcesRequest - * @property {string|null} [parent] ListValuedResourcesRequest parent - * @property {string|null} [filter] ListValuedResourcesRequest filter - * @property {string|null} [pageToken] ListValuedResourcesRequest pageToken - * @property {number|null} [pageSize] ListValuedResourcesRequest pageSize - * @property {string|null} [orderBy] ListValuedResourcesRequest orderBy - */ - - /** - * Constructs a new ListValuedResourcesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListValuedResourcesRequest. - * @implements IListValuedResourcesRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest=} [properties] Properties to set - */ - function ListValuedResourcesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValuedResourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.parent = ""; - - /** - * ListValuedResourcesRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.filter = ""; - - /** - * ListValuedResourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.pageToken = ""; - - /** - * ListValuedResourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.pageSize = 0; - - /** - * ListValuedResourcesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListValuedResourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListValuedResourcesRequest} ListValuedResourcesRequest instance - */ - ListValuedResourcesRequest.create = function create(properties) { - return new ListValuedResourcesRequest(properties); - }; - - /** - * Encodes the specified ListValuedResourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest} message ListValuedResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValuedResourcesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListValuedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListValuedResourcesRequest} message ListValuedResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValuedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValuedResourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListValuedResourcesRequest} ListValuedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValuedResourcesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListValuedResourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValuedResourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListValuedResourcesRequest} ListValuedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValuedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValuedResourcesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValuedResourcesRequest.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.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.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListValuedResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListValuedResourcesRequest} ListValuedResourcesRequest - */ - ListValuedResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListValuedResourcesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListValuedResourcesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListValuedResourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {google.cloud.securitycenter.v1.ListValuedResourcesRequest} message ListValuedResourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValuedResourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageToken = ""; - object.pageSize = 0; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListValuedResourcesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @instance - * @returns {Object.} JSON object - */ - ListValuedResourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValuedResourcesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValuedResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListValuedResourcesRequest"; - }; - - return ListValuedResourcesRequest; - })(); - - v1.ListValuedResourcesResponse = (function() { - - /** - * Properties of a ListValuedResourcesResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListValuedResourcesResponse - * @property {Array.|null} [valuedResources] ListValuedResourcesResponse valuedResources - * @property {string|null} [nextPageToken] ListValuedResourcesResponse nextPageToken - * @property {number|null} [totalSize] ListValuedResourcesResponse totalSize - */ - - /** - * Constructs a new ListValuedResourcesResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListValuedResourcesResponse. - * @implements IListValuedResourcesResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListValuedResourcesResponse=} [properties] Properties to set - */ - function ListValuedResourcesResponse(properties) { - this.valuedResources = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValuedResourcesResponse valuedResources. - * @member {Array.} valuedResources - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @instance - */ - ListValuedResourcesResponse.prototype.valuedResources = $util.emptyArray; - - /** - * ListValuedResourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @instance - */ - ListValuedResourcesResponse.prototype.nextPageToken = ""; - - /** - * ListValuedResourcesResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @instance - */ - ListValuedResourcesResponse.prototype.totalSize = 0; - - /** - * Creates a new ListValuedResourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListValuedResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListValuedResourcesResponse} ListValuedResourcesResponse instance - */ - ListValuedResourcesResponse.create = function create(properties) { - return new ListValuedResourcesResponse(properties); - }; - - /** - * Encodes the specified ListValuedResourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListValuedResourcesResponse} message ListValuedResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValuedResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.valuedResources != null && message.valuedResources.length) - for (var i = 0; i < message.valuedResources.length; ++i) - $root.google.cloud.securitycenter.v1.ValuedResource.encode(message.valuedResources[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); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - return writer; - }; - - /** - * Encodes the specified ListValuedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListValuedResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListValuedResourcesResponse} message ListValuedResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValuedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValuedResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListValuedResourcesResponse} ListValuedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValuedResourcesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListValuedResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.valuedResources && message.valuedResources.length)) - message.valuedResources = []; - message.valuedResources.push($root.google.cloud.securitycenter.v1.ValuedResource.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.totalSize = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValuedResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListValuedResourcesResponse} ListValuedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValuedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValuedResourcesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValuedResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.valuedResources != null && message.hasOwnProperty("valuedResources")) { - if (!Array.isArray(message.valuedResources)) - return "valuedResources: array expected"; - for (var i = 0; i < message.valuedResources.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ValuedResource.verify(message.valuedResources[i]); - if (error) - return "valuedResources." + 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 ListValuedResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListValuedResourcesResponse} ListValuedResourcesResponse - */ - ListValuedResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListValuedResourcesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListValuedResourcesResponse(); - if (object.valuedResources) { - if (!Array.isArray(object.valuedResources)) - throw TypeError(".google.cloud.securitycenter.v1.ListValuedResourcesResponse.valuedResources: array expected"); - message.valuedResources = []; - for (var i = 0; i < object.valuedResources.length; ++i) { - if (typeof object.valuedResources[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListValuedResourcesResponse.valuedResources: object expected"); - message.valuedResources[i] = $root.google.cloud.securitycenter.v1.ValuedResource.fromObject(object.valuedResources[i]); - } - } - 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 ListValuedResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {google.cloud.securitycenter.v1.ListValuedResourcesResponse} message ListValuedResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValuedResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.valuedResources = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.valuedResources && message.valuedResources.length) { - object.valuedResources = []; - for (var j = 0; j < message.valuedResources.length; ++j) - object.valuedResources[j] = $root.google.cloud.securitycenter.v1.ValuedResource.toObject(message.valuedResources[j], 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 ListValuedResourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @instance - * @returns {Object.} JSON object - */ - ListValuedResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValuedResourcesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListValuedResourcesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValuedResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListValuedResourcesResponse"; - }; - - return ListValuedResourcesResponse; - })(); - - v1.ListAttackPathsRequest = (function() { - - /** - * Properties of a ListAttackPathsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListAttackPathsRequest - * @property {string|null} [parent] ListAttackPathsRequest parent - * @property {string|null} [filter] ListAttackPathsRequest filter - * @property {string|null} [pageToken] ListAttackPathsRequest pageToken - * @property {number|null} [pageSize] ListAttackPathsRequest pageSize - */ - - /** - * Constructs a new ListAttackPathsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListAttackPathsRequest. - * @implements IListAttackPathsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest=} [properties] Properties to set - */ - function ListAttackPathsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttackPathsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @instance - */ - ListAttackPathsRequest.prototype.parent = ""; - - /** - * ListAttackPathsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @instance - */ - ListAttackPathsRequest.prototype.filter = ""; - - /** - * ListAttackPathsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @instance - */ - ListAttackPathsRequest.prototype.pageToken = ""; - - /** - * ListAttackPathsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @instance - */ - ListAttackPathsRequest.prototype.pageSize = 0; - - /** - * Creates a new ListAttackPathsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListAttackPathsRequest} ListAttackPathsRequest instance - */ - ListAttackPathsRequest.create = function create(properties) { - return new ListAttackPathsRequest(properties); - }; - - /** - * Encodes the specified ListAttackPathsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest} message ListAttackPathsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttackPathsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - return writer; - }; - - /** - * Encodes the specified ListAttackPathsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {google.cloud.securitycenter.v1.IListAttackPathsRequest} message ListAttackPathsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttackPathsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttackPathsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListAttackPathsRequest} ListAttackPathsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttackPathsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAttackPathsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttackPathsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListAttackPathsRequest} ListAttackPathsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttackPathsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttackPathsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttackPathsRequest.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.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 ListAttackPathsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListAttackPathsRequest} ListAttackPathsRequest - */ - ListAttackPathsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListAttackPathsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListAttackPathsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - 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 ListAttackPathsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {google.cloud.securitycenter.v1.ListAttackPathsRequest} message ListAttackPathsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttackPathsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - 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.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - return object; - }; - - /** - * Converts this ListAttackPathsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAttackPathsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttackPathsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListAttackPathsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttackPathsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAttackPathsRequest"; - }; - - return ListAttackPathsRequest; - })(); - - v1.ListAttackPathsResponse = (function() { - - /** - * Properties of a ListAttackPathsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListAttackPathsResponse - * @property {Array.|null} [attackPaths] ListAttackPathsResponse attackPaths - * @property {string|null} [nextPageToken] ListAttackPathsResponse nextPageToken - */ - - /** - * Constructs a new ListAttackPathsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListAttackPathsResponse. - * @implements IListAttackPathsResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListAttackPathsResponse=} [properties] Properties to set - */ - function ListAttackPathsResponse(properties) { - this.attackPaths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttackPathsResponse attackPaths. - * @member {Array.} attackPaths - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @instance - */ - ListAttackPathsResponse.prototype.attackPaths = $util.emptyArray; - - /** - * ListAttackPathsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @instance - */ - ListAttackPathsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAttackPathsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {google.cloud.securitycenter.v1.IListAttackPathsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListAttackPathsResponse} ListAttackPathsResponse instance - */ - ListAttackPathsResponse.create = function create(properties) { - return new ListAttackPathsResponse(properties); - }; - - /** - * Encodes the specified ListAttackPathsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {google.cloud.securitycenter.v1.IListAttackPathsResponse} message ListAttackPathsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttackPathsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attackPaths != null && message.attackPaths.length) - for (var i = 0; i < message.attackPaths.length; ++i) - $root.google.cloud.securitycenter.v1.AttackPath.encode(message.attackPaths[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 ListAttackPathsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAttackPathsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {google.cloud.securitycenter.v1.IListAttackPathsResponse} message ListAttackPathsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttackPathsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttackPathsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListAttackPathsResponse} ListAttackPathsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttackPathsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAttackPathsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.attackPaths && message.attackPaths.length)) - message.attackPaths = []; - message.attackPaths.push($root.google.cloud.securitycenter.v1.AttackPath.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttackPathsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListAttackPathsResponse} ListAttackPathsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttackPathsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttackPathsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttackPathsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attackPaths != null && message.hasOwnProperty("attackPaths")) { - if (!Array.isArray(message.attackPaths)) - return "attackPaths: array expected"; - for (var i = 0; i < message.attackPaths.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.AttackPath.verify(message.attackPaths[i]); - if (error) - return "attackPaths." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAttackPathsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListAttackPathsResponse} ListAttackPathsResponse - */ - ListAttackPathsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListAttackPathsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListAttackPathsResponse(); - if (object.attackPaths) { - if (!Array.isArray(object.attackPaths)) - throw TypeError(".google.cloud.securitycenter.v1.ListAttackPathsResponse.attackPaths: array expected"); - message.attackPaths = []; - for (var i = 0; i < object.attackPaths.length; ++i) { - if (typeof object.attackPaths[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAttackPathsResponse.attackPaths: object expected"); - message.attackPaths[i] = $root.google.cloud.securitycenter.v1.AttackPath.fromObject(object.attackPaths[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAttackPathsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {google.cloud.securitycenter.v1.ListAttackPathsResponse} message ListAttackPathsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttackPathsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attackPaths = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.attackPaths && message.attackPaths.length) { - object.attackPaths = []; - for (var j = 0; j < message.attackPaths.length; ++j) - object.attackPaths[j] = $root.google.cloud.securitycenter.v1.AttackPath.toObject(message.attackPaths[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAttackPathsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAttackPathsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttackPathsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListAttackPathsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttackPathsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAttackPathsResponse"; - }; - - return ListAttackPathsResponse; - })(); - - v1.GetSimulationRequest = (function() { - - /** - * Properties of a GetSimulationRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetSimulationRequest - * @property {string|null} [name] GetSimulationRequest name - */ - - /** - * Constructs a new GetSimulationRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetSimulationRequest. - * @implements IGetSimulationRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetSimulationRequest=} [properties] Properties to set - */ - function GetSimulationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetSimulationRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @instance - */ - GetSimulationRequest.prototype.name = ""; - - /** - * Creates a new GetSimulationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetSimulationRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetSimulationRequest} GetSimulationRequest instance - */ - GetSimulationRequest.create = function create(properties) { - return new GetSimulationRequest(properties); - }; - - /** - * Encodes the specified GetSimulationRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSimulationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetSimulationRequest} message GetSimulationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSimulationRequest.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 GetSimulationRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSimulationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetSimulationRequest} message GetSimulationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSimulationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSimulationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetSimulationRequest} GetSimulationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSimulationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSimulationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSimulationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetSimulationRequest} GetSimulationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSimulationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSimulationRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSimulationRequest.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 GetSimulationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetSimulationRequest} GetSimulationRequest - */ - GetSimulationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetSimulationRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.GetSimulationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSimulationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {google.cloud.securitycenter.v1.GetSimulationRequest} message GetSimulationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSimulationRequest.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 GetSimulationRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @instance - * @returns {Object.} JSON object - */ - GetSimulationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSimulationRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.GetSimulationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSimulationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetSimulationRequest"; - }; - - return GetSimulationRequest; - })(); - - v1.GetValuedResourceRequest = (function() { - - /** - * Properties of a GetValuedResourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetValuedResourceRequest - * @property {string|null} [name] GetValuedResourceRequest name - */ - - /** - * Constructs a new GetValuedResourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetValuedResourceRequest. - * @implements IGetValuedResourceRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest=} [properties] Properties to set - */ - function GetValuedResourceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetValuedResourceRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @instance - */ - GetValuedResourceRequest.prototype.name = ""; - - /** - * Creates a new GetValuedResourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetValuedResourceRequest} GetValuedResourceRequest instance - */ - GetValuedResourceRequest.create = function create(properties) { - return new GetValuedResourceRequest(properties); - }; - - /** - * Encodes the specified GetValuedResourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetValuedResourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest} message GetValuedResourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetValuedResourceRequest.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 GetValuedResourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetValuedResourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetValuedResourceRequest} message GetValuedResourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetValuedResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetValuedResourceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetValuedResourceRequest} GetValuedResourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetValuedResourceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetValuedResourceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetValuedResourceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetValuedResourceRequest} GetValuedResourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetValuedResourceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetValuedResourceRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetValuedResourceRequest.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 GetValuedResourceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetValuedResourceRequest} GetValuedResourceRequest - */ - GetValuedResourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetValuedResourceRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.GetValuedResourceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetValuedResourceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {google.cloud.securitycenter.v1.GetValuedResourceRequest} message GetValuedResourceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetValuedResourceRequest.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 GetValuedResourceRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @instance - * @returns {Object.} JSON object - */ - GetValuedResourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetValuedResourceRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.GetValuedResourceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetValuedResourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetValuedResourceRequest"; - }; - - return GetValuedResourceRequest; - })(); - - v1.ListMuteConfigsRequest = (function() { - - /** - * Properties of a ListMuteConfigsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListMuteConfigsRequest - * @property {string|null} [parent] ListMuteConfigsRequest parent - * @property {number|null} [pageSize] ListMuteConfigsRequest pageSize - * @property {string|null} [pageToken] ListMuteConfigsRequest pageToken - */ - - /** - * Constructs a new ListMuteConfigsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListMuteConfigsRequest. - * @implements IListMuteConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set - */ - function ListMuteConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListMuteConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @instance - */ - ListMuteConfigsRequest.prototype.parent = ""; - - /** - * ListMuteConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @instance - */ - ListMuteConfigsRequest.prototype.pageSize = 0; - - /** - * ListMuteConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @instance - */ - ListMuteConfigsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListMuteConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest instance - */ - ListMuteConfigsRequest.create = function create(properties) { - return new ListMuteConfigsRequest(properties); - }; - - /** - * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @static - * @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 - */ - ListMuteConfigsRequest.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 ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @static - * @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 - */ - ListMuteConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. - * @function decode - * @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.ListMuteConfigsRequest} ListMuteConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListMuteConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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 ListMuteConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - ListMuteConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListMuteConfigsRequest message. - * @function verify - * @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 - */ - ListMuteConfigsRequest.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 ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest - */ - ListMuteConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest) - return object; - 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 ListMuteConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.ListMuteConfigsRequest} message ListMuteConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListMuteConfigsRequest.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 ListMuteConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListMuteConfigsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.ListMuteConfigsResponse = (function() { - - /** - * Properties of a ListMuteConfigsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListMuteConfigsResponse - * @property {Array.|null} [muteConfigs] ListMuteConfigsResponse muteConfigs - * @property {string|null} [nextPageToken] ListMuteConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListMuteConfigsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListMuteConfigsResponse. - * @implements IListMuteConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set - */ - function ListMuteConfigsResponse(properties) { - this.muteConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListMuteConfigsResponse muteConfigs. - * @member {Array.} muteConfigs - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @instance - */ - ListMuteConfigsResponse.prototype.muteConfigs = $util.emptyArray; - - /** - * ListMuteConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @instance - */ - ListMuteConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListMuteConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse instance - */ - ListMuteConfigsResponse.create = function create(properties) { - return new ListMuteConfigsResponse(properties); - }; - - /** - * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @static - * @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 - */ - ListMuteConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @static - * @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 - */ - ListMuteConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. - * @function decode - * @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.ListMuteConfigsResponse} ListMuteConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListMuteConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - ListMuteConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListMuteConfigsResponse message. - * @function verify - * @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 - */ - ListMuteConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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 "muteConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse - */ - ListMuteConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse) - return object; - 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.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.ListMuteConfigsResponse} message ListMuteConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListMuteConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.muteConfigs = []; - if (options.defaults) - 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListMuteConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListMuteConfigsResponse.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.ListNotificationConfigsRequest = (function() { - - /** - * Properties of a ListNotificationConfigsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListNotificationConfigsRequest - * @property {string|null} [parent] ListNotificationConfigsRequest parent - * @property {string|null} [pageToken] ListNotificationConfigsRequest pageToken - * @property {number|null} [pageSize] ListNotificationConfigsRequest pageSize - */ - - /** - * Constructs a new ListNotificationConfigsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListNotificationConfigsRequest. - * @implements IListNotificationConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest=} [properties] Properties to set - */ - function ListNotificationConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListNotificationConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.parent = ""; - - /** - * ListNotificationConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.pageToken = ""; - - /** - * ListNotificationConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.pageSize = 0; - - /** - * Creates a new ListNotificationConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance - */ - ListNotificationConfigsRequest.create = function create(properties) { - return new ListNotificationConfigsRequest(properties); - }; - - /** - * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @static - * @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 - */ - ListNotificationConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - return writer; - }; - - /** - * 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.ListNotificationConfigsRequest - * @static - * @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 - */ - ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. - * @function decode - * @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.ListNotificationConfigsRequest} ListNotificationConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListNotificationConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - 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; - } - } - return message; - }; - - /** - * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest - */ - ListNotificationConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest) - return object; - 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 ListNotificationConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} message ListNotificationConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListNotificationConfigsRequest.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 ListNotificationConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.ListNotificationConfigsResponse = (function() { - - /** - * Properties of a ListNotificationConfigsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListNotificationConfigsResponse - * @property {Array.|null} [notificationConfigs] ListNotificationConfigsResponse notificationConfigs - * @property {string|null} [nextPageToken] ListNotificationConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListNotificationConfigsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListNotificationConfigsResponse. - * @implements IListNotificationConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse=} [properties] Properties to set - */ - function ListNotificationConfigsResponse(properties) { - this.notificationConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListNotificationConfigsResponse notificationConfigs. - * @member {Array.} notificationConfigs - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse - * @instance - */ - ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; - - /** - * ListNotificationConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse - * @instance - */ - ListNotificationConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListNotificationConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance - */ - ListNotificationConfigsResponse.create = function create(properties) { - return new ListNotificationConfigsResponse(properties); - }; - - /** - * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse - * @static - * @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 - */ - ListNotificationConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * 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.ListNotificationConfigsResponse - * @static - * @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 - */ - ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. - * @function decode - * @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.ListNotificationConfigsResponse} ListNotificationConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListNotificationConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListNotificationConfigsResponse message. - * @function verify - * @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 - */ - ListNotificationConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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 "notificationConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse - */ - ListNotificationConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse) - return object; - 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.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} message ListNotificationConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListNotificationConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest = (function() { - - /** - * Properties of a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @property {string|null} [parent] ListEffectiveSecurityHealthAnalyticsCustomModulesRequest parent - * @property {number|null} [pageSize] ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageSize - * @property {string|null} [pageToken] ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageToken - */ - - /** - * Constructs a new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. - * @implements IListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set - */ - function ListEffectiveSecurityHealthAnalyticsCustomModulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEffectiveSecurityHealthAnalyticsCustomModulesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.prototype.parent = ""; - - /** - * ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.prototype.pageSize = 0; - - /** - * ListEffectiveSecurityHealthAnalyticsCustomModulesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} ListEffectiveSecurityHealthAnalyticsCustomModulesRequest instance - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.create = function create(properties) { - return new ListEffectiveSecurityHealthAnalyticsCustomModulesRequest(properties); - }; - - /** - * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest} message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest} message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest(); - 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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @instance - * @returns {Object.} JSON object - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest"; - }; - - return ListEffectiveSecurityHealthAnalyticsCustomModulesRequest; - })(); - - v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse = (function() { - - /** - * Properties of a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @property {Array.|null} [effectiveSecurityHealthAnalyticsCustomModules] ListEffectiveSecurityHealthAnalyticsCustomModulesResponse effectiveSecurityHealthAnalyticsCustomModules - * @property {string|null} [nextPageToken] ListEffectiveSecurityHealthAnalyticsCustomModulesResponse nextPageToken - */ - - /** - * Constructs a new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse. - * @implements IListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set - */ - function ListEffectiveSecurityHealthAnalyticsCustomModulesResponse(properties) { - this.effectiveSecurityHealthAnalyticsCustomModules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEffectiveSecurityHealthAnalyticsCustomModulesResponse effectiveSecurityHealthAnalyticsCustomModules. - * @member {Array.} effectiveSecurityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @instance - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.prototype.effectiveSecurityHealthAnalyticsCustomModules = $util.emptyArray; - - /** - * ListEffectiveSecurityHealthAnalyticsCustomModulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @instance - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} ListEffectiveSecurityHealthAnalyticsCustomModulesResponse instance - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.create = function create(properties) { - return new ListEffectiveSecurityHealthAnalyticsCustomModulesResponse(properties); - }; - - /** - * Encodes the specified ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse} message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.effectiveSecurityHealthAnalyticsCustomModules != null && message.effectiveSecurityHealthAnalyticsCustomModules.length) - for (var i = 0; i < message.effectiveSecurityHealthAnalyticsCustomModules.length; ++i) - $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.encode(message.effectiveSecurityHealthAnalyticsCustomModules[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 ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse} message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.effectiveSecurityHealthAnalyticsCustomModules && message.effectiveSecurityHealthAnalyticsCustomModules.length)) - message.effectiveSecurityHealthAnalyticsCustomModules = []; - message.effectiveSecurityHealthAnalyticsCustomModules.push($root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.effectiveSecurityHealthAnalyticsCustomModules != null && message.hasOwnProperty("effectiveSecurityHealthAnalyticsCustomModules")) { - if (!Array.isArray(message.effectiveSecurityHealthAnalyticsCustomModules)) - return "effectiveSecurityHealthAnalyticsCustomModules: array expected"; - for (var i = 0; i < message.effectiveSecurityHealthAnalyticsCustomModules.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.verify(message.effectiveSecurityHealthAnalyticsCustomModules[i]); - if (error) - return "effectiveSecurityHealthAnalyticsCustomModules." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse(); - if (object.effectiveSecurityHealthAnalyticsCustomModules) { - if (!Array.isArray(object.effectiveSecurityHealthAnalyticsCustomModules)) - throw TypeError(".google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.effectiveSecurityHealthAnalyticsCustomModules: array expected"); - message.effectiveSecurityHealthAnalyticsCustomModules = []; - for (var i = 0; i < object.effectiveSecurityHealthAnalyticsCustomModules.length; ++i) { - if (typeof object.effectiveSecurityHealthAnalyticsCustomModules[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.effectiveSecurityHealthAnalyticsCustomModules: object expected"); - message.effectiveSecurityHealthAnalyticsCustomModules[i] = $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.fromObject(object.effectiveSecurityHealthAnalyticsCustomModules[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEffectiveSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse} message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.effectiveSecurityHealthAnalyticsCustomModules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.effectiveSecurityHealthAnalyticsCustomModules && message.effectiveSecurityHealthAnalyticsCustomModules.length) { - object.effectiveSecurityHealthAnalyticsCustomModules = []; - for (var j = 0; j < message.effectiveSecurityHealthAnalyticsCustomModules.length; ++j) - object.effectiveSecurityHealthAnalyticsCustomModules[j] = $root.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.toObject(message.effectiveSecurityHealthAnalyticsCustomModules[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEffectiveSecurityHealthAnalyticsCustomModulesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @instance - * @returns {Object.} JSON object - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse"; - }; - - return ListEffectiveSecurityHealthAnalyticsCustomModulesResponse; - })(); - - v1.ListSecurityHealthAnalyticsCustomModulesRequest = (function() { - - /** - * Properties of a ListSecurityHealthAnalyticsCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListSecurityHealthAnalyticsCustomModulesRequest - * @property {string|null} [parent] ListSecurityHealthAnalyticsCustomModulesRequest parent - * @property {number|null} [pageSize] ListSecurityHealthAnalyticsCustomModulesRequest pageSize - * @property {string|null} [pageToken] ListSecurityHealthAnalyticsCustomModulesRequest pageToken - */ - - /** - * Constructs a new ListSecurityHealthAnalyticsCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListSecurityHealthAnalyticsCustomModulesRequest. - * @implements IListSecurityHealthAnalyticsCustomModulesRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set - */ - function ListSecurityHealthAnalyticsCustomModulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSecurityHealthAnalyticsCustomModulesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListSecurityHealthAnalyticsCustomModulesRequest.prototype.parent = ""; - - /** - * ListSecurityHealthAnalyticsCustomModulesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListSecurityHealthAnalyticsCustomModulesRequest.prototype.pageSize = 0; - - /** - * ListSecurityHealthAnalyticsCustomModulesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @instance - */ - ListSecurityHealthAnalyticsCustomModulesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListSecurityHealthAnalyticsCustomModulesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} ListSecurityHealthAnalyticsCustomModulesRequest instance - */ - ListSecurityHealthAnalyticsCustomModulesRequest.create = function create(properties) { - return new ListSecurityHealthAnalyticsCustomModulesRequest(properties); - }; - - /** - * Encodes the specified ListSecurityHealthAnalyticsCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest} message ListSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSecurityHealthAnalyticsCustomModulesRequest.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 ListSecurityHealthAnalyticsCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest} message ListSecurityHealthAnalyticsCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSecurityHealthAnalyticsCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} ListSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSecurityHealthAnalyticsCustomModulesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListSecurityHealthAnalyticsCustomModulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} ListSecurityHealthAnalyticsCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSecurityHealthAnalyticsCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSecurityHealthAnalyticsCustomModulesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSecurityHealthAnalyticsCustomModulesRequest.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 ListSecurityHealthAnalyticsCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} ListSecurityHealthAnalyticsCustomModulesRequest - */ - ListSecurityHealthAnalyticsCustomModulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest(); - 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 ListSecurityHealthAnalyticsCustomModulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest} message ListSecurityHealthAnalyticsCustomModulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSecurityHealthAnalyticsCustomModulesRequest.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 ListSecurityHealthAnalyticsCustomModulesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @instance - * @returns {Object.} JSON object - */ - ListSecurityHealthAnalyticsCustomModulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSecurityHealthAnalyticsCustomModulesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSecurityHealthAnalyticsCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest"; - }; - - return ListSecurityHealthAnalyticsCustomModulesRequest; - })(); - - v1.ListSecurityHealthAnalyticsCustomModulesResponse = (function() { - - /** - * Properties of a ListSecurityHealthAnalyticsCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListSecurityHealthAnalyticsCustomModulesResponse - * @property {Array.|null} [securityHealthAnalyticsCustomModules] ListSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules - * @property {string|null} [nextPageToken] ListSecurityHealthAnalyticsCustomModulesResponse nextPageToken - */ - - /** - * Constructs a new ListSecurityHealthAnalyticsCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListSecurityHealthAnalyticsCustomModulesResponse. - * @implements IListSecurityHealthAnalyticsCustomModulesResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set - */ - function ListSecurityHealthAnalyticsCustomModulesResponse(properties) { - this.securityHealthAnalyticsCustomModules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSecurityHealthAnalyticsCustomModulesResponse securityHealthAnalyticsCustomModules. - * @member {Array.} securityHealthAnalyticsCustomModules - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @instance - */ - ListSecurityHealthAnalyticsCustomModulesResponse.prototype.securityHealthAnalyticsCustomModules = $util.emptyArray; - - /** - * ListSecurityHealthAnalyticsCustomModulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @instance - */ - ListSecurityHealthAnalyticsCustomModulesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSecurityHealthAnalyticsCustomModulesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} ListSecurityHealthAnalyticsCustomModulesResponse instance - */ - ListSecurityHealthAnalyticsCustomModulesResponse.create = function create(properties) { - return new ListSecurityHealthAnalyticsCustomModulesResponse(properties); - }; - - /** - * Encodes the specified ListSecurityHealthAnalyticsCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse} message ListSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSecurityHealthAnalyticsCustomModulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.securityHealthAnalyticsCustomModules != null && message.securityHealthAnalyticsCustomModules.length) - for (var i = 0; i < message.securityHealthAnalyticsCustomModules.length; ++i) - $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.encode(message.securityHealthAnalyticsCustomModules[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 ListSecurityHealthAnalyticsCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse} message ListSecurityHealthAnalyticsCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSecurityHealthAnalyticsCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} ListSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSecurityHealthAnalyticsCustomModulesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.securityHealthAnalyticsCustomModules && message.securityHealthAnalyticsCustomModules.length)) - message.securityHealthAnalyticsCustomModules = []; - message.securityHealthAnalyticsCustomModules.push($root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSecurityHealthAnalyticsCustomModulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} ListSecurityHealthAnalyticsCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSecurityHealthAnalyticsCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSecurityHealthAnalyticsCustomModulesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSecurityHealthAnalyticsCustomModulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.securityHealthAnalyticsCustomModules != null && message.hasOwnProperty("securityHealthAnalyticsCustomModules")) { - if (!Array.isArray(message.securityHealthAnalyticsCustomModules)) - return "securityHealthAnalyticsCustomModules: array expected"; - for (var i = 0; i < message.securityHealthAnalyticsCustomModules.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify(message.securityHealthAnalyticsCustomModules[i]); - if (error) - return "securityHealthAnalyticsCustomModules." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSecurityHealthAnalyticsCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} ListSecurityHealthAnalyticsCustomModulesResponse - */ - ListSecurityHealthAnalyticsCustomModulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse(); - if (object.securityHealthAnalyticsCustomModules) { - if (!Array.isArray(object.securityHealthAnalyticsCustomModules)) - throw TypeError(".google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.securityHealthAnalyticsCustomModules: array expected"); - message.securityHealthAnalyticsCustomModules = []; - for (var i = 0; i < object.securityHealthAnalyticsCustomModules.length; ++i) { - if (typeof object.securityHealthAnalyticsCustomModules[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse.securityHealthAnalyticsCustomModules: object expected"); - message.securityHealthAnalyticsCustomModules[i] = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.fromObject(object.securityHealthAnalyticsCustomModules[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSecurityHealthAnalyticsCustomModulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse} message ListSecurityHealthAnalyticsCustomModulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSecurityHealthAnalyticsCustomModulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.securityHealthAnalyticsCustomModules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.securityHealthAnalyticsCustomModules && message.securityHealthAnalyticsCustomModules.length) { - object.securityHealthAnalyticsCustomModules = []; - for (var j = 0; j < message.securityHealthAnalyticsCustomModules.length; ++j) - object.securityHealthAnalyticsCustomModules[j] = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.toObject(message.securityHealthAnalyticsCustomModules[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSecurityHealthAnalyticsCustomModulesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @instance - * @returns {Object.} JSON object - */ - ListSecurityHealthAnalyticsCustomModulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSecurityHealthAnalyticsCustomModulesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSecurityHealthAnalyticsCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse"; - }; - - return ListSecurityHealthAnalyticsCustomModulesResponse; - })(); - - 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 && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - 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.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")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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() { - - /** - * 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 && 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.stateChange === "number") { - message.stateChange = object.stateChange; - break; - } - break; - 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] === undefined ? message.stateChange : $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); - }; - - /** - * 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 - * @enum {number} - * @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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - 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.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")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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() { - - /** - * 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 && 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 && Object.hasOwnProperty.call(message, "stateChange")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.stateChange === "number") { - message.stateChange = object.stateChange; - break; - } - break; - 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] === 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; - }; - - /** - * 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); - }; - - /** - * 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 - * @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() { - - /** - * Properties of a Resource. - * @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 {Array.|null} [folders] Resource folders - * @property {google.cloud.securitycenter.v1.CloudProvider|null} [cloudProvider] Resource cloudProvider - * @property {string|null} [organization] Resource organization - * @property {string|null} [service] Resource service - * @property {string|null} [location] Resource location - * @property {google.cloud.securitycenter.v1.IAwsMetadata|null} [awsMetadata] Resource awsMetadata - * @property {google.cloud.securitycenter.v1.IAzureMetadata|null} [azureMetadata] Resource azureMetadata - * @property {google.cloud.securitycenter.v1.IResourcePath|null} [resourcePath] Resource resourcePath - * @property {string|null} [resourcePathString] Resource resourcePathString - */ - - /** - * 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) { - 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]]; - } - - /** - * Resource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - 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 - * @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 = ""; - - /** - * Resource folders. - * @member {Array.} folders - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.folders = $util.emptyArray; - - /** - * Resource cloudProvider. - * @member {google.cloud.securitycenter.v1.CloudProvider} cloudProvider - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.cloudProvider = 0; - - /** - * Resource organization. - * @member {string} organization - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.organization = ""; - - /** - * Resource service. - * @member {string} service - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.service = ""; - - /** - * Resource location. - * @member {string} location - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.location = ""; - - /** - * Resource awsMetadata. - * @member {google.cloud.securitycenter.v1.IAwsMetadata|null|undefined} awsMetadata - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.awsMetadata = null; - - /** - * Resource azureMetadata. - * @member {google.cloud.securitycenter.v1.IAzureMetadata|null|undefined} azureMetadata - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.azureMetadata = null; - - /** - * Resource resourcePath. - * @member {google.cloud.securitycenter.v1.IResourcePath|null|undefined} resourcePath - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.resourcePath = null; - - /** - * Resource resourcePathString. - * @member {string} resourcePathString - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.resourcePathString = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Resource cloudProviderMetadata. - * @member {"awsMetadata"|"azureMetadata"|undefined} cloudProviderMetadata - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Object.defineProperty(Resource.prototype, "cloudProviderMetadata", { - get: $util.oneOfGetter($oneOfFields = ["awsMetadata", "azureMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.projectName != null && Object.hasOwnProperty.call(message, "projectName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); - if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); - if (message.parentName != null && Object.hasOwnProperty.call(message, "parentName")) - 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); - if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.cloudProvider); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.organization); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.service); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.location); - if (message.awsMetadata != null && Object.hasOwnProperty.call(message, "awsMetadata")) - $root.google.cloud.securitycenter.v1.AwsMetadata.encode(message.awsMetadata, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.azureMetadata != null && Object.hasOwnProperty.call(message, "azureMetadata")) - $root.google.cloud.securitycenter.v1.AzureMetadata.encode(message.azureMetadata, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.resourcePath != null && Object.hasOwnProperty.call(message, "resourcePath")) - $root.google.cloud.securitycenter.v1.ResourcePath.encode(message.resourcePath, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.resourcePathString != null && Object.hasOwnProperty.call(message, "resourcePathString")) - writer.uint32(/* id 19, wireType 2 =*/154).string(message.resourcePathString); - 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, error) { - 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(); - if (tag === error) - break; - 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 9: { - message.cloudProvider = reader.int32(); - break; - } - case 10: { - message.organization = reader.string(); - break; - } - case 11: { - message.service = reader.string(); - break; - } - case 12: { - message.location = reader.string(); - break; - } - case 16: { - message.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.decode(reader, reader.uint32()); - break; - } - case 17: { - message.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.decode(reader, reader.uint32()); - break; - } - case 18: { - message.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.decode(reader, reader.uint32()); - break; - } - case 19: { - message.resourcePathString = 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"; - 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.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"; - 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"; - 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - switch (message.cloudProvider) { - default: - return "cloudProvider: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.organization != null && message.hasOwnProperty("organization")) - if (!$util.isString(message.organization)) - return "organization: string expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v1.AwsMetadata.verify(message.awsMetadata); - if (error) - return "awsMetadata." + error; - } - } - if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { - if (properties.cloudProviderMetadata === 1) - return "cloudProviderMetadata: multiple values"; - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v1.AzureMetadata.verify(message.azureMetadata); - if (error) - return "azureMetadata." + error; - } - } - if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) { - var error = $root.google.cloud.securitycenter.v1.ResourcePath.verify(message.resourcePath); - if (error) - return "resourcePath." + error; - } - if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) - if (!$util.isString(message.resourcePathString)) - return "resourcePathString: 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.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) - message.projectDisplayName = String(object.projectDisplayName); - if (object.parentName != null) - 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]); - } - } - switch (object.cloudProvider) { - default: - if (typeof object.cloudProvider === "number") { - message.cloudProvider = object.cloudProvider; - break; - } - break; - case "CLOUD_PROVIDER_UNSPECIFIED": - case 0: - message.cloudProvider = 0; - break; - case "GOOGLE_CLOUD_PLATFORM": - case 1: - message.cloudProvider = 1; - break; - case "AMAZON_WEB_SERVICES": - case 2: - message.cloudProvider = 2; - break; - case "MICROSOFT_AZURE": - case 3: - message.cloudProvider = 3; - break; - } - if (object.organization != null) - message.organization = String(object.organization); - if (object.service != null) - message.service = String(object.service); - if (object.location != null) - message.location = String(object.location); - if (object.awsMetadata != null) { - if (typeof object.awsMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.awsMetadata: object expected"); - message.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.fromObject(object.awsMetadata); - } - if (object.azureMetadata != null) { - if (typeof object.azureMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.azureMetadata: object expected"); - message.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.fromObject(object.azureMetadata); - } - if (object.resourcePath != null) { - if (typeof object.resourcePath !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.resourcePath: object expected"); - message.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.fromObject(object.resourcePath); - } - if (object.resourcePathString != null) - message.resourcePathString = String(object.resourcePathString); - 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.arrays || options.defaults) - object.folders = []; - if (options.defaults) { - object.name = ""; - object.projectName = ""; - object.projectDisplayName = ""; - object.parentName = ""; - object.parentDisplayName = ""; - object.type = ""; - object.displayName = ""; - object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; - object.organization = ""; - object.service = ""; - object.location = ""; - object.resourcePath = null; - object.resourcePathString = ""; - } - 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; - 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; - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] : message.cloudProvider; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = message.organization; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { - object.awsMetadata = $root.google.cloud.securitycenter.v1.AwsMetadata.toObject(message.awsMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "awsMetadata"; - } - if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { - object.azureMetadata = $root.google.cloud.securitycenter.v1.AzureMetadata.toObject(message.azureMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "azureMetadata"; - } - if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) - object.resourcePath = $root.google.cloud.securitycenter.v1.ResourcePath.toObject(message.resourcePath, options); - if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) - object.resourcePathString = message.resourcePathString; - 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); - }; - - /** - * 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; - })(); - - 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 && 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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - 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] === 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - v1.SetMuteRequest = (function() { - - /** - * Properties of a SetMuteRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ISetMuteRequest - * @property {string|null} [name] SetMuteRequest name - * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] SetMuteRequest mute - */ - - /** - * Constructs a new SetMuteRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SetMuteRequest. - * @implements ISetMuteRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set - */ - function SetMuteRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetMuteRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.SetMuteRequest - * @instance - */ - SetMuteRequest.prototype.name = ""; - - /** - * SetMuteRequest mute. - * @member {google.cloud.securitycenter.v1.Finding.Mute} mute - * @memberof google.cloud.securitycenter.v1.SetMuteRequest - * @instance - */ - SetMuteRequest.prototype.mute = 0; - - /** - * Creates a new SetMuteRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SetMuteRequest - * @static - * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest instance - */ - SetMuteRequest.create = function create(properties) { - return new SetMuteRequest(properties); - }; - - /** - * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SetMuteRequest - * @static - * @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 - */ - 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.mute != null && Object.hasOwnProperty.call(message, "mute")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mute); - return writer; - }; - - /** - * 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.SetMuteRequest - * @static - * @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 - */ - SetMuteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetMuteRequest message from the specified reader or buffer. - * @function decode - * @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.SetMuteRequest} SetMuteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetMuteRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.mute = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SetMuteRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - SetMuteRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetMuteRequest message. - * @function verify - * @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 - */ - 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.mute != null && message.hasOwnProperty("mute")) - switch (message.mute) { - default: - return "mute: enum value expected"; - case 0: - case 1: - case 2: - case 4: - break; - } - return null; - }; - - /** - * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SetMuteRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest - */ - SetMuteRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SetMuteRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.SetMuteRequest(); - 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; - 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; - } - return message; - }; - - /** - * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SetMuteRequest - * @static - * @param {google.cloud.securitycenter.v1.SetMuteRequest} message SetMuteRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetMuteRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; - } - 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] === undefined ? message.mute : $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; - return object; - }; - - /** - * Converts this SetMuteRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SetMuteRequest - * @instance - * @returns {Object.} JSON object - */ - SetMuteRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.SimulateSecurityHealthAnalyticsCustomModuleRequest = (function() { - - /** - * Properties of a SimulateSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ISimulateSecurityHealthAnalyticsCustomModuleRequest - * @property {string|null} [parent] SimulateSecurityHealthAnalyticsCustomModuleRequest parent - * @property {google.cloud.securitycenter.v1.ICustomConfig|null} [customConfig] SimulateSecurityHealthAnalyticsCustomModuleRequest customConfig - * @property {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource|null} [resource] SimulateSecurityHealthAnalyticsCustomModuleRequest resource - */ - - /** - * Constructs a new SimulateSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SimulateSecurityHealthAnalyticsCustomModuleRequest. - * @implements ISimulateSecurityHealthAnalyticsCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - */ - function SimulateSecurityHealthAnalyticsCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SimulateSecurityHealthAnalyticsCustomModuleRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.prototype.parent = ""; - - /** - * SimulateSecurityHealthAnalyticsCustomModuleRequest customConfig. - * @member {google.cloud.securitycenter.v1.ICustomConfig|null|undefined} customConfig - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.prototype.customConfig = null; - - /** - * SimulateSecurityHealthAnalyticsCustomModuleRequest resource. - * @member {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource|null|undefined} resource - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.prototype.resource = null; - - /** - * Creates a new SimulateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} SimulateSecurityHealthAnalyticsCustomModuleRequest instance - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { - return new SimulateSecurityHealthAnalyticsCustomModuleRequest(properties); - }; - - /** - * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest} message SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.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.customConfig != null && Object.hasOwnProperty.call(message, "customConfig")) - $root.google.cloud.securitycenter.v1.CustomConfig.encode(message.customConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest} message SimulateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SimulateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} SimulateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.resource = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SimulateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} SimulateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SimulateSecurityHealthAnalyticsCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.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.customConfig != null && message.hasOwnProperty("customConfig")) { - var error = $root.google.cloud.securitycenter.v1.CustomConfig.verify(message.customConfig); - if (error) - return "customConfig." + error; - } - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify(message.resource); - if (error) - return "resource." + error; - } - return null; - }; - - /** - * Creates a SimulateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} SimulateSecurityHealthAnalyticsCustomModuleRequest - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.customConfig != null) { - if (typeof object.customConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.customConfig: object expected"); - message.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.fromObject(object.customConfig); - } - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.resource: object expected"); - message.resource = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.fromObject(object.resource); - } - return message; - }; - - /** - * Creates a plain object from a SimulateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest} message SimulateSecurityHealthAnalyticsCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.customConfig = null; - object.resource = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.customConfig != null && message.hasOwnProperty("customConfig")) - object.customConfig = $root.google.cloud.securitycenter.v1.CustomConfig.toObject(message.customConfig, options); - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.toObject(message.resource, options); - return object; - }; - - /** - * Converts this SimulateSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SimulateSecurityHealthAnalyticsCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SimulateSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest"; - }; - - SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource = (function() { - - /** - * Properties of a SimulatedResource. - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @interface ISimulatedResource - * @property {string|null} [resourceType] SimulatedResource resourceType - * @property {google.protobuf.IStruct|null} [resourceData] SimulatedResource resourceData - * @property {google.iam.v1.IPolicy|null} [iamPolicyData] SimulatedResource iamPolicyData - */ - - /** - * Constructs a new SimulatedResource. - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest - * @classdesc Represents a SimulatedResource. - * @implements ISimulatedResource - * @constructor - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource=} [properties] Properties to set - */ - function SimulatedResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SimulatedResource resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @instance - */ - SimulatedResource.prototype.resourceType = ""; - - /** - * SimulatedResource resourceData. - * @member {google.protobuf.IStruct|null|undefined} resourceData - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @instance - */ - SimulatedResource.prototype.resourceData = null; - - /** - * SimulatedResource iamPolicyData. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicyData - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @instance - */ - SimulatedResource.prototype.iamPolicyData = null; - - /** - * Creates a new SimulatedResource instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} SimulatedResource instance - */ - SimulatedResource.create = function create(properties) { - return new SimulatedResource(properties); - }; - - /** - * Encodes the specified SimulatedResource message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource} message SimulatedResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimulatedResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceType); - if (message.resourceData != null && Object.hasOwnProperty.call(message, "resourceData")) - $root.google.protobuf.Struct.encode(message.resourceData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.iamPolicyData != null && Object.hasOwnProperty.call(message, "iamPolicyData")) - $root.google.iam.v1.Policy.encode(message.iamPolicyData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SimulatedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.ISimulatedResource} message SimulatedResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimulatedResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SimulatedResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} SimulatedResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimulatedResource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resourceType = reader.string(); - break; - } - case 2: { - message.resourceData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - message.iamPolicyData = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SimulatedResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} SimulatedResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimulatedResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SimulatedResource message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimulatedResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.resourceData != null && message.hasOwnProperty("resourceData")) { - var error = $root.google.protobuf.Struct.verify(message.resourceData); - if (error) - return "resourceData." + error; - } - if (message.iamPolicyData != null && message.hasOwnProperty("iamPolicyData")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicyData); - if (error) - return "iamPolicyData." + error; - } - return null; - }; - - /** - * Creates a SimulatedResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} SimulatedResource - */ - SimulatedResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource) - return object; - var message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource(); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.resourceData != null) { - if (typeof object.resourceData !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.resourceData: object expected"); - message.resourceData = $root.google.protobuf.Struct.fromObject(object.resourceData); - } - if (object.iamPolicyData != null) { - if (typeof object.iamPolicyData !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource.iamPolicyData: object expected"); - message.iamPolicyData = $root.google.iam.v1.Policy.fromObject(object.iamPolicyData); - } - return message; - }; - - /** - * Creates a plain object from a SimulatedResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} message SimulatedResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimulatedResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resourceType = ""; - object.resourceData = null; - object.iamPolicyData = null; - } - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.resourceData != null && message.hasOwnProperty("resourceData")) - object.resourceData = $root.google.protobuf.Struct.toObject(message.resourceData, options); - if (message.iamPolicyData != null && message.hasOwnProperty("iamPolicyData")) - object.iamPolicyData = $root.google.iam.v1.Policy.toObject(message.iamPolicyData, options); - return object; - }; - - /** - * Converts this SimulatedResource to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @instance - * @returns {Object.} JSON object - */ - SimulatedResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SimulatedResource - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SimulatedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource"; - }; - - return SimulatedResource; - })(); - - return SimulateSecurityHealthAnalyticsCustomModuleRequest; - })(); - - v1.SimulateSecurityHealthAnalyticsCustomModuleResponse = (function() { - - /** - * Properties of a SimulateSecurityHealthAnalyticsCustomModuleResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface ISimulateSecurityHealthAnalyticsCustomModuleResponse - * @property {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult|null} [result] SimulateSecurityHealthAnalyticsCustomModuleResponse result - */ - - /** - * Constructs a new SimulateSecurityHealthAnalyticsCustomModuleResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SimulateSecurityHealthAnalyticsCustomModuleResponse. - * @implements ISimulateSecurityHealthAnalyticsCustomModuleResponse - * @constructor - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse=} [properties] Properties to set - */ - function SimulateSecurityHealthAnalyticsCustomModuleResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SimulateSecurityHealthAnalyticsCustomModuleResponse result. - * @member {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult|null|undefined} result - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @instance - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.prototype.result = null; - - /** - * Creates a new SimulateSecurityHealthAnalyticsCustomModuleResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} SimulateSecurityHealthAnalyticsCustomModuleResponse instance - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.create = function create(properties) { - return new SimulateSecurityHealthAnalyticsCustomModuleResponse(properties); - }; - - /** - * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse} message SimulateSecurityHealthAnalyticsCustomModuleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.encode(message.result, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SimulateSecurityHealthAnalyticsCustomModuleResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse} message SimulateSecurityHealthAnalyticsCustomModuleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SimulateSecurityHealthAnalyticsCustomModuleResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} SimulateSecurityHealthAnalyticsCustomModuleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.result = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SimulateSecurityHealthAnalyticsCustomModuleResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} SimulateSecurityHealthAnalyticsCustomModuleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SimulateSecurityHealthAnalyticsCustomModuleResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) { - var error = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify(message.result); - if (error) - return "result." + error; - } - return null; - }; - - /** - * Creates a SimulateSecurityHealthAnalyticsCustomModuleResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} SimulateSecurityHealthAnalyticsCustomModuleResponse - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse(); - if (object.result != null) { - if (typeof object.result !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.result: object expected"); - message.result = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.fromObject(object.result); - } - return message; - }; - - /** - * Creates a plain object from a SimulateSecurityHealthAnalyticsCustomModuleResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse} message SimulateSecurityHealthAnalyticsCustomModuleResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.result = null; - if (message.result != null && message.hasOwnProperty("result")) - object.result = $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.toObject(message.result, options); - return object; - }; - - /** - * Converts this SimulateSecurityHealthAnalyticsCustomModuleResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @instance - * @returns {Object.} JSON object - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SimulateSecurityHealthAnalyticsCustomModuleResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SimulateSecurityHealthAnalyticsCustomModuleResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse"; - }; - - SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult = (function() { - - /** - * Properties of a SimulatedResult. - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @interface ISimulatedResult - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] SimulatedResult finding - * @property {google.protobuf.IEmpty|null} [noViolation] SimulatedResult noViolation - * @property {google.rpc.IStatus|null} [error] SimulatedResult error - */ - - /** - * Constructs a new SimulatedResult. - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse - * @classdesc Represents a SimulatedResult. - * @implements ISimulatedResult - * @constructor - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult=} [properties] Properties to set - */ - function SimulatedResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SimulatedResult finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @instance - */ - SimulatedResult.prototype.finding = null; - - /** - * SimulatedResult noViolation. - * @member {google.protobuf.IEmpty|null|undefined} noViolation - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @instance - */ - SimulatedResult.prototype.noViolation = null; - - /** - * SimulatedResult error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @instance - */ - SimulatedResult.prototype.error = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SimulatedResult result. - * @member {"finding"|"noViolation"|"error"|undefined} result - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @instance - */ - Object.defineProperty(SimulatedResult.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["finding", "noViolation", "error"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SimulatedResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} SimulatedResult instance - */ - SimulatedResult.create = function create(properties) { - return new SimulatedResult(properties); - }; - - /** - * Encodes the specified SimulatedResult message. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult} message SimulatedResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimulatedResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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.noViolation != null && Object.hasOwnProperty.call(message, "noViolation")) - $root.google.protobuf.Empty.encode(message.noViolation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SimulatedResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.ISimulatedResult} message SimulatedResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimulatedResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SimulatedResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} SimulatedResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimulatedResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); - break; - } - case 2: { - message.noViolation = $root.google.protobuf.Empty.decode(reader, reader.uint32()); - break; - } - case 3: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SimulatedResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} SimulatedResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimulatedResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SimulatedResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimulatedResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.finding != null && message.hasOwnProperty("finding")) { - properties.result = 1; - { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } - } - if (message.noViolation != null && message.hasOwnProperty("noViolation")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Empty.verify(message.noViolation); - if (error) - return "noViolation." + error; - } - } - if (message.error != null && message.hasOwnProperty("error")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - return null; - }; - - /** - * Creates a SimulatedResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} SimulatedResult - */ - SimulatedResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult) - return object; - var message = new $root.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } - if (object.noViolation != null) { - if (typeof object.noViolation !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.noViolation: object expected"); - message.noViolation = $root.google.protobuf.Empty.fromObject(object.noViolation); - } - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - return message; - }; - - /** - * Creates a plain object from a SimulatedResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult} message SimulatedResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimulatedResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.finding != null && message.hasOwnProperty("finding")) { - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); - if (options.oneofs) - object.result = "finding"; - } - if (message.noViolation != null && message.hasOwnProperty("noViolation")) { - object.noViolation = $root.google.protobuf.Empty.toObject(message.noViolation, options); - if (options.oneofs) - object.result = "noViolation"; - } - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - return object; - }; - - /** - * Converts this SimulatedResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @instance - * @returns {Object.} JSON object - */ - SimulatedResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SimulatedResult - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SimulatedResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult"; - }; - - return SimulatedResult; - })(); - - return SimulateSecurityHealthAnalyticsCustomModuleResponse; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.UpdateSecurityHealthAnalyticsCustomModuleRequest = (function() { - - /** - * Properties of an UpdateSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateSecurityHealthAnalyticsCustomModuleRequest - * @property {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null} [securityHealthAnalyticsCustomModule] UpdateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityHealthAnalyticsCustomModuleRequest updateMask - */ - - /** - * Constructs a new UpdateSecurityHealthAnalyticsCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateSecurityHealthAnalyticsCustomModuleRequest. - * @implements IUpdateSecurityHealthAnalyticsCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - */ - function UpdateSecurityHealthAnalyticsCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateSecurityHealthAnalyticsCustomModuleRequest securityHealthAnalyticsCustomModule. - * @member {google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null|undefined} securityHealthAnalyticsCustomModule - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.prototype.securityHealthAnalyticsCustomModule = null; - - /** - * UpdateSecurityHealthAnalyticsCustomModuleRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @instance - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateSecurityHealthAnalyticsCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} UpdateSecurityHealthAnalyticsCustomModuleRequest instance - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.create = function create(properties) { - return new UpdateSecurityHealthAnalyticsCustomModuleRequest(properties); - }; - - /** - * Encodes the specified UpdateSecurityHealthAnalyticsCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest} message UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.securityHealthAnalyticsCustomModule != null && Object.hasOwnProperty.call(message, "securityHealthAnalyticsCustomModule")) - $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.encode(message.securityHealthAnalyticsCustomModule, 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 UpdateSecurityHealthAnalyticsCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest} message UpdateSecurityHealthAnalyticsCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} UpdateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.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 UpdateSecurityHealthAnalyticsCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} UpdateSecurityHealthAnalyticsCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateSecurityHealthAnalyticsCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.securityHealthAnalyticsCustomModule != null && message.hasOwnProperty("securityHealthAnalyticsCustomModule")) { - var error = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.verify(message.securityHealthAnalyticsCustomModule); - if (error) - return "securityHealthAnalyticsCustomModule." + 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 UpdateSecurityHealthAnalyticsCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} UpdateSecurityHealthAnalyticsCustomModuleRequest - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest(); - if (object.securityHealthAnalyticsCustomModule != null) { - if (typeof object.securityHealthAnalyticsCustomModule !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.securityHealthAnalyticsCustomModule: object expected"); - message.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.fromObject(object.securityHealthAnalyticsCustomModule); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateSecurityHealthAnalyticsCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest} message UpdateSecurityHealthAnalyticsCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.securityHealthAnalyticsCustomModule = null; - object.updateMask = null; - } - if (message.securityHealthAnalyticsCustomModule != null && message.hasOwnProperty("securityHealthAnalyticsCustomModule")) - object.securityHealthAnalyticsCustomModule = $root.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule.toObject(message.securityHealthAnalyticsCustomModule, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateSecurityHealthAnalyticsCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateSecurityHealthAnalyticsCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateSecurityHealthAnalyticsCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest"; - }; - - return UpdateSecurityHealthAnalyticsCustomModuleRequest; - })(); - - 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.CreateBigQueryExportRequest = (function() { - - /** - * Properties of a CreateBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v1 - * @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 CreateBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateBigQueryExportRequest. - * @implements ICreateBigQueryExportRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest=} [properties] Properties to set - */ - function CreateBigQueryExportRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBigQueryExportRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @instance - */ - CreateBigQueryExportRequest.prototype.parent = ""; - - /** - * CreateBigQueryExportRequest bigQueryExport. - * @member {google.cloud.securitycenter.v1.IBigQueryExport|null|undefined} bigQueryExport - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @instance - */ - CreateBigQueryExportRequest.prototype.bigQueryExport = null; - - /** - * CreateBigQueryExportRequest bigQueryExportId. - * @member {string} bigQueryExportId - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @instance - */ - CreateBigQueryExportRequest.prototype.bigQueryExportId = ""; - - /** - * Creates a new CreateBigQueryExportRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest instance - */ - CreateBigQueryExportRequest.create = function create(properties) { - return new CreateBigQueryExportRequest(properties); - }; - - /** - * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @static - * @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 - */ - CreateBigQueryExportRequest.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.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 CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @static - * @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 - */ - CreateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer. - * @function decode - * @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.CreateBigQueryExportRequest} CreateBigQueryExportRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBigQueryExportRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - CreateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBigQueryExportRequest message. - * @function verify - * @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 - */ - CreateBigQueryExportRequest.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.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 CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest - */ - CreateBigQueryExportRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest) - return object; - 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 CreateBigQueryExportRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} message CreateBigQueryExportRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBigQueryExportRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.bigQueryExport = null; - object.bigQueryExportId = ""; - } - 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 CreateBigQueryExportRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBigQueryExportRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1.UpdateBigQueryExportRequest = (function() { - - /** - * 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 UpdateBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateBigQueryExportRequest. - * @implements IUpdateBigQueryExportRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest=} [properties] Properties to set - */ - function UpdateBigQueryExportRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBigQueryExportRequest bigQueryExport. - * @member {google.cloud.securitycenter.v1.IBigQueryExport|null|undefined} bigQueryExport - * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest - * @instance - */ - UpdateBigQueryExportRequest.prototype.bigQueryExport = null; - - /** - * UpdateBigQueryExportRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest - * @instance - */ - UpdateBigQueryExportRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBigQueryExportRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest instance - */ - UpdateBigQueryExportRequest.create = function create(properties) { - return new UpdateBigQueryExportRequest(properties); - }; - - /** - * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest - * @static - * @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 - */ - UpdateBigQueryExportRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest - * @static - * @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 - */ - UpdateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer. - * @function decode - * @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.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBigQueryExportRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - UpdateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1.CreateEventThreatDetectionCustomModuleRequest = (function() { - - /** - * Properties of a CreateEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ICreateEventThreatDetectionCustomModuleRequest - * @property {string|null} [parent] CreateEventThreatDetectionCustomModuleRequest parent - * @property {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null} [eventThreatDetectionCustomModule] CreateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule - */ - - /** - * Constructs a new CreateEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateEventThreatDetectionCustomModuleRequest. - * @implements ICreateEventThreatDetectionCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - */ - function CreateEventThreatDetectionCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateEventThreatDetectionCustomModuleRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @instance - */ - CreateEventThreatDetectionCustomModuleRequest.prototype.parent = ""; - - /** - * CreateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule. - * @member {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null|undefined} eventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @instance - */ - CreateEventThreatDetectionCustomModuleRequest.prototype.eventThreatDetectionCustomModule = null; - - /** - * Creates a new CreateEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} CreateEventThreatDetectionCustomModuleRequest instance - */ - CreateEventThreatDetectionCustomModuleRequest.create = function create(properties) { - return new CreateEventThreatDetectionCustomModuleRequest(properties); - }; - - /** - * Encodes the specified CreateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest} message CreateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateEventThreatDetectionCustomModuleRequest.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.eventThreatDetectionCustomModule != null && Object.hasOwnProperty.call(message, "eventThreatDetectionCustomModule")) - $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.encode(message.eventThreatDetectionCustomModule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest} message CreateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} CreateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} CreateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateEventThreatDetectionCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateEventThreatDetectionCustomModuleRequest.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.eventThreatDetectionCustomModule != null && message.hasOwnProperty("eventThreatDetectionCustomModule")) { - var error = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify(message.eventThreatDetectionCustomModule); - if (error) - return "eventThreatDetectionCustomModule." + error; - } - return null; - }; - - /** - * Creates a CreateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} CreateEventThreatDetectionCustomModuleRequest - */ - CreateEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.eventThreatDetectionCustomModule != null) { - if (typeof object.eventThreatDetectionCustomModule !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest.eventThreatDetectionCustomModule: object expected"); - message.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.fromObject(object.eventThreatDetectionCustomModule); - } - return message; - }; - - /** - * Creates a plain object from a CreateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest} message CreateEventThreatDetectionCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateEventThreatDetectionCustomModuleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.eventThreatDetectionCustomModule = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.eventThreatDetectionCustomModule != null && message.hasOwnProperty("eventThreatDetectionCustomModule")) - object.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.toObject(message.eventThreatDetectionCustomModule, options); - return object; - }; - - /** - * Converts this CreateEventThreatDetectionCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - CreateEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateEventThreatDetectionCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest"; - }; - - return CreateEventThreatDetectionCustomModuleRequest; - })(); - - v1.ValidateEventThreatDetectionCustomModuleRequest = (function() { - - /** - * Properties of a ValidateEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IValidateEventThreatDetectionCustomModuleRequest - * @property {string|null} [parent] ValidateEventThreatDetectionCustomModuleRequest parent - * @property {string|null} [rawText] ValidateEventThreatDetectionCustomModuleRequest rawText - * @property {string|null} [type] ValidateEventThreatDetectionCustomModuleRequest type - */ - - /** - * Constructs a new ValidateEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ValidateEventThreatDetectionCustomModuleRequest. - * @implements IValidateEventThreatDetectionCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - */ - function ValidateEventThreatDetectionCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidateEventThreatDetectionCustomModuleRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @instance - */ - ValidateEventThreatDetectionCustomModuleRequest.prototype.parent = ""; - - /** - * ValidateEventThreatDetectionCustomModuleRequest rawText. - * @member {string} rawText - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @instance - */ - ValidateEventThreatDetectionCustomModuleRequest.prototype.rawText = ""; - - /** - * ValidateEventThreatDetectionCustomModuleRequest type. - * @member {string} type - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @instance - */ - ValidateEventThreatDetectionCustomModuleRequest.prototype.type = ""; - - /** - * Creates a new ValidateEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} ValidateEventThreatDetectionCustomModuleRequest instance - */ - ValidateEventThreatDetectionCustomModuleRequest.create = function create(properties) { - return new ValidateEventThreatDetectionCustomModuleRequest(properties); - }; - - /** - * Encodes the specified ValidateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest} message ValidateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateEventThreatDetectionCustomModuleRequest.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.rawText != null && Object.hasOwnProperty.call(message, "rawText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.rawText); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - return writer; - }; - - /** - * Encodes the specified ValidateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest} message ValidateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} ValidateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.rawText = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} ValidateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidateEventThreatDetectionCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidateEventThreatDetectionCustomModuleRequest.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.rawText != null && message.hasOwnProperty("rawText")) - if (!$util.isString(message.rawText)) - return "rawText: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - return null; - }; - - /** - * Creates a ValidateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} ValidateEventThreatDetectionCustomModuleRequest - */ - ValidateEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.rawText != null) - message.rawText = String(object.rawText); - if (object.type != null) - message.type = String(object.type); - return message; - }; - - /** - * Creates a plain object from a ValidateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest} message ValidateEventThreatDetectionCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidateEventThreatDetectionCustomModuleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.rawText = ""; - object.type = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.rawText != null && message.hasOwnProperty("rawText")) - object.rawText = message.rawText; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this ValidateEventThreatDetectionCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - ValidateEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValidateEventThreatDetectionCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValidateEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest"; - }; - - return ValidateEventThreatDetectionCustomModuleRequest; - })(); - - v1.ValidateEventThreatDetectionCustomModuleResponse = (function() { - - /** - * Properties of a ValidateEventThreatDetectionCustomModuleResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IValidateEventThreatDetectionCustomModuleResponse - * @property {google.cloud.securitycenter.v1.ICustomModuleValidationErrors|null} [errors] ValidateEventThreatDetectionCustomModuleResponse errors - */ - - /** - * Constructs a new ValidateEventThreatDetectionCustomModuleResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ValidateEventThreatDetectionCustomModuleResponse. - * @implements IValidateEventThreatDetectionCustomModuleResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse=} [properties] Properties to set - */ - function ValidateEventThreatDetectionCustomModuleResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidateEventThreatDetectionCustomModuleResponse errors. - * @member {google.cloud.securitycenter.v1.ICustomModuleValidationErrors|null|undefined} errors - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @instance - */ - ValidateEventThreatDetectionCustomModuleResponse.prototype.errors = null; - - /** - * Creates a new ValidateEventThreatDetectionCustomModuleResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} ValidateEventThreatDetectionCustomModuleResponse instance - */ - ValidateEventThreatDetectionCustomModuleResponse.create = function create(properties) { - return new ValidateEventThreatDetectionCustomModuleResponse(properties); - }; - - /** - * Encodes the specified ValidateEventThreatDetectionCustomModuleResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse} message ValidateEventThreatDetectionCustomModuleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateEventThreatDetectionCustomModuleResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) - $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.encode(message.errors, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ValidateEventThreatDetectionCustomModuleResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse} message ValidateEventThreatDetectionCustomModuleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateEventThreatDetectionCustomModuleResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidateEventThreatDetectionCustomModuleResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} ValidateEventThreatDetectionCustomModuleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateEventThreatDetectionCustomModuleResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.errors = $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidateEventThreatDetectionCustomModuleResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} ValidateEventThreatDetectionCustomModuleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateEventThreatDetectionCustomModuleResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidateEventThreatDetectionCustomModuleResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidateEventThreatDetectionCustomModuleResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.errors != null && message.hasOwnProperty("errors")) { - var error = $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.verify(message.errors); - if (error) - return "errors." + error; - } - return null; - }; - - /** - * Creates a ValidateEventThreatDetectionCustomModuleResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} ValidateEventThreatDetectionCustomModuleResponse - */ - ValidateEventThreatDetectionCustomModuleResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse(); - if (object.errors != null) { - if (typeof object.errors !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse.errors: object expected"); - message.errors = $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.fromObject(object.errors); - } - return message; - }; - - /** - * Creates a plain object from a ValidateEventThreatDetectionCustomModuleResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse} message ValidateEventThreatDetectionCustomModuleResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidateEventThreatDetectionCustomModuleResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.errors = null; - if (message.errors != null && message.hasOwnProperty("errors")) - object.errors = $root.google.cloud.securitycenter.v1.CustomModuleValidationErrors.toObject(message.errors, options); - return object; - }; - - /** - * Converts this ValidateEventThreatDetectionCustomModuleResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @instance - * @returns {Object.} JSON object - */ - ValidateEventThreatDetectionCustomModuleResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValidateEventThreatDetectionCustomModuleResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValidateEventThreatDetectionCustomModuleResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse"; - }; - - return ValidateEventThreatDetectionCustomModuleResponse; - })(); - - v1.DeleteEventThreatDetectionCustomModuleRequest = (function() { - - /** - * Properties of a DeleteEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IDeleteEventThreatDetectionCustomModuleRequest - * @property {string|null} [name] DeleteEventThreatDetectionCustomModuleRequest name - */ - - /** - * Constructs a new DeleteEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a DeleteEventThreatDetectionCustomModuleRequest. - * @implements IDeleteEventThreatDetectionCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - */ - function DeleteEventThreatDetectionCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteEventThreatDetectionCustomModuleRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @instance - */ - DeleteEventThreatDetectionCustomModuleRequest.prototype.name = ""; - - /** - * Creates a new DeleteEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} DeleteEventThreatDetectionCustomModuleRequest instance - */ - DeleteEventThreatDetectionCustomModuleRequest.create = function create(properties) { - return new DeleteEventThreatDetectionCustomModuleRequest(properties); - }; - - /** - * Encodes the specified DeleteEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest} message DeleteEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEventThreatDetectionCustomModuleRequest.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 DeleteEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest} message DeleteEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} DeleteEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} DeleteEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteEventThreatDetectionCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteEventThreatDetectionCustomModuleRequest.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 DeleteEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} DeleteEventThreatDetectionCustomModuleRequest - */ - DeleteEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest} message DeleteEventThreatDetectionCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteEventThreatDetectionCustomModuleRequest.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 DeleteEventThreatDetectionCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteEventThreatDetectionCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest"; - }; - - return DeleteEventThreatDetectionCustomModuleRequest; - })(); - - v1.GetEventThreatDetectionCustomModuleRequest = (function() { - - /** - * Properties of a GetEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetEventThreatDetectionCustomModuleRequest - * @property {string|null} [name] GetEventThreatDetectionCustomModuleRequest name - */ - - /** - * Constructs a new GetEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetEventThreatDetectionCustomModuleRequest. - * @implements IGetEventThreatDetectionCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - */ - function GetEventThreatDetectionCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEventThreatDetectionCustomModuleRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @instance - */ - GetEventThreatDetectionCustomModuleRequest.prototype.name = ""; - - /** - * Creates a new GetEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} GetEventThreatDetectionCustomModuleRequest instance - */ - GetEventThreatDetectionCustomModuleRequest.create = function create(properties) { - return new GetEventThreatDetectionCustomModuleRequest(properties); - }; - - /** - * Encodes the specified GetEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest} message GetEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEventThreatDetectionCustomModuleRequest.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 GetEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest} message GetEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} GetEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} GetEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEventThreatDetectionCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEventThreatDetectionCustomModuleRequest.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 GetEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} GetEventThreatDetectionCustomModuleRequest - */ - GetEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest} message GetEventThreatDetectionCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEventThreatDetectionCustomModuleRequest.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 GetEventThreatDetectionCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - GetEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEventThreatDetectionCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest"; - }; - - return GetEventThreatDetectionCustomModuleRequest; - })(); - - v1.ListDescendantEventThreatDetectionCustomModulesRequest = (function() { - - /** - * Properties of a ListDescendantEventThreatDetectionCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListDescendantEventThreatDetectionCustomModulesRequest - * @property {string|null} [parent] ListDescendantEventThreatDetectionCustomModulesRequest parent - * @property {string|null} [pageToken] ListDescendantEventThreatDetectionCustomModulesRequest pageToken - * @property {number|null} [pageSize] ListDescendantEventThreatDetectionCustomModulesRequest pageSize - */ - - /** - * Constructs a new ListDescendantEventThreatDetectionCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListDescendantEventThreatDetectionCustomModulesRequest. - * @implements IListDescendantEventThreatDetectionCustomModulesRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest=} [properties] Properties to set - */ - function ListDescendantEventThreatDetectionCustomModulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDescendantEventThreatDetectionCustomModulesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @instance - */ - ListDescendantEventThreatDetectionCustomModulesRequest.prototype.parent = ""; - - /** - * ListDescendantEventThreatDetectionCustomModulesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @instance - */ - ListDescendantEventThreatDetectionCustomModulesRequest.prototype.pageToken = ""; - - /** - * ListDescendantEventThreatDetectionCustomModulesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @instance - */ - ListDescendantEventThreatDetectionCustomModulesRequest.prototype.pageSize = 0; - - /** - * Creates a new ListDescendantEventThreatDetectionCustomModulesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} ListDescendantEventThreatDetectionCustomModulesRequest instance - */ - ListDescendantEventThreatDetectionCustomModulesRequest.create = function create(properties) { - return new ListDescendantEventThreatDetectionCustomModulesRequest(properties); - }; - - /** - * Encodes the specified ListDescendantEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest} message ListDescendantEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDescendantEventThreatDetectionCustomModulesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - return writer; - }; - - /** - * Encodes the specified ListDescendantEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest} message ListDescendantEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDescendantEventThreatDetectionCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDescendantEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} ListDescendantEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDescendantEventThreatDetectionCustomModulesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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; - } - } - return message; - }; - - /** - * Decodes a ListDescendantEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} ListDescendantEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDescendantEventThreatDetectionCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDescendantEventThreatDetectionCustomModulesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDescendantEventThreatDetectionCustomModulesRequest.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 ListDescendantEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} ListDescendantEventThreatDetectionCustomModulesRequest - */ - ListDescendantEventThreatDetectionCustomModulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest(); - 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 ListDescendantEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest} message ListDescendantEventThreatDetectionCustomModulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDescendantEventThreatDetectionCustomModulesRequest.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 ListDescendantEventThreatDetectionCustomModulesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDescendantEventThreatDetectionCustomModulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDescendantEventThreatDetectionCustomModulesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDescendantEventThreatDetectionCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest"; - }; - - return ListDescendantEventThreatDetectionCustomModulesRequest; - })(); - - v1.ListDescendantEventThreatDetectionCustomModulesResponse = (function() { - - /** - * Properties of a ListDescendantEventThreatDetectionCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListDescendantEventThreatDetectionCustomModulesResponse - * @property {Array.|null} [eventThreatDetectionCustomModules] ListDescendantEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules - * @property {string|null} [nextPageToken] ListDescendantEventThreatDetectionCustomModulesResponse nextPageToken - */ - - /** - * Constructs a new ListDescendantEventThreatDetectionCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListDescendantEventThreatDetectionCustomModulesResponse. - * @implements IListDescendantEventThreatDetectionCustomModulesResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse=} [properties] Properties to set - */ - function ListDescendantEventThreatDetectionCustomModulesResponse(properties) { - this.eventThreatDetectionCustomModules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDescendantEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules. - * @member {Array.} eventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @instance - */ - ListDescendantEventThreatDetectionCustomModulesResponse.prototype.eventThreatDetectionCustomModules = $util.emptyArray; - - /** - * ListDescendantEventThreatDetectionCustomModulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @instance - */ - ListDescendantEventThreatDetectionCustomModulesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDescendantEventThreatDetectionCustomModulesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} ListDescendantEventThreatDetectionCustomModulesResponse instance - */ - ListDescendantEventThreatDetectionCustomModulesResponse.create = function create(properties) { - return new ListDescendantEventThreatDetectionCustomModulesResponse(properties); - }; - - /** - * Encodes the specified ListDescendantEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse} message ListDescendantEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDescendantEventThreatDetectionCustomModulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.eventThreatDetectionCustomModules != null && message.eventThreatDetectionCustomModules.length) - for (var i = 0; i < message.eventThreatDetectionCustomModules.length; ++i) - $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.encode(message.eventThreatDetectionCustomModules[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 ListDescendantEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse} message ListDescendantEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDescendantEventThreatDetectionCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDescendantEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} ListDescendantEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDescendantEventThreatDetectionCustomModulesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.eventThreatDetectionCustomModules && message.eventThreatDetectionCustomModules.length)) - message.eventThreatDetectionCustomModules = []; - message.eventThreatDetectionCustomModules.push($root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDescendantEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} ListDescendantEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDescendantEventThreatDetectionCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDescendantEventThreatDetectionCustomModulesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDescendantEventThreatDetectionCustomModulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.eventThreatDetectionCustomModules != null && message.hasOwnProperty("eventThreatDetectionCustomModules")) { - if (!Array.isArray(message.eventThreatDetectionCustomModules)) - return "eventThreatDetectionCustomModules: array expected"; - for (var i = 0; i < message.eventThreatDetectionCustomModules.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify(message.eventThreatDetectionCustomModules[i]); - if (error) - return "eventThreatDetectionCustomModules." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDescendantEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} ListDescendantEventThreatDetectionCustomModulesResponse - */ - ListDescendantEventThreatDetectionCustomModulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse(); - if (object.eventThreatDetectionCustomModules) { - if (!Array.isArray(object.eventThreatDetectionCustomModules)) - throw TypeError(".google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.eventThreatDetectionCustomModules: array expected"); - message.eventThreatDetectionCustomModules = []; - for (var i = 0; i < object.eventThreatDetectionCustomModules.length; ++i) { - if (typeof object.eventThreatDetectionCustomModules[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse.eventThreatDetectionCustomModules: object expected"); - message.eventThreatDetectionCustomModules[i] = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.fromObject(object.eventThreatDetectionCustomModules[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDescendantEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse} message ListDescendantEventThreatDetectionCustomModulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDescendantEventThreatDetectionCustomModulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.eventThreatDetectionCustomModules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.eventThreatDetectionCustomModules && message.eventThreatDetectionCustomModules.length) { - object.eventThreatDetectionCustomModules = []; - for (var j = 0; j < message.eventThreatDetectionCustomModules.length; ++j) - object.eventThreatDetectionCustomModules[j] = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.toObject(message.eventThreatDetectionCustomModules[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDescendantEventThreatDetectionCustomModulesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDescendantEventThreatDetectionCustomModulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDescendantEventThreatDetectionCustomModulesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDescendantEventThreatDetectionCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse"; - }; - - return ListDescendantEventThreatDetectionCustomModulesResponse; - })(); - - v1.ListEventThreatDetectionCustomModulesRequest = (function() { - - /** - * Properties of a ListEventThreatDetectionCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListEventThreatDetectionCustomModulesRequest - * @property {string|null} [parent] ListEventThreatDetectionCustomModulesRequest parent - * @property {string|null} [pageToken] ListEventThreatDetectionCustomModulesRequest pageToken - * @property {number|null} [pageSize] ListEventThreatDetectionCustomModulesRequest pageSize - */ - - /** - * Constructs a new ListEventThreatDetectionCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListEventThreatDetectionCustomModulesRequest. - * @implements IListEventThreatDetectionCustomModulesRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest=} [properties] Properties to set - */ - function ListEventThreatDetectionCustomModulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEventThreatDetectionCustomModulesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @instance - */ - ListEventThreatDetectionCustomModulesRequest.prototype.parent = ""; - - /** - * ListEventThreatDetectionCustomModulesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @instance - */ - ListEventThreatDetectionCustomModulesRequest.prototype.pageToken = ""; - - /** - * ListEventThreatDetectionCustomModulesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @instance - */ - ListEventThreatDetectionCustomModulesRequest.prototype.pageSize = 0; - - /** - * Creates a new ListEventThreatDetectionCustomModulesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} ListEventThreatDetectionCustomModulesRequest instance - */ - ListEventThreatDetectionCustomModulesRequest.create = function create(properties) { - return new ListEventThreatDetectionCustomModulesRequest(properties); - }; - - /** - * Encodes the specified ListEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest} message ListEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEventThreatDetectionCustomModulesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - return writer; - }; - - /** - * Encodes the specified ListEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest} message ListEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEventThreatDetectionCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} ListEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEventThreatDetectionCustomModulesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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; - } - } - return message; - }; - - /** - * Decodes a ListEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} ListEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEventThreatDetectionCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEventThreatDetectionCustomModulesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEventThreatDetectionCustomModulesRequest.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 ListEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} ListEventThreatDetectionCustomModulesRequest - */ - ListEventThreatDetectionCustomModulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest(); - 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 ListEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest} message ListEventThreatDetectionCustomModulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEventThreatDetectionCustomModulesRequest.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 ListEventThreatDetectionCustomModulesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @instance - * @returns {Object.} JSON object - */ - ListEventThreatDetectionCustomModulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEventThreatDetectionCustomModulesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEventThreatDetectionCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest"; - }; - - return ListEventThreatDetectionCustomModulesRequest; - })(); - - v1.ListEventThreatDetectionCustomModulesResponse = (function() { - - /** - * Properties of a ListEventThreatDetectionCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListEventThreatDetectionCustomModulesResponse - * @property {Array.|null} [eventThreatDetectionCustomModules] ListEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules - * @property {string|null} [nextPageToken] ListEventThreatDetectionCustomModulesResponse nextPageToken - */ - - /** - * Constructs a new ListEventThreatDetectionCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListEventThreatDetectionCustomModulesResponse. - * @implements IListEventThreatDetectionCustomModulesResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse=} [properties] Properties to set - */ - function ListEventThreatDetectionCustomModulesResponse(properties) { - this.eventThreatDetectionCustomModules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEventThreatDetectionCustomModulesResponse eventThreatDetectionCustomModules. - * @member {Array.} eventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @instance - */ - ListEventThreatDetectionCustomModulesResponse.prototype.eventThreatDetectionCustomModules = $util.emptyArray; - - /** - * ListEventThreatDetectionCustomModulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @instance - */ - ListEventThreatDetectionCustomModulesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEventThreatDetectionCustomModulesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} ListEventThreatDetectionCustomModulesResponse instance - */ - ListEventThreatDetectionCustomModulesResponse.create = function create(properties) { - return new ListEventThreatDetectionCustomModulesResponse(properties); - }; - - /** - * Encodes the specified ListEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse} message ListEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEventThreatDetectionCustomModulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.eventThreatDetectionCustomModules != null && message.eventThreatDetectionCustomModules.length) - for (var i = 0; i < message.eventThreatDetectionCustomModules.length; ++i) - $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.encode(message.eventThreatDetectionCustomModules[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 ListEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse} message ListEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEventThreatDetectionCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} ListEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEventThreatDetectionCustomModulesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.eventThreatDetectionCustomModules && message.eventThreatDetectionCustomModules.length)) - message.eventThreatDetectionCustomModules = []; - message.eventThreatDetectionCustomModules.push($root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} ListEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEventThreatDetectionCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEventThreatDetectionCustomModulesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEventThreatDetectionCustomModulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.eventThreatDetectionCustomModules != null && message.hasOwnProperty("eventThreatDetectionCustomModules")) { - if (!Array.isArray(message.eventThreatDetectionCustomModules)) - return "eventThreatDetectionCustomModules: array expected"; - for (var i = 0; i < message.eventThreatDetectionCustomModules.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify(message.eventThreatDetectionCustomModules[i]); - if (error) - return "eventThreatDetectionCustomModules." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} ListEventThreatDetectionCustomModulesResponse - */ - ListEventThreatDetectionCustomModulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse(); - if (object.eventThreatDetectionCustomModules) { - if (!Array.isArray(object.eventThreatDetectionCustomModules)) - throw TypeError(".google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.eventThreatDetectionCustomModules: array expected"); - message.eventThreatDetectionCustomModules = []; - for (var i = 0; i < object.eventThreatDetectionCustomModules.length; ++i) { - if (typeof object.eventThreatDetectionCustomModules[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse.eventThreatDetectionCustomModules: object expected"); - message.eventThreatDetectionCustomModules[i] = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.fromObject(object.eventThreatDetectionCustomModules[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse} message ListEventThreatDetectionCustomModulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEventThreatDetectionCustomModulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.eventThreatDetectionCustomModules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.eventThreatDetectionCustomModules && message.eventThreatDetectionCustomModules.length) { - object.eventThreatDetectionCustomModules = []; - for (var j = 0; j < message.eventThreatDetectionCustomModules.length; ++j) - object.eventThreatDetectionCustomModules[j] = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.toObject(message.eventThreatDetectionCustomModules[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEventThreatDetectionCustomModulesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @instance - * @returns {Object.} JSON object - */ - ListEventThreatDetectionCustomModulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEventThreatDetectionCustomModulesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEventThreatDetectionCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse"; - }; - - return ListEventThreatDetectionCustomModulesResponse; - })(); - - v1.UpdateEventThreatDetectionCustomModuleRequest = (function() { - - /** - * Properties of an UpdateEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateEventThreatDetectionCustomModuleRequest - * @property {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null} [eventThreatDetectionCustomModule] UpdateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEventThreatDetectionCustomModuleRequest updateMask - */ - - /** - * Constructs a new UpdateEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateEventThreatDetectionCustomModuleRequest. - * @implements IUpdateEventThreatDetectionCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - */ - function UpdateEventThreatDetectionCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateEventThreatDetectionCustomModuleRequest eventThreatDetectionCustomModule. - * @member {google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null|undefined} eventThreatDetectionCustomModule - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @instance - */ - UpdateEventThreatDetectionCustomModuleRequest.prototype.eventThreatDetectionCustomModule = null; - - /** - * UpdateEventThreatDetectionCustomModuleRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @instance - */ - UpdateEventThreatDetectionCustomModuleRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} UpdateEventThreatDetectionCustomModuleRequest instance - */ - UpdateEventThreatDetectionCustomModuleRequest.create = function create(properties) { - return new UpdateEventThreatDetectionCustomModuleRequest(properties); - }; - - /** - * Encodes the specified UpdateEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest} message UpdateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEventThreatDetectionCustomModuleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.eventThreatDetectionCustomModule != null && Object.hasOwnProperty.call(message, "eventThreatDetectionCustomModule")) - $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.encode(message.eventThreatDetectionCustomModule, 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 UpdateEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest} message UpdateEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} UpdateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.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 UpdateEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} UpdateEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateEventThreatDetectionCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateEventThreatDetectionCustomModuleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.eventThreatDetectionCustomModule != null && message.hasOwnProperty("eventThreatDetectionCustomModule")) { - var error = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.verify(message.eventThreatDetectionCustomModule); - if (error) - return "eventThreatDetectionCustomModule." + 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 UpdateEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} UpdateEventThreatDetectionCustomModuleRequest - */ - UpdateEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest(); - if (object.eventThreatDetectionCustomModule != null) { - if (typeof object.eventThreatDetectionCustomModule !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.eventThreatDetectionCustomModule: object expected"); - message.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.fromObject(object.eventThreatDetectionCustomModule); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest} message UpdateEventThreatDetectionCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateEventThreatDetectionCustomModuleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.eventThreatDetectionCustomModule = null; - object.updateMask = null; - } - if (message.eventThreatDetectionCustomModule != null && message.hasOwnProperty("eventThreatDetectionCustomModule")) - object.eventThreatDetectionCustomModule = $root.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.toObject(message.eventThreatDetectionCustomModule, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateEventThreatDetectionCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateEventThreatDetectionCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest"; - }; - - return UpdateEventThreatDetectionCustomModuleRequest; - })(); - - v1.GetEffectiveEventThreatDetectionCustomModuleRequest = (function() { - - /** - * Properties of a GetEffectiveEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetEffectiveEventThreatDetectionCustomModuleRequest - * @property {string|null} [name] GetEffectiveEventThreatDetectionCustomModuleRequest name - */ - - /** - * Constructs a new GetEffectiveEventThreatDetectionCustomModuleRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetEffectiveEventThreatDetectionCustomModuleRequest. - * @implements IGetEffectiveEventThreatDetectionCustomModuleRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - */ - function GetEffectiveEventThreatDetectionCustomModuleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEffectiveEventThreatDetectionCustomModuleRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @instance - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.prototype.name = ""; - - /** - * Creates a new GetEffectiveEventThreatDetectionCustomModuleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} GetEffectiveEventThreatDetectionCustomModuleRequest instance - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.create = function create(properties) { - return new GetEffectiveEventThreatDetectionCustomModuleRequest(properties); - }; - - /** - * Encodes the specified GetEffectiveEventThreatDetectionCustomModuleRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest} message GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.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 GetEffectiveEventThreatDetectionCustomModuleRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest} message GetEffectiveEventThreatDetectionCustomModuleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEffectiveEventThreatDetectionCustomModuleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} GetEffectiveEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEffectiveEventThreatDetectionCustomModuleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} GetEffectiveEventThreatDetectionCustomModuleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEffectiveEventThreatDetectionCustomModuleRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.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 GetEffectiveEventThreatDetectionCustomModuleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} GetEffectiveEventThreatDetectionCustomModuleRequest - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEffectiveEventThreatDetectionCustomModuleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest} message GetEffectiveEventThreatDetectionCustomModuleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.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 GetEffectiveEventThreatDetectionCustomModuleRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @instance - * @returns {Object.} JSON object - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEffectiveEventThreatDetectionCustomModuleRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEffectiveEventThreatDetectionCustomModuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest"; - }; - - return GetEffectiveEventThreatDetectionCustomModuleRequest; - })(); - - v1.ListEffectiveEventThreatDetectionCustomModulesRequest = (function() { - - /** - * Properties of a ListEffectiveEventThreatDetectionCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListEffectiveEventThreatDetectionCustomModulesRequest - * @property {string|null} [parent] ListEffectiveEventThreatDetectionCustomModulesRequest parent - * @property {string|null} [pageToken] ListEffectiveEventThreatDetectionCustomModulesRequest pageToken - * @property {number|null} [pageSize] ListEffectiveEventThreatDetectionCustomModulesRequest pageSize - */ - - /** - * Constructs a new ListEffectiveEventThreatDetectionCustomModulesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListEffectiveEventThreatDetectionCustomModulesRequest. - * @implements IListEffectiveEventThreatDetectionCustomModulesRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest=} [properties] Properties to set - */ - function ListEffectiveEventThreatDetectionCustomModulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEffectiveEventThreatDetectionCustomModulesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @instance - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.prototype.parent = ""; - - /** - * ListEffectiveEventThreatDetectionCustomModulesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @instance - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.prototype.pageToken = ""; - - /** - * ListEffectiveEventThreatDetectionCustomModulesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @instance - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.prototype.pageSize = 0; - - /** - * Creates a new ListEffectiveEventThreatDetectionCustomModulesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} ListEffectiveEventThreatDetectionCustomModulesRequest instance - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.create = function create(properties) { - return new ListEffectiveEventThreatDetectionCustomModulesRequest(properties); - }; - - /** - * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest} message ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - return writer; - }; - - /** - * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest} message ListEffectiveEventThreatDetectionCustomModulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEffectiveEventThreatDetectionCustomModulesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} ListEffectiveEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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; - } - } - return message; - }; - - /** - * Decodes a ListEffectiveEventThreatDetectionCustomModulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} ListEffectiveEventThreatDetectionCustomModulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEffectiveEventThreatDetectionCustomModulesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.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 ListEffectiveEventThreatDetectionCustomModulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} ListEffectiveEventThreatDetectionCustomModulesRequest - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest(); - 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 ListEffectiveEventThreatDetectionCustomModulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest} message ListEffectiveEventThreatDetectionCustomModulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.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 ListEffectiveEventThreatDetectionCustomModulesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @instance - * @returns {Object.} JSON object - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEffectiveEventThreatDetectionCustomModulesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEffectiveEventThreatDetectionCustomModulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest"; - }; - - return ListEffectiveEventThreatDetectionCustomModulesRequest; - })(); - - v1.ListEffectiveEventThreatDetectionCustomModulesResponse = (function() { - - /** - * Properties of a ListEffectiveEventThreatDetectionCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListEffectiveEventThreatDetectionCustomModulesResponse - * @property {Array.|null} [effectiveEventThreatDetectionCustomModules] ListEffectiveEventThreatDetectionCustomModulesResponse effectiveEventThreatDetectionCustomModules - * @property {string|null} [nextPageToken] ListEffectiveEventThreatDetectionCustomModulesResponse nextPageToken - */ - - /** - * Constructs a new ListEffectiveEventThreatDetectionCustomModulesResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListEffectiveEventThreatDetectionCustomModulesResponse. - * @implements IListEffectiveEventThreatDetectionCustomModulesResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse=} [properties] Properties to set - */ - function ListEffectiveEventThreatDetectionCustomModulesResponse(properties) { - this.effectiveEventThreatDetectionCustomModules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEffectiveEventThreatDetectionCustomModulesResponse effectiveEventThreatDetectionCustomModules. - * @member {Array.} effectiveEventThreatDetectionCustomModules - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @instance - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.prototype.effectiveEventThreatDetectionCustomModules = $util.emptyArray; - - /** - * ListEffectiveEventThreatDetectionCustomModulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @instance - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEffectiveEventThreatDetectionCustomModulesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} ListEffectiveEventThreatDetectionCustomModulesResponse instance - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.create = function create(properties) { - return new ListEffectiveEventThreatDetectionCustomModulesResponse(properties); - }; - - /** - * Encodes the specified ListEffectiveEventThreatDetectionCustomModulesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse} message ListEffectiveEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.effectiveEventThreatDetectionCustomModules != null && message.effectiveEventThreatDetectionCustomModules.length) - for (var i = 0; i < message.effectiveEventThreatDetectionCustomModules.length; ++i) - $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.encode(message.effectiveEventThreatDetectionCustomModules[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 ListEffectiveEventThreatDetectionCustomModulesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse} message ListEffectiveEventThreatDetectionCustomModulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEffectiveEventThreatDetectionCustomModulesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} ListEffectiveEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.effectiveEventThreatDetectionCustomModules && message.effectiveEventThreatDetectionCustomModules.length)) - message.effectiveEventThreatDetectionCustomModules = []; - message.effectiveEventThreatDetectionCustomModules.push($root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEffectiveEventThreatDetectionCustomModulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} ListEffectiveEventThreatDetectionCustomModulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEffectiveEventThreatDetectionCustomModulesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.effectiveEventThreatDetectionCustomModules != null && message.hasOwnProperty("effectiveEventThreatDetectionCustomModules")) { - if (!Array.isArray(message.effectiveEventThreatDetectionCustomModules)) - return "effectiveEventThreatDetectionCustomModules: array expected"; - for (var i = 0; i < message.effectiveEventThreatDetectionCustomModules.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.verify(message.effectiveEventThreatDetectionCustomModules[i]); - if (error) - return "effectiveEventThreatDetectionCustomModules." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEffectiveEventThreatDetectionCustomModulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} ListEffectiveEventThreatDetectionCustomModulesResponse - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse(); - if (object.effectiveEventThreatDetectionCustomModules) { - if (!Array.isArray(object.effectiveEventThreatDetectionCustomModules)) - throw TypeError(".google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.effectiveEventThreatDetectionCustomModules: array expected"); - message.effectiveEventThreatDetectionCustomModules = []; - for (var i = 0; i < object.effectiveEventThreatDetectionCustomModules.length; ++i) { - if (typeof object.effectiveEventThreatDetectionCustomModules[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse.effectiveEventThreatDetectionCustomModules: object expected"); - message.effectiveEventThreatDetectionCustomModules[i] = $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.fromObject(object.effectiveEventThreatDetectionCustomModules[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEffectiveEventThreatDetectionCustomModulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse} message ListEffectiveEventThreatDetectionCustomModulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.effectiveEventThreatDetectionCustomModules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.effectiveEventThreatDetectionCustomModules && message.effectiveEventThreatDetectionCustomModules.length) { - object.effectiveEventThreatDetectionCustomModules = []; - for (var j = 0; j < message.effectiveEventThreatDetectionCustomModules.length; ++j) - object.effectiveEventThreatDetectionCustomModules[j] = $root.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.toObject(message.effectiveEventThreatDetectionCustomModules[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEffectiveEventThreatDetectionCustomModulesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @instance - * @returns {Object.} JSON object - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEffectiveEventThreatDetectionCustomModulesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEffectiveEventThreatDetectionCustomModulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse"; - }; - - return ListEffectiveEventThreatDetectionCustomModulesResponse; - })(); - - v1.Simulation = (function() { - - /** - * Properties of a Simulation. - * @memberof google.cloud.securitycenter.v1 - * @interface ISimulation - * @property {string|null} [name] Simulation name - * @property {google.protobuf.ITimestamp|null} [createTime] Simulation createTime - * @property {Array.|null} [resourceValueConfigsMetadata] Simulation resourceValueConfigsMetadata - * @property {google.cloud.securitycenter.v1.CloudProvider|null} [cloudProvider] Simulation cloudProvider - */ - - /** - * Constructs a new Simulation. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Simulation. - * @implements ISimulation - * @constructor - * @param {google.cloud.securitycenter.v1.ISimulation=} [properties] Properties to set - */ - function Simulation(properties) { - this.resourceValueConfigsMetadata = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Simulation name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Simulation - * @instance - */ - Simulation.prototype.name = ""; - - /** - * Simulation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.Simulation - * @instance - */ - Simulation.prototype.createTime = null; - - /** - * Simulation resourceValueConfigsMetadata. - * @member {Array.} resourceValueConfigsMetadata - * @memberof google.cloud.securitycenter.v1.Simulation - * @instance - */ - Simulation.prototype.resourceValueConfigsMetadata = $util.emptyArray; - - /** - * Simulation cloudProvider. - * @member {google.cloud.securitycenter.v1.CloudProvider} cloudProvider - * @memberof google.cloud.securitycenter.v1.Simulation - * @instance - */ - Simulation.prototype.cloudProvider = 0; - - /** - * Creates a new Simulation instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {google.cloud.securitycenter.v1.ISimulation=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Simulation} Simulation instance - */ - Simulation.create = function create(properties) { - return new Simulation(properties); - }; - - /** - * Encodes the specified Simulation message. Does not implicitly {@link google.cloud.securitycenter.v1.Simulation.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {google.cloud.securitycenter.v1.ISimulation} message Simulation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Simulation.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceValueConfigsMetadata != null && message.resourceValueConfigsMetadata.length) - for (var i = 0; i < message.resourceValueConfigsMetadata.length; ++i) - $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.encode(message.resourceValueConfigsMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cloudProvider); - return writer; - }; - - /** - * Encodes the specified Simulation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Simulation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {google.cloud.securitycenter.v1.ISimulation} message Simulation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Simulation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Simulation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Simulation} Simulation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Simulation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Simulation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.resourceValueConfigsMetadata && message.resourceValueConfigsMetadata.length)) - message.resourceValueConfigsMetadata = []; - message.resourceValueConfigsMetadata.push($root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.decode(reader, reader.uint32())); - break; - } - case 4: { - message.cloudProvider = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Simulation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Simulation} Simulation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Simulation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Simulation message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Simulation.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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.resourceValueConfigsMetadata != null && message.hasOwnProperty("resourceValueConfigsMetadata")) { - if (!Array.isArray(message.resourceValueConfigsMetadata)) - return "resourceValueConfigsMetadata: array expected"; - for (var i = 0; i < message.resourceValueConfigsMetadata.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify(message.resourceValueConfigsMetadata[i]); - if (error) - return "resourceValueConfigsMetadata." + error; - } - } - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - switch (message.cloudProvider) { - default: - return "cloudProvider: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a Simulation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Simulation} Simulation - */ - Simulation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Simulation) - return object; - var message = new $root.google.cloud.securitycenter.v1.Simulation(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Simulation.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.resourceValueConfigsMetadata) { - if (!Array.isArray(object.resourceValueConfigsMetadata)) - throw TypeError(".google.cloud.securitycenter.v1.Simulation.resourceValueConfigsMetadata: array expected"); - message.resourceValueConfigsMetadata = []; - for (var i = 0; i < object.resourceValueConfigsMetadata.length; ++i) { - if (typeof object.resourceValueConfigsMetadata[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Simulation.resourceValueConfigsMetadata: object expected"); - message.resourceValueConfigsMetadata[i] = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.fromObject(object.resourceValueConfigsMetadata[i]); - } - } - switch (object.cloudProvider) { - default: - if (typeof object.cloudProvider === "number") { - message.cloudProvider = object.cloudProvider; - break; - } - break; - case "CLOUD_PROVIDER_UNSPECIFIED": - case 0: - message.cloudProvider = 0; - break; - case "GOOGLE_CLOUD_PLATFORM": - case 1: - message.cloudProvider = 1; - break; - case "AMAZON_WEB_SERVICES": - case 2: - message.cloudProvider = 2; - break; - case "MICROSOFT_AZURE": - case 3: - message.cloudProvider = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a Simulation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {google.cloud.securitycenter.v1.Simulation} message Simulation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Simulation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceValueConfigsMetadata = []; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.resourceValueConfigsMetadata && message.resourceValueConfigsMetadata.length) { - object.resourceValueConfigsMetadata = []; - for (var j = 0; j < message.resourceValueConfigsMetadata.length; ++j) - object.resourceValueConfigsMetadata[j] = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.toObject(message.resourceValueConfigsMetadata[j], options); - } - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v1.CloudProvider[message.cloudProvider] : message.cloudProvider; - return object; - }; - - /** - * Converts this Simulation to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Simulation - * @instance - * @returns {Object.} JSON object - */ - Simulation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Simulation - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.Simulation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Simulation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.Simulation"; - }; - - return Simulation; - })(); - - v1.ValuedResource = (function() { - - /** - * Properties of a ValuedResource. - * @memberof google.cloud.securitycenter.v1 - * @interface IValuedResource - * @property {string|null} [name] ValuedResource name - * @property {string|null} [resource] ValuedResource resource - * @property {string|null} [resourceType] ValuedResource resourceType - * @property {string|null} [displayName] ValuedResource displayName - * @property {google.cloud.securitycenter.v1.ValuedResource.ResourceValue|null} [resourceValue] ValuedResource resourceValue - * @property {number|null} [exposedScore] ValuedResource exposedScore - * @property {Array.|null} [resourceValueConfigsUsed] ValuedResource resourceValueConfigsUsed - */ - - /** - * Constructs a new ValuedResource. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ValuedResource. - * @implements IValuedResource - * @constructor - * @param {google.cloud.securitycenter.v1.IValuedResource=} [properties] Properties to set - */ - function ValuedResource(properties) { - this.resourceValueConfigsUsed = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValuedResource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @instance - */ - ValuedResource.prototype.name = ""; - - /** - * ValuedResource resource. - * @member {string} resource - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @instance - */ - ValuedResource.prototype.resource = ""; - - /** - * ValuedResource resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @instance - */ - ValuedResource.prototype.resourceType = ""; - - /** - * ValuedResource displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @instance - */ - ValuedResource.prototype.displayName = ""; - - /** - * ValuedResource resourceValue. - * @member {google.cloud.securitycenter.v1.ValuedResource.ResourceValue} resourceValue - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @instance - */ - ValuedResource.prototype.resourceValue = 0; - - /** - * ValuedResource exposedScore. - * @member {number} exposedScore - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @instance - */ - ValuedResource.prototype.exposedScore = 0; - - /** - * ValuedResource resourceValueConfigsUsed. - * @member {Array.} resourceValueConfigsUsed - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @instance - */ - ValuedResource.prototype.resourceValueConfigsUsed = $util.emptyArray; - - /** - * Creates a new ValuedResource instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {google.cloud.securitycenter.v1.IValuedResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ValuedResource} ValuedResource instance - */ - ValuedResource.create = function create(properties) { - return new ValuedResource(properties); - }; - - /** - * Encodes the specified ValuedResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ValuedResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {google.cloud.securitycenter.v1.IValuedResource} message ValuedResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValuedResource.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.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceType); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.resourceValue != null && Object.hasOwnProperty.call(message, "resourceValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resourceValue); - if (message.exposedScore != null && Object.hasOwnProperty.call(message, "exposedScore")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.exposedScore); - if (message.resourceValueConfigsUsed != null && message.resourceValueConfigsUsed.length) - for (var i = 0; i < message.resourceValueConfigsUsed.length; ++i) - $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.encode(message.resourceValueConfigsUsed[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ValuedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ValuedResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {google.cloud.securitycenter.v1.IValuedResource} message ValuedResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValuedResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValuedResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ValuedResource} ValuedResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValuedResource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ValuedResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.resource = reader.string(); - break; - } - case 3: { - message.resourceType = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - case 5: { - message.resourceValue = reader.int32(); - break; - } - case 6: { - message.exposedScore = reader.double(); - break; - } - case 7: { - if (!(message.resourceValueConfigsUsed && message.resourceValueConfigsUsed.length)) - message.resourceValueConfigsUsed = []; - message.resourceValueConfigsUsed.push($root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValuedResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ValuedResource} ValuedResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValuedResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValuedResource message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValuedResource.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.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) - switch (message.resourceValue) { - default: - return "resourceValue: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exposedScore != null && message.hasOwnProperty("exposedScore")) - if (typeof message.exposedScore !== "number") - return "exposedScore: number expected"; - if (message.resourceValueConfigsUsed != null && message.hasOwnProperty("resourceValueConfigsUsed")) { - if (!Array.isArray(message.resourceValueConfigsUsed)) - return "resourceValueConfigsUsed: array expected"; - for (var i = 0; i < message.resourceValueConfigsUsed.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify(message.resourceValueConfigsUsed[i]); - if (error) - return "resourceValueConfigsUsed." + error; - } - } - return null; - }; - - /** - * Creates a ValuedResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ValuedResource} ValuedResource - */ - ValuedResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ValuedResource) - return object; - var message = new $root.google.cloud.securitycenter.v1.ValuedResource(); - if (object.name != null) - message.name = String(object.name); - if (object.resource != null) - message.resource = String(object.resource); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.resourceValue) { - default: - if (typeof object.resourceValue === "number") { - message.resourceValue = object.resourceValue; - break; - } - break; - case "RESOURCE_VALUE_UNSPECIFIED": - case 0: - message.resourceValue = 0; - break; - case "RESOURCE_VALUE_LOW": - case 1: - message.resourceValue = 1; - break; - case "RESOURCE_VALUE_MEDIUM": - case 2: - message.resourceValue = 2; - break; - case "RESOURCE_VALUE_HIGH": - case 3: - message.resourceValue = 3; - break; - } - if (object.exposedScore != null) - message.exposedScore = Number(object.exposedScore); - if (object.resourceValueConfigsUsed) { - if (!Array.isArray(object.resourceValueConfigsUsed)) - throw TypeError(".google.cloud.securitycenter.v1.ValuedResource.resourceValueConfigsUsed: array expected"); - message.resourceValueConfigsUsed = []; - for (var i = 0; i < object.resourceValueConfigsUsed.length; ++i) { - if (typeof object.resourceValueConfigsUsed[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ValuedResource.resourceValueConfigsUsed: object expected"); - message.resourceValueConfigsUsed[i] = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.fromObject(object.resourceValueConfigsUsed[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ValuedResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {google.cloud.securitycenter.v1.ValuedResource} message ValuedResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValuedResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceValueConfigsUsed = []; - if (options.defaults) { - object.name = ""; - object.resource = ""; - object.resourceType = ""; - object.displayName = ""; - object.resourceValue = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; - object.exposedScore = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) - object.resourceValue = options.enums === String ? $root.google.cloud.securitycenter.v1.ValuedResource.ResourceValue[message.resourceValue] === undefined ? message.resourceValue : $root.google.cloud.securitycenter.v1.ValuedResource.ResourceValue[message.resourceValue] : message.resourceValue; - if (message.exposedScore != null && message.hasOwnProperty("exposedScore")) - object.exposedScore = options.json && !isFinite(message.exposedScore) ? String(message.exposedScore) : message.exposedScore; - if (message.resourceValueConfigsUsed && message.resourceValueConfigsUsed.length) { - object.resourceValueConfigsUsed = []; - for (var j = 0; j < message.resourceValueConfigsUsed.length; ++j) - object.resourceValueConfigsUsed[j] = $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata.toObject(message.resourceValueConfigsUsed[j], options); - } - return object; - }; - - /** - * Converts this ValuedResource to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @instance - * @returns {Object.} JSON object - */ - ValuedResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValuedResource - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ValuedResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValuedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ValuedResource"; - }; - - /** - * ResourceValue enum. - * @name google.cloud.securitycenter.v1.ValuedResource.ResourceValue - * @enum {number} - * @property {number} RESOURCE_VALUE_UNSPECIFIED=0 RESOURCE_VALUE_UNSPECIFIED value - * @property {number} RESOURCE_VALUE_LOW=1 RESOURCE_VALUE_LOW value - * @property {number} RESOURCE_VALUE_MEDIUM=2 RESOURCE_VALUE_MEDIUM value - * @property {number} RESOURCE_VALUE_HIGH=3 RESOURCE_VALUE_HIGH value - */ - ValuedResource.ResourceValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_VALUE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE_VALUE_LOW"] = 1; - values[valuesById[2] = "RESOURCE_VALUE_MEDIUM"] = 2; - values[valuesById[3] = "RESOURCE_VALUE_HIGH"] = 3; - return values; - })(); - - return ValuedResource; - })(); - - v1.ResourceValueConfigMetadata = (function() { - - /** - * Properties of a ResourceValueConfigMetadata. - * @memberof google.cloud.securitycenter.v1 - * @interface IResourceValueConfigMetadata - * @property {string|null} [name] ResourceValueConfigMetadata name - */ - - /** - * Constructs a new ResourceValueConfigMetadata. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ResourceValueConfigMetadata. - * @implements IResourceValueConfigMetadata - * @constructor - * @param {google.cloud.securitycenter.v1.IResourceValueConfigMetadata=} [properties] Properties to set - */ - function ResourceValueConfigMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceValueConfigMetadata name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @instance - */ - ResourceValueConfigMetadata.prototype.name = ""; - - /** - * Creates a new ResourceValueConfigMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {google.cloud.securitycenter.v1.IResourceValueConfigMetadata=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} ResourceValueConfigMetadata instance - */ - ResourceValueConfigMetadata.create = function create(properties) { - return new ResourceValueConfigMetadata(properties); - }; - - /** - * Encodes the specified ResourceValueConfigMetadata message. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {google.cloud.securitycenter.v1.IResourceValueConfigMetadata} message ResourceValueConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceValueConfigMetadata.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 ResourceValueConfigMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ResourceValueConfigMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {google.cloud.securitycenter.v1.IResourceValueConfigMetadata} message ResourceValueConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceValueConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} ResourceValueConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceValueConfigMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} ResourceValueConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceValueConfigMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceValueConfigMetadata message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceValueConfigMetadata.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 ResourceValueConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} ResourceValueConfigMetadata - */ - ResourceValueConfigMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata) - return object; - var message = new $root.google.cloud.securitycenter.v1.ResourceValueConfigMetadata(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a ResourceValueConfigMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {google.cloud.securitycenter.v1.ResourceValueConfigMetadata} message ResourceValueConfigMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceValueConfigMetadata.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 ResourceValueConfigMetadata to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @instance - * @returns {Object.} JSON object - */ - ResourceValueConfigMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceValueConfigMetadata - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v1.ResourceValueConfigMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceValueConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v1.ResourceValueConfigMetadata"; - }; - - return ResourceValueConfigMetadata; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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 - * @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); - }; - - /** - * 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() { - - /** - * 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 && Object.hasOwnProperty.call(message, "resourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - 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]); - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - 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; - }; - - /** - * 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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - } - message.marks[key] = value; - 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); - }; - - /** - * 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; - })(); - - 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 && 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.v1beta1.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(); - 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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.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) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - 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] === 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")) - 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); - }; - - /** - * 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 - * @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; - })(); - - 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 && 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.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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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() { - - /** - * 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.inclusionMode === "number") { - message.inclusionMode = object.inclusionMode; - break; - } - break; - 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] === undefined ? message.inclusionMode : $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); - }; - - /** - * 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 - * @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; - })(); - - 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 - */ - - /** - * 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 - */ - 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.v1beta1.RunAssetDiscoveryResponse.State} state - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @instance - */ - RunAssetDiscoveryResponse.prototype.state = 0; - - /** - * RunAssetDiscoveryResponse duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @instance - */ - RunAssetDiscoveryResponse.prototype.duration = null; - - /** - * 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 - */ - 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 - */ - 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.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 - */ - 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.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 - */ - RunAssetDiscoveryResponse.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - 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 - */ - 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 - */ - 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.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse - */ - 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) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - 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 - */ - 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] === 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; - }; - - /** - * Converts this RunAssetDiscoveryResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @instance - * @returns {Object.} JSON object - */ - RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { - 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 - * @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; - })(); - - 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 && 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.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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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.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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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); - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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); - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - 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.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")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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() { - - /** - * 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 && 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - 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] === undefined ? message.state : $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); - }; - - /** - * 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 - * @enum {number} - * @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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - 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 && 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 && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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.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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - 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] === 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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 && 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 && 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 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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); - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - return v1beta1; - })(); - - securitycenter.v1p1beta1 = (function() { - - /** - * Namespace v1p1beta1. - * @memberof google.cloud.securitycenter - * @namespace - */ - var v1p1beta1 = {}; - - v1p1beta1.Asset = (function() { - - /** - * 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 - * @property {string|null} [canonicalName] Asset canonicalName - */ - - /** - * Constructs a new Asset. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents an Asset. - * @implements IAsset - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * 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; - - /** - * 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 - * @memberof google.cloud.securitycenter.v1p1beta1.Asset - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset instance - */ - Asset.create = function create(properties) { - return new Asset(properties); - }; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.Asset - * @static - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.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; - }; - - /** - * 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.v1p1beta1.Asset - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - } - 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; - } - } - return message; - }; - - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.Asset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.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; - } - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - if (!$util.isString(message.canonicalName)) - return "canonicalName: string expected"; - return null; - }; - - /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1p1beta1.Asset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset - */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Asset) - return object; - 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); - } - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); - return message; - }; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.Asset - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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; - object.canonicalName = ""; - } - 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); - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; - return object; - }; - - /** - * 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); - }; - - /** - * 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() { - - /** - * 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 - * @property {Array.|null} [folders] SecurityCenterProperties folders - */ - - /** - * 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 = []; - 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]]; - } - - /** - * 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 = ""; - - /** - * 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 - * @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 && Object.hasOwnProperty.call(message, "resourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - 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 && Object.hasOwnProperty.call(message, "resourceDisplayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); - if (message.resourceParentDisplayName != null && Object.hasOwnProperty.call(message, "resourceParentDisplayName")) - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - 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"; - 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; - }; - - /** - * 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); - 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; - }; - - /** - * 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 = []; - object.folders = []; - } - 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; - 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - Asset.IamPolicy = (function() { - - /** - * Properties of an IamPolicy. - * @memberof google.cloud.securitycenter.v1p1beta1.Asset - * @interface IIamPolicy - * @property {string|null} [policyBlob] IamPolicy policyBlob - */ - - /** - * 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]]; - } - - /** - * IamPolicy policyBlob. - * @member {string} policyBlob - * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy - * @instance - */ - IamPolicy.prototype.policyBlob = ""; - - /** - * 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 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 && Object.hasOwnProperty.call(message, "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.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, error) { - 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(); - if (tag === error) - break; - 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.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 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 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - v1p1beta1.SecurityMarks = (function() { - - /** - * Properties of a SecurityMarks. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @interface ISecurityMarks - * @property {string|null} [name] SecurityMarks name - * @property {Object.|null} [marks] SecurityMarks marks - * @property {string|null} [canonicalName] SecurityMarks canonicalName - */ - - /** - * Constructs a new SecurityMarks. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a SecurityMarks. - * @implements ISecurityMarks - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.SecurityMarks - * @instance - */ - SecurityMarks.prototype.name = ""; - - /** - * SecurityMarks marks. - * @member {Object.} marks - * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks - * @instance - */ - 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 - * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks instance - */ - SecurityMarks.create = function create(properties) { - return new SecurityMarks(properties); - }; - - /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks - * @static - * @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 - */ - SecurityMarks.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.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; - }; - - /** - * 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.v1p1beta1.SecurityMarks - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - } - message.marks[key] = value; - break; - } - case 3: { - message.canonicalName = 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.v1p1beta1.SecurityMarks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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"; - } - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - if (!$util.isString(message.canonicalName)) - return "canonicalName: 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.v1p1beta1.SecurityMarks - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks - */ - SecurityMarks.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks) - return object; - 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]]); - } - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); - return message; - }; - - /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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 = ""; - object.canonicalName = ""; - } - 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.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; - return object; - }; - - /** - * Converts this SecurityMarks to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks - * @instance - * @returns {Object.} JSON object - */ - SecurityMarks.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.Finding = (function() { - - /** - * 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 - * @property {google.cloud.securitycenter.v1p1beta1.Finding.Severity|null} [severity] Finding severity - * @property {string|null} [canonicalName] Finding canonicalName - */ - - /** - * Constructs a new Finding. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a Finding. - * @implements IFinding - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Finding - * @instance - */ - Finding.prototype.name = ""; - - /** - * Finding parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1p1beta1.Finding - * @instance - */ - Finding.prototype.parent = ""; - - /** - * 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; - - /** - * Finding severity. - * @member {google.cloud.securitycenter.v1p1beta1.Finding.Severity} severity - * @memberof google.cloud.securitycenter.v1p1beta1.Finding - * @instance - */ - 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 - * @memberof google.cloud.securitycenter.v1p1beta1.Finding - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding instance - */ - Finding.create = function create(properties) { - return new Finding(properties); - }; - - /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Finding.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.Finding - * @static - * @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 - */ - 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.v1p1beta1.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 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; - }; - - /** - * 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.v1p1beta1.Finding - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.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; - } - } - return message; - }; - - /** - * Decodes a Finding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.Finding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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"; - return null; - }; - - /** - * Creates a Finding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1p1beta1.Finding - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding - */ - Finding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Finding) - return object; - 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) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - 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.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); - } - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - 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); - return message; - }; - - /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.Finding - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - object.canonicalName = ""; - } - 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] === 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")) - 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); - if (message.severity != null && message.hasOwnProperty("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; - }; - - /** - * Converts this Finding to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.Finding - * @instance - * @returns {Object.} JSON object - */ - Finding.prototype.toJSON = function toJSON() { - 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 - * @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.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; - })(); - - 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 NotificationConfig. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a NotificationConfig. - * @implements INotificationConfig - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig=} [properties] Properties to set - */ - function NotificationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NotificationConfig name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig - * @instance - */ - NotificationConfig.prototype.name = ""; - - /** - * NotificationConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig - * @instance - */ - NotificationConfig.prototype.description = ""; - - /** - * NotificationConfig eventType. - * @member {google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType} eventType - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig - * @instance - */ - NotificationConfig.prototype.eventType = 0; - - /** - * 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.v1p1beta1.NotificationConfig - * @static - * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig instance - */ - NotificationConfig.create = function create(properties) { - return new NotificationConfig(properties); - }; - - /** - * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig - * @static - * @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 - */ - NotificationConfig.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.eventType != null && Object.hasOwnProperty.call(message, "eventType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.eventType); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pubsubTopic); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); - 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; - }; - - /** - * 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.v1p1beta1.NotificationConfig - * @static - * @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 - */ - NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NotificationConfig message from the specified reader or buffer. - * @function decode - * @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.v1p1beta1.NotificationConfig} NotificationConfig - * @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, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - NotificationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NotificationConfig message. - * @function verify - * @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 - */ - 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.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 a NotificationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig - */ - 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) { - default: - if (typeof object.eventType === "number") { - message.eventType = object.eventType; - break; - } - break; - 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] === 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")) - 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); - }; - - /** - * 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() { - - /** - * 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 && 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.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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - /** - * EventType enum. - * @name google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType - * @enum {number} - * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value - * @property {number} FINDING=1 FINDING value - */ - NotificationConfig.EventType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FINDING"] = 1; - return values; - })(); - - return NotificationConfig; - })(); - - v1p1beta1.NotificationMessage = (function() { - - /** - * 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 - * @property {google.cloud.securitycenter.v1p1beta1.IResource|null} [resource] NotificationMessage resource - */ - - /** - * Constructs a new NotificationMessage. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a NotificationMessage. - * @implements INotificationMessage - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.NotificationMessage - * @instance - */ - NotificationMessage.prototype.notificationConfigName = ""; - - /** - * NotificationMessage finding. - * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage - * @instance - */ - 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; - - /** - * NotificationMessage event. - * @member {"finding"|undefined} event - * @memberof google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.NotificationMessage - * @static - * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage instance - */ - NotificationMessage.create = function create(properties) { - return new NotificationMessage(properties); - }; - - /** - * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage - * @static - * @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 - */ - NotificationMessage.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.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; - }; - - /** - * 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.v1p1beta1.NotificationMessage - * @static - * @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 - */ - NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NotificationMessage message from the specified reader or buffer. - * @function decode - * @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.v1p1beta1.NotificationMessage} NotificationMessage - * @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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - NotificationMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NotificationMessage message. - * @function verify - * @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 - */ - NotificationMessage.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; - { - var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); - if (error) - 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; - }; - - /** - * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage - */ - NotificationMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.NotificationMessage) - return object; - 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); - } - 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; - }; - - /** - * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage - * @static - * @param {google.cloud.securitycenter.v1p1beta1.NotificationMessage} message NotificationMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NotificationMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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")) { - object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); - 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; - }; - - /** - * Converts this NotificationMessage to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage - * @instance - * @returns {Object.} JSON object - */ - NotificationMessage.prototype.toJSON = function toJSON() { - 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; - })(); - - 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 - * @property {Array.|null} [folders] Resource folders - */ - - /** - * 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) { - 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]]; - } - - /** - * 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 = ""; - - /** - * 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 - * @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); - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - 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"; - 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; - }; - - /** - * 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); - 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; - }; - - /** - * 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.arrays || options.defaults) - object.folders = []; - 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; - 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - v1p1beta1.OrganizationSettings = (function() { - - /** - * 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 OrganizationSettings. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents an OrganizationSettings. - * @implements IOrganizationSettings - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.OrganizationSettings - * @instance - */ - OrganizationSettings.prototype.name = ""; - - /** - * OrganizationSettings enableAssetDiscovery. - * @member {boolean} enableAssetDiscovery - * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings - * @instance - */ - OrganizationSettings.prototype.enableAssetDiscovery = false; - - /** - * 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.v1p1beta1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings instance - */ - OrganizationSettings.create = function create(properties) { - return new OrganizationSettings(properties); - }; - - /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings - * @static - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.OrganizationSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.OrganizationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.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); - }; - - /** - * 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() { - - /** - * 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 - * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds - */ - - /** - * 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 = []; - this.folderIds = []; - if (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; - - /** - * 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 - * @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 && 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - 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; - } - 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; - }; - - /** - * 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) { - default: - if (typeof object.inclusionMode === "number") { - message.inclusionMode = object.inclusionMode; - break; - } - break; - 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; - } - 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; - }; - - /** - * 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 = []; - object.folderIds = []; - } - 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] === 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) - object.folderIds[j] = message.folderIds[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); - }; - - /** - * 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 - * @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; - })(); - - v1p1beta1.RunAssetDiscoveryResponse = (function() { - - /** - * 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 RunAssetDiscoveryResponse. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a RunAssetDiscoveryResponse. - * @implements IRunAssetDiscoveryResponse - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryResponse.State} state - * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse - * @instance - */ - RunAssetDiscoveryResponse.prototype.state = 0; - - /** - * RunAssetDiscoveryResponse duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse - * @instance - */ - RunAssetDiscoveryResponse.prototype.duration = null; - - /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance - */ - RunAssetDiscoveryResponse.create = function create(properties) { - return new RunAssetDiscoveryResponse(properties); - }; - - /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse - * @static - * @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 - */ - 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.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.RunAssetDiscoveryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse - */ - RunAssetDiscoveryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) - 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; - 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.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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; - }; - - /** - * 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); - }; - - /** - * 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 - * @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; - })(); - - 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 - * @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 - */ - 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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 - */ - 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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 - */ - 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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 - */ - 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.v1p1beta1.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.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 - */ - - /** - * 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 - */ - 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.v1p1beta1.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.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 - */ - - /** - * 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 - */ - 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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 - */ - 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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 - */ - 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter - * @instance - * @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 - */ - 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" }); - - /** - * 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 - */ - - return SecurityCenter; - })(); - - 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 CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.parent = ""; - - /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.findingId = ""; - - /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.finding = null; - - /** - * Creates a new CreateFindingRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest instance - */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); - }; - - /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest - * @static - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.CreateFindingRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.CreateFindingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.CreateFindingRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest - */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) - return object; - 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 a CreateFindingRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Finding.toObject(message.finding, options); - return object; - }; - - /** - * Converts this CreateFindingRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest - * @instance - * @returns {Object.} JSON object - */ - CreateFindingRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.CreateNotificationConfigRequest = (function() { - - /** - * 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 - */ - - /** - * 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]]; - } - - /** - * CreateNotificationConfigRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.parent = ""; - - /** - * CreateNotificationConfigRequest configId. - * @member {string} configId - * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.configId = ""; - - /** - * CreateNotificationConfigRequest notificationConfig. - * @member {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null|undefined} notificationConfig - * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.notificationConfig = null; - - /** - * 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); - }; - - /** - * 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 && 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.v1p1beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - v1p1beta1.CreateSourceRequest = (function() { - - /** - * 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 {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.CreateSourceRequest - * @instance - */ - CreateSourceRequest.prototype.parent = ""; - - /** - * 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.v1p1beta1.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest instance - */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); - }; - - /** - * 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 && 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.v1p1beta1.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.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 - */ - 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.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, error) { - 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(); - if (tag === error) - break; - 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()); - }; - - /** - * 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; - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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 - * @returns {Object.} JSON object - */ - CreateSourceRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.DeleteNotificationConfigRequest = (function() { - - /** - * Properties of a DeleteNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @interface IDeleteNotificationConfigRequest - * @property {string|null} [name] DeleteNotificationConfigRequest name - */ - - /** - * 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]]; - } - - /** - * DeleteNotificationConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest - * @instance - */ - DeleteNotificationConfigRequest.prototype.name = ""; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * 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 - */ - DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * Converts this DeleteNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.GetNotificationConfigRequest = (function() { - - /** - * Properties of a GetNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @interface IGetNotificationConfigRequest - * @property {string|null} [name] GetNotificationConfigRequest name - */ - - /** - * 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]]; - } - - /** - * GetNotificationConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest - * @instance - */ - GetNotificationConfigRequest.prototype.name = ""; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * 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 - */ - GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * Converts this GetNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetNotificationConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.GetOrganizationSettingsRequest = (function() { - - /** - * Properties of a GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @interface IGetOrganizationSettingsRequest - * @property {string|null} [name] GetOrganizationSettingsRequest name - */ - - /** - * 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 - */ - 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.v1p1beta1.GetOrganizationSettingsRequest - * @instance - */ - GetOrganizationSettingsRequest.prototype.name = ""; - - /** - * 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); - }; - - /** - * 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 - */ - GetOrganizationSettingsRequest.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 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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.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 - */ - 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.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; - }; - - /** - * 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; - }; - - /** - * 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 - */ - 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.v1p1beta1.GetOrganizationSettingsRequest - * @instance - * @returns {Object.} JSON object - */ - GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.GetSourceRequest = (function() { - - /** - * Properties of a GetSourceRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name - */ - - /** - * 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 - */ - 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.v1p1beta1.GetSourceRequest - * @instance - */ - GetSourceRequest.prototype.name = ""; - - /** - * 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); - }; - - /** - * 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 - */ - GetSourceRequest.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 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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.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 - */ - 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.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; - }; - - /** - * 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; - }; - - /** - * 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 - */ - 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.v1p1beta1.GetSourceRequest - * @instance - * @returns {Object.} JSON object - */ - GetSourceRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.GroupAssetsRequest = (function() { - - /** - * 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} [pageToken] GroupAssetsRequest pageToken - * @property {number|null} [pageSize] GroupAssetsRequest pageSize - */ - - /** - * Constructs a new GroupAssetsRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a GroupAssetsRequest. - * @implements IGroupAssetsRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.parent = ""; - - /** - * GroupAssetsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.filter = ""; - - /** - * GroupAssetsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.groupBy = ""; - - /** - * 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 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.v1p1beta1.GroupAssetsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest instance - */ - GroupAssetsRequest.create = function create(properties) { - return new GroupAssetsRequest(properties); - }; - - /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest - * @static - * @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 - */ - GroupAssetsRequest.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.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 GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.GroupAssetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.GroupAssetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest - */ - GroupAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1p1beta1.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.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.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.v1p1beta1.GroupAssetsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupAssetsRequest - * @instance - * @returns {Object.} JSON object - */ - GroupAssetsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.GroupAssetsResponse = (function() { - - /** - * 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 GroupAssetsResponse. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a GroupAssetsResponse. - * @implements IGroupAssetsResponse - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupAssetsResponse - * @instance - */ - GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; - - /** - * GroupAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse - * @instance - */ - GroupAssetsResponse.prototype.readTime = null; - - /** - * 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.v1p1beta1.GroupAssetsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse instance - */ - GroupAssetsResponse.create = function create(properties) { - return new GroupAssetsResponse(properties); - }; - - /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse - * @static - * @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 - */ - 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.v1p1beta1.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 GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.GroupAssetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.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 GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse - */ - GroupAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) - return object; - 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 GroupAssetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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 GroupAssetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse - * @instance - * @returns {Object.} JSON object - */ - GroupAssetsResponse.prototype.toJSON = function toJSON() { - 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; - })(); - - 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} [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 - */ - GroupFindingsRequest.prototype.compareDuration = null; - - /** - * GroupFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.pageToken = ""; - - /** - * GroupFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.pageSize = 0; - - /** - * Creates a new GroupFindingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest instance - */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); - }; - - /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest - * @static - * @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 - */ - GroupFindingsRequest.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); - return writer; - }; - - /** - * 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.v1p1beta1.GroupFindingsRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.GroupFindingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.GroupFindingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest - */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) - return object; - 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.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.v1p1beta1.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupFindingsRequest - * @instance - * @returns {Object.} JSON object - */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.GroupFindingsResponse = (function() { - - /** - * 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 GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.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 - */ - GroupFindingsResponse.prototype.totalSize = 0; - - /** - * Creates a new GroupFindingsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse instance - */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); - }; - - /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse - * @static - * @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 - */ - 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.v1p1beta1.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 GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.GroupFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.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 GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse - */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) - return object; - 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 GroupFindingsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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 GroupFindingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse - * @instance - * @returns {Object.} JSON object - */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.GroupResult = (function() { - - /** - * 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 GroupResult. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a GroupResult. - * @implements IGroupResult - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupResult - * @instance - */ - GroupResult.prototype.properties = $util.emptyObject; - - /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult instance - */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); - }; - - /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult - * @static - * @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 && 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 GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult - * @static - * @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.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.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.v1p1beta1.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, error) { - 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, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - 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.v1p1beta1.GroupResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.GroupResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult - */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupResult) - return object; - 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.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.v1p1beta1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.GroupResult - * @instance - * @returns {Object.} JSON object - */ - GroupResult.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.ListNotificationConfigsRequest = (function() { - - /** - * 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 ListNotificationConfigsRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a ListNotificationConfigsRequest. - * @implements IListNotificationConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest=} [properties] Properties to set - */ - function ListNotificationConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListNotificationConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.parent = ""; - - /** - * ListNotificationConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.pageToken = ""; - - /** - * ListNotificationConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.pageSize = 0; - - /** - * Creates a new ListNotificationConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance - */ - ListNotificationConfigsRequest.create = function create(properties) { - return new ListNotificationConfigsRequest(properties); - }; - - /** - * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @static - * @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 - */ - ListNotificationConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - return writer; - }; - - /** - * 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.v1p1beta1.ListNotificationConfigsRequest - * @static - * @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 - */ - ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. - * @function decode - * @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.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListNotificationConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - 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; - } - } - return message; - }; - - /** - * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest - */ - ListNotificationConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) - return object; - 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 ListNotificationConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} message ListNotificationConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListNotificationConfigsRequest.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 ListNotificationConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.ListNotificationConfigsResponse = (function() { - - /** - * 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 ListNotificationConfigsResponse. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a ListNotificationConfigsResponse. - * @implements IListNotificationConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse=} [properties] Properties to set - */ - function ListNotificationConfigsResponse(properties) { - this.notificationConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListNotificationConfigsResponse notificationConfigs. - * @member {Array.} notificationConfigs - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse - * @instance - */ - ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; - - /** - * ListNotificationConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse - * @instance - */ - ListNotificationConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListNotificationConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance - */ - ListNotificationConfigsResponse.create = function create(properties) { - return new ListNotificationConfigsResponse(properties); - }; - - /** - * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse - * @static - * @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 - */ - ListNotificationConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * 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.v1p1beta1.ListNotificationConfigsResponse - * @static - * @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 - */ - ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. - * @function decode - * @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.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListNotificationConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListNotificationConfigsResponse message. - * @function verify - * @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 - */ - ListNotificationConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * 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.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} message ListNotificationConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - 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.v1p1beta1.NotificationConfig.toObject(message.notificationConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListNotificationConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.ListSourcesRequest = (function() { - - /** - * 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 ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a ListSourcesRequest. - * @implements IListSourcesRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListSourcesRequest - * @instance - */ - ListSourcesRequest.prototype.parent = ""; - - /** - * ListSourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest - * @instance - */ - ListSourcesRequest.prototype.pageToken = ""; - - /** - * ListSourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest - * @instance - */ - ListSourcesRequest.prototype.pageSize = 0; - - /** - * Creates a new ListSourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest instance - */ - ListSourcesRequest.create = function create(properties) { - return new ListSourcesRequest(properties); - }; - - /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest - * @static - * @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 - */ - ListSourcesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v1p1beta1.ListSourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.ListSourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.ListSourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest - */ - ListSourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) - return object; - 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 ListSourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListSourcesRequest - * @instance - * @returns {Object.} JSON object - */ - ListSourcesRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.ListSourcesResponse = (function() { - - /** - * 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 ListSourcesResponse. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a ListSourcesResponse. - * @implements IListSourcesResponse - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListSourcesResponse - * @instance - */ - ListSourcesResponse.prototype.sources = $util.emptyArray; - - /** - * ListSourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse - * @instance - */ - ListSourcesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse instance - */ - ListSourcesResponse.create = function create(properties) { - return new ListSourcesResponse(properties); - }; - - /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse - * @static - * @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 - */ - 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.v1p1beta1.Source.encode(message.sources[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 ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.ListSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListSourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse - */ - ListSourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) - return object; - 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.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.v1p1beta1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListSourcesResponse - * @instance - * @returns {Object.} JSON object - */ - ListSourcesResponse.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.ListAssetsRequest = (function() { - - /** - * 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 {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.v1p1beta1 - * @classdesc Represents a ListAssetsRequest. - * @implements IListAssetsRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.parent = ""; - - /** - * 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 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.v1p1beta1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.pageToken = ""; - - /** - * ListAssetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.pageSize = 0; - - /** - * Creates a new ListAssetsRequest instance using the specified properties. - * @function create - * @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 - */ - ListAssetsRequest.create = function create(properties) { - return new ListAssetsRequest(properties); - }; - - /** - * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest - * @static - * @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 - */ - ListAssetsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - 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.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")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v1p1beta1.ListAssetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.ListAssetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.ListAssetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest - */ - ListAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) - return object; - 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.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) - 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.v1p1beta1.ListAssetsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListAssetsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAssetsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.ListAssetsResponse = (function() { - - /** - * 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 ListAssetsResponse. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a ListAssetsResponse. - * @implements IListAssetsResponse - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListAssetsResponse - * @instance - */ - ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; - - /** - * 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.v1p1beta1.ListAssetsResponse - * @instance - */ - ListAssetsResponse.prototype.nextPageToken = ""; - - /** - * 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.v1p1beta1.ListAssetsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse instance - */ - ListAssetsResponse.create = function create(properties) { - return new ListAssetsResponse(properties); - }; - - /** - * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse - * @static - * @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 - */ - 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.v1p1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[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 ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.ListAssetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListAssetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse - */ - ListAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) - return object; - 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); - }; - - /** - * 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() { - - /** - * 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 && 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.stateChange === "number") { - message.stateChange = object.stateChange; - break; - } - break; - 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 (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] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; - 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); - }; - - /** - * 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 - * @enum {number} - * @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; - })(); - - v1p1beta1.ListFindingsRequest = (function() { - - /** - * 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 {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.v1p1beta1 - * @classdesc Represents a ListFindingsRequest. - * @implements IListFindingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.parent = ""; - - /** - * ListFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.filter = ""; - - /** - * ListFindingsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.orderBy = ""; - - /** - * ListFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.readTime = null; - - /** - * ListFindingsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.compareDuration = null; - - /** - * ListFindingsRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.fieldMask = null; - - /** - * ListFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.pageToken = ""; - - /** - * ListFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.pageSize = 0; - - /** - * Creates a new ListFindingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest instance - */ - ListFindingsRequest.create = function create(properties) { - return new ListFindingsRequest(properties); - }; - - /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @static - * @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 - */ - ListFindingsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - 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.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")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v1p1beta1.ListFindingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.ListFindingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.ListFindingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest - */ - ListFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1p1beta1.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.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListFindingsRequest - * @instance - * @returns {Object.} JSON object - */ - ListFindingsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.ListFindingsResponse = (function() { - - /** - * 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 ListFindingsResponse. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a ListFindingsResponse. - * @implements IListFindingsResponse - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; - - /** - * ListFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.readTime = null; - - /** - * ListFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.nextPageToken = ""; - - /** - * ListFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.totalSize = 0; - - /** - * Creates a new ListFindingsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse instance - */ - ListFindingsResponse.create = function create(properties) { - return new ListFindingsResponse(properties); - }; - - /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse - * @static - * @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 - */ - 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.v1p1beta1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[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 ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.ListFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.ListFindingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse - */ - ListFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) - return object; - 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.v1p1beta1.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.v1p1beta1.ListFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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); - 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.v1p1beta1.ListFindingsResponse - * @instance - * @returns {Object.} JSON object - */ - ListFindingsResponse.prototype.toJSON = function toJSON() { - 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() { - - /** - * 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 ListFindingsResult. - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse - * @classdesc Represents a ListFindingsResult. - * @implements IListFindingsResult - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.finding = null; - - /** - * ListFindingsResult stateChange. - * @member {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.stateChange = 0; - - /** - * 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.v1p1beta1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult - * @static - * @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 - */ - ListFindingsResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 && Object.hasOwnProperty.call(message, "stateChange")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); - 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; - }; - - /** - * 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.v1p1beta1.ListFindingsResponse.ListFindingsResult - * @static - * @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 - */ - 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.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.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.decode = function decode(reader, length, error) { - 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(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - 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.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) { - default: - if (typeof object.stateChange === "number") { - message.stateChange = object.stateChange; - break; - } - break; - 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 {google.cloud.securitycenter.v1p1beta1.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.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] === 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; - }; - - /** - * 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); - }; - - /** - * 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() { - - /** - * 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 - * @property {Array.|null} [folders] Resource folders - */ - - /** - * 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) { - 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]]; - } - - /** - * 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 = ""; - - /** - * 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 - * @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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.projectName != null && Object.hasOwnProperty.call(message, "projectName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); - if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); - if (message.parentName != null && Object.hasOwnProperty.call(message, "parentName")) - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - 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"; - 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; - }; - - /** - * 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); - 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; - }; - - /** - * 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.arrays || options.defaults) - object.folders = []; - 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; - 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - /** - * StateChange enum. - * @name google.cloud.securitycenter.v1p1beta1.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; - })(); - - return ListFindingsResponse; - })(); - - v1p1beta1.SetFindingStateRequest = (function() { - - /** - * 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 SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a SetFindingStateRequest. - * @implements ISetFindingStateRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.name = ""; - - /** - * SetFindingStateRequest state. - * @member {google.cloud.securitycenter.v1p1beta1.Finding.State} state - * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.state = 0; - - /** - * SetFindingStateRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.startTime = null; - - /** - * Creates a new SetFindingStateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest instance - */ - SetFindingStateRequest.create = function create(properties) { - return new SetFindingStateRequest(properties); - }; - - /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest - * @static - * @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 - */ - 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.v1p1beta1.SetFindingStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.SetFindingStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.SetFindingStateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest - */ - SetFindingStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest(); - 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; - 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.v1p1beta1.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.v1p1beta1.SetFindingStateRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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; - }; - - /** - * Converts this SetFindingStateRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest - * @instance - * @returns {Object.} JSON object - */ - SetFindingStateRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.RunAssetDiscoveryRequest = (function() { - - /** - * Properties of a RunAssetDiscoveryRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @interface IRunAssetDiscoveryRequest - * @property {string|null} [parent] RunAssetDiscoveryRequest parent - */ - - /** - * Constructs a new RunAssetDiscoveryRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a RunAssetDiscoveryRequest. - * @implements IRunAssetDiscoveryRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryRequest - * @instance - */ - RunAssetDiscoveryRequest.prototype.parent = ""; - - /** - * Creates a new RunAssetDiscoveryRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance - */ - RunAssetDiscoveryRequest.create = function create(properties) { - return new RunAssetDiscoveryRequest(properties); - }; - - /** - * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest - * @static - * @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 - */ - RunAssetDiscoveryRequest.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); - return writer; - }; - - /** - * 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.v1p1beta1.RunAssetDiscoveryRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.RunAssetDiscoveryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest - */ - RunAssetDiscoveryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) - return object; - 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 RunAssetDiscoveryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.RunAssetDiscoveryRequest - * @instance - * @returns {Object.} JSON object - */ - RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.UpdateFindingRequest = (function() { - - /** - * 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 UpdateFindingRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents an UpdateFindingRequest. - * @implements IUpdateFindingRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest - * @instance - */ - UpdateFindingRequest.prototype.finding = null; - - /** - * UpdateFindingRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest - * @instance - */ - UpdateFindingRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateFindingRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest instance - */ - UpdateFindingRequest.create = function create(properties) { - return new UpdateFindingRequest(properties); - }; - - /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest - * @static - * @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 - */ - UpdateFindingRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 && 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 UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.UpdateFindingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateFindingRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest - */ - UpdateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) - return object; - 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.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 an UpdateFindingRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateFindingRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateFindingRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.UpdateNotificationConfigRequest = (function() { - - /** - * 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 UpdateNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents an UpdateNotificationConfigRequest. - * @implements IUpdateNotificationConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.INotificationConfig|null|undefined} notificationConfig - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest - * @instance - */ - UpdateNotificationConfigRequest.prototype.notificationConfig = null; - - /** - * 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.v1p1beta1.UpdateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest instance - */ - UpdateNotificationConfigRequest.create = function create(properties) { - return new UpdateNotificationConfigRequest(properties); - }; - - /** - * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest - * @static - * @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 - */ - UpdateNotificationConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 && 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 UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.UpdateNotificationConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.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 an UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest - */ - UpdateNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) - return object; - 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 an UpdateNotificationConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateNotificationConfigRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.UpdateOrganizationSettingsRequest = (function() { - - /** - * 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 UpdateOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents an UpdateOrganizationSettingsRequest. - * @implements IUpdateOrganizationSettingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.IOrganizationSettings|null|undefined} organizationSettings - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest - * @instance - */ - UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; - - /** - * UpdateOrganizationSettingsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest - * @instance - */ - UpdateOrganizationSettingsRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance - */ - UpdateOrganizationSettingsRequest.create = function create(properties) { - return new UpdateOrganizationSettingsRequest(properties); - }; - - /** - * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest - * @static - * @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 - */ - UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 && 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 UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.UpdateOrganizationSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateOrganizationSettingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest - */ - UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) - return object; - 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.v1p1beta1.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.v1p1beta1.UpdateOrganizationSettingsRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateOrganizationSettingsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.UpdateSourceRequest = (function() { - - /** - * 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 UpdateSourceRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents an UpdateSourceRequest. - * @implements IUpdateSourceRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest - * @instance - */ - UpdateSourceRequest.prototype.source = null; - - /** - * UpdateSourceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest - * @instance - */ - UpdateSourceRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateSourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest instance - */ - UpdateSourceRequest.create = function create(properties) { - return new UpdateSourceRequest(properties); - }; - - /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest - * @static - * @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 - */ - UpdateSourceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 && 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 UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.UpdateSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateSourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest - */ - UpdateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) - return object; - 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.v1p1beta1.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.v1p1beta1.UpdateSourceRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateSourceRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSourceRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.UpdateSecurityMarksRequest = (function() { - - /** - * 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 UpdateSecurityMarksRequest. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents an UpdateSecurityMarksRequest. - * @implements IUpdateSecurityMarksRequest - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest - * @instance - */ - UpdateSecurityMarksRequest.prototype.securityMarks = null; - - /** - * UpdateSecurityMarksRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest - * @instance - */ - UpdateSecurityMarksRequest.prototype.updateMask = null; - - /** - * 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.v1p1beta1.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance - */ - UpdateSecurityMarksRequest.create = function create(properties) { - return new UpdateSecurityMarksRequest(properties); - }; - - /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest - * @static - * @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 - */ - UpdateSecurityMarksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 && 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 && 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 UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - 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.v1p1beta1.UpdateSecurityMarksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.UpdateSecurityMarksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest - */ - UpdateSecurityMarksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) - return object; - 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.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 UpdateSecurityMarksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.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 UpdateSecurityMarksRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { - 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; - })(); - - v1p1beta1.Source = (function() { - - /** - * 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 - * @property {string|null} [canonicalName] Source canonicalName - */ - - /** - * Constructs a new Source. - * @memberof google.cloud.securitycenter.v1p1beta1 - * @classdesc Represents a Source. - * @implements ISource - * @constructor - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Source - * @instance - */ - Source.prototype.name = ""; - - /** - * Source displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1p1beta1.Source - * @instance - */ - Source.prototype.displayName = ""; - - /** - * Source description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1p1beta1.Source - * @instance - */ - 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 - * @memberof google.cloud.securitycenter.v1p1beta1.Source - * @static - * @param {google.cloud.securitycenter.v1p1beta1.ISource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source instance - */ - Source.create = function create(properties) { - return new Source(properties); - }; - - /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1p1beta1.Source - * @static - * @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 - */ - 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.v1p1beta1.Source.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1p1beta1.Source - * @static - * @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 - */ - 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.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.v1p1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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.v1p1beta1.Source - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - 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.v1p1beta1.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.v1p1beta1.Source - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source - */ - Source.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Source) - return object; - 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); - 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.v1p1beta1.Source - * @static - * @param {google.cloud.securitycenter.v1p1beta1.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.v1p1beta1.Source - * @instance - * @returns {Object.} JSON object - */ - Source.prototype.toJSON = function toJSON() { - 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; - })(); - - return v1p1beta1; - })(); - - securitycenter.v2 = (function() { - - /** - * Namespace v2. - * @memberof google.cloud.securitycenter - * @namespace - */ - var v2 = {}; - - v2.Access = (function() { - - /** - * Properties of an Access. - * @memberof google.cloud.securitycenter.v2 - * @interface IAccess - * @property {string|null} [principalEmail] Access principalEmail - * @property {string|null} [callerIp] Access callerIp - * @property {google.cloud.securitycenter.v2.IGeolocation|null} [callerIpGeo] Access callerIpGeo - * @property {string|null} [userAgentFamily] Access userAgentFamily - * @property {string|null} [userAgent] Access userAgent - * @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 - * @property {string|null} [userName] Access userName - */ - - /** - * Constructs a new Access. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an Access. - * @implements IAccess - * @constructor - * @param {google.cloud.securitycenter.v2.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) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Access principalEmail. - * @member {string} principalEmail - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.principalEmail = ""; - - /** - * Access callerIp. - * @member {string} callerIp - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.callerIp = ""; - - /** - * Access callerIpGeo. - * @member {google.cloud.securitycenter.v2.IGeolocation|null|undefined} callerIpGeo - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.callerIpGeo = null; - - /** - * Access userAgentFamily. - * @member {string} userAgentFamily - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.userAgentFamily = ""; - - /** - * Access userAgent. - * @member {string} userAgent - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.userAgent = ""; - - /** - * Access serviceName. - * @member {string} serviceName - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.serviceName = ""; - - /** - * Access methodName. - * @member {string} methodName - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.methodName = ""; - - /** - * Access principalSubject. - * @member {string} principalSubject - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.principalSubject = ""; - - /** - * Access serviceAccountKeyName. - * @member {string} serviceAccountKeyName - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.serviceAccountKeyName = ""; - - /** - * Access serviceAccountDelegationInfo. - * @member {Array.} serviceAccountDelegationInfo - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.serviceAccountDelegationInfo = $util.emptyArray; - - /** - * Access userName. - * @member {string} userName - * @memberof google.cloud.securitycenter.v2.Access - * @instance - */ - Access.prototype.userName = ""; - - /** - * Creates a new Access instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Access - * @static - * @param {google.cloud.securitycenter.v2.IAccess=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Access} Access instance - */ - Access.create = function create(properties) { - return new Access(properties); - }; - - /** - * Encodes the specified Access message. Does not implicitly {@link google.cloud.securitycenter.v2.Access.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Access - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.userAgent); - if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceName); - if (message.methodName != null && Object.hasOwnProperty.call(message, "methodName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.methodName); - if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.principalSubject); - if (message.serviceAccountKeyName != null && Object.hasOwnProperty.call(message, "serviceAccountKeyName")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccountKeyName); - if (message.serviceAccountDelegationInfo != null && message.serviceAccountDelegationInfo.length) - for (var i = 0; i < message.serviceAccountDelegationInfo.length; ++i) - $root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo.encode(message.serviceAccountDelegationInfo[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.userName); - return writer; - }; - - /** - * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Access.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Access - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Access(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Geolocation.decode(reader, reader.uint32()); - break; - } - case 4: { - message.userAgentFamily = reader.string(); - break; - } - case 5: { - message.userAgent = reader.string(); - break; - } - case 6: { - message.serviceName = reader.string(); - break; - } - case 7: { - message.methodName = reader.string(); - break; - } - case 8: { - message.principalSubject = reader.string(); - break; - } - case 9: { - message.serviceAccountKeyName = reader.string(); - break; - } - case 10: { - if (!(message.serviceAccountDelegationInfo && message.serviceAccountDelegationInfo.length)) - message.serviceAccountDelegationInfo = []; - message.serviceAccountDelegationInfo.push($root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo.decode(reader, reader.uint32())); - break; - } - case 11: { - message.userName = 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.v2.Access - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.userAgent != null && message.hasOwnProperty("userAgent")) - if (!$util.isString(message.userAgent)) - return "userAgent: 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"; - 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.v2.ServiceAccountDelegationInfo.verify(message.serviceAccountDelegationInfo[i]); - if (error) - return "serviceAccountDelegationInfo." + error; - } - } - if (message.userName != null && message.hasOwnProperty("userName")) - if (!$util.isString(message.userName)) - return "userName: 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.v2.Access - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Access} Access - */ - Access.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Access) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Access.callerIpGeo: object expected"); - message.callerIpGeo = $root.google.cloud.securitycenter.v2.Geolocation.fromObject(object.callerIpGeo); - } - if (object.userAgentFamily != null) - message.userAgentFamily = String(object.userAgentFamily); - if (object.userAgent != null) - message.userAgent = String(object.userAgent); - if (object.serviceName != null) - 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.v2.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.v2.Access.serviceAccountDelegationInfo: object expected"); - message.serviceAccountDelegationInfo[i] = $root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo.fromObject(object.serviceAccountDelegationInfo[i]); - } - } - if (object.userName != null) - message.userName = String(object.userName); - return message; - }; - - /** - * Creates a plain object from an Access message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Access - * @static - * @param {google.cloud.securitycenter.v2.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.arrays || options.defaults) - object.serviceAccountDelegationInfo = []; - if (options.defaults) { - object.principalEmail = ""; - object.callerIp = ""; - object.callerIpGeo = null; - object.userAgentFamily = ""; - object.userAgent = ""; - object.serviceName = ""; - object.methodName = ""; - object.principalSubject = ""; - object.serviceAccountKeyName = ""; - object.userName = ""; - } - 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.v2.Geolocation.toObject(message.callerIpGeo, options); - if (message.userAgentFamily != null && message.hasOwnProperty("userAgentFamily")) - object.userAgentFamily = message.userAgentFamily; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - object.userAgent = message.userAgent; - if (message.serviceName != null && message.hasOwnProperty("serviceName")) - 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.v2.ServiceAccountDelegationInfo.toObject(message.serviceAccountDelegationInfo[j], options); - } - if (message.userName != null && message.hasOwnProperty("userName")) - object.userName = message.userName; - return object; - }; - - /** - * Converts this Access to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Access - * @instance - * @returns {Object.} JSON object - */ - Access.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Access - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Access"; - }; - - return Access; - })(); - - v2.ServiceAccountDelegationInfo = (function() { - - /** - * Properties of a ServiceAccountDelegationInfo. - * @memberof google.cloud.securitycenter.v2 - * @interface IServiceAccountDelegationInfo - * @property {string|null} [principalEmail] ServiceAccountDelegationInfo principalEmail - * @property {string|null} [principalSubject] ServiceAccountDelegationInfo principalSubject - */ - - /** - * Constructs a new ServiceAccountDelegationInfo. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ServiceAccountDelegationInfo. - * @implements IServiceAccountDelegationInfo - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ServiceAccountDelegationInfo - * @instance - */ - ServiceAccountDelegationInfo.prototype.principalEmail = ""; - - /** - * ServiceAccountDelegationInfo principalSubject. - * @member {string} principalSubject - * @memberof google.cloud.securitycenter.v2.ServiceAccountDelegationInfo - * @instance - */ - ServiceAccountDelegationInfo.prototype.principalSubject = ""; - - /** - * Creates a new ServiceAccountDelegationInfo instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ServiceAccountDelegationInfo - * @static - * @param {google.cloud.securitycenter.v2.IServiceAccountDelegationInfo=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo instance - */ - ServiceAccountDelegationInfo.create = function create(properties) { - return new ServiceAccountDelegationInfo(properties); - }; - - /** - * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.ServiceAccountDelegationInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ServiceAccountDelegationInfo - * @static - * @param {google.cloud.securitycenter.v2.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.v2.ServiceAccountDelegationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ServiceAccountDelegationInfo - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.ServiceAccountDelegationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.ServiceAccountDelegationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo - */ - ServiceAccountDelegationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.ServiceAccountDelegationInfo - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.ServiceAccountDelegationInfo"; - }; - - return ServiceAccountDelegationInfo; - })(); - - v2.Geolocation = (function() { - - /** - * Properties of a Geolocation. - * @memberof google.cloud.securitycenter.v2 - * @interface IGeolocation - * @property {string|null} [regionCode] Geolocation regionCode - */ - - /** - * Constructs a new Geolocation. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Geolocation. - * @implements IGeolocation - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Geolocation - * @instance - */ - Geolocation.prototype.regionCode = ""; - - /** - * Creates a new Geolocation instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Geolocation - * @static - * @param {google.cloud.securitycenter.v2.IGeolocation=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Geolocation} Geolocation instance - */ - Geolocation.create = function create(properties) { - return new Geolocation(properties); - }; - - /** - * Encodes the specified Geolocation message. Does not implicitly {@link google.cloud.securitycenter.v2.Geolocation.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Geolocation - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Geolocation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Geolocation - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Geolocation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Geolocation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Geolocation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Geolocation} Geolocation - */ - Geolocation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Geolocation) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Geolocation - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Geolocation - * @instance - * @returns {Object.} JSON object - */ - Geolocation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Geolocation - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Geolocation"; - }; - - return Geolocation; - })(); - - v2.AffectedResources = (function() { - - /** - * Properties of an AffectedResources. - * @memberof google.cloud.securitycenter.v2 - * @interface IAffectedResources - * @property {number|Long|null} [count] AffectedResources count - */ - - /** - * Constructs a new AffectedResources. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an AffectedResources. - * @implements IAffectedResources - * @constructor - * @param {google.cloud.securitycenter.v2.IAffectedResources=} [properties] Properties to set - */ - function AffectedResources(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AffectedResources count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @instance - */ - AffectedResources.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new AffectedResources instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {google.cloud.securitycenter.v2.IAffectedResources=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AffectedResources} AffectedResources instance - */ - AffectedResources.create = function create(properties) { - return new AffectedResources(properties); - }; - - /** - * Encodes the specified AffectedResources message. Does not implicitly {@link google.cloud.securitycenter.v2.AffectedResources.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {google.cloud.securitycenter.v2.IAffectedResources} message AffectedResources message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AffectedResources.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); - return writer; - }; - - /** - * Encodes the specified AffectedResources message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AffectedResources.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {google.cloud.securitycenter.v2.IAffectedResources} message AffectedResources message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AffectedResources.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AffectedResources message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AffectedResources} AffectedResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AffectedResources.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AffectedResources(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.count = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AffectedResources message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AffectedResources} AffectedResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AffectedResources.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AffectedResources message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AffectedResources.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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 an AffectedResources message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AffectedResources} AffectedResources - */ - AffectedResources.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AffectedResources) - return object; - var message = new $root.google.cloud.securitycenter.v2.AffectedResources(); - 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 AffectedResources message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {google.cloud.securitycenter.v2.AffectedResources} message AffectedResources - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AffectedResources.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 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; - return object; - }; - - /** - * Converts this AffectedResources to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @instance - * @returns {Object.} JSON object - */ - AffectedResources.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AffectedResources - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AffectedResources - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AffectedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AffectedResources"; - }; - - return AffectedResources; - })(); - - v2.AiModel = (function() { - - /** - * Properties of an AiModel. - * @memberof google.cloud.securitycenter.v2 - * @interface IAiModel - * @property {string|null} [name] AiModel name - * @property {string|null} [domain] AiModel domain - * @property {string|null} [library] AiModel library - * @property {string|null} [location] AiModel location - * @property {string|null} [publisher] AiModel publisher - * @property {google.cloud.securitycenter.v2.AiModel.DeploymentPlatform|null} [deploymentPlatform] AiModel deploymentPlatform - * @property {string|null} [displayName] AiModel displayName - */ - - /** - * Constructs a new AiModel. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an AiModel. - * @implements IAiModel - * @constructor - * @param {google.cloud.securitycenter.v2.IAiModel=} [properties] Properties to set - */ - function AiModel(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AiModel name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.AiModel - * @instance - */ - AiModel.prototype.name = ""; - - /** - * AiModel domain. - * @member {string} domain - * @memberof google.cloud.securitycenter.v2.AiModel - * @instance - */ - AiModel.prototype.domain = ""; - - /** - * AiModel library. - * @member {string} library - * @memberof google.cloud.securitycenter.v2.AiModel - * @instance - */ - AiModel.prototype.library = ""; - - /** - * AiModel location. - * @member {string} location - * @memberof google.cloud.securitycenter.v2.AiModel - * @instance - */ - AiModel.prototype.location = ""; - - /** - * AiModel publisher. - * @member {string} publisher - * @memberof google.cloud.securitycenter.v2.AiModel - * @instance - */ - AiModel.prototype.publisher = ""; - - /** - * AiModel deploymentPlatform. - * @member {google.cloud.securitycenter.v2.AiModel.DeploymentPlatform} deploymentPlatform - * @memberof google.cloud.securitycenter.v2.AiModel - * @instance - */ - AiModel.prototype.deploymentPlatform = 0; - - /** - * AiModel displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.AiModel - * @instance - */ - AiModel.prototype.displayName = ""; - - /** - * Creates a new AiModel instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {google.cloud.securitycenter.v2.IAiModel=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AiModel} AiModel instance - */ - AiModel.create = function create(properties) { - return new AiModel(properties); - }; - - /** - * Encodes the specified AiModel message. Does not implicitly {@link google.cloud.securitycenter.v2.AiModel.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {google.cloud.securitycenter.v2.IAiModel} message AiModel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AiModel.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.domain != null && Object.hasOwnProperty.call(message, "domain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.domain); - if (message.library != null && Object.hasOwnProperty.call(message, "library")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.library); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - if (message.publisher != null && Object.hasOwnProperty.call(message, "publisher")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.publisher); - if (message.deploymentPlatform != null && Object.hasOwnProperty.call(message, "deploymentPlatform")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.deploymentPlatform); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified AiModel message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AiModel.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {google.cloud.securitycenter.v2.IAiModel} message AiModel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AiModel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AiModel message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AiModel} AiModel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AiModel.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AiModel(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.domain = reader.string(); - break; - } - case 3: { - message.library = reader.string(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - case 5: { - message.publisher = reader.string(); - break; - } - case 6: { - message.deploymentPlatform = reader.int32(); - break; - } - case 7: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AiModel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AiModel} AiModel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AiModel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AiModel message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AiModel.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.domain != null && message.hasOwnProperty("domain")) - if (!$util.isString(message.domain)) - return "domain: string expected"; - if (message.library != null && message.hasOwnProperty("library")) - if (!$util.isString(message.library)) - return "library: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.publisher != null && message.hasOwnProperty("publisher")) - if (!$util.isString(message.publisher)) - return "publisher: string expected"; - if (message.deploymentPlatform != null && message.hasOwnProperty("deploymentPlatform")) - switch (message.deploymentPlatform) { - default: - return "deploymentPlatform: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an AiModel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AiModel} AiModel - */ - AiModel.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AiModel) - return object; - var message = new $root.google.cloud.securitycenter.v2.AiModel(); - if (object.name != null) - message.name = String(object.name); - if (object.domain != null) - message.domain = String(object.domain); - if (object.library != null) - message.library = String(object.library); - if (object.location != null) - message.location = String(object.location); - if (object.publisher != null) - message.publisher = String(object.publisher); - switch (object.deploymentPlatform) { - default: - if (typeof object.deploymentPlatform === "number") { - message.deploymentPlatform = object.deploymentPlatform; - break; - } - break; - case "DEPLOYMENT_PLATFORM_UNSPECIFIED": - case 0: - message.deploymentPlatform = 0; - break; - case "VERTEX_AI": - case 1: - message.deploymentPlatform = 1; - break; - case "GKE": - case 2: - message.deploymentPlatform = 2; - break; - case "GCE": - case 3: - message.deploymentPlatform = 3; - break; - case "FINE_TUNED_MODEL": - case 4: - message.deploymentPlatform = 4; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an AiModel message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {google.cloud.securitycenter.v2.AiModel} message AiModel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AiModel.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.domain = ""; - object.library = ""; - object.location = ""; - object.publisher = ""; - object.deploymentPlatform = options.enums === String ? "DEPLOYMENT_PLATFORM_UNSPECIFIED" : 0; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.domain != null && message.hasOwnProperty("domain")) - object.domain = message.domain; - if (message.library != null && message.hasOwnProperty("library")) - object.library = message.library; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.publisher != null && message.hasOwnProperty("publisher")) - object.publisher = message.publisher; - if (message.deploymentPlatform != null && message.hasOwnProperty("deploymentPlatform")) - object.deploymentPlatform = options.enums === String ? $root.google.cloud.securitycenter.v2.AiModel.DeploymentPlatform[message.deploymentPlatform] === undefined ? message.deploymentPlatform : $root.google.cloud.securitycenter.v2.AiModel.DeploymentPlatform[message.deploymentPlatform] : message.deploymentPlatform; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this AiModel to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AiModel - * @instance - * @returns {Object.} JSON object - */ - AiModel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AiModel - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AiModel - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AiModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AiModel"; - }; - - /** - * DeploymentPlatform enum. - * @name google.cloud.securitycenter.v2.AiModel.DeploymentPlatform - * @enum {number} - * @property {number} DEPLOYMENT_PLATFORM_UNSPECIFIED=0 DEPLOYMENT_PLATFORM_UNSPECIFIED value - * @property {number} VERTEX_AI=1 VERTEX_AI value - * @property {number} GKE=2 GKE value - * @property {number} GCE=3 GCE value - * @property {number} FINE_TUNED_MODEL=4 FINE_TUNED_MODEL value - */ - AiModel.DeploymentPlatform = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEPLOYMENT_PLATFORM_UNSPECIFIED"] = 0; - values[valuesById[1] = "VERTEX_AI"] = 1; - values[valuesById[2] = "GKE"] = 2; - values[valuesById[3] = "GCE"] = 3; - values[valuesById[4] = "FINE_TUNED_MODEL"] = 4; - return values; - })(); - - return AiModel; - })(); - - v2.Application = (function() { - - /** - * Properties of an Application. - * @memberof google.cloud.securitycenter.v2 - * @interface IApplication - * @property {string|null} [baseUri] Application baseUri - * @property {string|null} [fullUri] Application fullUri - */ - - /** - * Constructs a new Application. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an Application. - * @implements IApplication - * @constructor - * @param {google.cloud.securitycenter.v2.IApplication=} [properties] Properties to set - */ - function Application(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Application baseUri. - * @member {string} baseUri - * @memberof google.cloud.securitycenter.v2.Application - * @instance - */ - Application.prototype.baseUri = ""; - - /** - * Application fullUri. - * @member {string} fullUri - * @memberof google.cloud.securitycenter.v2.Application - * @instance - */ - Application.prototype.fullUri = ""; - - /** - * Creates a new Application instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {google.cloud.securitycenter.v2.IApplication=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Application} Application instance - */ - Application.create = function create(properties) { - return new Application(properties); - }; - - /** - * Encodes the specified Application message. Does not implicitly {@link google.cloud.securitycenter.v2.Application.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {google.cloud.securitycenter.v2.IApplication} message Application message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Application.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.baseUri != null && Object.hasOwnProperty.call(message, "baseUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseUri); - if (message.fullUri != null && Object.hasOwnProperty.call(message, "fullUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullUri); - return writer; - }; - - /** - * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Application.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {google.cloud.securitycenter.v2.IApplication} message Application message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Application.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Application message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Application} Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Application.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Application(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.baseUri = reader.string(); - break; - } - case 2: { - message.fullUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Application message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Application} Application - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Application.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Application message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Application.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.baseUri != null && message.hasOwnProperty("baseUri")) - if (!$util.isString(message.baseUri)) - return "baseUri: string expected"; - if (message.fullUri != null && message.hasOwnProperty("fullUri")) - if (!$util.isString(message.fullUri)) - return "fullUri: string expected"; - return null; - }; - - /** - * Creates an Application message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Application} Application - */ - Application.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Application) - return object; - var message = new $root.google.cloud.securitycenter.v2.Application(); - if (object.baseUri != null) - message.baseUri = String(object.baseUri); - if (object.fullUri != null) - message.fullUri = String(object.fullUri); - return message; - }; - - /** - * Creates a plain object from an Application message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {google.cloud.securitycenter.v2.Application} message Application - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Application.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.baseUri = ""; - object.fullUri = ""; - } - if (message.baseUri != null && message.hasOwnProperty("baseUri")) - object.baseUri = message.baseUri; - if (message.fullUri != null && message.hasOwnProperty("fullUri")) - object.fullUri = message.fullUri; - return object; - }; - - /** - * Converts this Application to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Application - * @instance - * @returns {Object.} JSON object - */ - Application.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Application - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Application - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Application.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Application"; - }; - - return Application; - })(); - - v2.AttackExposure = (function() { - - /** - * Properties of an AttackExposure. - * @memberof google.cloud.securitycenter.v2 - * @interface IAttackExposure - * @property {number|null} [score] AttackExposure score - * @property {google.protobuf.ITimestamp|null} [latestCalculationTime] AttackExposure latestCalculationTime - * @property {string|null} [attackExposureResult] AttackExposure attackExposureResult - * @property {google.cloud.securitycenter.v2.AttackExposure.State|null} [state] AttackExposure state - * @property {number|null} [exposedHighValueResourcesCount] AttackExposure exposedHighValueResourcesCount - * @property {number|null} [exposedMediumValueResourcesCount] AttackExposure exposedMediumValueResourcesCount - * @property {number|null} [exposedLowValueResourcesCount] AttackExposure exposedLowValueResourcesCount - */ - - /** - * Constructs a new AttackExposure. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an AttackExposure. - * @implements IAttackExposure - * @constructor - * @param {google.cloud.securitycenter.v2.IAttackExposure=} [properties] Properties to set - */ - function AttackExposure(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackExposure score. - * @member {number} score - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @instance - */ - AttackExposure.prototype.score = 0; - - /** - * AttackExposure latestCalculationTime. - * @member {google.protobuf.ITimestamp|null|undefined} latestCalculationTime - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @instance - */ - AttackExposure.prototype.latestCalculationTime = null; - - /** - * AttackExposure attackExposureResult. - * @member {string} attackExposureResult - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @instance - */ - AttackExposure.prototype.attackExposureResult = ""; - - /** - * AttackExposure state. - * @member {google.cloud.securitycenter.v2.AttackExposure.State} state - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @instance - */ - AttackExposure.prototype.state = 0; - - /** - * AttackExposure exposedHighValueResourcesCount. - * @member {number} exposedHighValueResourcesCount - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @instance - */ - AttackExposure.prototype.exposedHighValueResourcesCount = 0; - - /** - * AttackExposure exposedMediumValueResourcesCount. - * @member {number} exposedMediumValueResourcesCount - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @instance - */ - AttackExposure.prototype.exposedMediumValueResourcesCount = 0; - - /** - * AttackExposure exposedLowValueResourcesCount. - * @member {number} exposedLowValueResourcesCount - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @instance - */ - AttackExposure.prototype.exposedLowValueResourcesCount = 0; - - /** - * Creates a new AttackExposure instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {google.cloud.securitycenter.v2.IAttackExposure=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AttackExposure} AttackExposure instance - */ - AttackExposure.create = function create(properties) { - return new AttackExposure(properties); - }; - - /** - * Encodes the specified AttackExposure message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackExposure.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {google.cloud.securitycenter.v2.IAttackExposure} message AttackExposure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackExposure.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.score); - if (message.latestCalculationTime != null && Object.hasOwnProperty.call(message, "latestCalculationTime")) - $root.google.protobuf.Timestamp.encode(message.latestCalculationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.attackExposureResult != null && Object.hasOwnProperty.call(message, "attackExposureResult")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.attackExposureResult); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.exposedHighValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedHighValueResourcesCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.exposedHighValueResourcesCount); - if (message.exposedMediumValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedMediumValueResourcesCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.exposedMediumValueResourcesCount); - if (message.exposedLowValueResourcesCount != null && Object.hasOwnProperty.call(message, "exposedLowValueResourcesCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.exposedLowValueResourcesCount); - return writer; - }; - - /** - * Encodes the specified AttackExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackExposure.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {google.cloud.securitycenter.v2.IAttackExposure} message AttackExposure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackExposure.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackExposure message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AttackExposure} AttackExposure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackExposure.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackExposure(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.double(); - break; - } - case 2: { - message.latestCalculationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.attackExposureResult = reader.string(); - break; - } - case 4: { - message.state = reader.int32(); - break; - } - case 5: { - message.exposedHighValueResourcesCount = reader.int32(); - break; - } - case 6: { - message.exposedMediumValueResourcesCount = reader.int32(); - break; - } - case 7: { - message.exposedLowValueResourcesCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackExposure message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AttackExposure} AttackExposure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackExposure.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackExposure message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackExposure.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - if (message.latestCalculationTime != null && message.hasOwnProperty("latestCalculationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.latestCalculationTime); - if (error) - return "latestCalculationTime." + error; - } - if (message.attackExposureResult != null && message.hasOwnProperty("attackExposureResult")) - if (!$util.isString(message.attackExposureResult)) - return "attackExposureResult: 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.exposedHighValueResourcesCount != null && message.hasOwnProperty("exposedHighValueResourcesCount")) - if (!$util.isInteger(message.exposedHighValueResourcesCount)) - return "exposedHighValueResourcesCount: integer expected"; - if (message.exposedMediumValueResourcesCount != null && message.hasOwnProperty("exposedMediumValueResourcesCount")) - if (!$util.isInteger(message.exposedMediumValueResourcesCount)) - return "exposedMediumValueResourcesCount: integer expected"; - if (message.exposedLowValueResourcesCount != null && message.hasOwnProperty("exposedLowValueResourcesCount")) - if (!$util.isInteger(message.exposedLowValueResourcesCount)) - return "exposedLowValueResourcesCount: integer expected"; - return null; - }; - - /** - * Creates an AttackExposure message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AttackExposure} AttackExposure - */ - AttackExposure.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AttackExposure) - return object; - var message = new $root.google.cloud.securitycenter.v2.AttackExposure(); - if (object.score != null) - message.score = Number(object.score); - if (object.latestCalculationTime != null) { - if (typeof object.latestCalculationTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AttackExposure.latestCalculationTime: object expected"); - message.latestCalculationTime = $root.google.protobuf.Timestamp.fromObject(object.latestCalculationTime); - } - if (object.attackExposureResult != null) - message.attackExposureResult = String(object.attackExposureResult); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CALCULATED": - case 1: - message.state = 1; - break; - case "NOT_CALCULATED": - case 2: - message.state = 2; - break; - } - if (object.exposedHighValueResourcesCount != null) - message.exposedHighValueResourcesCount = object.exposedHighValueResourcesCount | 0; - if (object.exposedMediumValueResourcesCount != null) - message.exposedMediumValueResourcesCount = object.exposedMediumValueResourcesCount | 0; - if (object.exposedLowValueResourcesCount != null) - message.exposedLowValueResourcesCount = object.exposedLowValueResourcesCount | 0; - return message; - }; - - /** - * Creates a plain object from an AttackExposure message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {google.cloud.securitycenter.v2.AttackExposure} message AttackExposure - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackExposure.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.score = 0; - object.latestCalculationTime = null; - object.attackExposureResult = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.exposedHighValueResourcesCount = 0; - object.exposedMediumValueResourcesCount = 0; - object.exposedLowValueResourcesCount = 0; - } - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - if (message.latestCalculationTime != null && message.hasOwnProperty("latestCalculationTime")) - object.latestCalculationTime = $root.google.protobuf.Timestamp.toObject(message.latestCalculationTime, options); - if (message.attackExposureResult != null && message.hasOwnProperty("attackExposureResult")) - object.attackExposureResult = message.attackExposureResult; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v2.AttackExposure.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.AttackExposure.State[message.state] : message.state; - if (message.exposedHighValueResourcesCount != null && message.hasOwnProperty("exposedHighValueResourcesCount")) - object.exposedHighValueResourcesCount = message.exposedHighValueResourcesCount; - if (message.exposedMediumValueResourcesCount != null && message.hasOwnProperty("exposedMediumValueResourcesCount")) - object.exposedMediumValueResourcesCount = message.exposedMediumValueResourcesCount; - if (message.exposedLowValueResourcesCount != null && message.hasOwnProperty("exposedLowValueResourcesCount")) - object.exposedLowValueResourcesCount = message.exposedLowValueResourcesCount; - return object; - }; - - /** - * Converts this AttackExposure to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @instance - * @returns {Object.} JSON object - */ - AttackExposure.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackExposure - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AttackExposure - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackExposure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackExposure"; - }; - - /** - * State enum. - * @name google.cloud.securitycenter.v2.AttackExposure.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CALCULATED=1 CALCULATED value - * @property {number} NOT_CALCULATED=2 NOT_CALCULATED value - */ - AttackExposure.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CALCULATED"] = 1; - values[valuesById[2] = "NOT_CALCULATED"] = 2; - return values; - })(); - - return AttackExposure; - })(); - - v2.AttackPath = (function() { - - /** - * Properties of an AttackPath. - * @memberof google.cloud.securitycenter.v2 - * @interface IAttackPath - * @property {string|null} [name] AttackPath name - * @property {Array.|null} [pathNodes] AttackPath pathNodes - * @property {Array.|null} [edges] AttackPath edges - */ - - /** - * Constructs a new AttackPath. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an AttackPath. - * @implements IAttackPath - * @constructor - * @param {google.cloud.securitycenter.v2.IAttackPath=} [properties] Properties to set - */ - function AttackPath(properties) { - this.pathNodes = []; - this.edges = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackPath name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.AttackPath - * @instance - */ - AttackPath.prototype.name = ""; - - /** - * AttackPath pathNodes. - * @member {Array.} pathNodes - * @memberof google.cloud.securitycenter.v2.AttackPath - * @instance - */ - AttackPath.prototype.pathNodes = $util.emptyArray; - - /** - * AttackPath edges. - * @member {Array.} edges - * @memberof google.cloud.securitycenter.v2.AttackPath - * @instance - */ - AttackPath.prototype.edges = $util.emptyArray; - - /** - * Creates a new AttackPath instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {google.cloud.securitycenter.v2.IAttackPath=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AttackPath} AttackPath instance - */ - AttackPath.create = function create(properties) { - return new AttackPath(properties); - }; - - /** - * Encodes the specified AttackPath message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {google.cloud.securitycenter.v2.IAttackPath} message AttackPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPath.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.pathNodes != null && message.pathNodes.length) - for (var i = 0; i < message.pathNodes.length; ++i) - $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.encode(message.pathNodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edges != null && message.edges.length) - for (var i = 0; i < message.edges.length; ++i) - $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.encode(message.edges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttackPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {google.cloud.securitycenter.v2.IAttackPath} message AttackPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackPath message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AttackPath} AttackPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPath.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.pathNodes && message.pathNodes.length)) - message.pathNodes = []; - message.pathNodes.push($root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.edges && message.edges.length)) - message.edges = []; - message.edges.push($root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackPath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AttackPath} AttackPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackPath message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackPath.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.pathNodes != null && message.hasOwnProperty("pathNodes")) { - if (!Array.isArray(message.pathNodes)) - return "pathNodes: array expected"; - for (var i = 0; i < message.pathNodes.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify(message.pathNodes[i]); - if (error) - return "pathNodes." + error; - } - } - if (message.edges != null && message.hasOwnProperty("edges")) { - if (!Array.isArray(message.edges)) - return "edges: array expected"; - for (var i = 0; i < message.edges.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify(message.edges[i]); - if (error) - return "edges." + error; - } - } - return null; - }; - - /** - * Creates an AttackPath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AttackPath} AttackPath - */ - AttackPath.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath) - return object; - var message = new $root.google.cloud.securitycenter.v2.AttackPath(); - if (object.name != null) - message.name = String(object.name); - if (object.pathNodes) { - if (!Array.isArray(object.pathNodes)) - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.pathNodes: array expected"); - message.pathNodes = []; - for (var i = 0; i < object.pathNodes.length; ++i) { - if (typeof object.pathNodes[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.pathNodes: object expected"); - message.pathNodes[i] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.fromObject(object.pathNodes[i]); - } - } - if (object.edges) { - if (!Array.isArray(object.edges)) - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.edges: array expected"); - message.edges = []; - for (var i = 0; i < object.edges.length; ++i) { - if (typeof object.edges[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.edges: object expected"); - message.edges[i] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.fromObject(object.edges[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AttackPath message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {google.cloud.securitycenter.v2.AttackPath} message AttackPath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackPath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pathNodes = []; - object.edges = []; - } - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pathNodes && message.pathNodes.length) { - object.pathNodes = []; - for (var j = 0; j < message.pathNodes.length; ++j) - object.pathNodes[j] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.toObject(message.pathNodes[j], options); - } - if (message.edges && message.edges.length) { - object.edges = []; - for (var j = 0; j < message.edges.length; ++j) - object.edges[j] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.toObject(message.edges[j], options); - } - return object; - }; - - /** - * Converts this AttackPath to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AttackPath - * @instance - * @returns {Object.} JSON object - */ - AttackPath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackPath - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AttackPath - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath"; - }; - - AttackPath.AttackPathNode = (function() { - - /** - * Properties of an AttackPathNode. - * @memberof google.cloud.securitycenter.v2.AttackPath - * @interface IAttackPathNode - * @property {string|null} [resource] AttackPathNode resource - * @property {string|null} [resourceType] AttackPathNode resourceType - * @property {string|null} [displayName] AttackPathNode displayName - * @property {Array.|null} [associatedFindings] AttackPathNode associatedFindings - * @property {string|null} [uuid] AttackPathNode uuid - * @property {Array.|null} [attackSteps] AttackPathNode attackSteps - */ - - /** - * Constructs a new AttackPathNode. - * @memberof google.cloud.securitycenter.v2.AttackPath - * @classdesc Represents an AttackPathNode. - * @implements IAttackPathNode - * @constructor - * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathNode=} [properties] Properties to set - */ - function AttackPathNode(properties) { - this.associatedFindings = []; - this.attackSteps = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackPathNode resource. - * @member {string} resource - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.resource = ""; - - /** - * AttackPathNode resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.resourceType = ""; - - /** - * AttackPathNode displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.displayName = ""; - - /** - * AttackPathNode associatedFindings. - * @member {Array.} associatedFindings - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.associatedFindings = $util.emptyArray; - - /** - * AttackPathNode uuid. - * @member {string} uuid - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.uuid = ""; - - /** - * AttackPathNode attackSteps. - * @member {Array.} attackSteps - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @instance - */ - AttackPathNode.prototype.attackSteps = $util.emptyArray; - - /** - * Creates a new AttackPathNode instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathNode=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} AttackPathNode instance - */ - AttackPathNode.create = function create(properties) { - return new AttackPathNode(properties); - }; - - /** - * Encodes the specified AttackPathNode message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathNode} message AttackPathNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPathNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.associatedFindings != null && message.associatedFindings.length) - for (var i = 0; i < message.associatedFindings.length; ++i) - $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.encode(message.associatedFindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.uuid); - if (message.attackSteps != null && message.attackSteps.length) - for (var i = 0; i < message.attackSteps.length; ++i) - $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.encode(message.attackSteps[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttackPathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathNode} message AttackPathNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPathNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackPathNode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} AttackPathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPathNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.resourceType = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - if (!(message.associatedFindings && message.associatedFindings.length)) - message.associatedFindings = []; - message.associatedFindings.push($root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.decode(reader, reader.uint32())); - break; - } - case 5: { - message.uuid = reader.string(); - break; - } - case 6: { - if (!(message.attackSteps && message.attackSteps.length)) - message.attackSteps = []; - message.attackSteps.push($root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackPathNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} AttackPathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPathNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackPathNode message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackPathNode.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.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.associatedFindings != null && message.hasOwnProperty("associatedFindings")) { - if (!Array.isArray(message.associatedFindings)) - return "associatedFindings: array expected"; - for (var i = 0; i < message.associatedFindings.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify(message.associatedFindings[i]); - if (error) - return "associatedFindings." + error; - } - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: string expected"; - if (message.attackSteps != null && message.hasOwnProperty("attackSteps")) { - if (!Array.isArray(message.attackSteps)) - return "attackSteps: array expected"; - for (var i = 0; i < message.attackSteps.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify(message.attackSteps[i]); - if (error) - return "attackSteps." + error; - } - } - return null; - }; - - /** - * Creates an AttackPathNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} AttackPathNode - */ - AttackPathNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode) - return object; - var message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.associatedFindings) { - if (!Array.isArray(object.associatedFindings)) - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.associatedFindings: array expected"); - message.associatedFindings = []; - for (var i = 0; i < object.associatedFindings.length; ++i) { - if (typeof object.associatedFindings[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.associatedFindings: object expected"); - message.associatedFindings[i] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.fromObject(object.associatedFindings[i]); - } - } - if (object.uuid != null) - message.uuid = String(object.uuid); - if (object.attackSteps) { - if (!Array.isArray(object.attackSteps)) - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.attackSteps: array expected"); - message.attackSteps = []; - for (var i = 0; i < object.attackSteps.length; ++i) { - if (typeof object.attackSteps[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.attackSteps: object expected"); - message.attackSteps[i] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.fromObject(object.attackSteps[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AttackPathNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode} message AttackPathNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackPathNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.associatedFindings = []; - object.attackSteps = []; - } - if (options.defaults) { - object.resource = ""; - object.resourceType = ""; - object.displayName = ""; - object.uuid = ""; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.associatedFindings && message.associatedFindings.length) { - object.associatedFindings = []; - for (var j = 0; j < message.associatedFindings.length; ++j) - object.associatedFindings[j] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.toObject(message.associatedFindings[j], options); - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - if (message.attackSteps && message.attackSteps.length) { - object.attackSteps = []; - for (var j = 0; j < message.attackSteps.length; ++j) - object.attackSteps[j] = $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.toObject(message.attackSteps[j], options); - } - return object; - }; - - /** - * Converts this AttackPathNode to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @instance - * @returns {Object.} JSON object - */ - AttackPathNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackPathNode - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackPathNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath.AttackPathNode"; - }; - - AttackPathNode.PathNodeAssociatedFinding = (function() { - - /** - * Properties of a PathNodeAssociatedFinding. - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @interface IPathNodeAssociatedFinding - * @property {string|null} [canonicalFinding] PathNodeAssociatedFinding canonicalFinding - * @property {string|null} [findingCategory] PathNodeAssociatedFinding findingCategory - * @property {string|null} [name] PathNodeAssociatedFinding name - */ - - /** - * Constructs a new PathNodeAssociatedFinding. - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @classdesc Represents a PathNodeAssociatedFinding. - * @implements IPathNodeAssociatedFinding - * @constructor - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding=} [properties] Properties to set - */ - function PathNodeAssociatedFinding(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PathNodeAssociatedFinding canonicalFinding. - * @member {string} canonicalFinding - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @instance - */ - PathNodeAssociatedFinding.prototype.canonicalFinding = ""; - - /** - * PathNodeAssociatedFinding findingCategory. - * @member {string} findingCategory - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @instance - */ - PathNodeAssociatedFinding.prototype.findingCategory = ""; - - /** - * PathNodeAssociatedFinding name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @instance - */ - PathNodeAssociatedFinding.prototype.name = ""; - - /** - * Creates a new PathNodeAssociatedFinding instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding instance - */ - PathNodeAssociatedFinding.create = function create(properties) { - return new PathNodeAssociatedFinding(properties); - }; - - /** - * Encodes the specified PathNodeAssociatedFinding message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding} message PathNodeAssociatedFinding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PathNodeAssociatedFinding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.canonicalFinding != null && Object.hasOwnProperty.call(message, "canonicalFinding")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.canonicalFinding); - if (message.findingCategory != null && Object.hasOwnProperty.call(message, "findingCategory")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingCategory); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - return writer; - }; - - /** - * Encodes the specified PathNodeAssociatedFinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IPathNodeAssociatedFinding} message PathNodeAssociatedFinding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PathNodeAssociatedFinding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PathNodeAssociatedFinding.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.canonicalFinding = reader.string(); - break; - } - case 2: { - message.findingCategory = reader.string(); - break; - } - case 3: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PathNodeAssociatedFinding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PathNodeAssociatedFinding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PathNodeAssociatedFinding message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PathNodeAssociatedFinding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.canonicalFinding != null && message.hasOwnProperty("canonicalFinding")) - if (!$util.isString(message.canonicalFinding)) - return "canonicalFinding: string expected"; - if (message.findingCategory != null && message.hasOwnProperty("findingCategory")) - if (!$util.isString(message.findingCategory)) - return "findingCategory: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a PathNodeAssociatedFinding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} PathNodeAssociatedFinding - */ - PathNodeAssociatedFinding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding) - return object; - var message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding(); - if (object.canonicalFinding != null) - message.canonicalFinding = String(object.canonicalFinding); - if (object.findingCategory != null) - message.findingCategory = String(object.findingCategory); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a PathNodeAssociatedFinding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding} message PathNodeAssociatedFinding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PathNodeAssociatedFinding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.canonicalFinding = ""; - object.findingCategory = ""; - object.name = ""; - } - if (message.canonicalFinding != null && message.hasOwnProperty("canonicalFinding")) - object.canonicalFinding = message.canonicalFinding; - if (message.findingCategory != null && message.hasOwnProperty("findingCategory")) - object.findingCategory = message.findingCategory; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this PathNodeAssociatedFinding to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @instance - * @returns {Object.} JSON object - */ - PathNodeAssociatedFinding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PathNodeAssociatedFinding - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PathNodeAssociatedFinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding"; - }; - - return PathNodeAssociatedFinding; - })(); - - /** - * NodeType enum. - * @name google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType - * @enum {number} - * @property {number} NODE_TYPE_UNSPECIFIED=0 NODE_TYPE_UNSPECIFIED value - * @property {number} NODE_TYPE_AND=1 NODE_TYPE_AND value - * @property {number} NODE_TYPE_OR=2 NODE_TYPE_OR value - * @property {number} NODE_TYPE_DEFENSE=3 NODE_TYPE_DEFENSE value - * @property {number} NODE_TYPE_ATTACKER=4 NODE_TYPE_ATTACKER value - */ - AttackPathNode.NodeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NODE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NODE_TYPE_AND"] = 1; - values[valuesById[2] = "NODE_TYPE_OR"] = 2; - values[valuesById[3] = "NODE_TYPE_DEFENSE"] = 3; - values[valuesById[4] = "NODE_TYPE_ATTACKER"] = 4; - return values; - })(); - - AttackPathNode.AttackStepNode = (function() { - - /** - * Properties of an AttackStepNode. - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @interface IAttackStepNode - * @property {string|null} [uuid] AttackStepNode uuid - * @property {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType|null} [type] AttackStepNode type - * @property {string|null} [displayName] AttackStepNode displayName - * @property {Object.|null} [labels] AttackStepNode labels - * @property {string|null} [description] AttackStepNode description - */ - - /** - * Constructs a new AttackStepNode. - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode - * @classdesc Represents an AttackStepNode. - * @implements IAttackStepNode - * @constructor - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode=} [properties] Properties to set - */ - function AttackStepNode(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackStepNode uuid. - * @member {string} uuid - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.uuid = ""; - - /** - * AttackStepNode type. - * @member {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType} type - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.type = 0; - - /** - * AttackStepNode displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.displayName = ""; - - /** - * AttackStepNode labels. - * @member {Object.} labels - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.labels = $util.emptyObject; - - /** - * AttackStepNode description. - * @member {string} description - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @instance - */ - AttackStepNode.prototype.description = ""; - - /** - * Creates a new AttackStepNode instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode instance - */ - AttackStepNode.create = function create(properties) { - return new AttackStepNode(properties); - }; - - /** - * Encodes the specified AttackStepNode message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode} message AttackStepNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackStepNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uuid); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - return writer; - }; - - /** - * Encodes the specified AttackStepNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.IAttackStepNode} message AttackStepNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackStepNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackStepNode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackStepNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.uuid = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - 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.labels[key] = value; - break; - } - case 5: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackStepNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackStepNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackStepNode message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackStepNode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates an AttackStepNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} AttackStepNode - */ - AttackStepNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode) - return object; - var message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode(); - if (object.uuid != null) - message.uuid = String(object.uuid); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "NODE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "NODE_TYPE_AND": - case 1: - message.type = 1; - break; - case "NODE_TYPE_OR": - case 2: - message.type = 2; - break; - case "NODE_TYPE_DEFENSE": - case 3: - message.type = 3; - break; - case "NODE_TYPE_ATTACKER": - case 4: - message.type = 4; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from an AttackStepNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode} message AttackStepNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackStepNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.uuid = ""; - object.type = options.enums === String ? "NODE_TYPE_UNSPECIFIED" : 0; - object.displayName = ""; - object.description = ""; - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType[message.type] : message.type; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this AttackStepNode to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @instance - * @returns {Object.} JSON object - */ - AttackStepNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackStepNode - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackStepNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode"; - }; - - return AttackStepNode; - })(); - - return AttackPathNode; - })(); - - AttackPath.AttackPathEdge = (function() { - - /** - * Properties of an AttackPathEdge. - * @memberof google.cloud.securitycenter.v2.AttackPath - * @interface IAttackPathEdge - * @property {string|null} [source] AttackPathEdge source - * @property {string|null} [destination] AttackPathEdge destination - */ - - /** - * Constructs a new AttackPathEdge. - * @memberof google.cloud.securitycenter.v2.AttackPath - * @classdesc Represents an AttackPathEdge. - * @implements IAttackPathEdge - * @constructor - * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge=} [properties] Properties to set - */ - function AttackPathEdge(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttackPathEdge source. - * @member {string} source - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @instance - */ - AttackPathEdge.prototype.source = ""; - - /** - * AttackPathEdge destination. - * @member {string} destination - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @instance - */ - AttackPathEdge.prototype.destination = ""; - - /** - * Creates a new AttackPathEdge instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} AttackPathEdge instance - */ - AttackPathEdge.create = function create(properties) { - return new AttackPathEdge(properties); - }; - - /** - * Encodes the specified AttackPathEdge message. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge} message AttackPathEdge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPathEdge.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.destination != null && Object.hasOwnProperty.call(message, "destination")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.destination); - return writer; - }; - - /** - * Encodes the specified AttackPathEdge message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AttackPath.AttackPathEdge.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.IAttackPathEdge} message AttackPathEdge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttackPathEdge.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttackPathEdge message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} AttackPathEdge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPathEdge.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.source = reader.string(); - break; - } - case 2: { - message.destination = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttackPathEdge message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} AttackPathEdge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttackPathEdge.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttackPathEdge message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttackPathEdge.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.destination != null && message.hasOwnProperty("destination")) - if (!$util.isString(message.destination)) - return "destination: string expected"; - return null; - }; - - /** - * Creates an AttackPathEdge message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} AttackPathEdge - */ - AttackPathEdge.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge) - return object; - var message = new $root.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge(); - if (object.source != null) - message.source = String(object.source); - if (object.destination != null) - message.destination = String(object.destination); - return message; - }; - - /** - * Creates a plain object from an AttackPathEdge message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {google.cloud.securitycenter.v2.AttackPath.AttackPathEdge} message AttackPathEdge - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttackPathEdge.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.source = ""; - object.destination = ""; - } - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = message.destination; - return object; - }; - - /** - * Converts this AttackPathEdge to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @instance - * @returns {Object.} JSON object - */ - AttackPathEdge.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttackPathEdge - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AttackPath.AttackPathEdge - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttackPathEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AttackPath.AttackPathEdge"; - }; - - return AttackPathEdge; - })(); - - return AttackPath; - })(); - - v2.BackupDisasterRecovery = (function() { - - /** - * Properties of a BackupDisasterRecovery. - * @memberof google.cloud.securitycenter.v2 - * @interface IBackupDisasterRecovery - * @property {string|null} [backupTemplate] BackupDisasterRecovery backupTemplate - * @property {Array.|null} [policies] BackupDisasterRecovery policies - * @property {string|null} [host] BackupDisasterRecovery host - * @property {Array.|null} [applications] BackupDisasterRecovery applications - * @property {string|null} [storagePool] BackupDisasterRecovery storagePool - * @property {Array.|null} [policyOptions] BackupDisasterRecovery policyOptions - * @property {string|null} [profile] BackupDisasterRecovery profile - * @property {string|null} [appliance] BackupDisasterRecovery appliance - * @property {string|null} [backupType] BackupDisasterRecovery backupType - * @property {google.protobuf.ITimestamp|null} [backupCreateTime] BackupDisasterRecovery backupCreateTime - */ - - /** - * Constructs a new BackupDisasterRecovery. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a BackupDisasterRecovery. - * @implements IBackupDisasterRecovery - * @constructor - * @param {google.cloud.securitycenter.v2.IBackupDisasterRecovery=} [properties] Properties to set - */ - function BackupDisasterRecovery(properties) { - this.policies = []; - this.applications = []; - this.policyOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupDisasterRecovery backupTemplate. - * @member {string} backupTemplate - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.backupTemplate = ""; - - /** - * BackupDisasterRecovery policies. - * @member {Array.} policies - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.policies = $util.emptyArray; - - /** - * BackupDisasterRecovery host. - * @member {string} host - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.host = ""; - - /** - * BackupDisasterRecovery applications. - * @member {Array.} applications - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.applications = $util.emptyArray; - - /** - * BackupDisasterRecovery storagePool. - * @member {string} storagePool - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.storagePool = ""; - - /** - * BackupDisasterRecovery policyOptions. - * @member {Array.} policyOptions - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.policyOptions = $util.emptyArray; - - /** - * BackupDisasterRecovery profile. - * @member {string} profile - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.profile = ""; - - /** - * BackupDisasterRecovery appliance. - * @member {string} appliance - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.appliance = ""; - - /** - * BackupDisasterRecovery backupType. - * @member {string} backupType - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.backupType = ""; - - /** - * BackupDisasterRecovery backupCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} backupCreateTime - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - */ - BackupDisasterRecovery.prototype.backupCreateTime = null; - - /** - * Creates a new BackupDisasterRecovery instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {google.cloud.securitycenter.v2.IBackupDisasterRecovery=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.BackupDisasterRecovery} BackupDisasterRecovery instance - */ - BackupDisasterRecovery.create = function create(properties) { - return new BackupDisasterRecovery(properties); - }; - - /** - * Encodes the specified BackupDisasterRecovery message. Does not implicitly {@link google.cloud.securitycenter.v2.BackupDisasterRecovery.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {google.cloud.securitycenter.v2.IBackupDisasterRecovery} message BackupDisasterRecovery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDisasterRecovery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupTemplate != null && Object.hasOwnProperty.call(message, "backupTemplate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupTemplate); - if (message.policies != null && message.policies.length) - for (var i = 0; i < message.policies.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.policies[i]); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.host); - if (message.applications != null && message.applications.length) - for (var i = 0; i < message.applications.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.applications[i]); - if (message.storagePool != null && Object.hasOwnProperty.call(message, "storagePool")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.storagePool); - if (message.policyOptions != null && message.policyOptions.length) - for (var i = 0; i < message.policyOptions.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.policyOptions[i]); - if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.profile); - if (message.appliance != null && Object.hasOwnProperty.call(message, "appliance")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.appliance); - if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.backupType); - if (message.backupCreateTime != null && Object.hasOwnProperty.call(message, "backupCreateTime")) - $root.google.protobuf.Timestamp.encode(message.backupCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupDisasterRecovery message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BackupDisasterRecovery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {google.cloud.securitycenter.v2.IBackupDisasterRecovery} message BackupDisasterRecovery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDisasterRecovery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupDisasterRecovery message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.BackupDisasterRecovery} BackupDisasterRecovery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDisasterRecovery.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BackupDisasterRecovery(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupTemplate = reader.string(); - break; - } - case 2: { - if (!(message.policies && message.policies.length)) - message.policies = []; - message.policies.push(reader.string()); - break; - } - case 3: { - message.host = reader.string(); - break; - } - case 4: { - if (!(message.applications && message.applications.length)) - message.applications = []; - message.applications.push(reader.string()); - break; - } - case 5: { - message.storagePool = reader.string(); - break; - } - case 6: { - if (!(message.policyOptions && message.policyOptions.length)) - message.policyOptions = []; - message.policyOptions.push(reader.string()); - break; - } - case 7: { - message.profile = reader.string(); - break; - } - case 8: { - message.appliance = reader.string(); - break; - } - case 9: { - message.backupType = reader.string(); - break; - } - case 10: { - message.backupCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupDisasterRecovery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.BackupDisasterRecovery} BackupDisasterRecovery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDisasterRecovery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupDisasterRecovery message. - * @function verify - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupDisasterRecovery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupTemplate != null && message.hasOwnProperty("backupTemplate")) - if (!$util.isString(message.backupTemplate)) - return "backupTemplate: string expected"; - if (message.policies != null && message.hasOwnProperty("policies")) { - if (!Array.isArray(message.policies)) - return "policies: array expected"; - for (var i = 0; i < message.policies.length; ++i) - if (!$util.isString(message.policies[i])) - return "policies: string[] expected"; - } - if (message.host != null && message.hasOwnProperty("host")) - if (!$util.isString(message.host)) - return "host: string expected"; - if (message.applications != null && message.hasOwnProperty("applications")) { - if (!Array.isArray(message.applications)) - return "applications: array expected"; - for (var i = 0; i < message.applications.length; ++i) - if (!$util.isString(message.applications[i])) - return "applications: string[] expected"; - } - if (message.storagePool != null && message.hasOwnProperty("storagePool")) - if (!$util.isString(message.storagePool)) - return "storagePool: string expected"; - if (message.policyOptions != null && message.hasOwnProperty("policyOptions")) { - if (!Array.isArray(message.policyOptions)) - return "policyOptions: array expected"; - for (var i = 0; i < message.policyOptions.length; ++i) - if (!$util.isString(message.policyOptions[i])) - return "policyOptions: string[] expected"; - } - if (message.profile != null && message.hasOwnProperty("profile")) - if (!$util.isString(message.profile)) - return "profile: string expected"; - if (message.appliance != null && message.hasOwnProperty("appliance")) - if (!$util.isString(message.appliance)) - return "appliance: string expected"; - if (message.backupType != null && message.hasOwnProperty("backupType")) - if (!$util.isString(message.backupType)) - return "backupType: string expected"; - if (message.backupCreateTime != null && message.hasOwnProperty("backupCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.backupCreateTime); - if (error) - return "backupCreateTime." + error; - } - return null; - }; - - /** - * Creates a BackupDisasterRecovery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.BackupDisasterRecovery} BackupDisasterRecovery - */ - BackupDisasterRecovery.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.BackupDisasterRecovery) - return object; - var message = new $root.google.cloud.securitycenter.v2.BackupDisasterRecovery(); - if (object.backupTemplate != null) - message.backupTemplate = String(object.backupTemplate); - if (object.policies) { - if (!Array.isArray(object.policies)) - throw TypeError(".google.cloud.securitycenter.v2.BackupDisasterRecovery.policies: array expected"); - message.policies = []; - for (var i = 0; i < object.policies.length; ++i) - message.policies[i] = String(object.policies[i]); - } - if (object.host != null) - message.host = String(object.host); - if (object.applications) { - if (!Array.isArray(object.applications)) - throw TypeError(".google.cloud.securitycenter.v2.BackupDisasterRecovery.applications: array expected"); - message.applications = []; - for (var i = 0; i < object.applications.length; ++i) - message.applications[i] = String(object.applications[i]); - } - if (object.storagePool != null) - message.storagePool = String(object.storagePool); - if (object.policyOptions) { - if (!Array.isArray(object.policyOptions)) - throw TypeError(".google.cloud.securitycenter.v2.BackupDisasterRecovery.policyOptions: array expected"); - message.policyOptions = []; - for (var i = 0; i < object.policyOptions.length; ++i) - message.policyOptions[i] = String(object.policyOptions[i]); - } - if (object.profile != null) - message.profile = String(object.profile); - if (object.appliance != null) - message.appliance = String(object.appliance); - if (object.backupType != null) - message.backupType = String(object.backupType); - if (object.backupCreateTime != null) { - if (typeof object.backupCreateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.BackupDisasterRecovery.backupCreateTime: object expected"); - message.backupCreateTime = $root.google.protobuf.Timestamp.fromObject(object.backupCreateTime); - } - return message; - }; - - /** - * Creates a plain object from a BackupDisasterRecovery message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {google.cloud.securitycenter.v2.BackupDisasterRecovery} message BackupDisasterRecovery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupDisasterRecovery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.policies = []; - object.applications = []; - object.policyOptions = []; - } - if (options.defaults) { - object.backupTemplate = ""; - object.host = ""; - object.storagePool = ""; - object.profile = ""; - object.appliance = ""; - object.backupType = ""; - object.backupCreateTime = null; - } - if (message.backupTemplate != null && message.hasOwnProperty("backupTemplate")) - object.backupTemplate = message.backupTemplate; - if (message.policies && message.policies.length) { - object.policies = []; - for (var j = 0; j < message.policies.length; ++j) - object.policies[j] = message.policies[j]; - } - if (message.host != null && message.hasOwnProperty("host")) - object.host = message.host; - if (message.applications && message.applications.length) { - object.applications = []; - for (var j = 0; j < message.applications.length; ++j) - object.applications[j] = message.applications[j]; - } - if (message.storagePool != null && message.hasOwnProperty("storagePool")) - object.storagePool = message.storagePool; - if (message.policyOptions && message.policyOptions.length) { - object.policyOptions = []; - for (var j = 0; j < message.policyOptions.length; ++j) - object.policyOptions[j] = message.policyOptions[j]; - } - if (message.profile != null && message.hasOwnProperty("profile")) - object.profile = message.profile; - if (message.appliance != null && message.hasOwnProperty("appliance")) - object.appliance = message.appliance; - if (message.backupType != null && message.hasOwnProperty("backupType")) - object.backupType = message.backupType; - if (message.backupCreateTime != null && message.hasOwnProperty("backupCreateTime")) - object.backupCreateTime = $root.google.protobuf.Timestamp.toObject(message.backupCreateTime, options); - return object; - }; - - /** - * Converts this BackupDisasterRecovery to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @instance - * @returns {Object.} JSON object - */ - BackupDisasterRecovery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupDisasterRecovery - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.BackupDisasterRecovery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupDisasterRecovery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.BackupDisasterRecovery"; - }; - - return BackupDisasterRecovery; - })(); - - v2.BigQueryExport = (function() { - - /** - * Properties of a BigQueryExport. - * @memberof google.cloud.securitycenter.v2 - * @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.v2 - * @classdesc Represents a BigQueryExport. - * @implements IBigQueryExport - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.BigQueryExport - * @instance - */ - BigQueryExport.prototype.name = ""; - - /** - * BigQueryExport description. - * @member {string} description - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @instance - */ - BigQueryExport.prototype.description = ""; - - /** - * BigQueryExport filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @instance - */ - BigQueryExport.prototype.filter = ""; - - /** - * BigQueryExport dataset. - * @member {string} dataset - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @instance - */ - BigQueryExport.prototype.dataset = ""; - - /** - * BigQueryExport createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @instance - */ - BigQueryExport.prototype.createTime = null; - - /** - * BigQueryExport updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @instance - */ - BigQueryExport.prototype.updateTime = null; - - /** - * BigQueryExport mostRecentEditor. - * @member {string} mostRecentEditor - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @instance - */ - BigQueryExport.prototype.mostRecentEditor = ""; - - /** - * BigQueryExport principal. - * @member {string} principal - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @instance - */ - BigQueryExport.prototype.principal = ""; - - /** - * Creates a new BigQueryExport instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @static - * @param {google.cloud.securitycenter.v2.IBigQueryExport=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.BigQueryExport} BigQueryExport instance - */ - BigQueryExport.create = function create(properties) { - return new BigQueryExport(properties); - }; - - /** - * Encodes the specified BigQueryExport message. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryExport.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @static - * @param {google.cloud.securitycenter.v2.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.v2.BigQueryExport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.BigQueryExport - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BigQueryExport(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.BigQueryExport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.BigQueryExport - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.BigQueryExport} BigQueryExport - */ - BigQueryExport.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.BigQueryExport) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.BigQueryExport - * @static - * @param {google.cloud.securitycenter.v2.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.v2.BigQueryExport - * @instance - * @returns {Object.} JSON object - */ - BigQueryExport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BigQueryExport - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.BigQueryExport"; - }; - - return BigQueryExport; - })(); - - v2.Chokepoint = (function() { - - /** - * Properties of a Chokepoint. - * @memberof google.cloud.securitycenter.v2 - * @interface IChokepoint - * @property {Array.|null} [relatedFindings] Chokepoint relatedFindings - */ - - /** - * Constructs a new Chokepoint. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Chokepoint. - * @implements IChokepoint - * @constructor - * @param {google.cloud.securitycenter.v2.IChokepoint=} [properties] Properties to set - */ - function Chokepoint(properties) { - this.relatedFindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Chokepoint relatedFindings. - * @member {Array.} relatedFindings - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @instance - */ - Chokepoint.prototype.relatedFindings = $util.emptyArray; - - /** - * Creates a new Chokepoint instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {google.cloud.securitycenter.v2.IChokepoint=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Chokepoint} Chokepoint instance - */ - Chokepoint.create = function create(properties) { - return new Chokepoint(properties); - }; - - /** - * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v2.Chokepoint.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {google.cloud.securitycenter.v2.IChokepoint} message Chokepoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chokepoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.relatedFindings != null && message.relatedFindings.length) - for (var i = 0; i < message.relatedFindings.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.relatedFindings[i]); - return writer; - }; - - /** - * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Chokepoint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {google.cloud.securitycenter.v2.IChokepoint} message Chokepoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chokepoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chokepoint message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Chokepoint} Chokepoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chokepoint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Chokepoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.relatedFindings && message.relatedFindings.length)) - message.relatedFindings = []; - message.relatedFindings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chokepoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Chokepoint} Chokepoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chokepoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chokepoint message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chokepoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { - if (!Array.isArray(message.relatedFindings)) - return "relatedFindings: array expected"; - for (var i = 0; i < message.relatedFindings.length; ++i) - if (!$util.isString(message.relatedFindings[i])) - return "relatedFindings: string[] expected"; - } - return null; - }; - - /** - * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Chokepoint} Chokepoint - */ - Chokepoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Chokepoint) - return object; - var message = new $root.google.cloud.securitycenter.v2.Chokepoint(); - if (object.relatedFindings) { - if (!Array.isArray(object.relatedFindings)) - throw TypeError(".google.cloud.securitycenter.v2.Chokepoint.relatedFindings: array expected"); - message.relatedFindings = []; - for (var i = 0; i < object.relatedFindings.length; ++i) - message.relatedFindings[i] = String(object.relatedFindings[i]); - } - return message; - }; - - /** - * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {google.cloud.securitycenter.v2.Chokepoint} message Chokepoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chokepoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.relatedFindings = []; - if (message.relatedFindings && message.relatedFindings.length) { - object.relatedFindings = []; - for (var j = 0; j < message.relatedFindings.length; ++j) - object.relatedFindings[j] = message.relatedFindings[j]; - } - return object; - }; - - /** - * Converts this Chokepoint to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @instance - * @returns {Object.} JSON object - */ - Chokepoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Chokepoint - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Chokepoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Chokepoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Chokepoint"; - }; - - return Chokepoint; - })(); - - v2.CloudArmor = (function() { - - /** - * Properties of a CloudArmor. - * @memberof google.cloud.securitycenter.v2 - * @interface ICloudArmor - * @property {google.cloud.securitycenter.v2.ISecurityPolicy|null} [securityPolicy] CloudArmor securityPolicy - * @property {google.cloud.securitycenter.v2.IRequests|null} [requests] CloudArmor requests - * @property {google.cloud.securitycenter.v2.IAdaptiveProtection|null} [adaptiveProtection] CloudArmor adaptiveProtection - * @property {google.cloud.securitycenter.v2.IAttack|null} [attack] CloudArmor attack - * @property {string|null} [threatVector] CloudArmor threatVector - * @property {google.protobuf.IDuration|null} [duration] CloudArmor duration - */ - - /** - * Constructs a new CloudArmor. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CloudArmor. - * @implements ICloudArmor - * @constructor - * @param {google.cloud.securitycenter.v2.ICloudArmor=} [properties] Properties to set - */ - function CloudArmor(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudArmor securityPolicy. - * @member {google.cloud.securitycenter.v2.ISecurityPolicy|null|undefined} securityPolicy - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @instance - */ - CloudArmor.prototype.securityPolicy = null; - - /** - * CloudArmor requests. - * @member {google.cloud.securitycenter.v2.IRequests|null|undefined} requests - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @instance - */ - CloudArmor.prototype.requests = null; - - /** - * CloudArmor adaptiveProtection. - * @member {google.cloud.securitycenter.v2.IAdaptiveProtection|null|undefined} adaptiveProtection - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @instance - */ - CloudArmor.prototype.adaptiveProtection = null; - - /** - * CloudArmor attack. - * @member {google.cloud.securitycenter.v2.IAttack|null|undefined} attack - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @instance - */ - CloudArmor.prototype.attack = null; - - /** - * CloudArmor threatVector. - * @member {string} threatVector - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @instance - */ - CloudArmor.prototype.threatVector = ""; - - /** - * CloudArmor duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @instance - */ - CloudArmor.prototype.duration = null; - - /** - * Creates a new CloudArmor instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {google.cloud.securitycenter.v2.ICloudArmor=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CloudArmor} CloudArmor instance - */ - CloudArmor.create = function create(properties) { - return new CloudArmor(properties); - }; - - /** - * Encodes the specified CloudArmor message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudArmor.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {google.cloud.securitycenter.v2.ICloudArmor} message CloudArmor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudArmor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) - $root.google.cloud.securitycenter.v2.SecurityPolicy.encode(message.securityPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) - $root.google.cloud.securitycenter.v2.Requests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.adaptiveProtection != null && Object.hasOwnProperty.call(message, "adaptiveProtection")) - $root.google.cloud.securitycenter.v2.AdaptiveProtection.encode(message.adaptiveProtection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.attack != null && Object.hasOwnProperty.call(message, "attack")) - $root.google.cloud.securitycenter.v2.Attack.encode(message.attack, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.threatVector != null && Object.hasOwnProperty.call(message, "threatVector")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.threatVector); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudArmor message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudArmor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {google.cloud.securitycenter.v2.ICloudArmor} message CloudArmor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudArmor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudArmor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.CloudArmor} CloudArmor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudArmor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CloudArmor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.securityPolicy = $root.google.cloud.securitycenter.v2.SecurityPolicy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.requests = $root.google.cloud.securitycenter.v2.Requests.decode(reader, reader.uint32()); - break; - } - case 3: { - message.adaptiveProtection = $root.google.cloud.securitycenter.v2.AdaptiveProtection.decode(reader, reader.uint32()); - break; - } - case 4: { - message.attack = $root.google.cloud.securitycenter.v2.Attack.decode(reader, reader.uint32()); - break; - } - case 5: { - message.threatVector = reader.string(); - break; - } - case 6: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudArmor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.CloudArmor} CloudArmor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudArmor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudArmor message. - * @function verify - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudArmor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) { - var error = $root.google.cloud.securitycenter.v2.SecurityPolicy.verify(message.securityPolicy); - if (error) - return "securityPolicy." + error; - } - if (message.requests != null && message.hasOwnProperty("requests")) { - var error = $root.google.cloud.securitycenter.v2.Requests.verify(message.requests); - if (error) - return "requests." + error; - } - if (message.adaptiveProtection != null && message.hasOwnProperty("adaptiveProtection")) { - var error = $root.google.cloud.securitycenter.v2.AdaptiveProtection.verify(message.adaptiveProtection); - if (error) - return "adaptiveProtection." + error; - } - if (message.attack != null && message.hasOwnProperty("attack")) { - var error = $root.google.cloud.securitycenter.v2.Attack.verify(message.attack); - if (error) - return "attack." + error; - } - if (message.threatVector != null && message.hasOwnProperty("threatVector")) - if (!$util.isString(message.threatVector)) - return "threatVector: string expected"; - 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 CloudArmor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CloudArmor} CloudArmor - */ - CloudArmor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CloudArmor) - return object; - var message = new $root.google.cloud.securitycenter.v2.CloudArmor(); - if (object.securityPolicy != null) { - if (typeof object.securityPolicy !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.securityPolicy: object expected"); - message.securityPolicy = $root.google.cloud.securitycenter.v2.SecurityPolicy.fromObject(object.securityPolicy); - } - if (object.requests != null) { - if (typeof object.requests !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.requests: object expected"); - message.requests = $root.google.cloud.securitycenter.v2.Requests.fromObject(object.requests); - } - if (object.adaptiveProtection != null) { - if (typeof object.adaptiveProtection !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.adaptiveProtection: object expected"); - message.adaptiveProtection = $root.google.cloud.securitycenter.v2.AdaptiveProtection.fromObject(object.adaptiveProtection); - } - if (object.attack != null) { - if (typeof object.attack !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.attack: object expected"); - message.attack = $root.google.cloud.securitycenter.v2.Attack.fromObject(object.attack); - } - if (object.threatVector != null) - message.threatVector = String(object.threatVector); - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CloudArmor.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - return message; - }; - - /** - * Creates a plain object from a CloudArmor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {google.cloud.securitycenter.v2.CloudArmor} message CloudArmor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudArmor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.securityPolicy = null; - object.requests = null; - object.adaptiveProtection = null; - object.attack = null; - object.threatVector = ""; - object.duration = null; - } - if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) - object.securityPolicy = $root.google.cloud.securitycenter.v2.SecurityPolicy.toObject(message.securityPolicy, options); - if (message.requests != null && message.hasOwnProperty("requests")) - object.requests = $root.google.cloud.securitycenter.v2.Requests.toObject(message.requests, options); - if (message.adaptiveProtection != null && message.hasOwnProperty("adaptiveProtection")) - object.adaptiveProtection = $root.google.cloud.securitycenter.v2.AdaptiveProtection.toObject(message.adaptiveProtection, options); - if (message.attack != null && message.hasOwnProperty("attack")) - object.attack = $root.google.cloud.securitycenter.v2.Attack.toObject(message.attack, options); - if (message.threatVector != null && message.hasOwnProperty("threatVector")) - object.threatVector = message.threatVector; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - return object; - }; - - /** - * Converts this CloudArmor to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @instance - * @returns {Object.} JSON object - */ - CloudArmor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudArmor - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.CloudArmor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudArmor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.CloudArmor"; - }; - - return CloudArmor; - })(); - - v2.SecurityPolicy = (function() { - - /** - * Properties of a SecurityPolicy. - * @memberof google.cloud.securitycenter.v2 - * @interface ISecurityPolicy - * @property {string|null} [name] SecurityPolicy name - * @property {string|null} [type] SecurityPolicy type - * @property {boolean|null} [preview] SecurityPolicy preview - */ - - /** - * Constructs a new SecurityPolicy. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a SecurityPolicy. - * @implements ISecurityPolicy - * @constructor - * @param {google.cloud.securitycenter.v2.ISecurityPolicy=} [properties] Properties to set - */ - function SecurityPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityPolicy name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @instance - */ - SecurityPolicy.prototype.name = ""; - - /** - * SecurityPolicy type. - * @member {string} type - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @instance - */ - SecurityPolicy.prototype.type = ""; - - /** - * SecurityPolicy preview. - * @member {boolean} preview - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @instance - */ - SecurityPolicy.prototype.preview = false; - - /** - * Creates a new SecurityPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {google.cloud.securitycenter.v2.ISecurityPolicy=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.SecurityPolicy} SecurityPolicy instance - */ - SecurityPolicy.create = function create(properties) { - return new SecurityPolicy(properties); - }; - - /** - * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {google.cloud.securitycenter.v2.ISecurityPolicy} message SecurityPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.preview != null && Object.hasOwnProperty.call(message, "preview")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.preview); - return writer; - }; - - /** - * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {google.cloud.securitycenter.v2.ISecurityPolicy} message SecurityPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.SecurityPolicy} SecurityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - message.preview = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.SecurityPolicy} SecurityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityPolicy message. - * @function verify - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.preview != null && message.hasOwnProperty("preview")) - if (typeof message.preview !== "boolean") - return "preview: boolean expected"; - return null; - }; - - /** - * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.SecurityPolicy} SecurityPolicy - */ - SecurityPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.SecurityPolicy) - return object; - var message = new $root.google.cloud.securitycenter.v2.SecurityPolicy(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.preview != null) - message.preview = Boolean(object.preview); - return message; - }; - - /** - * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {google.cloud.securitycenter.v2.SecurityPolicy} message SecurityPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = ""; - object.preview = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.preview != null && message.hasOwnProperty("preview")) - object.preview = message.preview; - return object; - }; - - /** - * Converts this SecurityPolicy to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @instance - * @returns {Object.} JSON object - */ - SecurityPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityPolicy - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.SecurityPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecurityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.SecurityPolicy"; - }; - - return SecurityPolicy; - })(); - - v2.Requests = (function() { - - /** - * Properties of a Requests. - * @memberof google.cloud.securitycenter.v2 - * @interface IRequests - * @property {number|null} [ratio] Requests ratio - * @property {number|null} [shortTermAllowed] Requests shortTermAllowed - * @property {number|null} [longTermAllowed] Requests longTermAllowed - * @property {number|null} [longTermDenied] Requests longTermDenied - */ - - /** - * Constructs a new Requests. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Requests. - * @implements IRequests - * @constructor - * @param {google.cloud.securitycenter.v2.IRequests=} [properties] Properties to set - */ - function Requests(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Requests ratio. - * @member {number} ratio - * @memberof google.cloud.securitycenter.v2.Requests - * @instance - */ - Requests.prototype.ratio = 0; - - /** - * Requests shortTermAllowed. - * @member {number} shortTermAllowed - * @memberof google.cloud.securitycenter.v2.Requests - * @instance - */ - Requests.prototype.shortTermAllowed = 0; - - /** - * Requests longTermAllowed. - * @member {number} longTermAllowed - * @memberof google.cloud.securitycenter.v2.Requests - * @instance - */ - Requests.prototype.longTermAllowed = 0; - - /** - * Requests longTermDenied. - * @member {number} longTermDenied - * @memberof google.cloud.securitycenter.v2.Requests - * @instance - */ - Requests.prototype.longTermDenied = 0; - - /** - * Creates a new Requests instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {google.cloud.securitycenter.v2.IRequests=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Requests} Requests instance - */ - Requests.create = function create(properties) { - return new Requests(properties); - }; - - /** - * Encodes the specified Requests message. Does not implicitly {@link google.cloud.securitycenter.v2.Requests.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {google.cloud.securitycenter.v2.IRequests} message Requests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Requests.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.ratio); - if (message.shortTermAllowed != null && Object.hasOwnProperty.call(message, "shortTermAllowed")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.shortTermAllowed); - if (message.longTermAllowed != null && Object.hasOwnProperty.call(message, "longTermAllowed")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.longTermAllowed); - if (message.longTermDenied != null && Object.hasOwnProperty.call(message, "longTermDenied")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.longTermDenied); - return writer; - }; - - /** - * Encodes the specified Requests message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Requests.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {google.cloud.securitycenter.v2.IRequests} message Requests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Requests.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Requests message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Requests} Requests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Requests.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Requests(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ratio = reader.double(); - break; - } - case 2: { - message.shortTermAllowed = reader.int32(); - break; - } - case 3: { - message.longTermAllowed = reader.int32(); - break; - } - case 4: { - message.longTermDenied = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Requests message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Requests} Requests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Requests.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Requests message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Requests.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ratio != null && message.hasOwnProperty("ratio")) - if (typeof message.ratio !== "number") - return "ratio: number expected"; - if (message.shortTermAllowed != null && message.hasOwnProperty("shortTermAllowed")) - if (!$util.isInteger(message.shortTermAllowed)) - return "shortTermAllowed: integer expected"; - if (message.longTermAllowed != null && message.hasOwnProperty("longTermAllowed")) - if (!$util.isInteger(message.longTermAllowed)) - return "longTermAllowed: integer expected"; - if (message.longTermDenied != null && message.hasOwnProperty("longTermDenied")) - if (!$util.isInteger(message.longTermDenied)) - return "longTermDenied: integer expected"; - return null; - }; - - /** - * Creates a Requests message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Requests} Requests - */ - Requests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Requests) - return object; - var message = new $root.google.cloud.securitycenter.v2.Requests(); - if (object.ratio != null) - message.ratio = Number(object.ratio); - if (object.shortTermAllowed != null) - message.shortTermAllowed = object.shortTermAllowed | 0; - if (object.longTermAllowed != null) - message.longTermAllowed = object.longTermAllowed | 0; - if (object.longTermDenied != null) - message.longTermDenied = object.longTermDenied | 0; - return message; - }; - - /** - * Creates a plain object from a Requests message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {google.cloud.securitycenter.v2.Requests} message Requests - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Requests.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ratio = 0; - object.shortTermAllowed = 0; - object.longTermAllowed = 0; - object.longTermDenied = 0; - } - if (message.ratio != null && message.hasOwnProperty("ratio")) - object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; - if (message.shortTermAllowed != null && message.hasOwnProperty("shortTermAllowed")) - object.shortTermAllowed = message.shortTermAllowed; - if (message.longTermAllowed != null && message.hasOwnProperty("longTermAllowed")) - object.longTermAllowed = message.longTermAllowed; - if (message.longTermDenied != null && message.hasOwnProperty("longTermDenied")) - object.longTermDenied = message.longTermDenied; - return object; - }; - - /** - * Converts this Requests to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Requests - * @instance - * @returns {Object.} JSON object - */ - Requests.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Requests - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Requests - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Requests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Requests"; - }; - - return Requests; - })(); - - v2.AdaptiveProtection = (function() { - - /** - * Properties of an AdaptiveProtection. - * @memberof google.cloud.securitycenter.v2 - * @interface IAdaptiveProtection - * @property {number|null} [confidence] AdaptiveProtection confidence - */ - - /** - * Constructs a new AdaptiveProtection. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an AdaptiveProtection. - * @implements IAdaptiveProtection - * @constructor - * @param {google.cloud.securitycenter.v2.IAdaptiveProtection=} [properties] Properties to set - */ - function AdaptiveProtection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AdaptiveProtection confidence. - * @member {number} confidence - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @instance - */ - AdaptiveProtection.prototype.confidence = 0; - - /** - * Creates a new AdaptiveProtection instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {google.cloud.securitycenter.v2.IAdaptiveProtection=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AdaptiveProtection} AdaptiveProtection instance - */ - AdaptiveProtection.create = function create(properties) { - return new AdaptiveProtection(properties); - }; - - /** - * Encodes the specified AdaptiveProtection message. Does not implicitly {@link google.cloud.securitycenter.v2.AdaptiveProtection.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {google.cloud.securitycenter.v2.IAdaptiveProtection} message AdaptiveProtection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdaptiveProtection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.confidence); - return writer; - }; - - /** - * Encodes the specified AdaptiveProtection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AdaptiveProtection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {google.cloud.securitycenter.v2.IAdaptiveProtection} message AdaptiveProtection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdaptiveProtection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AdaptiveProtection message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AdaptiveProtection} AdaptiveProtection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdaptiveProtection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AdaptiveProtection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.confidence = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AdaptiveProtection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AdaptiveProtection} AdaptiveProtection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdaptiveProtection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AdaptiveProtection message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AdaptiveProtection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - return null; - }; - - /** - * Creates an AdaptiveProtection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AdaptiveProtection} AdaptiveProtection - */ - AdaptiveProtection.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AdaptiveProtection) - return object; - var message = new $root.google.cloud.securitycenter.v2.AdaptiveProtection(); - if (object.confidence != null) - message.confidence = Number(object.confidence); - return message; - }; - - /** - * Creates a plain object from an AdaptiveProtection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {google.cloud.securitycenter.v2.AdaptiveProtection} message AdaptiveProtection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AdaptiveProtection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.confidence = 0; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - return object; - }; - - /** - * Converts this AdaptiveProtection to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @instance - * @returns {Object.} JSON object - */ - AdaptiveProtection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AdaptiveProtection - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AdaptiveProtection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AdaptiveProtection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AdaptiveProtection"; - }; - - return AdaptiveProtection; - })(); - - v2.Attack = (function() { - - /** - * Properties of an Attack. - * @memberof google.cloud.securitycenter.v2 - * @interface IAttack - * @property {number|Long|null} [volumePpsLong] Attack volumePpsLong - * @property {number|Long|null} [volumeBpsLong] Attack volumeBpsLong - * @property {string|null} [classification] Attack classification - * @property {number|null} [volumePps] Attack volumePps - * @property {number|null} [volumeBps] Attack volumeBps - */ - - /** - * Constructs a new Attack. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an Attack. - * @implements IAttack - * @constructor - * @param {google.cloud.securitycenter.v2.IAttack=} [properties] Properties to set - */ - function Attack(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Attack volumePpsLong. - * @member {number|Long} volumePpsLong - * @memberof google.cloud.securitycenter.v2.Attack - * @instance - */ - Attack.prototype.volumePpsLong = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Attack volumeBpsLong. - * @member {number|Long} volumeBpsLong - * @memberof google.cloud.securitycenter.v2.Attack - * @instance - */ - Attack.prototype.volumeBpsLong = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Attack classification. - * @member {string} classification - * @memberof google.cloud.securitycenter.v2.Attack - * @instance - */ - Attack.prototype.classification = ""; - - /** - * Attack volumePps. - * @member {number} volumePps - * @memberof google.cloud.securitycenter.v2.Attack - * @instance - */ - Attack.prototype.volumePps = 0; - - /** - * Attack volumeBps. - * @member {number} volumeBps - * @memberof google.cloud.securitycenter.v2.Attack - * @instance - */ - Attack.prototype.volumeBps = 0; - - /** - * Creates a new Attack instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {google.cloud.securitycenter.v2.IAttack=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Attack} Attack instance - */ - Attack.create = function create(properties) { - return new Attack(properties); - }; - - /** - * Encodes the specified Attack message. Does not implicitly {@link google.cloud.securitycenter.v2.Attack.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {google.cloud.securitycenter.v2.IAttack} message Attack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attack.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.volumePps != null && Object.hasOwnProperty.call(message, "volumePps")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.volumePps); - if (message.volumeBps != null && Object.hasOwnProperty.call(message, "volumeBps")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.volumeBps); - if (message.classification != null && Object.hasOwnProperty.call(message, "classification")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.classification); - if (message.volumePpsLong != null && Object.hasOwnProperty.call(message, "volumePpsLong")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.volumePpsLong); - if (message.volumeBpsLong != null && Object.hasOwnProperty.call(message, "volumeBpsLong")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.volumeBpsLong); - return writer; - }; - - /** - * Encodes the specified Attack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Attack.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {google.cloud.securitycenter.v2.IAttack} message Attack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attack.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Attack message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Attack} Attack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attack.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Attack(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.volumePpsLong = reader.int64(); - break; - } - case 5: { - message.volumeBpsLong = reader.int64(); - break; - } - case 3: { - message.classification = reader.string(); - break; - } - case 1: { - message.volumePps = reader.int32(); - break; - } - case 2: { - message.volumeBps = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Attack message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Attack} Attack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attack.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Attack message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Attack.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.volumePpsLong != null && message.hasOwnProperty("volumePpsLong")) - if (!$util.isInteger(message.volumePpsLong) && !(message.volumePpsLong && $util.isInteger(message.volumePpsLong.low) && $util.isInteger(message.volumePpsLong.high))) - return "volumePpsLong: integer|Long expected"; - if (message.volumeBpsLong != null && message.hasOwnProperty("volumeBpsLong")) - if (!$util.isInteger(message.volumeBpsLong) && !(message.volumeBpsLong && $util.isInteger(message.volumeBpsLong.low) && $util.isInteger(message.volumeBpsLong.high))) - return "volumeBpsLong: integer|Long expected"; - if (message.classification != null && message.hasOwnProperty("classification")) - if (!$util.isString(message.classification)) - return "classification: string expected"; - if (message.volumePps != null && message.hasOwnProperty("volumePps")) - if (!$util.isInteger(message.volumePps)) - return "volumePps: integer expected"; - if (message.volumeBps != null && message.hasOwnProperty("volumeBps")) - if (!$util.isInteger(message.volumeBps)) - return "volumeBps: integer expected"; - return null; - }; - - /** - * Creates an Attack message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Attack} Attack - */ - Attack.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Attack) - return object; - var message = new $root.google.cloud.securitycenter.v2.Attack(); - if (object.volumePpsLong != null) - if ($util.Long) - (message.volumePpsLong = $util.Long.fromValue(object.volumePpsLong)).unsigned = false; - else if (typeof object.volumePpsLong === "string") - message.volumePpsLong = parseInt(object.volumePpsLong, 10); - else if (typeof object.volumePpsLong === "number") - message.volumePpsLong = object.volumePpsLong; - else if (typeof object.volumePpsLong === "object") - message.volumePpsLong = new $util.LongBits(object.volumePpsLong.low >>> 0, object.volumePpsLong.high >>> 0).toNumber(); - if (object.volumeBpsLong != null) - if ($util.Long) - (message.volumeBpsLong = $util.Long.fromValue(object.volumeBpsLong)).unsigned = false; - else if (typeof object.volumeBpsLong === "string") - message.volumeBpsLong = parseInt(object.volumeBpsLong, 10); - else if (typeof object.volumeBpsLong === "number") - message.volumeBpsLong = object.volumeBpsLong; - else if (typeof object.volumeBpsLong === "object") - message.volumeBpsLong = new $util.LongBits(object.volumeBpsLong.low >>> 0, object.volumeBpsLong.high >>> 0).toNumber(); - if (object.classification != null) - message.classification = String(object.classification); - if (object.volumePps != null) - message.volumePps = object.volumePps | 0; - if (object.volumeBps != null) - message.volumeBps = object.volumeBps | 0; - return message; - }; - - /** - * Creates a plain object from an Attack message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {google.cloud.securitycenter.v2.Attack} message Attack - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Attack.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.volumePps = 0; - object.volumeBps = 0; - object.classification = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.volumePpsLong = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.volumePpsLong = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.volumeBpsLong = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.volumeBpsLong = options.longs === String ? "0" : 0; - } - if (message.volumePps != null && message.hasOwnProperty("volumePps")) - object.volumePps = message.volumePps; - if (message.volumeBps != null && message.hasOwnProperty("volumeBps")) - object.volumeBps = message.volumeBps; - if (message.classification != null && message.hasOwnProperty("classification")) - object.classification = message.classification; - if (message.volumePpsLong != null && message.hasOwnProperty("volumePpsLong")) - if (typeof message.volumePpsLong === "number") - object.volumePpsLong = options.longs === String ? String(message.volumePpsLong) : message.volumePpsLong; - else - object.volumePpsLong = options.longs === String ? $util.Long.prototype.toString.call(message.volumePpsLong) : options.longs === Number ? new $util.LongBits(message.volumePpsLong.low >>> 0, message.volumePpsLong.high >>> 0).toNumber() : message.volumePpsLong; - if (message.volumeBpsLong != null && message.hasOwnProperty("volumeBpsLong")) - if (typeof message.volumeBpsLong === "number") - object.volumeBpsLong = options.longs === String ? String(message.volumeBpsLong) : message.volumeBpsLong; - else - object.volumeBpsLong = options.longs === String ? $util.Long.prototype.toString.call(message.volumeBpsLong) : options.longs === Number ? new $util.LongBits(message.volumeBpsLong.low >>> 0, message.volumeBpsLong.high >>> 0).toNumber() : message.volumeBpsLong; - return object; - }; - - /** - * Converts this Attack to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Attack - * @instance - * @returns {Object.} JSON object - */ - Attack.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Attack - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Attack - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Attack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Attack"; - }; - - return Attack; - })(); - - v2.CloudDlpDataProfile = (function() { - - /** - * Properties of a CloudDlpDataProfile. - * @memberof google.cloud.securitycenter.v2 - * @interface ICloudDlpDataProfile - * @property {string|null} [dataProfile] CloudDlpDataProfile dataProfile - * @property {google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType|null} [parentType] CloudDlpDataProfile parentType - */ - - /** - * Constructs a new CloudDlpDataProfile. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CloudDlpDataProfile. - * @implements ICloudDlpDataProfile - * @constructor - * @param {google.cloud.securitycenter.v2.ICloudDlpDataProfile=} [properties] Properties to set - */ - function CloudDlpDataProfile(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudDlpDataProfile dataProfile. - * @member {string} dataProfile - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @instance - */ - CloudDlpDataProfile.prototype.dataProfile = ""; - - /** - * CloudDlpDataProfile parentType. - * @member {google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType} parentType - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @instance - */ - CloudDlpDataProfile.prototype.parentType = 0; - - /** - * Creates a new CloudDlpDataProfile instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {google.cloud.securitycenter.v2.ICloudDlpDataProfile=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CloudDlpDataProfile} CloudDlpDataProfile instance - */ - CloudDlpDataProfile.create = function create(properties) { - return new CloudDlpDataProfile(properties); - }; - - /** - * Encodes the specified CloudDlpDataProfile message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpDataProfile.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {google.cloud.securitycenter.v2.ICloudDlpDataProfile} message CloudDlpDataProfile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDlpDataProfile.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataProfile != null && Object.hasOwnProperty.call(message, "dataProfile")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataProfile); - if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.parentType); - return writer; - }; - - /** - * Encodes the specified CloudDlpDataProfile message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpDataProfile.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {google.cloud.securitycenter.v2.ICloudDlpDataProfile} message CloudDlpDataProfile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDlpDataProfile.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudDlpDataProfile message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.CloudDlpDataProfile} CloudDlpDataProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDlpDataProfile.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CloudDlpDataProfile(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataProfile = reader.string(); - break; - } - case 2: { - message.parentType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudDlpDataProfile message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.CloudDlpDataProfile} CloudDlpDataProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDlpDataProfile.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudDlpDataProfile message. - * @function verify - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudDlpDataProfile.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) - if (!$util.isString(message.dataProfile)) - return "dataProfile: string expected"; - if (message.parentType != null && message.hasOwnProperty("parentType")) - switch (message.parentType) { - default: - return "parentType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CloudDlpDataProfile message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CloudDlpDataProfile} CloudDlpDataProfile - */ - CloudDlpDataProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CloudDlpDataProfile) - return object; - var message = new $root.google.cloud.securitycenter.v2.CloudDlpDataProfile(); - if (object.dataProfile != null) - message.dataProfile = String(object.dataProfile); - switch (object.parentType) { - default: - if (typeof object.parentType === "number") { - message.parentType = object.parentType; - break; - } - break; - case "PARENT_TYPE_UNSPECIFIED": - case 0: - message.parentType = 0; - break; - case "ORGANIZATION": - case 1: - message.parentType = 1; - break; - case "PROJECT": - case 2: - message.parentType = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CloudDlpDataProfile message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {google.cloud.securitycenter.v2.CloudDlpDataProfile} message CloudDlpDataProfile - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudDlpDataProfile.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dataProfile = ""; - object.parentType = options.enums === String ? "PARENT_TYPE_UNSPECIFIED" : 0; - } - if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) - object.dataProfile = message.dataProfile; - if (message.parentType != null && message.hasOwnProperty("parentType")) - object.parentType = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType[message.parentType] === undefined ? message.parentType : $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType[message.parentType] : message.parentType; - return object; - }; - - /** - * Converts this CloudDlpDataProfile to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @instance - * @returns {Object.} JSON object - */ - CloudDlpDataProfile.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudDlpDataProfile - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.CloudDlpDataProfile - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudDlpDataProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.CloudDlpDataProfile"; - }; - - /** - * ParentType enum. - * @name google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType - * @enum {number} - * @property {number} PARENT_TYPE_UNSPECIFIED=0 PARENT_TYPE_UNSPECIFIED value - * @property {number} ORGANIZATION=1 ORGANIZATION value - * @property {number} PROJECT=2 PROJECT value - */ - CloudDlpDataProfile.ParentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PARENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORGANIZATION"] = 1; - values[valuesById[2] = "PROJECT"] = 2; - return values; - })(); - - return CloudDlpDataProfile; - })(); - - v2.CloudDlpInspection = (function() { - - /** - * Properties of a CloudDlpInspection. - * @memberof google.cloud.securitycenter.v2 - * @interface ICloudDlpInspection - * @property {string|null} [inspectJob] CloudDlpInspection inspectJob - * @property {string|null} [infoType] CloudDlpInspection infoType - * @property {number|Long|null} [infoTypeCount] CloudDlpInspection infoTypeCount - * @property {boolean|null} [fullScan] CloudDlpInspection fullScan - */ - - /** - * Constructs a new CloudDlpInspection. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CloudDlpInspection. - * @implements ICloudDlpInspection - * @constructor - * @param {google.cloud.securitycenter.v2.ICloudDlpInspection=} [properties] Properties to set - */ - function CloudDlpInspection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudDlpInspection inspectJob. - * @member {string} inspectJob - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @instance - */ - CloudDlpInspection.prototype.inspectJob = ""; - - /** - * CloudDlpInspection infoType. - * @member {string} infoType - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @instance - */ - CloudDlpInspection.prototype.infoType = ""; - - /** - * CloudDlpInspection infoTypeCount. - * @member {number|Long} infoTypeCount - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @instance - */ - CloudDlpInspection.prototype.infoTypeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * CloudDlpInspection fullScan. - * @member {boolean} fullScan - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @instance - */ - CloudDlpInspection.prototype.fullScan = false; - - /** - * Creates a new CloudDlpInspection instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {google.cloud.securitycenter.v2.ICloudDlpInspection=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CloudDlpInspection} CloudDlpInspection instance - */ - CloudDlpInspection.create = function create(properties) { - return new CloudDlpInspection(properties); - }; - - /** - * Encodes the specified CloudDlpInspection message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpInspection.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {google.cloud.securitycenter.v2.ICloudDlpInspection} message CloudDlpInspection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDlpInspection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inspectJob != null && Object.hasOwnProperty.call(message, "inspectJob")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inspectJob); - if (message.infoType != null && Object.hasOwnProperty.call(message, "infoType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.infoType); - if (message.infoTypeCount != null && Object.hasOwnProperty.call(message, "infoTypeCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.infoTypeCount); - if (message.fullScan != null && Object.hasOwnProperty.call(message, "fullScan")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.fullScan); - return writer; - }; - - /** - * Encodes the specified CloudDlpInspection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudDlpInspection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {google.cloud.securitycenter.v2.ICloudDlpInspection} message CloudDlpInspection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDlpInspection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudDlpInspection message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.CloudDlpInspection} CloudDlpInspection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDlpInspection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CloudDlpInspection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inspectJob = reader.string(); - break; - } - case 2: { - message.infoType = reader.string(); - break; - } - case 3: { - message.infoTypeCount = reader.int64(); - break; - } - case 4: { - message.fullScan = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudDlpInspection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.CloudDlpInspection} CloudDlpInspection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDlpInspection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudDlpInspection message. - * @function verify - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudDlpInspection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) - if (!$util.isString(message.inspectJob)) - return "inspectJob: string expected"; - if (message.infoType != null && message.hasOwnProperty("infoType")) - if (!$util.isString(message.infoType)) - return "infoType: string expected"; - if (message.infoTypeCount != null && message.hasOwnProperty("infoTypeCount")) - if (!$util.isInteger(message.infoTypeCount) && !(message.infoTypeCount && $util.isInteger(message.infoTypeCount.low) && $util.isInteger(message.infoTypeCount.high))) - return "infoTypeCount: integer|Long expected"; - if (message.fullScan != null && message.hasOwnProperty("fullScan")) - if (typeof message.fullScan !== "boolean") - return "fullScan: boolean expected"; - return null; - }; - - /** - * Creates a CloudDlpInspection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CloudDlpInspection} CloudDlpInspection - */ - CloudDlpInspection.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CloudDlpInspection) - return object; - var message = new $root.google.cloud.securitycenter.v2.CloudDlpInspection(); - if (object.inspectJob != null) - message.inspectJob = String(object.inspectJob); - if (object.infoType != null) - message.infoType = String(object.infoType); - if (object.infoTypeCount != null) - if ($util.Long) - (message.infoTypeCount = $util.Long.fromValue(object.infoTypeCount)).unsigned = false; - else if (typeof object.infoTypeCount === "string") - message.infoTypeCount = parseInt(object.infoTypeCount, 10); - else if (typeof object.infoTypeCount === "number") - message.infoTypeCount = object.infoTypeCount; - else if (typeof object.infoTypeCount === "object") - message.infoTypeCount = new $util.LongBits(object.infoTypeCount.low >>> 0, object.infoTypeCount.high >>> 0).toNumber(); - if (object.fullScan != null) - message.fullScan = Boolean(object.fullScan); - return message; - }; - - /** - * Creates a plain object from a CloudDlpInspection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {google.cloud.securitycenter.v2.CloudDlpInspection} message CloudDlpInspection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudDlpInspection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inspectJob = ""; - object.infoType = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.infoTypeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.infoTypeCount = options.longs === String ? "0" : 0; - object.fullScan = false; - } - if (message.inspectJob != null && message.hasOwnProperty("inspectJob")) - object.inspectJob = message.inspectJob; - if (message.infoType != null && message.hasOwnProperty("infoType")) - object.infoType = message.infoType; - if (message.infoTypeCount != null && message.hasOwnProperty("infoTypeCount")) - if (typeof message.infoTypeCount === "number") - object.infoTypeCount = options.longs === String ? String(message.infoTypeCount) : message.infoTypeCount; - else - object.infoTypeCount = options.longs === String ? $util.Long.prototype.toString.call(message.infoTypeCount) : options.longs === Number ? new $util.LongBits(message.infoTypeCount.low >>> 0, message.infoTypeCount.high >>> 0).toNumber() : message.infoTypeCount; - if (message.fullScan != null && message.hasOwnProperty("fullScan")) - object.fullScan = message.fullScan; - return object; - }; - - /** - * Converts this CloudDlpInspection to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @instance - * @returns {Object.} JSON object - */ - CloudDlpInspection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudDlpInspection - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.CloudDlpInspection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudDlpInspection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.CloudDlpInspection"; - }; - - return CloudDlpInspection; - })(); - - v2.Compliance = (function() { - - /** - * Properties of a Compliance. - * @memberof google.cloud.securitycenter.v2 - * @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.v2 - * @classdesc Represents a Compliance. - * @implements ICompliance - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Compliance - * @instance - */ - Compliance.prototype.standard = ""; - - /** - * Compliance version. - * @member {string} version - * @memberof google.cloud.securitycenter.v2.Compliance - * @instance - */ - Compliance.prototype.version = ""; - - /** - * Compliance ids. - * @member {Array.} ids - * @memberof google.cloud.securitycenter.v2.Compliance - * @instance - */ - Compliance.prototype.ids = $util.emptyArray; - - /** - * Creates a new Compliance instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Compliance - * @static - * @param {google.cloud.securitycenter.v2.ICompliance=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Compliance} Compliance instance - */ - Compliance.create = function create(properties) { - return new Compliance(properties); - }; - - /** - * Encodes the specified Compliance message. Does not implicitly {@link google.cloud.securitycenter.v2.Compliance.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Compliance - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Compliance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Compliance - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Compliance(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Compliance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Compliance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Compliance} Compliance - */ - Compliance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Compliance) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.Compliance - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Compliance - * @instance - * @returns {Object.} JSON object - */ - Compliance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Compliance - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Compliance"; - }; - - return Compliance; - })(); - - v2.Connection = (function() { - - /** - * Properties of a Connection. - * @memberof google.cloud.securitycenter.v2 - * @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.v2.Connection.Protocol|null} [protocol] Connection protocol - */ - - /** - * Constructs a new Connection. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Connection. - * @implements IConnection - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Connection - * @instance - */ - Connection.prototype.destinationIp = ""; - - /** - * Connection destinationPort. - * @member {number} destinationPort - * @memberof google.cloud.securitycenter.v2.Connection - * @instance - */ - Connection.prototype.destinationPort = 0; - - /** - * Connection sourceIp. - * @member {string} sourceIp - * @memberof google.cloud.securitycenter.v2.Connection - * @instance - */ - Connection.prototype.sourceIp = ""; - - /** - * Connection sourcePort. - * @member {number} sourcePort - * @memberof google.cloud.securitycenter.v2.Connection - * @instance - */ - Connection.prototype.sourcePort = 0; - - /** - * Connection protocol. - * @member {google.cloud.securitycenter.v2.Connection.Protocol} protocol - * @memberof google.cloud.securitycenter.v2.Connection - * @instance - */ - Connection.prototype.protocol = 0; - - /** - * Creates a new Connection instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Connection - * @static - * @param {google.cloud.securitycenter.v2.IConnection=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Connection} Connection instance - */ - Connection.create = function create(properties) { - return new Connection(properties); - }; - - /** - * Encodes the specified Connection message. Does not implicitly {@link google.cloud.securitycenter.v2.Connection.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Connection - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Connection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Connection - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Connection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Connection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Connection - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Connection} Connection - */ - Connection.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Connection) - return object; - var message = new $root.google.cloud.securitycenter.v2.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) { - default: - if (typeof object.protocol === "number") { - message.protocol = object.protocol; - break; - } - break; - 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.v2.Connection - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Connection.Protocol[message.protocol] === undefined ? message.protocol : $root.google.cloud.securitycenter.v2.Connection.Protocol[message.protocol] : message.protocol; - return object; - }; - - /** - * Converts this Connection to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Connection - * @instance - * @returns {Object.} JSON object - */ - Connection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Connection - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Connection"; - }; - - /** - * Protocol enum. - * @name google.cloud.securitycenter.v2.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; - })(); - - v2.ContactDetails = (function() { - - /** - * Properties of a ContactDetails. - * @memberof google.cloud.securitycenter.v2 - * @interface IContactDetails - * @property {Array.|null} [contacts] ContactDetails contacts - */ - - /** - * Constructs a new ContactDetails. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ContactDetails. - * @implements IContactDetails - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ContactDetails - * @instance - */ - ContactDetails.prototype.contacts = $util.emptyArray; - - /** - * Creates a new ContactDetails instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ContactDetails - * @static - * @param {google.cloud.securitycenter.v2.IContactDetails=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ContactDetails} ContactDetails instance - */ - ContactDetails.create = function create(properties) { - return new ContactDetails(properties); - }; - - /** - * Encodes the specified ContactDetails message. Does not implicitly {@link google.cloud.securitycenter.v2.ContactDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ContactDetails - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.ContactDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ContactDetails - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ContactDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.contacts && message.contacts.length)) - message.contacts = []; - message.contacts.push($root.google.cloud.securitycenter.v2.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.v2.ContactDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.ContactDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ContactDetails} ContactDetails - */ - ContactDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ContactDetails) - return object; - var message = new $root.google.cloud.securitycenter.v2.ContactDetails(); - if (object.contacts) { - if (!Array.isArray(object.contacts)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.ContactDetails.contacts: object expected"); - message.contacts[i] = $root.google.cloud.securitycenter.v2.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.v2.ContactDetails - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Contact.toObject(message.contacts[j], options); - } - return object; - }; - - /** - * Converts this ContactDetails to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ContactDetails - * @instance - * @returns {Object.} JSON object - */ - ContactDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContactDetails - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ContactDetails"; - }; - - return ContactDetails; - })(); - - v2.Contact = (function() { - - /** - * Properties of a Contact. - * @memberof google.cloud.securitycenter.v2 - * @interface IContact - * @property {string|null} [email] Contact email - */ - - /** - * Constructs a new Contact. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Contact. - * @implements IContact - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Contact - * @instance - */ - Contact.prototype.email = ""; - - /** - * Creates a new Contact instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Contact - * @static - * @param {google.cloud.securitycenter.v2.IContact=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Contact} Contact instance - */ - Contact.create = function create(properties) { - return new Contact(properties); - }; - - /** - * Encodes the specified Contact message. Does not implicitly {@link google.cloud.securitycenter.v2.Contact.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Contact - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Contact.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Contact - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Contact(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Contact - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Contact - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Contact} Contact - */ - Contact.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Contact) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Contact - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Contact - * @instance - * @returns {Object.} JSON object - */ - Contact.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Contact - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Contact"; - }; - - return Contact; - })(); - - v2.Container = (function() { - - /** - * Properties of a Container. - * @memberof google.cloud.securitycenter.v2 - * @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 - * @property {google.protobuf.ITimestamp|null} [createTime] Container createTime - */ - - /** - * Constructs a new Container. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Container. - * @implements IContainer - * @constructor - * @param {google.cloud.securitycenter.v2.IContainer=} [properties] Properties to set - */ - function Container(properties) { - this.labels = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Container name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Container - * @instance - */ - Container.prototype.name = ""; - - /** - * Container uri. - * @member {string} uri - * @memberof google.cloud.securitycenter.v2.Container - * @instance - */ - Container.prototype.uri = ""; - - /** - * Container imageId. - * @member {string} imageId - * @memberof google.cloud.securitycenter.v2.Container - * @instance - */ - Container.prototype.imageId = ""; - - /** - * Container labels. - * @member {Array.} labels - * @memberof google.cloud.securitycenter.v2.Container - * @instance - */ - Container.prototype.labels = $util.emptyArray; - - /** - * Container createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v2.Container - * @instance - */ - Container.prototype.createTime = null; - - /** - * Creates a new Container instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Container - * @static - * @param {google.cloud.securitycenter.v2.IContainer=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Container} Container instance - */ - Container.create = function create(properties) { - return new Container(properties); - }; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v2.Container.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Container - * @static - * @param {google.cloud.securitycenter.v2.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.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.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.v2.Label.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - 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(); - return writer; - }; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Container.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Container - * @static - * @param {google.cloud.securitycenter.v2.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Container message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Container(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Label.decode(reader, reader.uint32())); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Container message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Container - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Container.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.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.v2.Label.verify(message.labels[i]); - if (error) - return "labels." + 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 Container message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Container - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Container} Container - */ - Container.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Container) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.Container.labels: object expected"); - message.labels[i] = $root.google.cloud.securitycenter.v2.Label.fromObject(object.labels[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Container.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - return message; - }; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Container - * @static - * @param {google.cloud.securitycenter.v2.Container} message Container - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Container.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.labels = []; - if (options.defaults) { - object.name = ""; - object.uri = ""; - object.imageId = ""; - object.createTime = null; - } - 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.v2.Label.toObject(message.labels[j], options); - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - return object; - }; - - /** - * Converts this Container to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Container - * @instance - * @returns {Object.} JSON object - */ - Container.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Container - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Container"; - }; - - return Container; - })(); - - v2.Label = (function() { - - /** - * Properties of a Label. - * @memberof google.cloud.securitycenter.v2 - * @interface ILabel - * @property {string|null} [name] Label name - * @property {string|null} [value] Label value - */ - - /** - * Constructs a new Label. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Label. - * @implements ILabel - * @constructor - * @param {google.cloud.securitycenter.v2.ILabel=} [properties] Properties to set - */ - function Label(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Label name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Label - * @instance - */ - Label.prototype.name = ""; - - /** - * Label value. - * @member {string} value - * @memberof google.cloud.securitycenter.v2.Label - * @instance - */ - Label.prototype.value = ""; - - /** - * Creates a new Label instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Label - * @static - * @param {google.cloud.securitycenter.v2.ILabel=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Label} Label instance - */ - Label.create = function create(properties) { - return new Label(properties); - }; - - /** - * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v2.Label.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Label - * @static - * @param {google.cloud.securitycenter.v2.ILabel} message Label message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} 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.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - return writer; - }; - - /** - * Encodes the specified Label message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Label.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Label - * @static - * @param {google.cloud.securitycenter.v2.ILabel} message Label message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Label.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Label message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.Label} Label - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Label.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Label(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Label message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Label - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Label} Label - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Label.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Label message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Label - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - 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.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a Label message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Label - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Label} Label - */ - Label.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Label) - return object; - var message = new $root.google.cloud.securitycenter.v2.Label(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a Label message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Label - * @static - * @param {google.cloud.securitycenter.v2.Label} message Label - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Label.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.value = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Label to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Label - * @instance - * @returns {Object.} JSON object - */ - Label.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Label - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Label"; - }; - - return Label; - })(); - - v2.DataAccessEvent = (function() { - - /** - * Properties of a DataAccessEvent. - * @memberof google.cloud.securitycenter.v2 - * @interface IDataAccessEvent - * @property {string|null} [eventId] DataAccessEvent eventId - * @property {string|null} [principalEmail] DataAccessEvent principalEmail - * @property {google.cloud.securitycenter.v2.DataAccessEvent.Operation|null} [operation] DataAccessEvent operation - * @property {google.protobuf.ITimestamp|null} [eventTime] DataAccessEvent eventTime - */ - - /** - * Constructs a new DataAccessEvent. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a DataAccessEvent. - * @implements IDataAccessEvent - * @constructor - * @param {google.cloud.securitycenter.v2.IDataAccessEvent=} [properties] Properties to set - */ - function DataAccessEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataAccessEvent eventId. - * @member {string} eventId - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @instance - */ - DataAccessEvent.prototype.eventId = ""; - - /** - * DataAccessEvent principalEmail. - * @member {string} principalEmail - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @instance - */ - DataAccessEvent.prototype.principalEmail = ""; - - /** - * DataAccessEvent operation. - * @member {google.cloud.securitycenter.v2.DataAccessEvent.Operation} operation - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @instance - */ - DataAccessEvent.prototype.operation = 0; - - /** - * DataAccessEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @instance - */ - DataAccessEvent.prototype.eventTime = null; - - /** - * Creates a new DataAccessEvent instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataAccessEvent=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.DataAccessEvent} DataAccessEvent instance - */ - DataAccessEvent.create = function create(properties) { - return new DataAccessEvent(properties); - }; - - /** - * Encodes the specified DataAccessEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataAccessEvent.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataAccessEvent} message DataAccessEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataAccessEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventId); - if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.principalEmail); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operation); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataAccessEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataAccessEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataAccessEvent} message DataAccessEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataAccessEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataAccessEvent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.DataAccessEvent} DataAccessEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataAccessEvent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DataAccessEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.eventId = reader.string(); - break; - } - case 2: { - message.principalEmail = reader.string(); - break; - } - case 3: { - message.operation = reader.int32(); - break; - } - case 4: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataAccessEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.DataAccessEvent} DataAccessEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataAccessEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataAccessEvent message. - * @function verify - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataAccessEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.eventId != null && message.hasOwnProperty("eventId")) - if (!$util.isString(message.eventId)) - return "eventId: string expected"; - if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) - if (!$util.isString(message.principalEmail)) - return "principalEmail: string expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - switch (message.operation) { - default: - return "operation: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - return null; - }; - - /** - * Creates a DataAccessEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.DataAccessEvent} DataAccessEvent - */ - DataAccessEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.DataAccessEvent) - return object; - var message = new $root.google.cloud.securitycenter.v2.DataAccessEvent(); - if (object.eventId != null) - message.eventId = String(object.eventId); - if (object.principalEmail != null) - message.principalEmail = String(object.principalEmail); - switch (object.operation) { - default: - if (typeof object.operation === "number") { - message.operation = object.operation; - break; - } - break; - case "OPERATION_UNSPECIFIED": - case 0: - message.operation = 0; - break; - case "READ": - case 1: - message.operation = 1; - break; - case "MOVE": - case 2: - message.operation = 2; - break; - case "COPY": - case 3: - message.operation = 3; - break; - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.DataAccessEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - return message; - }; - - /** - * Creates a plain object from a DataAccessEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {google.cloud.securitycenter.v2.DataAccessEvent} message DataAccessEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataAccessEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.eventId = ""; - object.principalEmail = ""; - object.operation = options.enums === String ? "OPERATION_UNSPECIFIED" : 0; - object.eventTime = null; - } - if (message.eventId != null && message.hasOwnProperty("eventId")) - object.eventId = message.eventId; - if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) - object.principalEmail = message.principalEmail; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = options.enums === String ? $root.google.cloud.securitycenter.v2.DataAccessEvent.Operation[message.operation] === undefined ? message.operation : $root.google.cloud.securitycenter.v2.DataAccessEvent.Operation[message.operation] : message.operation; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - return object; - }; - - /** - * Converts this DataAccessEvent to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @instance - * @returns {Object.} JSON object - */ - DataAccessEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataAccessEvent - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.DataAccessEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataAccessEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.DataAccessEvent"; - }; - - /** - * Operation enum. - * @name google.cloud.securitycenter.v2.DataAccessEvent.Operation - * @enum {number} - * @property {number} OPERATION_UNSPECIFIED=0 OPERATION_UNSPECIFIED value - * @property {number} READ=1 READ value - * @property {number} MOVE=2 MOVE value - * @property {number} COPY=3 COPY value - */ - DataAccessEvent.Operation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ"] = 1; - values[valuesById[2] = "MOVE"] = 2; - values[valuesById[3] = "COPY"] = 3; - return values; - })(); - - return DataAccessEvent; - })(); - - v2.DataFlowEvent = (function() { - - /** - * Properties of a DataFlowEvent. - * @memberof google.cloud.securitycenter.v2 - * @interface IDataFlowEvent - * @property {string|null} [eventId] DataFlowEvent eventId - * @property {string|null} [principalEmail] DataFlowEvent principalEmail - * @property {google.cloud.securitycenter.v2.DataFlowEvent.Operation|null} [operation] DataFlowEvent operation - * @property {string|null} [violatedLocation] DataFlowEvent violatedLocation - * @property {google.protobuf.ITimestamp|null} [eventTime] DataFlowEvent eventTime - */ - - /** - * Constructs a new DataFlowEvent. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a DataFlowEvent. - * @implements IDataFlowEvent - * @constructor - * @param {google.cloud.securitycenter.v2.IDataFlowEvent=} [properties] Properties to set - */ - function DataFlowEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataFlowEvent eventId. - * @member {string} eventId - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @instance - */ - DataFlowEvent.prototype.eventId = ""; - - /** - * DataFlowEvent principalEmail. - * @member {string} principalEmail - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @instance - */ - DataFlowEvent.prototype.principalEmail = ""; - - /** - * DataFlowEvent operation. - * @member {google.cloud.securitycenter.v2.DataFlowEvent.Operation} operation - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @instance - */ - DataFlowEvent.prototype.operation = 0; - - /** - * DataFlowEvent violatedLocation. - * @member {string} violatedLocation - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @instance - */ - DataFlowEvent.prototype.violatedLocation = ""; - - /** - * DataFlowEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @instance - */ - DataFlowEvent.prototype.eventTime = null; - - /** - * Creates a new DataFlowEvent instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataFlowEvent=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.DataFlowEvent} DataFlowEvent instance - */ - DataFlowEvent.create = function create(properties) { - return new DataFlowEvent(properties); - }; - - /** - * Encodes the specified DataFlowEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataFlowEvent.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataFlowEvent} message DataFlowEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataFlowEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventId); - if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.principalEmail); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operation); - if (message.violatedLocation != null && Object.hasOwnProperty.call(message, "violatedLocation")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.violatedLocation); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataFlowEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataFlowEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataFlowEvent} message DataFlowEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataFlowEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataFlowEvent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.DataFlowEvent} DataFlowEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataFlowEvent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DataFlowEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.eventId = reader.string(); - break; - } - case 2: { - message.principalEmail = reader.string(); - break; - } - case 3: { - message.operation = reader.int32(); - break; - } - case 4: { - message.violatedLocation = reader.string(); - break; - } - case 5: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataFlowEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.DataFlowEvent} DataFlowEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataFlowEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataFlowEvent message. - * @function verify - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataFlowEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.eventId != null && message.hasOwnProperty("eventId")) - if (!$util.isString(message.eventId)) - return "eventId: string expected"; - if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) - if (!$util.isString(message.principalEmail)) - return "principalEmail: string expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - switch (message.operation) { - default: - return "operation: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.violatedLocation != null && message.hasOwnProperty("violatedLocation")) - if (!$util.isString(message.violatedLocation)) - return "violatedLocation: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - return null; - }; - - /** - * Creates a DataFlowEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.DataFlowEvent} DataFlowEvent - */ - DataFlowEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.DataFlowEvent) - return object; - var message = new $root.google.cloud.securitycenter.v2.DataFlowEvent(); - if (object.eventId != null) - message.eventId = String(object.eventId); - if (object.principalEmail != null) - message.principalEmail = String(object.principalEmail); - switch (object.operation) { - default: - if (typeof object.operation === "number") { - message.operation = object.operation; - break; - } - break; - case "OPERATION_UNSPECIFIED": - case 0: - message.operation = 0; - break; - case "READ": - case 1: - message.operation = 1; - break; - case "MOVE": - case 2: - message.operation = 2; - break; - case "COPY": - case 3: - message.operation = 3; - break; - } - if (object.violatedLocation != null) - message.violatedLocation = String(object.violatedLocation); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.DataFlowEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - return message; - }; - - /** - * Creates a plain object from a DataFlowEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {google.cloud.securitycenter.v2.DataFlowEvent} message DataFlowEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataFlowEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.eventId = ""; - object.principalEmail = ""; - object.operation = options.enums === String ? "OPERATION_UNSPECIFIED" : 0; - object.violatedLocation = ""; - object.eventTime = null; - } - if (message.eventId != null && message.hasOwnProperty("eventId")) - object.eventId = message.eventId; - if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) - object.principalEmail = message.principalEmail; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = options.enums === String ? $root.google.cloud.securitycenter.v2.DataFlowEvent.Operation[message.operation] === undefined ? message.operation : $root.google.cloud.securitycenter.v2.DataFlowEvent.Operation[message.operation] : message.operation; - if (message.violatedLocation != null && message.hasOwnProperty("violatedLocation")) - object.violatedLocation = message.violatedLocation; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - return object; - }; - - /** - * Converts this DataFlowEvent to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @instance - * @returns {Object.} JSON object - */ - DataFlowEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataFlowEvent - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.DataFlowEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataFlowEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.DataFlowEvent"; - }; - - /** - * Operation enum. - * @name google.cloud.securitycenter.v2.DataFlowEvent.Operation - * @enum {number} - * @property {number} OPERATION_UNSPECIFIED=0 OPERATION_UNSPECIFIED value - * @property {number} READ=1 READ value - * @property {number} MOVE=2 MOVE value - * @property {number} COPY=3 COPY value - */ - DataFlowEvent.Operation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ"] = 1; - values[valuesById[2] = "MOVE"] = 2; - values[valuesById[3] = "COPY"] = 3; - return values; - })(); - - return DataFlowEvent; - })(); - - v2.DataRetentionDeletionEvent = (function() { - - /** - * Properties of a DataRetentionDeletionEvent. - * @memberof google.cloud.securitycenter.v2 - * @interface IDataRetentionDeletionEvent - * @property {google.protobuf.ITimestamp|null} [eventDetectionTime] DataRetentionDeletionEvent eventDetectionTime - * @property {number|Long|null} [dataObjectCount] DataRetentionDeletionEvent dataObjectCount - * @property {google.protobuf.IDuration|null} [maxRetentionAllowed] DataRetentionDeletionEvent maxRetentionAllowed - * @property {google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType|null} [eventType] DataRetentionDeletionEvent eventType - */ - - /** - * Constructs a new DataRetentionDeletionEvent. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a DataRetentionDeletionEvent. - * @implements IDataRetentionDeletionEvent - * @constructor - * @param {google.cloud.securitycenter.v2.IDataRetentionDeletionEvent=} [properties] Properties to set - */ - function DataRetentionDeletionEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataRetentionDeletionEvent eventDetectionTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventDetectionTime - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @instance - */ - DataRetentionDeletionEvent.prototype.eventDetectionTime = null; - - /** - * DataRetentionDeletionEvent dataObjectCount. - * @member {number|Long} dataObjectCount - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @instance - */ - DataRetentionDeletionEvent.prototype.dataObjectCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * DataRetentionDeletionEvent maxRetentionAllowed. - * @member {google.protobuf.IDuration|null|undefined} maxRetentionAllowed - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @instance - */ - DataRetentionDeletionEvent.prototype.maxRetentionAllowed = null; - - /** - * DataRetentionDeletionEvent eventType. - * @member {google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType} eventType - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @instance - */ - DataRetentionDeletionEvent.prototype.eventType = 0; - - /** - * Creates a new DataRetentionDeletionEvent instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataRetentionDeletionEvent=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} DataRetentionDeletionEvent instance - */ - DataRetentionDeletionEvent.create = function create(properties) { - return new DataRetentionDeletionEvent(properties); - }; - - /** - * Encodes the specified DataRetentionDeletionEvent message. Does not implicitly {@link google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataRetentionDeletionEvent} message DataRetentionDeletionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataRetentionDeletionEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.eventDetectionTime != null && Object.hasOwnProperty.call(message, "eventDetectionTime")) - $root.google.protobuf.Timestamp.encode(message.eventDetectionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dataObjectCount != null && Object.hasOwnProperty.call(message, "dataObjectCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.dataObjectCount); - if (message.maxRetentionAllowed != null && Object.hasOwnProperty.call(message, "maxRetentionAllowed")) - $root.google.protobuf.Duration.encode(message.maxRetentionAllowed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.eventType); - return writer; - }; - - /** - * Encodes the specified DataRetentionDeletionEvent message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {google.cloud.securitycenter.v2.IDataRetentionDeletionEvent} message DataRetentionDeletionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataRetentionDeletionEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataRetentionDeletionEvent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} DataRetentionDeletionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataRetentionDeletionEvent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.eventDetectionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.dataObjectCount = reader.int64(); - break; - } - case 4: { - message.maxRetentionAllowed = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.eventType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataRetentionDeletionEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} DataRetentionDeletionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataRetentionDeletionEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataRetentionDeletionEvent message. - * @function verify - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataRetentionDeletionEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.eventDetectionTime != null && message.hasOwnProperty("eventDetectionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventDetectionTime); - if (error) - return "eventDetectionTime." + error; - } - if (message.dataObjectCount != null && message.hasOwnProperty("dataObjectCount")) - if (!$util.isInteger(message.dataObjectCount) && !(message.dataObjectCount && $util.isInteger(message.dataObjectCount.low) && $util.isInteger(message.dataObjectCount.high))) - return "dataObjectCount: integer|Long expected"; - if (message.maxRetentionAllowed != null && message.hasOwnProperty("maxRetentionAllowed")) { - var error = $root.google.protobuf.Duration.verify(message.maxRetentionAllowed); - if (error) - return "maxRetentionAllowed." + error; - } - if (message.eventType != null && message.hasOwnProperty("eventType")) - switch (message.eventType) { - default: - return "eventType: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a DataRetentionDeletionEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} DataRetentionDeletionEvent - */ - DataRetentionDeletionEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent) - return object; - var message = new $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent(); - if (object.eventDetectionTime != null) { - if (typeof object.eventDetectionTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.eventDetectionTime: object expected"); - message.eventDetectionTime = $root.google.protobuf.Timestamp.fromObject(object.eventDetectionTime); - } - if (object.dataObjectCount != null) - if ($util.Long) - (message.dataObjectCount = $util.Long.fromValue(object.dataObjectCount)).unsigned = false; - else if (typeof object.dataObjectCount === "string") - message.dataObjectCount = parseInt(object.dataObjectCount, 10); - else if (typeof object.dataObjectCount === "number") - message.dataObjectCount = object.dataObjectCount; - else if (typeof object.dataObjectCount === "object") - message.dataObjectCount = new $util.LongBits(object.dataObjectCount.low >>> 0, object.dataObjectCount.high >>> 0).toNumber(); - if (object.maxRetentionAllowed != null) { - if (typeof object.maxRetentionAllowed !== "object") - throw TypeError(".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.maxRetentionAllowed: object expected"); - message.maxRetentionAllowed = $root.google.protobuf.Duration.fromObject(object.maxRetentionAllowed); - } - switch (object.eventType) { - default: - if (typeof object.eventType === "number") { - message.eventType = object.eventType; - break; - } - break; - case "EVENT_TYPE_UNSPECIFIED": - case 0: - message.eventType = 0; - break; - case "EVENT_TYPE_MAX_TTL_EXCEEDED": - case 1: - message.eventType = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a DataRetentionDeletionEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {google.cloud.securitycenter.v2.DataRetentionDeletionEvent} message DataRetentionDeletionEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataRetentionDeletionEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.eventDetectionTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.dataObjectCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.dataObjectCount = options.longs === String ? "0" : 0; - object.maxRetentionAllowed = null; - object.eventType = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; - } - if (message.eventDetectionTime != null && message.hasOwnProperty("eventDetectionTime")) - object.eventDetectionTime = $root.google.protobuf.Timestamp.toObject(message.eventDetectionTime, options); - if (message.dataObjectCount != null && message.hasOwnProperty("dataObjectCount")) - if (typeof message.dataObjectCount === "number") - object.dataObjectCount = options.longs === String ? String(message.dataObjectCount) : message.dataObjectCount; - else - object.dataObjectCount = options.longs === String ? $util.Long.prototype.toString.call(message.dataObjectCount) : options.longs === Number ? new $util.LongBits(message.dataObjectCount.low >>> 0, message.dataObjectCount.high >>> 0).toNumber() : message.dataObjectCount; - if (message.maxRetentionAllowed != null && message.hasOwnProperty("maxRetentionAllowed")) - object.maxRetentionAllowed = $root.google.protobuf.Duration.toObject(message.maxRetentionAllowed, options); - if (message.eventType != null && message.hasOwnProperty("eventType")) - object.eventType = options.enums === String ? $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType[message.eventType] === undefined ? message.eventType : $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType[message.eventType] : message.eventType; - return object; - }; - - /** - * Converts this DataRetentionDeletionEvent to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @instance - * @returns {Object.} JSON object - */ - DataRetentionDeletionEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataRetentionDeletionEvent - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.DataRetentionDeletionEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataRetentionDeletionEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.DataRetentionDeletionEvent"; - }; - - /** - * EventType enum. - * @name google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType - * @enum {number} - * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value - * @property {number} EVENT_TYPE_MAX_TTL_EXCEEDED=1 EVENT_TYPE_MAX_TTL_EXCEEDED value - */ - DataRetentionDeletionEvent.EventType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "EVENT_TYPE_MAX_TTL_EXCEEDED"] = 1; - return values; - })(); - - return DataRetentionDeletionEvent; - })(); - - v2.Database = (function() { - - /** - * Properties of a Database. - * @memberof google.cloud.securitycenter.v2 - * @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 - * @property {string|null} [version] Database version - */ - - /** - * Constructs a new Database. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Database. - * @implements IDatabase - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Database - * @instance - */ - Database.prototype.name = ""; - - /** - * Database displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.Database - * @instance - */ - Database.prototype.displayName = ""; - - /** - * Database userName. - * @member {string} userName - * @memberof google.cloud.securitycenter.v2.Database - * @instance - */ - Database.prototype.userName = ""; - - /** - * Database query. - * @member {string} query - * @memberof google.cloud.securitycenter.v2.Database - * @instance - */ - Database.prototype.query = ""; - - /** - * Database grantees. - * @member {Array.} grantees - * @memberof google.cloud.securitycenter.v2.Database - * @instance - */ - Database.prototype.grantees = $util.emptyArray; - - /** - * Database version. - * @member {string} version - * @memberof google.cloud.securitycenter.v2.Database - * @instance - */ - Database.prototype.version = ""; - - /** - * Creates a new Database instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Database - * @static - * @param {google.cloud.securitycenter.v2.IDatabase=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Database} Database instance - */ - Database.create = function create(properties) { - return new Database(properties); - }; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v2.Database.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Database - * @static - * @param {google.cloud.securitycenter.v2.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]); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.version); - return writer; - }; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Database.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Database - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Database(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - case 6: { - message.version = 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.v2.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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"; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: 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.v2.Database - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Database} Database - */ - Database.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Database) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Database.grantees: array expected"); - message.grantees = []; - for (var i = 0; i < object.grantees.length; ++i) - message.grantees[i] = String(object.grantees[i]); - } - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Database - * @static - * @param {google.cloud.securitycenter.v2.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 = ""; - object.version = ""; - } - 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]; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this Database to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.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.v2.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.v2.Database"; - }; - - return Database; - })(); - - v2.Disk = (function() { - - /** - * Properties of a Disk. - * @memberof google.cloud.securitycenter.v2 - * @interface IDisk - * @property {string|null} [name] Disk name - */ - - /** - * Constructs a new Disk. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Disk. - * @implements IDisk - * @constructor - * @param {google.cloud.securitycenter.v2.IDisk=} [properties] Properties to set - */ - function Disk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Disk name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Disk - * @instance - */ - Disk.prototype.name = ""; - - /** - * Creates a new Disk instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {google.cloud.securitycenter.v2.IDisk=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Disk} Disk instance - */ - Disk.create = function create(properties) { - return new Disk(properties); - }; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.securitycenter.v2.Disk.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {google.cloud.securitycenter.v2.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.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 Disk message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Disk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {google.cloud.securitycenter.v2.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Disk(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Disk message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Disk.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 Disk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Disk} Disk - */ - Disk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Disk) - return object; - var message = new $root.google.cloud.securitycenter.v2.Disk(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {google.cloud.securitycenter.v2.Disk} message Disk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Disk.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 Disk to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Disk - * @instance - * @returns {Object.} JSON object - */ - Disk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Disk - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Disk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Disk"; - }; - - return Disk; - })(); - - v2.Exfiltration = (function() { - - /** - * Properties of an Exfiltration. - * @memberof google.cloud.securitycenter.v2 - * @interface IExfiltration - * @property {Array.|null} [sources] Exfiltration sources - * @property {Array.|null} [targets] Exfiltration targets - * @property {number|Long|null} [totalExfiltratedBytes] Exfiltration totalExfiltratedBytes - */ - - /** - * Constructs a new Exfiltration. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an Exfiltration. - * @implements IExfiltration - * @constructor - * @param {google.cloud.securitycenter.v2.IExfiltration=} [properties] Properties to set - */ - 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) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Exfiltration sources. - * @member {Array.} sources - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @instance - */ - Exfiltration.prototype.sources = $util.emptyArray; - - /** - * Exfiltration targets. - * @member {Array.} targets - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @instance - */ - Exfiltration.prototype.targets = $util.emptyArray; - - /** - * Exfiltration totalExfiltratedBytes. - * @member {number|Long} totalExfiltratedBytes - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @instance - */ - Exfiltration.prototype.totalExfiltratedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Exfiltration instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @static - * @param {google.cloud.securitycenter.v2.IExfiltration=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Exfiltration} Exfiltration instance - */ - Exfiltration.create = function create(properties) { - return new Exfiltration(properties); - }; - - /** - * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v2.Exfiltration.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @static - * @param {google.cloud.securitycenter.v2.IExfiltration} message Exfiltration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exfiltration.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.v2.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.v2.ExfilResource.encode(message.targets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.totalExfiltratedBytes != null && Object.hasOwnProperty.call(message, "totalExfiltratedBytes")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalExfiltratedBytes); - return writer; - }; - - /** - * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Exfiltration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @static - * @param {google.cloud.securitycenter.v2.IExfiltration} message Exfiltration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exfiltration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Exfiltration message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.Exfiltration} Exfiltration - * @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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Exfiltration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v2.ExfilResource.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.targets && message.targets.length)) - message.targets = []; - message.targets.push($root.google.cloud.securitycenter.v2.ExfilResource.decode(reader, reader.uint32())); - break; - } - case 3: { - message.totalExfiltratedBytes = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Exfiltration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Exfiltration} Exfiltration - * @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) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Exfiltration message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @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) { - 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.v2.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.v2.ExfilResource.verify(message.targets[i]); - if (error) - return "targets." + error; - } - } - if (message.totalExfiltratedBytes != null && message.hasOwnProperty("totalExfiltratedBytes")) - if (!$util.isInteger(message.totalExfiltratedBytes) && !(message.totalExfiltratedBytes && $util.isInteger(message.totalExfiltratedBytes.low) && $util.isInteger(message.totalExfiltratedBytes.high))) - return "totalExfiltratedBytes: integer|Long expected"; - return null; - }; - - /** - * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Exfiltration} Exfiltration - */ - Exfiltration.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Exfiltration) - return object; - var message = new $root.google.cloud.securitycenter.v2.Exfiltration(); - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Exfiltration.sources: object expected"); - message.sources[i] = $root.google.cloud.securitycenter.v2.ExfilResource.fromObject(object.sources[i]); - } - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Exfiltration.targets: object expected"); - message.targets[i] = $root.google.cloud.securitycenter.v2.ExfilResource.fromObject(object.targets[i]); - } - } - if (object.totalExfiltratedBytes != null) - if ($util.Long) - (message.totalExfiltratedBytes = $util.Long.fromValue(object.totalExfiltratedBytes)).unsigned = false; - else if (typeof object.totalExfiltratedBytes === "string") - message.totalExfiltratedBytes = parseInt(object.totalExfiltratedBytes, 10); - else if (typeof object.totalExfiltratedBytes === "number") - message.totalExfiltratedBytes = object.totalExfiltratedBytes; - else if (typeof object.totalExfiltratedBytes === "object") - message.totalExfiltratedBytes = new $util.LongBits(object.totalExfiltratedBytes.low >>> 0, object.totalExfiltratedBytes.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @static - * @param {google.cloud.securitycenter.v2.Exfiltration} message Exfiltration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Exfiltration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.sources = []; - object.targets = []; - } - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalExfiltratedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalExfiltratedBytes = options.longs === String ? "0" : 0; - if (message.sources && message.sources.length) { - object.sources = []; - for (var j = 0; j < message.sources.length; ++j) - object.sources[j] = $root.google.cloud.securitycenter.v2.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.v2.ExfilResource.toObject(message.targets[j], options); - } - if (message.totalExfiltratedBytes != null && message.hasOwnProperty("totalExfiltratedBytes")) - if (typeof message.totalExfiltratedBytes === "number") - object.totalExfiltratedBytes = options.longs === String ? String(message.totalExfiltratedBytes) : message.totalExfiltratedBytes; - else - object.totalExfiltratedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalExfiltratedBytes) : options.longs === Number ? new $util.LongBits(message.totalExfiltratedBytes.low >>> 0, message.totalExfiltratedBytes.high >>> 0).toNumber() : message.totalExfiltratedBytes; - return object; - }; - - /** - * Converts this Exfiltration to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Exfiltration - * @instance - * @returns {Object.} JSON object - */ - Exfiltration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Exfiltration - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Exfiltration"; - }; - - return Exfiltration; - })(); - - v2.ExfilResource = (function() { - - /** - * Properties of an ExfilResource. - * @memberof google.cloud.securitycenter.v2 - * @interface IExfilResource - * @property {string|null} [name] ExfilResource name - * @property {Array.|null} [components] ExfilResource components - */ - - /** - * Constructs a new ExfilResource. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an ExfilResource. - * @implements IExfilResource - * @constructor - * @param {google.cloud.securitycenter.v2.IExfilResource=} [properties] Properties to set - */ - function ExfilResource(properties) { - this.components = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExfilResource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @instance - */ - ExfilResource.prototype.name = ""; - - /** - * ExfilResource components. - * @member {Array.} components - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @instance - */ - ExfilResource.prototype.components = $util.emptyArray; - - /** - * Creates a new ExfilResource instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @static - * @param {google.cloud.securitycenter.v2.IExfilResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ExfilResource} ExfilResource instance - */ - ExfilResource.create = function create(properties) { - return new ExfilResource(properties); - }; - - /** - * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v2.ExfilResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @static - * @param {google.cloud.securitycenter.v2.IExfilResource} message ExfilResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - 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; - }; - - /** - * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExfilResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @static - * @param {google.cloud.securitycenter.v2.IExfilResource} message ExfilResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExfilResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExfilResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.ExfilResource} ExfilResource - * @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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExfilResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - }; - - /** - * Decodes an ExfilResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ExfilResource} ExfilResource - * @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) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExfilResource message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @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) { - 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; - }; - - /** - * Creates an ExfilResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ExfilResource} ExfilResource - */ - ExfilResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ExfilResource) - return object; - var message = new $root.google.cloud.securitycenter.v2.ExfilResource(); - if (object.name != null) - message.name = String(object.name); - if (object.components) { - if (!Array.isArray(object.components)) - throw TypeError(".google.cloud.securitycenter.v2.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 an ExfilResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @static - * @param {google.cloud.securitycenter.v2.ExfilResource} message ExfilResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - 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; - }; - - /** - * Converts this ExfilResource to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ExfilResource - * @instance - * @returns {Object.} JSON object - */ - ExfilResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExfilResource - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ExfilResource"; - }; - - return ExfilResource; - })(); - - v2.ExternalSystem = (function() { - - /** - * Properties of an ExternalSystem. - * @memberof google.cloud.securitycenter.v2 - * @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 - * @property {string|null} [caseUri] ExternalSystem caseUri - * @property {string|null} [casePriority] ExternalSystem casePriority - * @property {google.protobuf.ITimestamp|null} [caseSla] ExternalSystem caseSla - * @property {google.protobuf.ITimestamp|null} [caseCreateTime] ExternalSystem caseCreateTime - * @property {google.protobuf.ITimestamp|null} [caseCloseTime] ExternalSystem caseCloseTime - * @property {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo|null} [ticketInfo] ExternalSystem ticketInfo - */ - - /** - * Constructs a new ExternalSystem. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an ExternalSystem. - * @implements IExternalSystem - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.name = ""; - - /** - * ExternalSystem assignees. - * @member {Array.} assignees - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.assignees = $util.emptyArray; - - /** - * ExternalSystem externalUid. - * @member {string} externalUid - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.externalUid = ""; - - /** - * ExternalSystem status. - * @member {string} status - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.status = ""; - - /** - * ExternalSystem externalSystemUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} externalSystemUpdateTime - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.externalSystemUpdateTime = null; - - /** - * ExternalSystem caseUri. - * @member {string} caseUri - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.caseUri = ""; - - /** - * ExternalSystem casePriority. - * @member {string} casePriority - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.casePriority = ""; - - /** - * ExternalSystem caseSla. - * @member {google.protobuf.ITimestamp|null|undefined} caseSla - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.caseSla = null; - - /** - * ExternalSystem caseCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} caseCreateTime - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.caseCreateTime = null; - - /** - * ExternalSystem caseCloseTime. - * @member {google.protobuf.ITimestamp|null|undefined} caseCloseTime - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.caseCloseTime = null; - - /** - * ExternalSystem ticketInfo. - * @member {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo|null|undefined} ticketInfo - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - */ - ExternalSystem.prototype.ticketInfo = null; - - /** - * Creates a new ExternalSystem instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @static - * @param {google.cloud.securitycenter.v2.IExternalSystem=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ExternalSystem} ExternalSystem instance - */ - ExternalSystem.create = function create(properties) { - return new ExternalSystem(properties); - }; - - /** - * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @static - * @param {google.cloud.securitycenter.v2.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(); - if (message.caseUri != null && Object.hasOwnProperty.call(message, "caseUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.caseUri); - if (message.casePriority != null && Object.hasOwnProperty.call(message, "casePriority")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.casePriority); - if (message.ticketInfo != null && Object.hasOwnProperty.call(message, "ticketInfo")) - $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.encode(message.ticketInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.caseSla != null && Object.hasOwnProperty.call(message, "caseSla")) - $root.google.protobuf.Timestamp.encode(message.caseSla, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.caseCreateTime != null && Object.hasOwnProperty.call(message, "caseCreateTime")) - $root.google.protobuf.Timestamp.encode(message.caseCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.caseCloseTime != null && Object.hasOwnProperty.call(message, "caseCloseTime")) - $root.google.protobuf.Timestamp.encode(message.caseCloseTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExternalSystem(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 6: { - message.caseUri = reader.string(); - break; - } - case 7: { - message.casePriority = reader.string(); - break; - } - case 9: { - message.caseSla = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.caseCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.caseCloseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.ticketInfo = $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.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.v2.ExternalSystem - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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; - } - if (message.caseUri != null && message.hasOwnProperty("caseUri")) - if (!$util.isString(message.caseUri)) - return "caseUri: string expected"; - if (message.casePriority != null && message.hasOwnProperty("casePriority")) - if (!$util.isString(message.casePriority)) - return "casePriority: string expected"; - if (message.caseSla != null && message.hasOwnProperty("caseSla")) { - var error = $root.google.protobuf.Timestamp.verify(message.caseSla); - if (error) - return "caseSla." + error; - } - if (message.caseCreateTime != null && message.hasOwnProperty("caseCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.caseCreateTime); - if (error) - return "caseCreateTime." + error; - } - if (message.caseCloseTime != null && message.hasOwnProperty("caseCloseTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.caseCloseTime); - if (error) - return "caseCloseTime." + error; - } - if (message.ticketInfo != null && message.hasOwnProperty("ticketInfo")) { - var error = $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify(message.ticketInfo); - if (error) - return "ticketInfo." + 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.v2.ExternalSystem - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ExternalSystem} ExternalSystem - */ - ExternalSystem.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ExternalSystem) - return object; - var message = new $root.google.cloud.securitycenter.v2.ExternalSystem(); - if (object.name != null) - message.name = String(object.name); - if (object.assignees) { - if (!Array.isArray(object.assignees)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.ExternalSystem.externalSystemUpdateTime: object expected"); - message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.externalSystemUpdateTime); - } - if (object.caseUri != null) - message.caseUri = String(object.caseUri); - if (object.casePriority != null) - message.casePriority = String(object.casePriority); - if (object.caseSla != null) { - if (typeof object.caseSla !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.caseSla: object expected"); - message.caseSla = $root.google.protobuf.Timestamp.fromObject(object.caseSla); - } - if (object.caseCreateTime != null) { - if (typeof object.caseCreateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.caseCreateTime: object expected"); - message.caseCreateTime = $root.google.protobuf.Timestamp.fromObject(object.caseCreateTime); - } - if (object.caseCloseTime != null) { - if (typeof object.caseCloseTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.caseCloseTime: object expected"); - message.caseCloseTime = $root.google.protobuf.Timestamp.fromObject(object.caseCloseTime); - } - if (object.ticketInfo != null) { - if (typeof object.ticketInfo !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.ticketInfo: object expected"); - message.ticketInfo = $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.fromObject(object.ticketInfo); - } - return message; - }; - - /** - * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @static - * @param {google.cloud.securitycenter.v2.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; - object.caseUri = ""; - object.casePriority = ""; - object.ticketInfo = null; - object.caseSla = null; - object.caseCreateTime = null; - object.caseCloseTime = 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); - if (message.caseUri != null && message.hasOwnProperty("caseUri")) - object.caseUri = message.caseUri; - if (message.casePriority != null && message.hasOwnProperty("casePriority")) - object.casePriority = message.casePriority; - if (message.ticketInfo != null && message.hasOwnProperty("ticketInfo")) - object.ticketInfo = $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.toObject(message.ticketInfo, options); - if (message.caseSla != null && message.hasOwnProperty("caseSla")) - object.caseSla = $root.google.protobuf.Timestamp.toObject(message.caseSla, options); - if (message.caseCreateTime != null && message.hasOwnProperty("caseCreateTime")) - object.caseCreateTime = $root.google.protobuf.Timestamp.toObject(message.caseCreateTime, options); - if (message.caseCloseTime != null && message.hasOwnProperty("caseCloseTime")) - object.caseCloseTime = $root.google.protobuf.Timestamp.toObject(message.caseCloseTime, options); - return object; - }; - - /** - * Converts this ExternalSystem to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @instance - * @returns {Object.} JSON object - */ - ExternalSystem.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExternalSystem - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ExternalSystem"; - }; - - ExternalSystem.TicketInfo = (function() { - - /** - * Properties of a TicketInfo. - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @interface ITicketInfo - * @property {string|null} [id] TicketInfo id - * @property {string|null} [assignee] TicketInfo assignee - * @property {string|null} [description] TicketInfo description - * @property {string|null} [uri] TicketInfo uri - * @property {string|null} [status] TicketInfo status - * @property {google.protobuf.ITimestamp|null} [updateTime] TicketInfo updateTime - */ - - /** - * Constructs a new TicketInfo. - * @memberof google.cloud.securitycenter.v2.ExternalSystem - * @classdesc Represents a TicketInfo. - * @implements ITicketInfo - * @constructor - * @param {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo=} [properties] Properties to set - */ - function TicketInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TicketInfo id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.id = ""; - - /** - * TicketInfo assignee. - * @member {string} assignee - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.assignee = ""; - - /** - * TicketInfo description. - * @member {string} description - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.description = ""; - - /** - * TicketInfo uri. - * @member {string} uri - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.uri = ""; - - /** - * TicketInfo status. - * @member {string} status - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.status = ""; - - /** - * TicketInfo updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @instance - */ - TicketInfo.prototype.updateTime = null; - - /** - * Creates a new TicketInfo instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} TicketInfo instance - */ - TicketInfo.create = function create(properties) { - return new TicketInfo(properties); - }; - - /** - * Encodes the specified TicketInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo} message TicketInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TicketInfo.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.assignee != null && Object.hasOwnProperty.call(message, "assignee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignee); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.status); - 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(); - return writer; - }; - - /** - * Encodes the specified TicketInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {google.cloud.securitycenter.v2.ExternalSystem.ITicketInfo} message TicketInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TicketInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TicketInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} TicketInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TicketInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.assignee = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.uri = reader.string(); - break; - } - case 5: { - message.status = reader.string(); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TicketInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} TicketInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TicketInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TicketInfo message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TicketInfo.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.assignee != null && message.hasOwnProperty("assignee")) - if (!$util.isString(message.assignee)) - return "assignee: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - return null; - }; - - /** - * Creates a TicketInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} TicketInfo - */ - TicketInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo) - return object; - var message = new $root.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo(); - if (object.id != null) - message.id = String(object.id); - if (object.assignee != null) - message.assignee = String(object.assignee); - if (object.description != null) - message.description = String(object.description); - if (object.uri != null) - message.uri = String(object.uri); - if (object.status != null) - message.status = String(object.status); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ExternalSystem.TicketInfo.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from a TicketInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {google.cloud.securitycenter.v2.ExternalSystem.TicketInfo} message TicketInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TicketInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.assignee = ""; - object.description = ""; - object.uri = ""; - object.status = ""; - object.updateTime = null; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.assignee != null && message.hasOwnProperty("assignee")) - object.assignee = message.assignee; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - return object; - }; - - /** - * Converts this TicketInfo to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @instance - * @returns {Object.} JSON object - */ - TicketInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TicketInfo - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ExternalSystem.TicketInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TicketInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ExternalSystem.TicketInfo"; - }; - - return TicketInfo; - })(); - - return ExternalSystem; - })(); - - v2.File = (function() { - - /** - * Properties of a File. - * @memberof google.cloud.securitycenter.v2 - * @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 - * @property {google.cloud.securitycenter.v2.File.IDiskPath|null} [diskPath] File diskPath - * @property {Array.|null} [operations] File operations - */ - - /** - * Constructs a new File. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a File. - * @implements IFile - * @constructor - * @param {google.cloud.securitycenter.v2.IFile=} [properties] Properties to set - */ - function File(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]]; - } - - /** - * File path. - * @member {string} path - * @memberof google.cloud.securitycenter.v2.File - * @instance - */ - File.prototype.path = ""; - - /** - * File size. - * @member {number|Long} size - * @memberof google.cloud.securitycenter.v2.File - * @instance - */ - File.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * File sha256. - * @member {string} sha256 - * @memberof google.cloud.securitycenter.v2.File - * @instance - */ - File.prototype.sha256 = ""; - - /** - * File hashedSize. - * @member {number|Long} hashedSize - * @memberof google.cloud.securitycenter.v2.File - * @instance - */ - File.prototype.hashedSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * File partiallyHashed. - * @member {boolean} partiallyHashed - * @memberof google.cloud.securitycenter.v2.File - * @instance - */ - File.prototype.partiallyHashed = false; - - /** - * File contents. - * @member {string} contents - * @memberof google.cloud.securitycenter.v2.File - * @instance - */ - File.prototype.contents = ""; - - /** - * File diskPath. - * @member {google.cloud.securitycenter.v2.File.IDiskPath|null|undefined} diskPath - * @memberof google.cloud.securitycenter.v2.File - * @instance - */ - File.prototype.diskPath = null; - - /** - * File operations. - * @member {Array.} operations - * @memberof google.cloud.securitycenter.v2.File - * @instance - */ - File.prototype.operations = $util.emptyArray; - - /** - * Creates a new File instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.File - * @static - * @param {google.cloud.securitycenter.v2.IFile=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.File} File instance - */ - File.create = function create(properties) { - return new File(properties); - }; - - /** - * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v2.File.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.File - * @static - * @param {google.cloud.securitycenter.v2.IFile} message File message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - File.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.diskPath != null && Object.hasOwnProperty.call(message, "diskPath")) - $root.google.cloud.securitycenter.v2.File.DiskPath.encode(message.diskPath, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.cloud.securitycenter.v2.File.FileOperation.encode(message.operations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.File - * @static - * @param {google.cloud.securitycenter.v2.IFile} message File message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - File.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a File message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.File} File - * @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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.File(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 7: { - message.diskPath = $root.google.cloud.securitycenter.v2.File.DiskPath.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.cloud.securitycenter.v2.File.FileOperation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a File message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.File - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.File} File - * @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) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a File message. - * @function verify - * @memberof google.cloud.securitycenter.v2.File - * @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) { - 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.diskPath != null && message.hasOwnProperty("diskPath")) { - var error = $root.google.cloud.securitycenter.v2.File.DiskPath.verify(message.diskPath); - if (error) - return "diskPath." + error; - } - 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.cloud.securitycenter.v2.File.FileOperation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - return null; - }; - - /** - * Creates a File message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.File - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.File} File - */ - File.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.File) - return object; - var message = new $root.google.cloud.securitycenter.v2.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); - if (object.diskPath != null) { - if (typeof object.diskPath !== "object") - throw TypeError(".google.cloud.securitycenter.v2.File.diskPath: object expected"); - message.diskPath = $root.google.cloud.securitycenter.v2.File.DiskPath.fromObject(object.diskPath); - } - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.cloud.securitycenter.v2.File.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.File.operations: object expected"); - message.operations[i] = $root.google.cloud.securitycenter.v2.File.FileOperation.fromObject(object.operations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a File message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.File - * @static - * @param {google.cloud.securitycenter.v2.File} message File - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - File.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - 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 = ""; - object.diskPath = null; - } - 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; - if (message.diskPath != null && message.hasOwnProperty("diskPath")) - object.diskPath = $root.google.cloud.securitycenter.v2.File.DiskPath.toObject(message.diskPath, options); - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.cloud.securitycenter.v2.File.FileOperation.toObject(message.operations[j], options); - } - return object; - }; - - /** - * Converts this File to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.File - * @instance - * @returns {Object.} JSON object - */ - File.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for File - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.File"; - }; - - File.DiskPath = (function() { - - /** - * Properties of a DiskPath. - * @memberof google.cloud.securitycenter.v2.File - * @interface IDiskPath - * @property {string|null} [partitionUuid] DiskPath partitionUuid - * @property {string|null} [relativePath] DiskPath relativePath - */ - - /** - * Constructs a new DiskPath. - * @memberof google.cloud.securitycenter.v2.File - * @classdesc Represents a DiskPath. - * @implements IDiskPath - * @constructor - * @param {google.cloud.securitycenter.v2.File.IDiskPath=} [properties] Properties to set - */ - function DiskPath(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiskPath partitionUuid. - * @member {string} partitionUuid - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @instance - */ - DiskPath.prototype.partitionUuid = ""; - - /** - * DiskPath relativePath. - * @member {string} relativePath - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @instance - */ - DiskPath.prototype.relativePath = ""; - - /** - * Creates a new DiskPath instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {google.cloud.securitycenter.v2.File.IDiskPath=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.File.DiskPath} DiskPath instance - */ - DiskPath.create = function create(properties) { - return new DiskPath(properties); - }; - - /** - * Encodes the specified DiskPath message. Does not implicitly {@link google.cloud.securitycenter.v2.File.DiskPath.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {google.cloud.securitycenter.v2.File.IDiskPath} message DiskPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskPath.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitionUuid != null && Object.hasOwnProperty.call(message, "partitionUuid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.partitionUuid); - if (message.relativePath != null && Object.hasOwnProperty.call(message, "relativePath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relativePath); - return writer; - }; - - /** - * Encodes the specified DiskPath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.DiskPath.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {google.cloud.securitycenter.v2.File.IDiskPath} message DiskPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskPath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiskPath message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.File.DiskPath} DiskPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskPath.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.File.DiskPath(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partitionUuid = reader.string(); - break; - } - case 2: { - message.relativePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiskPath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.File.DiskPath} DiskPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskPath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiskPath message. - * @function verify - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiskPath.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitionUuid != null && message.hasOwnProperty("partitionUuid")) - if (!$util.isString(message.partitionUuid)) - return "partitionUuid: string expected"; - if (message.relativePath != null && message.hasOwnProperty("relativePath")) - if (!$util.isString(message.relativePath)) - return "relativePath: string expected"; - return null; - }; - - /** - * Creates a DiskPath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.File.DiskPath} DiskPath - */ - DiskPath.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.File.DiskPath) - return object; - var message = new $root.google.cloud.securitycenter.v2.File.DiskPath(); - if (object.partitionUuid != null) - message.partitionUuid = String(object.partitionUuid); - if (object.relativePath != null) - message.relativePath = String(object.relativePath); - return message; - }; - - /** - * Creates a plain object from a DiskPath message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {google.cloud.securitycenter.v2.File.DiskPath} message DiskPath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiskPath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.partitionUuid = ""; - object.relativePath = ""; - } - if (message.partitionUuid != null && message.hasOwnProperty("partitionUuid")) - object.partitionUuid = message.partitionUuid; - if (message.relativePath != null && message.hasOwnProperty("relativePath")) - object.relativePath = message.relativePath; - return object; - }; - - /** - * Converts this DiskPath to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @instance - * @returns {Object.} JSON object - */ - DiskPath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiskPath - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.File.DiskPath - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiskPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.File.DiskPath"; - }; - - return DiskPath; - })(); - - File.FileOperation = (function() { - - /** - * Properties of a FileOperation. - * @memberof google.cloud.securitycenter.v2.File - * @interface IFileOperation - * @property {google.cloud.securitycenter.v2.File.FileOperation.OperationType|null} [type] FileOperation type - */ - - /** - * Constructs a new FileOperation. - * @memberof google.cloud.securitycenter.v2.File - * @classdesc Represents a FileOperation. - * @implements IFileOperation - * @constructor - * @param {google.cloud.securitycenter.v2.File.IFileOperation=} [properties] Properties to set - */ - function FileOperation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOperation type. - * @member {google.cloud.securitycenter.v2.File.FileOperation.OperationType} type - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @instance - */ - FileOperation.prototype.type = 0; - - /** - * Creates a new FileOperation instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {google.cloud.securitycenter.v2.File.IFileOperation=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.File.FileOperation} FileOperation instance - */ - FileOperation.create = function create(properties) { - return new FileOperation(properties); - }; - - /** - * Encodes the specified FileOperation message. Does not implicitly {@link google.cloud.securitycenter.v2.File.FileOperation.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {google.cloud.securitycenter.v2.File.IFileOperation} message FileOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOperation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - return writer; - }; - - /** - * Encodes the specified FileOperation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.File.FileOperation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {google.cloud.securitycenter.v2.File.IFileOperation} message FileOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOperation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOperation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.File.FileOperation} FileOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOperation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.File.FileOperation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOperation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.File.FileOperation} FileOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOperation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOperation message. - * @function verify - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOperation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates a FileOperation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.File.FileOperation} FileOperation - */ - FileOperation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.File.FileOperation) - return object; - var message = new $root.google.cloud.securitycenter.v2.File.FileOperation(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "OPERATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "OPEN": - case 1: - message.type = 1; - break; - case "READ": - case 2: - message.type = 2; - break; - case "RENAME": - case 3: - message.type = 3; - break; - case "WRITE": - case 4: - message.type = 4; - break; - case "EXECUTE": - case 5: - message.type = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileOperation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {google.cloud.securitycenter.v2.File.FileOperation} message FileOperation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOperation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.type = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.securitycenter.v2.File.FileOperation.OperationType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v2.File.FileOperation.OperationType[message.type] : message.type; - return object; - }; - - /** - * Converts this FileOperation to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @instance - * @returns {Object.} JSON object - */ - FileOperation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOperation - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.File.FileOperation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.File.FileOperation"; - }; - - /** - * OperationType enum. - * @name google.cloud.securitycenter.v2.File.FileOperation.OperationType - * @enum {number} - * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value - * @property {number} OPEN=1 OPEN value - * @property {number} READ=2 READ value - * @property {number} RENAME=3 RENAME value - * @property {number} WRITE=4 WRITE value - * @property {number} EXECUTE=5 EXECUTE value - */ - FileOperation.OperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "READ"] = 2; - values[valuesById[3] = "RENAME"] = 3; - values[valuesById[4] = "WRITE"] = 4; - values[valuesById[5] = "EXECUTE"] = 5; - return values; - })(); - - return FileOperation; - })(); - - return File; - })(); - - v2.Finding = (function() { - - /** - * Properties of a Finding. - * @memberof google.cloud.securitycenter.v2 - * @interface IFinding - * @property {string|null} [name] Finding name - * @property {string|null} [canonicalName] Finding canonicalName - * @property {string|null} [parent] Finding parent - * @property {string|null} [resourceName] Finding resourceName - * @property {google.cloud.securitycenter.v2.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.v2.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.v2.Finding.Severity|null} [severity] Finding severity - * @property {google.cloud.securitycenter.v2.Finding.Mute|null} [mute] Finding mute - * @property {google.cloud.securitycenter.v2.Finding.IMuteInfo|null} [muteInfo] Finding muteInfo - * @property {google.cloud.securitycenter.v2.Finding.FindingClass|null} [findingClass] Finding findingClass - * @property {google.cloud.securitycenter.v2.IIndicator|null} [indicator] Finding indicator - * @property {google.cloud.securitycenter.v2.IVulnerability|null} [vulnerability] Finding vulnerability - * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime - * @property {Object.|null} [externalSystems] Finding externalSystems - * @property {google.cloud.securitycenter.v2.IMitreAttack|null} [mitreAttack] Finding mitreAttack - * @property {google.cloud.securitycenter.v2.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} [parentDisplayName] Finding parentDisplayName - * @property {string|null} [description] Finding description - * @property {google.cloud.securitycenter.v2.IExfiltration|null} [exfiltration] Finding exfiltration - * @property {Array.|null} [iamBindings] Finding iamBindings - * @property {string|null} [nextSteps] Finding nextSteps - * @property {string|null} [moduleName] Finding moduleName - * @property {Array.|null} [containers] Finding containers - * @property {google.cloud.securitycenter.v2.IKubernetes|null} [kubernetes] Finding kubernetes - * @property {google.cloud.securitycenter.v2.IDatabase|null} [database] Finding database - * @property {google.cloud.securitycenter.v2.IAttackExposure|null} [attackExposure] Finding attackExposure - * @property {Array.|null} [files] Finding files - * @property {google.cloud.securitycenter.v2.ICloudDlpInspection|null} [cloudDlpInspection] Finding cloudDlpInspection - * @property {google.cloud.securitycenter.v2.ICloudDlpDataProfile|null} [cloudDlpDataProfile] Finding cloudDlpDataProfile - * @property {google.cloud.securitycenter.v2.IKernelRootkit|null} [kernelRootkit] Finding kernelRootkit - * @property {Array.|null} [orgPolicies] Finding orgPolicies - * @property {google.cloud.securitycenter.v2.IJob|null} [job] Finding job - * @property {google.cloud.securitycenter.v2.IApplication|null} [application] Finding application - * @property {google.cloud.securitycenter.v2.IIpRules|null} [ipRules] Finding ipRules - * @property {google.cloud.securitycenter.v2.IBackupDisasterRecovery|null} [backupDisasterRecovery] Finding backupDisasterRecovery - * @property {google.cloud.securitycenter.v2.ISecurityPosture|null} [securityPosture] Finding securityPosture - * @property {Array.|null} [logEntries] Finding logEntries - * @property {Array.|null} [loadBalancers] Finding loadBalancers - * @property {google.cloud.securitycenter.v2.ICloudArmor|null} [cloudArmor] Finding cloudArmor - * @property {google.cloud.securitycenter.v2.INotebook|null} [notebook] Finding notebook - * @property {google.cloud.securitycenter.v2.IToxicCombination|null} [toxicCombination] Finding toxicCombination - * @property {Array.|null} [groupMemberships] Finding groupMemberships - * @property {google.cloud.securitycenter.v2.IDisk|null} [disk] Finding disk - * @property {Array.|null} [dataAccessEvents] Finding dataAccessEvents - * @property {Array.|null} [dataFlowEvents] Finding dataFlowEvents - * @property {Array.|null} [networks] Finding networks - * @property {Array.|null} [dataRetentionDeletionEvents] Finding dataRetentionDeletionEvents - * @property {google.cloud.securitycenter.v2.IAffectedResources|null} [affectedResources] Finding affectedResources - * @property {google.cloud.securitycenter.v2.IAiModel|null} [aiModel] Finding aiModel - * @property {google.cloud.securitycenter.v2.IChokepoint|null} [chokepoint] Finding chokepoint - * @property {google.cloud.securitycenter.v2.IVertexAi|null} [vertexAi] Finding vertexAi - */ - - /** - * Constructs a new Finding. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Finding. - * @implements IFinding - * @constructor - * @param {google.cloud.securitycenter.v2.IFinding=} [properties] Properties to set - */ - function Finding(properties) { - this.sourceProperties = {}; - this.externalSystems = {}; - this.connections = []; - this.processes = []; - this.contacts = {}; - this.compliances = []; - this.iamBindings = []; - this.containers = []; - this.files = []; - this.orgPolicies = []; - this.logEntries = []; - this.loadBalancers = []; - this.groupMemberships = []; - this.dataAccessEvents = []; - this.dataFlowEvents = []; - this.networks = []; - this.dataRetentionDeletionEvents = []; - if (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.v2.Finding - * @instance - */ - Finding.prototype.name = ""; - - /** - * Finding canonicalName. - * @member {string} canonicalName - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.canonicalName = ""; - - /** - * Finding parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.parent = ""; - - /** - * Finding resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.resourceName = ""; - - /** - * Finding state. - * @member {google.cloud.securitycenter.v2.Finding.State} state - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.state = 0; - - /** - * Finding category. - * @member {string} category - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.category = ""; - - /** - * Finding externalUri. - * @member {string} externalUri - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.externalUri = ""; - - /** - * Finding sourceProperties. - * @member {Object.} sourceProperties - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.sourceProperties = $util.emptyObject; - - /** - * Finding securityMarks. - * @member {google.cloud.securitycenter.v2.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.securityMarks = null; - - /** - * Finding eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.eventTime = null; - - /** - * Finding createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.createTime = null; - - /** - * Finding severity. - * @member {google.cloud.securitycenter.v2.Finding.Severity} severity - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.severity = 0; - - /** - * Finding mute. - * @member {google.cloud.securitycenter.v2.Finding.Mute} mute - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.mute = 0; - - /** - * Finding muteInfo. - * @member {google.cloud.securitycenter.v2.Finding.IMuteInfo|null|undefined} muteInfo - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.muteInfo = null; - - /** - * Finding findingClass. - * @member {google.cloud.securitycenter.v2.Finding.FindingClass} findingClass - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.findingClass = 0; - - /** - * Finding indicator. - * @member {google.cloud.securitycenter.v2.IIndicator|null|undefined} indicator - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.indicator = null; - - /** - * Finding vulnerability. - * @member {google.cloud.securitycenter.v2.IVulnerability|null|undefined} vulnerability - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.vulnerability = null; - - /** - * Finding muteUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.muteUpdateTime = null; - - /** - * Finding externalSystems. - * @member {Object.} externalSystems - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.externalSystems = $util.emptyObject; - - /** - * Finding mitreAttack. - * @member {google.cloud.securitycenter.v2.IMitreAttack|null|undefined} mitreAttack - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.mitreAttack = null; - - /** - * Finding access. - * @member {google.cloud.securitycenter.v2.IAccess|null|undefined} access - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.access = null; - - /** - * Finding connections. - * @member {Array.} connections - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.connections = $util.emptyArray; - - /** - * Finding muteInitiator. - * @member {string} muteInitiator - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.muteInitiator = ""; - - /** - * Finding processes. - * @member {Array.} processes - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.processes = $util.emptyArray; - - /** - * Finding contacts. - * @member {Object.} contacts - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.contacts = $util.emptyObject; - - /** - * Finding compliances. - * @member {Array.} compliances - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.compliances = $util.emptyArray; - - /** - * Finding parentDisplayName. - * @member {string} parentDisplayName - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.parentDisplayName = ""; - - /** - * Finding description. - * @member {string} description - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.description = ""; - - /** - * Finding exfiltration. - * @member {google.cloud.securitycenter.v2.IExfiltration|null|undefined} exfiltration - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.exfiltration = null; - - /** - * Finding iamBindings. - * @member {Array.} iamBindings - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.iamBindings = $util.emptyArray; - - /** - * Finding nextSteps. - * @member {string} nextSteps - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.nextSteps = ""; - - /** - * Finding moduleName. - * @member {string} moduleName - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.moduleName = ""; - - /** - * Finding containers. - * @member {Array.} containers - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.containers = $util.emptyArray; - - /** - * Finding kubernetes. - * @member {google.cloud.securitycenter.v2.IKubernetes|null|undefined} kubernetes - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.kubernetes = null; - - /** - * Finding database. - * @member {google.cloud.securitycenter.v2.IDatabase|null|undefined} database - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.database = null; - - /** - * Finding attackExposure. - * @member {google.cloud.securitycenter.v2.IAttackExposure|null|undefined} attackExposure - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.attackExposure = null; - - /** - * Finding files. - * @member {Array.} files - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.files = $util.emptyArray; - - /** - * Finding cloudDlpInspection. - * @member {google.cloud.securitycenter.v2.ICloudDlpInspection|null|undefined} cloudDlpInspection - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.cloudDlpInspection = null; - - /** - * Finding cloudDlpDataProfile. - * @member {google.cloud.securitycenter.v2.ICloudDlpDataProfile|null|undefined} cloudDlpDataProfile - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.cloudDlpDataProfile = null; - - /** - * Finding kernelRootkit. - * @member {google.cloud.securitycenter.v2.IKernelRootkit|null|undefined} kernelRootkit - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.kernelRootkit = null; - - /** - * Finding orgPolicies. - * @member {Array.} orgPolicies - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.orgPolicies = $util.emptyArray; - - /** - * Finding job. - * @member {google.cloud.securitycenter.v2.IJob|null|undefined} job - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.job = null; - - /** - * Finding application. - * @member {google.cloud.securitycenter.v2.IApplication|null|undefined} application - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.application = null; - - /** - * Finding ipRules. - * @member {google.cloud.securitycenter.v2.IIpRules|null|undefined} ipRules - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.ipRules = null; - - /** - * Finding backupDisasterRecovery. - * @member {google.cloud.securitycenter.v2.IBackupDisasterRecovery|null|undefined} backupDisasterRecovery - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.backupDisasterRecovery = null; - - /** - * Finding securityPosture. - * @member {google.cloud.securitycenter.v2.ISecurityPosture|null|undefined} securityPosture - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.securityPosture = null; - - /** - * Finding logEntries. - * @member {Array.} logEntries - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.logEntries = $util.emptyArray; - - /** - * Finding loadBalancers. - * @member {Array.} loadBalancers - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.loadBalancers = $util.emptyArray; - - /** - * Finding cloudArmor. - * @member {google.cloud.securitycenter.v2.ICloudArmor|null|undefined} cloudArmor - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.cloudArmor = null; - - /** - * Finding notebook. - * @member {google.cloud.securitycenter.v2.INotebook|null|undefined} notebook - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.notebook = null; - - /** - * Finding toxicCombination. - * @member {google.cloud.securitycenter.v2.IToxicCombination|null|undefined} toxicCombination - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.toxicCombination = null; - - /** - * Finding groupMemberships. - * @member {Array.} groupMemberships - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.groupMemberships = $util.emptyArray; - - /** - * Finding disk. - * @member {google.cloud.securitycenter.v2.IDisk|null|undefined} disk - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.disk = null; - - /** - * Finding dataAccessEvents. - * @member {Array.} dataAccessEvents - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.dataAccessEvents = $util.emptyArray; - - /** - * Finding dataFlowEvents. - * @member {Array.} dataFlowEvents - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.dataFlowEvents = $util.emptyArray; - - /** - * Finding networks. - * @member {Array.} networks - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.networks = $util.emptyArray; - - /** - * Finding dataRetentionDeletionEvents. - * @member {Array.} dataRetentionDeletionEvents - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.dataRetentionDeletionEvents = $util.emptyArray; - - /** - * Finding affectedResources. - * @member {google.cloud.securitycenter.v2.IAffectedResources|null|undefined} affectedResources - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.affectedResources = null; - - /** - * Finding aiModel. - * @member {google.cloud.securitycenter.v2.IAiModel|null|undefined} aiModel - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.aiModel = null; - - /** - * Finding chokepoint. - * @member {google.cloud.securitycenter.v2.IChokepoint|null|undefined} chokepoint - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.chokepoint = null; - - /** - * Finding vertexAi. - * @member {google.cloud.securitycenter.v2.IVertexAi|null|undefined} vertexAi - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - */ - Finding.prototype.vertexAi = null; - - /** - * Creates a new Finding instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Finding - * @static - * @param {google.cloud.securitycenter.v2.IFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Finding} Finding instance - */ - Finding.create = function create(properties) { - return new Finding(properties); - }; - - /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Finding - * @static - * @param {google.cloud.securitycenter.v2.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.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.canonicalName); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); - if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceName); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.category); - if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) - writer.uint32(/* id 8, wireType 2 =*/66).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 9, wireType 2 =*/74).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.v2.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.severity); - 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 16, wireType 0 =*/128).int32(message.findingClass); - if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) - $root.google.cloud.securitycenter.v2.Indicator.encode(message.indicator, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) - $root.google.cloud.securitycenter.v2.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 19, wireType 2 =*/154).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 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.securitycenter.v2.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.v2.MitreAttack.encode(message.mitreAttack, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.access != null && Object.hasOwnProperty.call(message, "access")) - $root.google.cloud.securitycenter.v2.Access.encode(message.access, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.connections != null && message.connections.length) - for (var i = 0; i < message.connections.length; ++i) - $root.google.cloud.securitycenter.v2.Connection.encode(message.connections[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) - writer.uint32(/* id 24, wireType 2 =*/194).string(message.muteInitiator); - if (message.processes != null && message.processes.length) - for (var i = 0; i < message.processes.length; ++i) - $root.google.cloud.securitycenter.v2.Process.encode(message.processes[i], writer.uint32(/* id 25, wireType 2 =*/202).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 26, wireType 2 =*/210).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.securitycenter.v2.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.v2.Compliance.encode(message.compliances[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) - writer.uint32(/* id 29, wireType 2 =*/234).string(message.parentDisplayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 30, wireType 2 =*/242).string(message.description); - if (message.exfiltration != null && Object.hasOwnProperty.call(message, "exfiltration")) - $root.google.cloud.securitycenter.v2.Exfiltration.encode(message.exfiltration, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.iamBindings != null && message.iamBindings.length) - for (var i = 0; i < message.iamBindings.length; ++i) - $root.google.cloud.securitycenter.v2.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.nextSteps != null && Object.hasOwnProperty.call(message, "nextSteps")) - writer.uint32(/* id 33, wireType 2 =*/266).string(message.nextSteps); - if (message.moduleName != null && Object.hasOwnProperty.call(message, "moduleName")) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.moduleName); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.securitycenter.v2.Container.encode(message.containers[i], writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.kubernetes != null && Object.hasOwnProperty.call(message, "kubernetes")) - $root.google.cloud.securitycenter.v2.Kubernetes.encode(message.kubernetes, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - $root.google.cloud.securitycenter.v2.Database.encode(message.database, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.attackExposure != null && Object.hasOwnProperty.call(message, "attackExposure")) - $root.google.cloud.securitycenter.v2.AttackExposure.encode(message.attackExposure, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); - if (message.files != null && message.files.length) - for (var i = 0; i < message.files.length; ++i) - $root.google.cloud.securitycenter.v2.File.encode(message.files[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.cloudDlpInspection != null && Object.hasOwnProperty.call(message, "cloudDlpInspection")) - $root.google.cloud.securitycenter.v2.CloudDlpInspection.encode(message.cloudDlpInspection, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); - if (message.cloudDlpDataProfile != null && Object.hasOwnProperty.call(message, "cloudDlpDataProfile")) - $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.encode(message.cloudDlpDataProfile, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); - if (message.kernelRootkit != null && Object.hasOwnProperty.call(message, "kernelRootkit")) - $root.google.cloud.securitycenter.v2.KernelRootkit.encode(message.kernelRootkit, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.orgPolicies != null && message.orgPolicies.length) - for (var i = 0; i < message.orgPolicies.length; ++i) - $root.google.cloud.securitycenter.v2.OrgPolicy.encode(message.orgPolicies[i], writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.securitycenter.v2.Job.encode(message.job, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); - if (message.application != null && Object.hasOwnProperty.call(message, "application")) - $root.google.cloud.securitycenter.v2.Application.encode(message.application, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); - if (message.ipRules != null && Object.hasOwnProperty.call(message, "ipRules")) - $root.google.cloud.securitycenter.v2.IpRules.encode(message.ipRules, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); - if (message.backupDisasterRecovery != null && Object.hasOwnProperty.call(message, "backupDisasterRecovery")) - $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.encode(message.backupDisasterRecovery, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); - if (message.securityPosture != null && Object.hasOwnProperty.call(message, "securityPosture")) - $root.google.cloud.securitycenter.v2.SecurityPosture.encode(message.securityPosture, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); - if (message.logEntries != null && message.logEntries.length) - for (var i = 0; i < message.logEntries.length; ++i) - $root.google.cloud.securitycenter.v2.LogEntry.encode(message.logEntries[i], writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); - if (message.loadBalancers != null && message.loadBalancers.length) - for (var i = 0; i < message.loadBalancers.length; ++i) - $root.google.cloud.securitycenter.v2.LoadBalancer.encode(message.loadBalancers[i], writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.cloudArmor != null && Object.hasOwnProperty.call(message, "cloudArmor")) - $root.google.cloud.securitycenter.v2.CloudArmor.encode(message.cloudArmor, writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); - if (message.muteInfo != null && Object.hasOwnProperty.call(message, "muteInfo")) - $root.google.cloud.securitycenter.v2.Finding.MuteInfo.encode(message.muteInfo, writer.uint32(/* id 53, wireType 2 =*/426).fork()).ldelim(); - if (message.notebook != null && Object.hasOwnProperty.call(message, "notebook")) - $root.google.cloud.securitycenter.v2.Notebook.encode(message.notebook, writer.uint32(/* id 55, wireType 2 =*/442).fork()).ldelim(); - if (message.toxicCombination != null && Object.hasOwnProperty.call(message, "toxicCombination")) - $root.google.cloud.securitycenter.v2.ToxicCombination.encode(message.toxicCombination, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); - if (message.groupMemberships != null && message.groupMemberships.length) - for (var i = 0; i < message.groupMemberships.length; ++i) - $root.google.cloud.securitycenter.v2.GroupMembership.encode(message.groupMemberships[i], writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); - if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) - $root.google.cloud.securitycenter.v2.Disk.encode(message.disk, writer.uint32(/* id 58, wireType 2 =*/466).fork()).ldelim(); - if (message.dataAccessEvents != null && message.dataAccessEvents.length) - for (var i = 0; i < message.dataAccessEvents.length; ++i) - $root.google.cloud.securitycenter.v2.DataAccessEvent.encode(message.dataAccessEvents[i], writer.uint32(/* id 61, wireType 2 =*/490).fork()).ldelim(); - if (message.dataFlowEvents != null && message.dataFlowEvents.length) - for (var i = 0; i < message.dataFlowEvents.length; ++i) - $root.google.cloud.securitycenter.v2.DataFlowEvent.encode(message.dataFlowEvents[i], writer.uint32(/* id 62, wireType 2 =*/498).fork()).ldelim(); - if (message.networks != null && message.networks.length) - for (var i = 0; i < message.networks.length; ++i) - $root.google.cloud.securitycenter.v2.Network.encode(message.networks[i], writer.uint32(/* id 63, wireType 2 =*/506).fork()).ldelim(); - if (message.dataRetentionDeletionEvents != null && message.dataRetentionDeletionEvents.length) - for (var i = 0; i < message.dataRetentionDeletionEvents.length; ++i) - $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.encode(message.dataRetentionDeletionEvents[i], writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); - if (message.affectedResources != null && Object.hasOwnProperty.call(message, "affectedResources")) - $root.google.cloud.securitycenter.v2.AffectedResources.encode(message.affectedResources, writer.uint32(/* id 65, wireType 2 =*/522).fork()).ldelim(); - if (message.aiModel != null && Object.hasOwnProperty.call(message, "aiModel")) - $root.google.cloud.securitycenter.v2.AiModel.encode(message.aiModel, writer.uint32(/* id 66, wireType 2 =*/530).fork()).ldelim(); - if (message.chokepoint != null && Object.hasOwnProperty.call(message, "chokepoint")) - $root.google.cloud.securitycenter.v2.Chokepoint.encode(message.chokepoint, writer.uint32(/* id 69, wireType 2 =*/554).fork()).ldelim(); - if (message.vertexAi != null && Object.hasOwnProperty.call(message, "vertexAi")) - $root.google.cloud.securitycenter.v2.VertexAi.encode(message.vertexAi, writer.uint32(/* id 72, wireType 2 =*/578).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Finding - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Finding(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.canonicalName = reader.string(); - break; - } - case 3: { - message.parent = reader.string(); - break; - } - case 4: { - message.resourceName = reader.string(); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.category = reader.string(); - break; - } - case 8: { - message.externalUri = reader.string(); - break; - } - case 9: { - 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 10: { - message.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.decode(reader, reader.uint32()); - break; - } - case 11: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.severity = reader.int32(); - break; - } - case 15: { - message.mute = reader.int32(); - break; - } - case 53: { - message.muteInfo = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.decode(reader, reader.uint32()); - break; - } - case 16: { - message.findingClass = reader.int32(); - break; - } - case 17: { - message.indicator = $root.google.cloud.securitycenter.v2.Indicator.decode(reader, reader.uint32()); - break; - } - case 18: { - message.vulnerability = $root.google.cloud.securitycenter.v2.Vulnerability.decode(reader, reader.uint32()); - break; - } - case 19: { - message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 20: { - 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.v2.ExternalSystem.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.externalSystems[key] = value; - break; - } - case 21: { - message.mitreAttack = $root.google.cloud.securitycenter.v2.MitreAttack.decode(reader, reader.uint32()); - break; - } - case 22: { - message.access = $root.google.cloud.securitycenter.v2.Access.decode(reader, reader.uint32()); - break; - } - case 23: { - if (!(message.connections && message.connections.length)) - message.connections = []; - message.connections.push($root.google.cloud.securitycenter.v2.Connection.decode(reader, reader.uint32())); - break; - } - case 24: { - message.muteInitiator = reader.string(); - break; - } - case 25: { - if (!(message.processes && message.processes.length)) - message.processes = []; - message.processes.push($root.google.cloud.securitycenter.v2.Process.decode(reader, reader.uint32())); - break; - } - case 26: { - 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.v2.ContactDetails.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.contacts[key] = value; - break; - } - case 27: { - if (!(message.compliances && message.compliances.length)) - message.compliances = []; - message.compliances.push($root.google.cloud.securitycenter.v2.Compliance.decode(reader, reader.uint32())); - break; - } - case 29: { - message.parentDisplayName = reader.string(); - break; - } - case 30: { - message.description = reader.string(); - break; - } - case 31: { - message.exfiltration = $root.google.cloud.securitycenter.v2.Exfiltration.decode(reader, reader.uint32()); - break; - } - case 32: { - if (!(message.iamBindings && message.iamBindings.length)) - message.iamBindings = []; - message.iamBindings.push($root.google.cloud.securitycenter.v2.IamBinding.decode(reader, reader.uint32())); - break; - } - case 33: { - message.nextSteps = reader.string(); - break; - } - case 34: { - message.moduleName = reader.string(); - break; - } - case 35: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.securitycenter.v2.Container.decode(reader, reader.uint32())); - break; - } - case 36: { - message.kubernetes = $root.google.cloud.securitycenter.v2.Kubernetes.decode(reader, reader.uint32()); - break; - } - case 37: { - message.database = $root.google.cloud.securitycenter.v2.Database.decode(reader, reader.uint32()); - break; - } - case 38: { - message.attackExposure = $root.google.cloud.securitycenter.v2.AttackExposure.decode(reader, reader.uint32()); - break; - } - case 39: { - if (!(message.files && message.files.length)) - message.files = []; - message.files.push($root.google.cloud.securitycenter.v2.File.decode(reader, reader.uint32())); - break; - } - case 40: { - message.cloudDlpInspection = $root.google.cloud.securitycenter.v2.CloudDlpInspection.decode(reader, reader.uint32()); - break; - } - case 41: { - message.cloudDlpDataProfile = $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.decode(reader, reader.uint32()); - break; - } - case 42: { - message.kernelRootkit = $root.google.cloud.securitycenter.v2.KernelRootkit.decode(reader, reader.uint32()); - break; - } - case 43: { - if (!(message.orgPolicies && message.orgPolicies.length)) - message.orgPolicies = []; - message.orgPolicies.push($root.google.cloud.securitycenter.v2.OrgPolicy.decode(reader, reader.uint32())); - break; - } - case 44: { - message.job = $root.google.cloud.securitycenter.v2.Job.decode(reader, reader.uint32()); - break; - } - case 45: { - message.application = $root.google.cloud.securitycenter.v2.Application.decode(reader, reader.uint32()); - break; - } - case 46: { - message.ipRules = $root.google.cloud.securitycenter.v2.IpRules.decode(reader, reader.uint32()); - break; - } - case 47: { - message.backupDisasterRecovery = $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.decode(reader, reader.uint32()); - break; - } - case 48: { - message.securityPosture = $root.google.cloud.securitycenter.v2.SecurityPosture.decode(reader, reader.uint32()); - break; - } - case 49: { - if (!(message.logEntries && message.logEntries.length)) - message.logEntries = []; - message.logEntries.push($root.google.cloud.securitycenter.v2.LogEntry.decode(reader, reader.uint32())); - break; - } - case 50: { - if (!(message.loadBalancers && message.loadBalancers.length)) - message.loadBalancers = []; - message.loadBalancers.push($root.google.cloud.securitycenter.v2.LoadBalancer.decode(reader, reader.uint32())); - break; - } - case 51: { - message.cloudArmor = $root.google.cloud.securitycenter.v2.CloudArmor.decode(reader, reader.uint32()); - break; - } - case 55: { - message.notebook = $root.google.cloud.securitycenter.v2.Notebook.decode(reader, reader.uint32()); - break; - } - case 56: { - message.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.decode(reader, reader.uint32()); - break; - } - case 57: { - if (!(message.groupMemberships && message.groupMemberships.length)) - message.groupMemberships = []; - message.groupMemberships.push($root.google.cloud.securitycenter.v2.GroupMembership.decode(reader, reader.uint32())); - break; - } - case 58: { - message.disk = $root.google.cloud.securitycenter.v2.Disk.decode(reader, reader.uint32()); - break; - } - case 61: { - if (!(message.dataAccessEvents && message.dataAccessEvents.length)) - message.dataAccessEvents = []; - message.dataAccessEvents.push($root.google.cloud.securitycenter.v2.DataAccessEvent.decode(reader, reader.uint32())); - break; - } - case 62: { - if (!(message.dataFlowEvents && message.dataFlowEvents.length)) - message.dataFlowEvents = []; - message.dataFlowEvents.push($root.google.cloud.securitycenter.v2.DataFlowEvent.decode(reader, reader.uint32())); - break; - } - case 63: { - if (!(message.networks && message.networks.length)) - message.networks = []; - message.networks.push($root.google.cloud.securitycenter.v2.Network.decode(reader, reader.uint32())); - break; - } - case 64: { - if (!(message.dataRetentionDeletionEvents && message.dataRetentionDeletionEvents.length)) - message.dataRetentionDeletionEvents = []; - message.dataRetentionDeletionEvents.push($root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.decode(reader, reader.uint32())); - break; - } - case 65: { - message.affectedResources = $root.google.cloud.securitycenter.v2.AffectedResources.decode(reader, reader.uint32()); - break; - } - case 66: { - message.aiModel = $root.google.cloud.securitycenter.v2.AiModel.decode(reader, reader.uint32()); - break; - } - case 69: { - message.chokepoint = $root.google.cloud.securitycenter.v2.Chokepoint.decode(reader, reader.uint32()); - break; - } - case 72: { - message.vertexAi = $root.google.cloud.securitycenter.v2.VertexAi.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.v2.Finding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.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.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.v2.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.mute != null && message.hasOwnProperty("mute")) - switch (message.mute) { - default: - return "mute: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.muteInfo != null && message.hasOwnProperty("muteInfo")) { - var error = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.verify(message.muteInfo); - if (error) - return "muteInfo." + error; - } - 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: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.indicator != null && message.hasOwnProperty("indicator")) { - var error = $root.google.cloud.securitycenter.v2.Indicator.verify(message.indicator); - if (error) - return "indicator." + error; - } - if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) { - var error = $root.google.cloud.securitycenter.v2.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.v2.ExternalSystem.verify(message.externalSystems[key[i]]); - if (error) - return "externalSystems." + error; - } - } - if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) { - var error = $root.google.cloud.securitycenter.v2.MitreAttack.verify(message.mitreAttack); - if (error) - return "mitreAttack." + error; - } - if (message.access != null && message.hasOwnProperty("access")) { - var error = $root.google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.Compliance.verify(message.compliances[i]); - if (error) - 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"; - if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) { - var error = $root.google.cloud.securitycenter.v2.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.v2.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.moduleName != null && message.hasOwnProperty("moduleName")) - if (!$util.isString(message.moduleName)) - return "moduleName: 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.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) { - var error = $root.google.cloud.securitycenter.v2.Kubernetes.verify(message.kubernetes); - if (error) - return "kubernetes." + error; - } - if (message.database != null && message.hasOwnProperty("database")) { - var error = $root.google.cloud.securitycenter.v2.Database.verify(message.database); - if (error) - return "database." + error; - } - if (message.attackExposure != null && message.hasOwnProperty("attackExposure")) { - var error = $root.google.cloud.securitycenter.v2.AttackExposure.verify(message.attackExposure); - if (error) - return "attackExposure." + 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.v2.File.verify(message.files[i]); - if (error) - return "files." + error; - } - } - if (message.cloudDlpInspection != null && message.hasOwnProperty("cloudDlpInspection")) { - var error = $root.google.cloud.securitycenter.v2.CloudDlpInspection.verify(message.cloudDlpInspection); - if (error) - return "cloudDlpInspection." + error; - } - if (message.cloudDlpDataProfile != null && message.hasOwnProperty("cloudDlpDataProfile")) { - var error = $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.verify(message.cloudDlpDataProfile); - if (error) - return "cloudDlpDataProfile." + error; - } - if (message.kernelRootkit != null && message.hasOwnProperty("kernelRootkit")) { - var error = $root.google.cloud.securitycenter.v2.KernelRootkit.verify(message.kernelRootkit); - if (error) - return "kernelRootkit." + error; - } - if (message.orgPolicies != null && message.hasOwnProperty("orgPolicies")) { - if (!Array.isArray(message.orgPolicies)) - return "orgPolicies: array expected"; - for (var i = 0; i < message.orgPolicies.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.OrgPolicy.verify(message.orgPolicies[i]); - if (error) - return "orgPolicies." + error; - } - } - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.securitycenter.v2.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.application != null && message.hasOwnProperty("application")) { - var error = $root.google.cloud.securitycenter.v2.Application.verify(message.application); - if (error) - return "application." + error; - } - if (message.ipRules != null && message.hasOwnProperty("ipRules")) { - var error = $root.google.cloud.securitycenter.v2.IpRules.verify(message.ipRules); - if (error) - return "ipRules." + error; - } - if (message.backupDisasterRecovery != null && message.hasOwnProperty("backupDisasterRecovery")) { - var error = $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.verify(message.backupDisasterRecovery); - if (error) - return "backupDisasterRecovery." + error; - } - if (message.securityPosture != null && message.hasOwnProperty("securityPosture")) { - var error = $root.google.cloud.securitycenter.v2.SecurityPosture.verify(message.securityPosture); - if (error) - return "securityPosture." + error; - } - if (message.logEntries != null && message.hasOwnProperty("logEntries")) { - if (!Array.isArray(message.logEntries)) - return "logEntries: array expected"; - for (var i = 0; i < message.logEntries.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.LogEntry.verify(message.logEntries[i]); - if (error) - return "logEntries." + error; - } - } - if (message.loadBalancers != null && message.hasOwnProperty("loadBalancers")) { - if (!Array.isArray(message.loadBalancers)) - return "loadBalancers: array expected"; - for (var i = 0; i < message.loadBalancers.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.LoadBalancer.verify(message.loadBalancers[i]); - if (error) - return "loadBalancers." + error; - } - } - if (message.cloudArmor != null && message.hasOwnProperty("cloudArmor")) { - var error = $root.google.cloud.securitycenter.v2.CloudArmor.verify(message.cloudArmor); - if (error) - return "cloudArmor." + error; - } - if (message.notebook != null && message.hasOwnProperty("notebook")) { - var error = $root.google.cloud.securitycenter.v2.Notebook.verify(message.notebook); - if (error) - return "notebook." + error; - } - if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) { - var error = $root.google.cloud.securitycenter.v2.ToxicCombination.verify(message.toxicCombination); - if (error) - return "toxicCombination." + error; - } - if (message.groupMemberships != null && message.hasOwnProperty("groupMemberships")) { - if (!Array.isArray(message.groupMemberships)) - return "groupMemberships: array expected"; - for (var i = 0; i < message.groupMemberships.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.GroupMembership.verify(message.groupMemberships[i]); - if (error) - return "groupMemberships." + error; - } - } - if (message.disk != null && message.hasOwnProperty("disk")) { - var error = $root.google.cloud.securitycenter.v2.Disk.verify(message.disk); - if (error) - return "disk." + error; - } - if (message.dataAccessEvents != null && message.hasOwnProperty("dataAccessEvents")) { - if (!Array.isArray(message.dataAccessEvents)) - return "dataAccessEvents: array expected"; - for (var i = 0; i < message.dataAccessEvents.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.DataAccessEvent.verify(message.dataAccessEvents[i]); - if (error) - return "dataAccessEvents." + error; - } - } - if (message.dataFlowEvents != null && message.hasOwnProperty("dataFlowEvents")) { - if (!Array.isArray(message.dataFlowEvents)) - return "dataFlowEvents: array expected"; - for (var i = 0; i < message.dataFlowEvents.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.DataFlowEvent.verify(message.dataFlowEvents[i]); - if (error) - return "dataFlowEvents." + error; - } - } - if (message.networks != null && message.hasOwnProperty("networks")) { - if (!Array.isArray(message.networks)) - return "networks: array expected"; - for (var i = 0; i < message.networks.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.Network.verify(message.networks[i]); - if (error) - return "networks." + error; - } - } - if (message.dataRetentionDeletionEvents != null && message.hasOwnProperty("dataRetentionDeletionEvents")) { - if (!Array.isArray(message.dataRetentionDeletionEvents)) - return "dataRetentionDeletionEvents: array expected"; - for (var i = 0; i < message.dataRetentionDeletionEvents.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.verify(message.dataRetentionDeletionEvents[i]); - if (error) - return "dataRetentionDeletionEvents." + error; - } - } - if (message.affectedResources != null && message.hasOwnProperty("affectedResources")) { - var error = $root.google.cloud.securitycenter.v2.AffectedResources.verify(message.affectedResources); - if (error) - return "affectedResources." + error; - } - if (message.aiModel != null && message.hasOwnProperty("aiModel")) { - var error = $root.google.cloud.securitycenter.v2.AiModel.verify(message.aiModel); - if (error) - return "aiModel." + error; - } - if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) { - var error = $root.google.cloud.securitycenter.v2.Chokepoint.verify(message.chokepoint); - if (error) - return "chokepoint." + error; - } - if (message.vertexAi != null && message.hasOwnProperty("vertexAi")) { - var error = $root.google.cloud.securitycenter.v2.VertexAi.verify(message.vertexAi); - if (error) - return "vertexAi." + 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.v2.Finding - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Finding} Finding - */ - Finding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Finding) - return object; - var message = new $root.google.cloud.securitycenter.v2.Finding(); - if (object.name != null) - message.name = String(object.name); - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); - if (object.parent != null) - message.parent = String(object.parent); - 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; - 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.v2.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.v2.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.v2.Finding.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.fromObject(object.securityMarks); - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.createTime: object expected"); - 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; - 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; - } - switch (object.mute) { - default: - if (typeof object.mute === "number") { - message.mute = object.mute; - break; - } - break; - 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 3: - message.mute = 3; - break; - } - if (object.muteInfo != null) { - if (typeof object.muteInfo !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.muteInfo: object expected"); - message.muteInfo = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.fromObject(object.muteInfo); - } - switch (object.findingClass) { - default: - if (typeof object.findingClass === "number") { - message.findingClass = object.findingClass; - break; - } - break; - 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; - case "POSTURE_VIOLATION": - case 6: - message.findingClass = 6; - break; - case "TOXIC_COMBINATION": - case 7: - message.findingClass = 7; - break; - case "SENSITIVE_DATA_RISK": - case 8: - message.findingClass = 8; - break; - case "CHOKEPOINT": - case 9: - message.findingClass = 9; - break; - } - if (object.indicator != null) { - if (typeof object.indicator !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.indicator: object expected"); - message.indicator = $root.google.cloud.securitycenter.v2.Indicator.fromObject(object.indicator); - } - if (object.vulnerability != null) { - if (typeof object.vulnerability !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.vulnerability: object expected"); - message.vulnerability = $root.google.cloud.securitycenter.v2.Vulnerability.fromObject(object.vulnerability); - } - if (object.muteUpdateTime != null) { - if (typeof object.muteUpdateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.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.v2.Finding.externalSystems: object expected"); - message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v2.ExternalSystem.fromObject(object.externalSystems[keys[i]]); - } - } - if (object.mitreAttack != null) { - if (typeof object.mitreAttack !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.mitreAttack: object expected"); - message.mitreAttack = $root.google.cloud.securitycenter.v2.MitreAttack.fromObject(object.mitreAttack); - } - if (object.access != null) { - if (typeof object.access !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.access: object expected"); - message.access = $root.google.cloud.securitycenter.v2.Access.fromObject(object.access); - } - if (object.connections) { - if (!Array.isArray(object.connections)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.connections: object expected"); - message.connections[i] = $root.google.cloud.securitycenter.v2.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.v2.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.v2.Finding.processes: object expected"); - message.processes[i] = $root.google.cloud.securitycenter.v2.Process.fromObject(object.processes[i]); - } - } - if (object.contacts) { - if (typeof object.contacts !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.contacts: object expected"); - message.contacts[keys[i]] = $root.google.cloud.securitycenter.v2.ContactDetails.fromObject(object.contacts[keys[i]]); - } - } - if (object.compliances) { - if (!Array.isArray(object.compliances)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.compliances: object expected"); - message.compliances[i] = $root.google.cloud.securitycenter.v2.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) { - if (typeof object.exfiltration !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.exfiltration: object expected"); - message.exfiltration = $root.google.cloud.securitycenter.v2.Exfiltration.fromObject(object.exfiltration); - } - if (object.iamBindings) { - if (!Array.isArray(object.iamBindings)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.iamBindings: object expected"); - message.iamBindings[i] = $root.google.cloud.securitycenter.v2.IamBinding.fromObject(object.iamBindings[i]); - } - } - if (object.nextSteps != null) - message.nextSteps = String(object.nextSteps); - if (object.moduleName != null) - message.moduleName = String(object.moduleName); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.containers: object expected"); - message.containers[i] = $root.google.cloud.securitycenter.v2.Container.fromObject(object.containers[i]); - } - } - if (object.kubernetes != null) { - if (typeof object.kubernetes !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.kubernetes: object expected"); - message.kubernetes = $root.google.cloud.securitycenter.v2.Kubernetes.fromObject(object.kubernetes); - } - if (object.database != null) { - if (typeof object.database !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.database: object expected"); - message.database = $root.google.cloud.securitycenter.v2.Database.fromObject(object.database); - } - if (object.attackExposure != null) { - if (typeof object.attackExposure !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.attackExposure: object expected"); - message.attackExposure = $root.google.cloud.securitycenter.v2.AttackExposure.fromObject(object.attackExposure); - } - if (object.files) { - if (!Array.isArray(object.files)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Finding.files: object expected"); - message.files[i] = $root.google.cloud.securitycenter.v2.File.fromObject(object.files[i]); - } - } - if (object.cloudDlpInspection != null) { - if (typeof object.cloudDlpInspection !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.cloudDlpInspection: object expected"); - message.cloudDlpInspection = $root.google.cloud.securitycenter.v2.CloudDlpInspection.fromObject(object.cloudDlpInspection); - } - if (object.cloudDlpDataProfile != null) { - if (typeof object.cloudDlpDataProfile !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.cloudDlpDataProfile: object expected"); - message.cloudDlpDataProfile = $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.fromObject(object.cloudDlpDataProfile); - } - if (object.kernelRootkit != null) { - if (typeof object.kernelRootkit !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.kernelRootkit: object expected"); - message.kernelRootkit = $root.google.cloud.securitycenter.v2.KernelRootkit.fromObject(object.kernelRootkit); - } - if (object.orgPolicies) { - if (!Array.isArray(object.orgPolicies)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.orgPolicies: array expected"); - message.orgPolicies = []; - for (var i = 0; i < object.orgPolicies.length; ++i) { - if (typeof object.orgPolicies[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.orgPolicies: object expected"); - message.orgPolicies[i] = $root.google.cloud.securitycenter.v2.OrgPolicy.fromObject(object.orgPolicies[i]); - } - } - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.job: object expected"); - message.job = $root.google.cloud.securitycenter.v2.Job.fromObject(object.job); - } - if (object.application != null) { - if (typeof object.application !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.application: object expected"); - message.application = $root.google.cloud.securitycenter.v2.Application.fromObject(object.application); - } - if (object.ipRules != null) { - if (typeof object.ipRules !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.ipRules: object expected"); - message.ipRules = $root.google.cloud.securitycenter.v2.IpRules.fromObject(object.ipRules); - } - if (object.backupDisasterRecovery != null) { - if (typeof object.backupDisasterRecovery !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.backupDisasterRecovery: object expected"); - message.backupDisasterRecovery = $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.fromObject(object.backupDisasterRecovery); - } - if (object.securityPosture != null) { - if (typeof object.securityPosture !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.securityPosture: object expected"); - message.securityPosture = $root.google.cloud.securitycenter.v2.SecurityPosture.fromObject(object.securityPosture); - } - if (object.logEntries) { - if (!Array.isArray(object.logEntries)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.logEntries: array expected"); - message.logEntries = []; - for (var i = 0; i < object.logEntries.length; ++i) { - if (typeof object.logEntries[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.logEntries: object expected"); - message.logEntries[i] = $root.google.cloud.securitycenter.v2.LogEntry.fromObject(object.logEntries[i]); - } - } - if (object.loadBalancers) { - if (!Array.isArray(object.loadBalancers)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.loadBalancers: array expected"); - message.loadBalancers = []; - for (var i = 0; i < object.loadBalancers.length; ++i) { - if (typeof object.loadBalancers[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.loadBalancers: object expected"); - message.loadBalancers[i] = $root.google.cloud.securitycenter.v2.LoadBalancer.fromObject(object.loadBalancers[i]); - } - } - if (object.cloudArmor != null) { - if (typeof object.cloudArmor !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.cloudArmor: object expected"); - message.cloudArmor = $root.google.cloud.securitycenter.v2.CloudArmor.fromObject(object.cloudArmor); - } - if (object.notebook != null) { - if (typeof object.notebook !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.notebook: object expected"); - message.notebook = $root.google.cloud.securitycenter.v2.Notebook.fromObject(object.notebook); - } - if (object.toxicCombination != null) { - if (typeof object.toxicCombination !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.toxicCombination: object expected"); - message.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.fromObject(object.toxicCombination); - } - if (object.groupMemberships) { - if (!Array.isArray(object.groupMemberships)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.groupMemberships: array expected"); - message.groupMemberships = []; - for (var i = 0; i < object.groupMemberships.length; ++i) { - if (typeof object.groupMemberships[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.groupMemberships: object expected"); - message.groupMemberships[i] = $root.google.cloud.securitycenter.v2.GroupMembership.fromObject(object.groupMemberships[i]); - } - } - if (object.disk != null) { - if (typeof object.disk !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.disk: object expected"); - message.disk = $root.google.cloud.securitycenter.v2.Disk.fromObject(object.disk); - } - if (object.dataAccessEvents) { - if (!Array.isArray(object.dataAccessEvents)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.dataAccessEvents: array expected"); - message.dataAccessEvents = []; - for (var i = 0; i < object.dataAccessEvents.length; ++i) { - if (typeof object.dataAccessEvents[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.dataAccessEvents: object expected"); - message.dataAccessEvents[i] = $root.google.cloud.securitycenter.v2.DataAccessEvent.fromObject(object.dataAccessEvents[i]); - } - } - if (object.dataFlowEvents) { - if (!Array.isArray(object.dataFlowEvents)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.dataFlowEvents: array expected"); - message.dataFlowEvents = []; - for (var i = 0; i < object.dataFlowEvents.length; ++i) { - if (typeof object.dataFlowEvents[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.dataFlowEvents: object expected"); - message.dataFlowEvents[i] = $root.google.cloud.securitycenter.v2.DataFlowEvent.fromObject(object.dataFlowEvents[i]); - } - } - if (object.networks) { - if (!Array.isArray(object.networks)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.networks: array expected"); - message.networks = []; - for (var i = 0; i < object.networks.length; ++i) { - if (typeof object.networks[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.networks: object expected"); - message.networks[i] = $root.google.cloud.securitycenter.v2.Network.fromObject(object.networks[i]); - } - } - if (object.dataRetentionDeletionEvents) { - if (!Array.isArray(object.dataRetentionDeletionEvents)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.dataRetentionDeletionEvents: array expected"); - message.dataRetentionDeletionEvents = []; - for (var i = 0; i < object.dataRetentionDeletionEvents.length; ++i) { - if (typeof object.dataRetentionDeletionEvents[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.dataRetentionDeletionEvents: object expected"); - message.dataRetentionDeletionEvents[i] = $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.fromObject(object.dataRetentionDeletionEvents[i]); - } - } - if (object.affectedResources != null) { - if (typeof object.affectedResources !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.affectedResources: object expected"); - message.affectedResources = $root.google.cloud.securitycenter.v2.AffectedResources.fromObject(object.affectedResources); - } - if (object.aiModel != null) { - if (typeof object.aiModel !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.aiModel: object expected"); - message.aiModel = $root.google.cloud.securitycenter.v2.AiModel.fromObject(object.aiModel); - } - if (object.chokepoint != null) { - if (typeof object.chokepoint !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.chokepoint: object expected"); - message.chokepoint = $root.google.cloud.securitycenter.v2.Chokepoint.fromObject(object.chokepoint); - } - if (object.vertexAi != null) { - if (typeof object.vertexAi !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.vertexAi: object expected"); - message.vertexAi = $root.google.cloud.securitycenter.v2.VertexAi.fromObject(object.vertexAi); - } - return message; - }; - - /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Finding - * @static - * @param {google.cloud.securitycenter.v2.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.connections = []; - object.processes = []; - object.compliances = []; - object.iamBindings = []; - object.containers = []; - object.files = []; - object.orgPolicies = []; - object.logEntries = []; - object.loadBalancers = []; - object.groupMemberships = []; - object.dataAccessEvents = []; - object.dataFlowEvents = []; - object.networks = []; - object.dataRetentionDeletionEvents = []; - } - if (options.objects || options.defaults) { - object.sourceProperties = {}; - object.externalSystems = {}; - object.contacts = {}; - } - if (options.defaults) { - object.name = ""; - object.canonicalName = ""; - 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.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.parentDisplayName = ""; - object.description = ""; - object.exfiltration = null; - object.nextSteps = ""; - object.moduleName = ""; - object.kubernetes = null; - object.database = null; - object.attackExposure = null; - object.cloudDlpInspection = null; - object.cloudDlpDataProfile = null; - object.kernelRootkit = null; - object.job = null; - object.application = null; - object.ipRules = null; - object.backupDisasterRecovery = null; - object.securityPosture = null; - object.cloudArmor = null; - object.muteInfo = null; - object.notebook = null; - object.toxicCombination = null; - object.disk = null; - object.affectedResources = null; - object.aiModel = null; - object.chokepoint = null; - object.vertexAi = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; - 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.v2.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.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.v2.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.v2.Finding.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.securitycenter.v2.Finding.Severity[message.severity] : message.severity; - if (message.mute != null && message.hasOwnProperty("mute")) - object.mute = options.enums === String ? $root.google.cloud.securitycenter.v2.Finding.Mute[message.mute] === undefined ? message.mute : $root.google.cloud.securitycenter.v2.Finding.Mute[message.mute] : message.mute; - if (message.findingClass != null && message.hasOwnProperty("findingClass")) - object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v2.Finding.FindingClass[message.findingClass] === undefined ? message.findingClass : $root.google.cloud.securitycenter.v2.Finding.FindingClass[message.findingClass] : message.findingClass; - if (message.indicator != null && message.hasOwnProperty("indicator")) - object.indicator = $root.google.cloud.securitycenter.v2.Indicator.toObject(message.indicator, options); - if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) - object.vulnerability = $root.google.cloud.securitycenter.v2.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.v2.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); - } - if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) - object.mitreAttack = $root.google.cloud.securitycenter.v2.MitreAttack.toObject(message.mitreAttack, options); - if (message.access != null && message.hasOwnProperty("access")) - object.access = $root.google.cloud.securitycenter.v2.Access.toObject(message.access, 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.v2.Connection.toObject(message.connections[j], 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.v2.Process.toObject(message.processes[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.v2.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.v2.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")) - object.exfiltration = $root.google.cloud.securitycenter.v2.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.v2.IamBinding.toObject(message.iamBindings[j], options); - } - if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) - object.nextSteps = message.nextSteps; - if (message.moduleName != null && message.hasOwnProperty("moduleName")) - object.moduleName = message.moduleName; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.securitycenter.v2.Container.toObject(message.containers[j], options); - } - if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) - object.kubernetes = $root.google.cloud.securitycenter.v2.Kubernetes.toObject(message.kubernetes, options); - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.cloud.securitycenter.v2.Database.toObject(message.database, options); - if (message.attackExposure != null && message.hasOwnProperty("attackExposure")) - object.attackExposure = $root.google.cloud.securitycenter.v2.AttackExposure.toObject(message.attackExposure, 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.v2.File.toObject(message.files[j], options); - } - if (message.cloudDlpInspection != null && message.hasOwnProperty("cloudDlpInspection")) - object.cloudDlpInspection = $root.google.cloud.securitycenter.v2.CloudDlpInspection.toObject(message.cloudDlpInspection, options); - if (message.cloudDlpDataProfile != null && message.hasOwnProperty("cloudDlpDataProfile")) - object.cloudDlpDataProfile = $root.google.cloud.securitycenter.v2.CloudDlpDataProfile.toObject(message.cloudDlpDataProfile, options); - if (message.kernelRootkit != null && message.hasOwnProperty("kernelRootkit")) - object.kernelRootkit = $root.google.cloud.securitycenter.v2.KernelRootkit.toObject(message.kernelRootkit, options); - if (message.orgPolicies && message.orgPolicies.length) { - object.orgPolicies = []; - for (var j = 0; j < message.orgPolicies.length; ++j) - object.orgPolicies[j] = $root.google.cloud.securitycenter.v2.OrgPolicy.toObject(message.orgPolicies[j], options); - } - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.securitycenter.v2.Job.toObject(message.job, options); - if (message.application != null && message.hasOwnProperty("application")) - object.application = $root.google.cloud.securitycenter.v2.Application.toObject(message.application, options); - if (message.ipRules != null && message.hasOwnProperty("ipRules")) - object.ipRules = $root.google.cloud.securitycenter.v2.IpRules.toObject(message.ipRules, options); - if (message.backupDisasterRecovery != null && message.hasOwnProperty("backupDisasterRecovery")) - object.backupDisasterRecovery = $root.google.cloud.securitycenter.v2.BackupDisasterRecovery.toObject(message.backupDisasterRecovery, options); - if (message.securityPosture != null && message.hasOwnProperty("securityPosture")) - object.securityPosture = $root.google.cloud.securitycenter.v2.SecurityPosture.toObject(message.securityPosture, options); - if (message.logEntries && message.logEntries.length) { - object.logEntries = []; - for (var j = 0; j < message.logEntries.length; ++j) - object.logEntries[j] = $root.google.cloud.securitycenter.v2.LogEntry.toObject(message.logEntries[j], options); - } - if (message.loadBalancers && message.loadBalancers.length) { - object.loadBalancers = []; - for (var j = 0; j < message.loadBalancers.length; ++j) - object.loadBalancers[j] = $root.google.cloud.securitycenter.v2.LoadBalancer.toObject(message.loadBalancers[j], options); - } - if (message.cloudArmor != null && message.hasOwnProperty("cloudArmor")) - object.cloudArmor = $root.google.cloud.securitycenter.v2.CloudArmor.toObject(message.cloudArmor, options); - if (message.muteInfo != null && message.hasOwnProperty("muteInfo")) - object.muteInfo = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.toObject(message.muteInfo, options); - if (message.notebook != null && message.hasOwnProperty("notebook")) - object.notebook = $root.google.cloud.securitycenter.v2.Notebook.toObject(message.notebook, options); - if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) - object.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.toObject(message.toxicCombination, options); - if (message.groupMemberships && message.groupMemberships.length) { - object.groupMemberships = []; - for (var j = 0; j < message.groupMemberships.length; ++j) - object.groupMemberships[j] = $root.google.cloud.securitycenter.v2.GroupMembership.toObject(message.groupMemberships[j], options); - } - if (message.disk != null && message.hasOwnProperty("disk")) - object.disk = $root.google.cloud.securitycenter.v2.Disk.toObject(message.disk, options); - if (message.dataAccessEvents && message.dataAccessEvents.length) { - object.dataAccessEvents = []; - for (var j = 0; j < message.dataAccessEvents.length; ++j) - object.dataAccessEvents[j] = $root.google.cloud.securitycenter.v2.DataAccessEvent.toObject(message.dataAccessEvents[j], options); - } - if (message.dataFlowEvents && message.dataFlowEvents.length) { - object.dataFlowEvents = []; - for (var j = 0; j < message.dataFlowEvents.length; ++j) - object.dataFlowEvents[j] = $root.google.cloud.securitycenter.v2.DataFlowEvent.toObject(message.dataFlowEvents[j], options); - } - if (message.networks && message.networks.length) { - object.networks = []; - for (var j = 0; j < message.networks.length; ++j) - object.networks[j] = $root.google.cloud.securitycenter.v2.Network.toObject(message.networks[j], options); - } - if (message.dataRetentionDeletionEvents && message.dataRetentionDeletionEvents.length) { - object.dataRetentionDeletionEvents = []; - for (var j = 0; j < message.dataRetentionDeletionEvents.length; ++j) - object.dataRetentionDeletionEvents[j] = $root.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.toObject(message.dataRetentionDeletionEvents[j], options); - } - if (message.affectedResources != null && message.hasOwnProperty("affectedResources")) - object.affectedResources = $root.google.cloud.securitycenter.v2.AffectedResources.toObject(message.affectedResources, options); - if (message.aiModel != null && message.hasOwnProperty("aiModel")) - object.aiModel = $root.google.cloud.securitycenter.v2.AiModel.toObject(message.aiModel, options); - if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) - object.chokepoint = $root.google.cloud.securitycenter.v2.Chokepoint.toObject(message.chokepoint, options); - if (message.vertexAi != null && message.hasOwnProperty("vertexAi")) - object.vertexAi = $root.google.cloud.securitycenter.v2.VertexAi.toObject(message.vertexAi, options); - return object; - }; - - /** - * Converts this Finding to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Finding - * @instance - * @returns {Object.} JSON object - */ - Finding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Finding - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Finding"; - }; - - /** - * State enum. - * @name google.cloud.securitycenter.v2.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.v2.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.v2.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=3 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[3] = "UNDEFINED"] = 3; - return values; - })(); - - Finding.MuteInfo = (function() { - - /** - * Properties of a MuteInfo. - * @memberof google.cloud.securitycenter.v2.Finding - * @interface IMuteInfo - * @property {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute|null} [staticMute] MuteInfo staticMute - * @property {Array.|null} [dynamicMuteRecords] MuteInfo dynamicMuteRecords - */ - - /** - * Constructs a new MuteInfo. - * @memberof google.cloud.securitycenter.v2.Finding - * @classdesc Represents a MuteInfo. - * @implements IMuteInfo - * @constructor - * @param {google.cloud.securitycenter.v2.Finding.IMuteInfo=} [properties] Properties to set - */ - function MuteInfo(properties) { - this.dynamicMuteRecords = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MuteInfo staticMute. - * @member {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute|null|undefined} staticMute - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @instance - */ - MuteInfo.prototype.staticMute = null; - - /** - * MuteInfo dynamicMuteRecords. - * @member {Array.} dynamicMuteRecords - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @instance - */ - MuteInfo.prototype.dynamicMuteRecords = $util.emptyArray; - - /** - * Creates a new MuteInfo instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {google.cloud.securitycenter.v2.Finding.IMuteInfo=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo} MuteInfo instance - */ - MuteInfo.create = function create(properties) { - return new MuteInfo(properties); - }; - - /** - * Encodes the specified MuteInfo message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {google.cloud.securitycenter.v2.Finding.IMuteInfo} message MuteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MuteInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.staticMute != null && Object.hasOwnProperty.call(message, "staticMute")) - $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.encode(message.staticMute, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dynamicMuteRecords != null && message.dynamicMuteRecords.length) - for (var i = 0; i < message.dynamicMuteRecords.length; ++i) - $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.encode(message.dynamicMuteRecords[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MuteInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {google.cloud.securitycenter.v2.Finding.IMuteInfo} message MuteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MuteInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MuteInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo} MuteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MuteInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.staticMute = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.dynamicMuteRecords && message.dynamicMuteRecords.length)) - message.dynamicMuteRecords = []; - message.dynamicMuteRecords.push($root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MuteInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo} MuteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MuteInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MuteInfo message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MuteInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.staticMute != null && message.hasOwnProperty("staticMute")) { - var error = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify(message.staticMute); - if (error) - return "staticMute." + error; - } - if (message.dynamicMuteRecords != null && message.hasOwnProperty("dynamicMuteRecords")) { - if (!Array.isArray(message.dynamicMuteRecords)) - return "dynamicMuteRecords: array expected"; - for (var i = 0; i < message.dynamicMuteRecords.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify(message.dynamicMuteRecords[i]); - if (error) - return "dynamicMuteRecords." + error; - } - } - return null; - }; - - /** - * Creates a MuteInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo} MuteInfo - */ - MuteInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Finding.MuteInfo) - return object; - var message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo(); - if (object.staticMute != null) { - if (typeof object.staticMute !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.staticMute: object expected"); - message.staticMute = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.fromObject(object.staticMute); - } - if (object.dynamicMuteRecords) { - if (!Array.isArray(object.dynamicMuteRecords)) - throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.dynamicMuteRecords: array expected"); - message.dynamicMuteRecords = []; - for (var i = 0; i < object.dynamicMuteRecords.length; ++i) { - if (typeof object.dynamicMuteRecords[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.dynamicMuteRecords: object expected"); - message.dynamicMuteRecords[i] = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.fromObject(object.dynamicMuteRecords[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MuteInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo} message MuteInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MuteInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dynamicMuteRecords = []; - if (options.defaults) - object.staticMute = null; - if (message.staticMute != null && message.hasOwnProperty("staticMute")) - object.staticMute = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.toObject(message.staticMute, options); - if (message.dynamicMuteRecords && message.dynamicMuteRecords.length) { - object.dynamicMuteRecords = []; - for (var j = 0; j < message.dynamicMuteRecords.length; ++j) - object.dynamicMuteRecords[j] = $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.toObject(message.dynamicMuteRecords[j], options); - } - return object; - }; - - /** - * Converts this MuteInfo to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @instance - * @returns {Object.} JSON object - */ - MuteInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MuteInfo - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MuteInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Finding.MuteInfo"; - }; - - MuteInfo.StaticMute = (function() { - - /** - * Properties of a StaticMute. - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @interface IStaticMute - * @property {google.cloud.securitycenter.v2.Finding.Mute|null} [state] StaticMute state - * @property {google.protobuf.ITimestamp|null} [applyTime] StaticMute applyTime - */ - - /** - * Constructs a new StaticMute. - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @classdesc Represents a StaticMute. - * @implements IStaticMute - * @constructor - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute=} [properties] Properties to set - */ - function StaticMute(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StaticMute state. - * @member {google.cloud.securitycenter.v2.Finding.Mute} state - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @instance - */ - StaticMute.prototype.state = 0; - - /** - * StaticMute applyTime. - * @member {google.protobuf.ITimestamp|null|undefined} applyTime - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @instance - */ - StaticMute.prototype.applyTime = null; - - /** - * Creates a new StaticMute instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} StaticMute instance - */ - StaticMute.create = function create(properties) { - return new StaticMute(properties); - }; - - /** - * Encodes the specified StaticMute message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute} message StaticMute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StaticMute.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.applyTime != null && Object.hasOwnProperty.call(message, "applyTime")) - $root.google.protobuf.Timestamp.encode(message.applyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StaticMute message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IStaticMute} message StaticMute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StaticMute.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StaticMute message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} StaticMute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StaticMute.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.applyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StaticMute message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} StaticMute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StaticMute.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StaticMute message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StaticMute.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.applyTime != null && message.hasOwnProperty("applyTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.applyTime); - if (error) - return "applyTime." + error; - } - return null; - }; - - /** - * Creates a StaticMute message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} StaticMute - */ - StaticMute.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute) - return object; - var message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "MUTE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "MUTED": - case 1: - message.state = 1; - break; - case "UNMUTED": - case 2: - message.state = 2; - break; - case "UNDEFINED": - case 3: - message.state = 3; - break; - } - if (object.applyTime != null) { - if (typeof object.applyTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute.applyTime: object expected"); - message.applyTime = $root.google.protobuf.Timestamp.fromObject(object.applyTime); - } - return message; - }; - - /** - * Creates a plain object from a StaticMute message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute} message StaticMute - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StaticMute.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "MUTE_UNSPECIFIED" : 0; - object.applyTime = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v2.Finding.Mute[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.Finding.Mute[message.state] : message.state; - if (message.applyTime != null && message.hasOwnProperty("applyTime")) - object.applyTime = $root.google.protobuf.Timestamp.toObject(message.applyTime, options); - return object; - }; - - /** - * Converts this StaticMute to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @instance - * @returns {Object.} JSON object - */ - StaticMute.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StaticMute - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StaticMute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute"; - }; - - return StaticMute; - })(); - - MuteInfo.DynamicMuteRecord = (function() { - - /** - * Properties of a DynamicMuteRecord. - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @interface IDynamicMuteRecord - * @property {string|null} [muteConfig] DynamicMuteRecord muteConfig - * @property {google.protobuf.ITimestamp|null} [matchTime] DynamicMuteRecord matchTime - */ - - /** - * Constructs a new DynamicMuteRecord. - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo - * @classdesc Represents a DynamicMuteRecord. - * @implements IDynamicMuteRecord - * @constructor - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord=} [properties] Properties to set - */ - function DynamicMuteRecord(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DynamicMuteRecord muteConfig. - * @member {string} muteConfig - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @instance - */ - DynamicMuteRecord.prototype.muteConfig = ""; - - /** - * DynamicMuteRecord matchTime. - * @member {google.protobuf.ITimestamp|null|undefined} matchTime - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @instance - */ - DynamicMuteRecord.prototype.matchTime = null; - - /** - * Creates a new DynamicMuteRecord instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord instance - */ - DynamicMuteRecord.create = function create(properties) { - return new DynamicMuteRecord(properties); - }; - - /** - * Encodes the specified DynamicMuteRecord message. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord} message DynamicMuteRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicMuteRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.muteConfig); - if (message.matchTime != null && Object.hasOwnProperty.call(message, "matchTime")) - $root.google.protobuf.Timestamp.encode(message.matchTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DynamicMuteRecord message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.IDynamicMuteRecord} message DynamicMuteRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DynamicMuteRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DynamicMuteRecord message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicMuteRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.muteConfig = reader.string(); - break; - } - case 2: { - message.matchTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DynamicMuteRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DynamicMuteRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DynamicMuteRecord message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DynamicMuteRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) - if (!$util.isString(message.muteConfig)) - return "muteConfig: string expected"; - if (message.matchTime != null && message.hasOwnProperty("matchTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.matchTime); - if (error) - return "matchTime." + error; - } - return null; - }; - - /** - * Creates a DynamicMuteRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} DynamicMuteRecord - */ - DynamicMuteRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord) - return object; - var message = new $root.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord(); - if (object.muteConfig != null) - message.muteConfig = String(object.muteConfig); - if (object.matchTime != null) { - if (typeof object.matchTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord.matchTime: object expected"); - message.matchTime = $root.google.protobuf.Timestamp.fromObject(object.matchTime); - } - return message; - }; - - /** - * Creates a plain object from a DynamicMuteRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord} message DynamicMuteRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DynamicMuteRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.muteConfig = ""; - object.matchTime = null; - } - if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) - object.muteConfig = message.muteConfig; - if (message.matchTime != null && message.hasOwnProperty("matchTime")) - object.matchTime = $root.google.protobuf.Timestamp.toObject(message.matchTime, options); - return object; - }; - - /** - * Converts this DynamicMuteRecord to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @instance - * @returns {Object.} JSON object - */ - DynamicMuteRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DynamicMuteRecord - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DynamicMuteRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord"; - }; - - return DynamicMuteRecord; - })(); - - return MuteInfo; - })(); - - /** - * FindingClass enum. - * @name google.cloud.securitycenter.v2.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 - * @property {number} POSTURE_VIOLATION=6 POSTURE_VIOLATION value - * @property {number} TOXIC_COMBINATION=7 TOXIC_COMBINATION value - * @property {number} SENSITIVE_DATA_RISK=8 SENSITIVE_DATA_RISK value - * @property {number} CHOKEPOINT=9 CHOKEPOINT 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; - values[valuesById[6] = "POSTURE_VIOLATION"] = 6; - values[valuesById[7] = "TOXIC_COMBINATION"] = 7; - values[valuesById[8] = "SENSITIVE_DATA_RISK"] = 8; - values[valuesById[9] = "CHOKEPOINT"] = 9; - return values; - })(); - - return Finding; - })(); - - v2.GroupMembership = (function() { - - /** - * Properties of a GroupMembership. - * @memberof google.cloud.securitycenter.v2 - * @interface IGroupMembership - * @property {google.cloud.securitycenter.v2.GroupMembership.GroupType|null} [groupType] GroupMembership groupType - * @property {string|null} [groupId] GroupMembership groupId - */ - - /** - * Constructs a new GroupMembership. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GroupMembership. - * @implements IGroupMembership - * @constructor - * @param {google.cloud.securitycenter.v2.IGroupMembership=} [properties] Properties to set - */ - function GroupMembership(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupMembership groupType. - * @member {google.cloud.securitycenter.v2.GroupMembership.GroupType} groupType - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @instance - */ - GroupMembership.prototype.groupType = 0; - - /** - * GroupMembership groupId. - * @member {string} groupId - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @instance - */ - GroupMembership.prototype.groupId = ""; - - /** - * Creates a new GroupMembership instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {google.cloud.securitycenter.v2.IGroupMembership=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership instance - */ - GroupMembership.create = function create(properties) { - return new GroupMembership(properties); - }; - - /** - * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {google.cloud.securitycenter.v2.IGroupMembership} message GroupMembership message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMembership.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupType != null && Object.hasOwnProperty.call(message, "groupType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.groupType); - if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId); - return writer; - }; - - /** - * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {google.cloud.securitycenter.v2.IGroupMembership} message GroupMembership message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMembership.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupMembership message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMembership.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupMembership(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.groupType = reader.int32(); - break; - } - case 2: { - message.groupId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupMembership message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMembership.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupMembership message. - * @function verify - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupMembership.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupType != null && message.hasOwnProperty("groupType")) - switch (message.groupType) { - default: - return "groupType: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.groupId != null && message.hasOwnProperty("groupId")) - if (!$util.isString(message.groupId)) - return "groupId: string expected"; - return null; - }; - - /** - * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership - */ - GroupMembership.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GroupMembership) - return object; - var message = new $root.google.cloud.securitycenter.v2.GroupMembership(); - switch (object.groupType) { - default: - if (typeof object.groupType === "number") { - message.groupType = object.groupType; - break; - } - break; - case "GROUP_TYPE_UNSPECIFIED": - case 0: - message.groupType = 0; - break; - case "GROUP_TYPE_TOXIC_COMBINATION": - case 1: - message.groupType = 1; - break; - case "GROUP_TYPE_CHOKEPOINT": - case 3: - message.groupType = 3; - break; - } - if (object.groupId != null) - message.groupId = String(object.groupId); - return message; - }; - - /** - * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {google.cloud.securitycenter.v2.GroupMembership} message GroupMembership - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupMembership.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.groupType = options.enums === String ? "GROUP_TYPE_UNSPECIFIED" : 0; - object.groupId = ""; - } - if (message.groupType != null && message.hasOwnProperty("groupType")) - object.groupType = options.enums === String ? $root.google.cloud.securitycenter.v2.GroupMembership.GroupType[message.groupType] === undefined ? message.groupType : $root.google.cloud.securitycenter.v2.GroupMembership.GroupType[message.groupType] : message.groupType; - if (message.groupId != null && message.hasOwnProperty("groupId")) - object.groupId = message.groupId; - return object; - }; - - /** - * Converts this GroupMembership to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @instance - * @returns {Object.} JSON object - */ - GroupMembership.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GroupMembership - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.GroupMembership - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GroupMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.GroupMembership"; - }; - - /** - * GroupType enum. - * @name google.cloud.securitycenter.v2.GroupMembership.GroupType - * @enum {number} - * @property {number} GROUP_TYPE_UNSPECIFIED=0 GROUP_TYPE_UNSPECIFIED value - * @property {number} GROUP_TYPE_TOXIC_COMBINATION=1 GROUP_TYPE_TOXIC_COMBINATION value - * @property {number} GROUP_TYPE_CHOKEPOINT=3 GROUP_TYPE_CHOKEPOINT value - */ - GroupMembership.GroupType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "GROUP_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GROUP_TYPE_TOXIC_COMBINATION"] = 1; - values[valuesById[3] = "GROUP_TYPE_CHOKEPOINT"] = 3; - return values; - })(); - - return GroupMembership; - })(); - - v2.IamBinding = (function() { - - /** - * Properties of an IamBinding. - * @memberof google.cloud.securitycenter.v2 - * @interface IIamBinding - * @property {google.cloud.securitycenter.v2.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.v2 - * @classdesc Represents an IamBinding. - * @implements IIamBinding - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.IamBinding.Action} action - * @memberof google.cloud.securitycenter.v2.IamBinding - * @instance - */ - IamBinding.prototype.action = 0; - - /** - * IamBinding role. - * @member {string} role - * @memberof google.cloud.securitycenter.v2.IamBinding - * @instance - */ - IamBinding.prototype.role = ""; - - /** - * IamBinding member. - * @member {string} member - * @memberof google.cloud.securitycenter.v2.IamBinding - * @instance - */ - IamBinding.prototype.member = ""; - - /** - * Creates a new IamBinding instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.IamBinding - * @static - * @param {google.cloud.securitycenter.v2.IIamBinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.IamBinding} IamBinding instance - */ - IamBinding.create = function create(properties) { - return new IamBinding(properties); - }; - - /** - * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v2.IamBinding.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.IamBinding - * @static - * @param {google.cloud.securitycenter.v2.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.v2.IamBinding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.IamBinding - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.IamBinding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.IamBinding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.IamBinding - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.IamBinding} IamBinding - */ - IamBinding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.IamBinding) - return object; - var message = new $root.google.cloud.securitycenter.v2.IamBinding(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - 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.v2.IamBinding - * @static - * @param {google.cloud.securitycenter.v2.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.v2.IamBinding.Action[message.action] === undefined ? message.action : $root.google.cloud.securitycenter.v2.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.v2.IamBinding - * @instance - * @returns {Object.} JSON object - */ - IamBinding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IamBinding - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.IamBinding"; - }; - - /** - * Action enum. - * @name google.cloud.securitycenter.v2.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; - })(); - - v2.Indicator = (function() { - - /** - * Properties of an Indicator. - * @memberof google.cloud.securitycenter.v2 - * @interface IIndicator - * @property {Array.|null} [ipAddresses] Indicator ipAddresses - * @property {Array.|null} [domains] Indicator domains - * @property {Array.|null} [signatures] Indicator signatures - * @property {Array.|null} [uris] Indicator uris - */ - - /** - * Constructs a new Indicator. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an Indicator. - * @implements IIndicator - * @constructor - * @param {google.cloud.securitycenter.v2.IIndicator=} [properties] Properties to set - */ - function Indicator(properties) { - 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) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Indicator ipAddresses. - * @member {Array.} ipAddresses - * @memberof google.cloud.securitycenter.v2.Indicator - * @instance - */ - Indicator.prototype.ipAddresses = $util.emptyArray; - - /** - * Indicator domains. - * @member {Array.} domains - * @memberof google.cloud.securitycenter.v2.Indicator - * @instance - */ - Indicator.prototype.domains = $util.emptyArray; - - /** - * Indicator signatures. - * @member {Array.} signatures - * @memberof google.cloud.securitycenter.v2.Indicator - * @instance - */ - Indicator.prototype.signatures = $util.emptyArray; - - /** - * Indicator uris. - * @member {Array.} uris - * @memberof google.cloud.securitycenter.v2.Indicator - * @instance - */ - Indicator.prototype.uris = $util.emptyArray; - - /** - * Creates a new Indicator instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Indicator - * @static - * @param {google.cloud.securitycenter.v2.IIndicator=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Indicator} Indicator instance - */ - Indicator.create = function create(properties) { - return new Indicator(properties); - }; - - /** - * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v2.Indicator.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Indicator - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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; - }; - - /** - * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Indicator.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Indicator - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.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; - } - } - return message; - }; - - /** - * Decodes an Indicator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Indicator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.verify(message.signatures[i]); - if (error) - 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; - }; - - /** - * Creates an Indicator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Indicator - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Indicator} Indicator - */ - Indicator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Indicator) - return object; - var message = new $root.google.cloud.securitycenter.v2.Indicator(); - if (object.ipAddresses) { - if (!Array.isArray(object.ipAddresses)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.Indicator.signatures: object expected"); - message.signatures[i] = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.fromObject(object.signatures[i]); - } - } - if (object.uris) { - if (!Array.isArray(object.uris)) - throw TypeError(".google.cloud.securitycenter.v2.Indicator.uris: array expected"); - message.uris = []; - for (var i = 0; i < object.uris.length; ++i) - message.uris[i] = String(object.uris[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.v2.Indicator - * @static - * @param {google.cloud.securitycenter.v2.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 = []; - object.uris = []; - } - 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.v2.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; - }; - - /** - * Converts this Indicator to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Indicator - * @instance - * @returns {Object.} JSON object - */ - Indicator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Indicator - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Indicator"; - }; - - Indicator.ProcessSignature = (function() { - - /** - * Properties of a ProcessSignature. - * @memberof google.cloud.securitycenter.v2.Indicator - * @interface IProcessSignature - * @property {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IMemoryHashSignature|null} [memoryHashSignature] ProcessSignature memoryHashSignature - * @property {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature|null} [yaraRuleSignature] ProcessSignature yaraRuleSignature - * @property {google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType|null} [signatureType] ProcessSignature signatureType - */ - - /** - * Constructs a new ProcessSignature. - * @memberof google.cloud.securitycenter.v2.Indicator - * @classdesc Represents a ProcessSignature. - * @implements IProcessSignature - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.IMemoryHashSignature|null|undefined} memoryHashSignature - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @instance - */ - ProcessSignature.prototype.memoryHashSignature = null; - - /** - * ProcessSignature yaraRuleSignature. - * @member {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature|null|undefined} yaraRuleSignature - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @instance - */ - ProcessSignature.prototype.yaraRuleSignature = null; - - /** - * ProcessSignature signatureType. - * @member {google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType} signatureType - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @instance - */ - ProcessSignature.prototype.signatureType = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ProcessSignature signature. - * @member {"memoryHashSignature"|"yaraRuleSignature"|undefined} signature - * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature - * @static - * @param {google.cloud.securitycenter.v2.Indicator.IProcessSignature=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.encode(message.yaraRuleSignature, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.signatureType != null && Object.hasOwnProperty.call(message, "signatureType")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.signatureType); - return writer; - }; - - /** - * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Indicator.ProcessSignature.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 6: { - message.memoryHashSignature = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.decode(reader, reader.uint32()); - break; - } - case 7: { - message.yaraRuleSignature = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature.decode(reader, reader.uint32()); - break; - } - case 8: { - message.signatureType = reader.int32(); - 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.v2.Indicator.ProcessSignature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.verify(message.yaraRuleSignature); - if (error) - return "yaraRuleSignature." + error; - } - } - if (message.signatureType != null && message.hasOwnProperty("signatureType")) - switch (message.signatureType) { - default: - return "signatureType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ProcessSignature message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Indicator.ProcessSignature} ProcessSignature - */ - ProcessSignature.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature) - return object; - var message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature(); - if (object.memoryHashSignature != null) { - if (typeof object.memoryHashSignature !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Indicator.ProcessSignature.memoryHashSignature: object expected"); - message.memoryHashSignature = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.fromObject(object.memoryHashSignature); - } - if (object.yaraRuleSignature != null) { - if (typeof object.yaraRuleSignature !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Indicator.ProcessSignature.yaraRuleSignature: object expected"); - message.yaraRuleSignature = $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature.fromObject(object.yaraRuleSignature); - } - switch (object.signatureType) { - default: - if (typeof object.signatureType === "number") { - message.signatureType = object.signatureType; - break; - } - break; - case "SIGNATURE_TYPE_UNSPECIFIED": - case 0: - message.signatureType = 0; - break; - case "SIGNATURE_TYPE_PROCESS": - case 1: - message.signatureType = 1; - break; - case "SIGNATURE_TYPE_FILE": - case 2: - message.signatureType = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ProcessSignature message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @static - * @param {google.cloud.securitycenter.v2.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 (options.defaults) - object.signatureType = options.enums === String ? "SIGNATURE_TYPE_UNSPECIFIED" : 0; - if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { - object.memoryHashSignature = $root.google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.toObject(message.yaraRuleSignature, options); - if (options.oneofs) - object.signature = "yaraRuleSignature"; - } - if (message.signatureType != null && message.hasOwnProperty("signatureType")) - object.signatureType = options.enums === String ? $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType[message.signatureType] === undefined ? message.signatureType : $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType[message.signatureType] : message.signatureType; - return object; - }; - - /** - * Converts this ProcessSignature to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @instance - * @returns {Object.} JSON object - */ - ProcessSignature.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessSignature - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature"; - }; - - ProcessSignature.MemoryHashSignature = (function() { - - /** - * Properties of a MemoryHashSignature. - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @interface IMemoryHashSignature - * @property {string|null} [binaryFamily] MemoryHashSignature binaryFamily - * @property {Array.|null} [detections] MemoryHashSignature detections - */ - - /** - * Constructs a new MemoryHashSignature. - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @classdesc Represents a MemoryHashSignature. - * @implements IMemoryHashSignature - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature - * @instance - */ - MemoryHashSignature.prototype.binaryFamily = ""; - - /** - * MemoryHashSignature detections. - * @member {Array.} detections - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature - * @instance - */ - MemoryHashSignature.prototype.detections = $util.emptyArray; - - /** - * Creates a new MemoryHashSignature instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature - */ - MemoryHashSignature.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.detections: object expected"); - message.detections[i] = $root.google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection.toObject(message.detections[j], options); - } - return object; - }; - - /** - * Converts this MemoryHashSignature to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature - * @instance - * @returns {Object.} JSON object - */ - MemoryHashSignature.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MemoryHashSignature - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature"; - }; - - MemoryHashSignature.Detection = (function() { - - /** - * Properties of a Detection. - * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature - * @classdesc Represents a Detection. - * @implements IDetection - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @instance - */ - Detection.prototype.binary = ""; - - /** - * Detection percentPagesMatched. - * @member {number} percentPagesMatched - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @instance - */ - Detection.prototype.percentPagesMatched = 0; - - /** - * Creates a new Detection instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection - */ - Detection.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @instance - * @returns {Object.} JSON object - */ - Detection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Detection - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection"; - }; - - return Detection; - })(); - - return MemoryHashSignature; - })(); - - ProcessSignature.YaraRuleSignature = (function() { - - /** - * Properties of a YaraRuleSignature. - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @interface IYaraRuleSignature - * @property {string|null} [yaraRule] YaraRuleSignature yaraRule - */ - - /** - * Constructs a new YaraRuleSignature. - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature - * @classdesc Represents a YaraRuleSignature. - * @implements IYaraRuleSignature - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature - * @instance - */ - YaraRuleSignature.prototype.yaraRule = ""; - - /** - * Creates a new YaraRuleSignature instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {google.cloud.securitycenter.v2.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature - */ - YaraRuleSignature.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature - * @instance - * @returns {Object.} JSON object - */ - YaraRuleSignature.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for YaraRuleSignature - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Indicator.ProcessSignature.YaraRuleSignature"; - }; - - return YaraRuleSignature; - })(); - - /** - * SignatureType enum. - * @name google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType - * @enum {number} - * @property {number} SIGNATURE_TYPE_UNSPECIFIED=0 SIGNATURE_TYPE_UNSPECIFIED value - * @property {number} SIGNATURE_TYPE_PROCESS=1 SIGNATURE_TYPE_PROCESS value - * @property {number} SIGNATURE_TYPE_FILE=2 SIGNATURE_TYPE_FILE value - */ - ProcessSignature.SignatureType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SIGNATURE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SIGNATURE_TYPE_PROCESS"] = 1; - values[valuesById[2] = "SIGNATURE_TYPE_FILE"] = 2; - return values; - })(); - - return ProcessSignature; - })(); - - return Indicator; - })(); - - v2.IpRules = (function() { - - /** - * Properties of an IpRules. - * @memberof google.cloud.securitycenter.v2 - * @interface IIpRules - * @property {google.cloud.securitycenter.v2.IpRules.Direction|null} [direction] IpRules direction - * @property {google.cloud.securitycenter.v2.IAllowed|null} [allowed] IpRules allowed - * @property {google.cloud.securitycenter.v2.IDenied|null} [denied] IpRules denied - * @property {Array.|null} [sourceIpRanges] IpRules sourceIpRanges - * @property {Array.|null} [destinationIpRanges] IpRules destinationIpRanges - * @property {Array.|null} [exposedServices] IpRules exposedServices - */ - - /** - * Constructs a new IpRules. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an IpRules. - * @implements IIpRules - * @constructor - * @param {google.cloud.securitycenter.v2.IIpRules=} [properties] Properties to set - */ - function IpRules(properties) { - this.sourceIpRanges = []; - this.destinationIpRanges = []; - this.exposedServices = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IpRules direction. - * @member {google.cloud.securitycenter.v2.IpRules.Direction} direction - * @memberof google.cloud.securitycenter.v2.IpRules - * @instance - */ - IpRules.prototype.direction = 0; - - /** - * IpRules allowed. - * @member {google.cloud.securitycenter.v2.IAllowed|null|undefined} allowed - * @memberof google.cloud.securitycenter.v2.IpRules - * @instance - */ - IpRules.prototype.allowed = null; - - /** - * IpRules denied. - * @member {google.cloud.securitycenter.v2.IDenied|null|undefined} denied - * @memberof google.cloud.securitycenter.v2.IpRules - * @instance - */ - IpRules.prototype.denied = null; - - /** - * IpRules sourceIpRanges. - * @member {Array.} sourceIpRanges - * @memberof google.cloud.securitycenter.v2.IpRules - * @instance - */ - IpRules.prototype.sourceIpRanges = $util.emptyArray; - - /** - * IpRules destinationIpRanges. - * @member {Array.} destinationIpRanges - * @memberof google.cloud.securitycenter.v2.IpRules - * @instance - */ - IpRules.prototype.destinationIpRanges = $util.emptyArray; - - /** - * IpRules exposedServices. - * @member {Array.} exposedServices - * @memberof google.cloud.securitycenter.v2.IpRules - * @instance - */ - IpRules.prototype.exposedServices = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * IpRules rules. - * @member {"allowed"|"denied"|undefined} rules - * @memberof google.cloud.securitycenter.v2.IpRules - * @instance - */ - Object.defineProperty(IpRules.prototype, "rules", { - get: $util.oneOfGetter($oneOfFields = ["allowed", "denied"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new IpRules instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {google.cloud.securitycenter.v2.IIpRules=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.IpRules} IpRules instance - */ - IpRules.create = function create(properties) { - return new IpRules(properties); - }; - - /** - * Encodes the specified IpRules message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRules.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {google.cloud.securitycenter.v2.IIpRules} message IpRules message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IpRules.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.direction); - if (message.allowed != null && Object.hasOwnProperty.call(message, "allowed")) - $root.google.cloud.securitycenter.v2.Allowed.encode(message.allowed, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.denied != null && Object.hasOwnProperty.call(message, "denied")) - $root.google.cloud.securitycenter.v2.Denied.encode(message.denied, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.sourceIpRanges != null && message.sourceIpRanges.length) - for (var i = 0; i < message.sourceIpRanges.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceIpRanges[i]); - if (message.destinationIpRanges != null && message.destinationIpRanges.length) - for (var i = 0; i < message.destinationIpRanges.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.destinationIpRanges[i]); - if (message.exposedServices != null && message.exposedServices.length) - for (var i = 0; i < message.exposedServices.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.exposedServices[i]); - return writer; - }; - - /** - * Encodes the specified IpRules message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRules.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {google.cloud.securitycenter.v2.IIpRules} message IpRules message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IpRules.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IpRules message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.IpRules} IpRules - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IpRules.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.IpRules(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.direction = reader.int32(); - break; - } - case 2: { - message.allowed = $root.google.cloud.securitycenter.v2.Allowed.decode(reader, reader.uint32()); - break; - } - case 3: { - message.denied = $root.google.cloud.securitycenter.v2.Denied.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.sourceIpRanges && message.sourceIpRanges.length)) - message.sourceIpRanges = []; - message.sourceIpRanges.push(reader.string()); - break; - } - case 5: { - if (!(message.destinationIpRanges && message.destinationIpRanges.length)) - message.destinationIpRanges = []; - message.destinationIpRanges.push(reader.string()); - break; - } - case 6: { - if (!(message.exposedServices && message.exposedServices.length)) - message.exposedServices = []; - message.exposedServices.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IpRules message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.IpRules} IpRules - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IpRules.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IpRules message. - * @function verify - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IpRules.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.direction != null && message.hasOwnProperty("direction")) - switch (message.direction) { - default: - return "direction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.allowed != null && message.hasOwnProperty("allowed")) { - properties.rules = 1; - { - var error = $root.google.cloud.securitycenter.v2.Allowed.verify(message.allowed); - if (error) - return "allowed." + error; - } - } - if (message.denied != null && message.hasOwnProperty("denied")) { - if (properties.rules === 1) - return "rules: multiple values"; - properties.rules = 1; - { - var error = $root.google.cloud.securitycenter.v2.Denied.verify(message.denied); - if (error) - return "denied." + error; - } - } - if (message.sourceIpRanges != null && message.hasOwnProperty("sourceIpRanges")) { - if (!Array.isArray(message.sourceIpRanges)) - return "sourceIpRanges: array expected"; - for (var i = 0; i < message.sourceIpRanges.length; ++i) - if (!$util.isString(message.sourceIpRanges[i])) - return "sourceIpRanges: string[] expected"; - } - if (message.destinationIpRanges != null && message.hasOwnProperty("destinationIpRanges")) { - if (!Array.isArray(message.destinationIpRanges)) - return "destinationIpRanges: array expected"; - for (var i = 0; i < message.destinationIpRanges.length; ++i) - if (!$util.isString(message.destinationIpRanges[i])) - return "destinationIpRanges: string[] expected"; - } - if (message.exposedServices != null && message.hasOwnProperty("exposedServices")) { - if (!Array.isArray(message.exposedServices)) - return "exposedServices: array expected"; - for (var i = 0; i < message.exposedServices.length; ++i) - if (!$util.isString(message.exposedServices[i])) - return "exposedServices: string[] expected"; - } - return null; - }; - - /** - * Creates an IpRules message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.IpRules} IpRules - */ - IpRules.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.IpRules) - return object; - var message = new $root.google.cloud.securitycenter.v2.IpRules(); - switch (object.direction) { - default: - if (typeof object.direction === "number") { - message.direction = object.direction; - break; - } - break; - case "DIRECTION_UNSPECIFIED": - case 0: - message.direction = 0; - break; - case "INGRESS": - case 1: - message.direction = 1; - break; - case "EGRESS": - case 2: - message.direction = 2; - break; - } - if (object.allowed != null) { - if (typeof object.allowed !== "object") - throw TypeError(".google.cloud.securitycenter.v2.IpRules.allowed: object expected"); - message.allowed = $root.google.cloud.securitycenter.v2.Allowed.fromObject(object.allowed); - } - if (object.denied != null) { - if (typeof object.denied !== "object") - throw TypeError(".google.cloud.securitycenter.v2.IpRules.denied: object expected"); - message.denied = $root.google.cloud.securitycenter.v2.Denied.fromObject(object.denied); - } - if (object.sourceIpRanges) { - if (!Array.isArray(object.sourceIpRanges)) - throw TypeError(".google.cloud.securitycenter.v2.IpRules.sourceIpRanges: array expected"); - message.sourceIpRanges = []; - for (var i = 0; i < object.sourceIpRanges.length; ++i) - message.sourceIpRanges[i] = String(object.sourceIpRanges[i]); - } - if (object.destinationIpRanges) { - if (!Array.isArray(object.destinationIpRanges)) - throw TypeError(".google.cloud.securitycenter.v2.IpRules.destinationIpRanges: array expected"); - message.destinationIpRanges = []; - for (var i = 0; i < object.destinationIpRanges.length; ++i) - message.destinationIpRanges[i] = String(object.destinationIpRanges[i]); - } - if (object.exposedServices) { - if (!Array.isArray(object.exposedServices)) - throw TypeError(".google.cloud.securitycenter.v2.IpRules.exposedServices: array expected"); - message.exposedServices = []; - for (var i = 0; i < object.exposedServices.length; ++i) - message.exposedServices[i] = String(object.exposedServices[i]); - } - return message; - }; - - /** - * Creates a plain object from an IpRules message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {google.cloud.securitycenter.v2.IpRules} message IpRules - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IpRules.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.sourceIpRanges = []; - object.destinationIpRanges = []; - object.exposedServices = []; - } - if (options.defaults) - object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; - if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.cloud.securitycenter.v2.IpRules.Direction[message.direction] === undefined ? message.direction : $root.google.cloud.securitycenter.v2.IpRules.Direction[message.direction] : message.direction; - if (message.allowed != null && message.hasOwnProperty("allowed")) { - object.allowed = $root.google.cloud.securitycenter.v2.Allowed.toObject(message.allowed, options); - if (options.oneofs) - object.rules = "allowed"; - } - if (message.denied != null && message.hasOwnProperty("denied")) { - object.denied = $root.google.cloud.securitycenter.v2.Denied.toObject(message.denied, options); - if (options.oneofs) - object.rules = "denied"; - } - if (message.sourceIpRanges && message.sourceIpRanges.length) { - object.sourceIpRanges = []; - for (var j = 0; j < message.sourceIpRanges.length; ++j) - object.sourceIpRanges[j] = message.sourceIpRanges[j]; - } - if (message.destinationIpRanges && message.destinationIpRanges.length) { - object.destinationIpRanges = []; - for (var j = 0; j < message.destinationIpRanges.length; ++j) - object.destinationIpRanges[j] = message.destinationIpRanges[j]; - } - if (message.exposedServices && message.exposedServices.length) { - object.exposedServices = []; - for (var j = 0; j < message.exposedServices.length; ++j) - object.exposedServices[j] = message.exposedServices[j]; - } - return object; - }; - - /** - * Converts this IpRules to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.IpRules - * @instance - * @returns {Object.} JSON object - */ - IpRules.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IpRules - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.IpRules - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IpRules.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.IpRules"; - }; - - /** - * Direction enum. - * @name google.cloud.securitycenter.v2.IpRules.Direction - * @enum {number} - * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value - * @property {number} INGRESS=1 INGRESS value - * @property {number} EGRESS=2 EGRESS value - */ - IpRules.Direction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "INGRESS"] = 1; - values[valuesById[2] = "EGRESS"] = 2; - return values; - })(); - - return IpRules; - })(); - - v2.IpRule = (function() { - - /** - * Properties of an IpRule. - * @memberof google.cloud.securitycenter.v2 - * @interface IIpRule - * @property {string|null} [protocol] IpRule protocol - * @property {Array.|null} [portRanges] IpRule portRanges - */ - - /** - * Constructs a new IpRule. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an IpRule. - * @implements IIpRule - * @constructor - * @param {google.cloud.securitycenter.v2.IIpRule=} [properties] Properties to set - */ - function IpRule(properties) { - this.portRanges = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IpRule protocol. - * @member {string} protocol - * @memberof google.cloud.securitycenter.v2.IpRule - * @instance - */ - IpRule.prototype.protocol = ""; - - /** - * IpRule portRanges. - * @member {Array.} portRanges - * @memberof google.cloud.securitycenter.v2.IpRule - * @instance - */ - IpRule.prototype.portRanges = $util.emptyArray; - - /** - * Creates a new IpRule instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {google.cloud.securitycenter.v2.IIpRule=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.IpRule} IpRule instance - */ - IpRule.create = function create(properties) { - return new IpRule(properties); - }; - - /** - * Encodes the specified IpRule message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {google.cloud.securitycenter.v2.IIpRule} message IpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.protocol); - if (message.portRanges != null && message.portRanges.length) - for (var i = 0; i < message.portRanges.length; ++i) - $root.google.cloud.securitycenter.v2.IpRule.PortRange.encode(message.portRanges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IpRule message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {google.cloud.securitycenter.v2.IIpRule} message IpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IpRule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.IpRule} IpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.IpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.protocol = reader.string(); - break; - } - case 2: { - if (!(message.portRanges && message.portRanges.length)) - message.portRanges = []; - message.portRanges.push($root.google.cloud.securitycenter.v2.IpRule.PortRange.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.IpRule} IpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IpRule message. - * @function verify - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.protocol != null && message.hasOwnProperty("protocol")) - if (!$util.isString(message.protocol)) - return "protocol: string expected"; - if (message.portRanges != null && message.hasOwnProperty("portRanges")) { - if (!Array.isArray(message.portRanges)) - return "portRanges: array expected"; - for (var i = 0; i < message.portRanges.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.IpRule.PortRange.verify(message.portRanges[i]); - if (error) - return "portRanges." + error; - } - } - return null; - }; - - /** - * Creates an IpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.IpRule} IpRule - */ - IpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.IpRule) - return object; - var message = new $root.google.cloud.securitycenter.v2.IpRule(); - if (object.protocol != null) - message.protocol = String(object.protocol); - if (object.portRanges) { - if (!Array.isArray(object.portRanges)) - throw TypeError(".google.cloud.securitycenter.v2.IpRule.portRanges: array expected"); - message.portRanges = []; - for (var i = 0; i < object.portRanges.length; ++i) { - if (typeof object.portRanges[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.IpRule.portRanges: object expected"); - message.portRanges[i] = $root.google.cloud.securitycenter.v2.IpRule.PortRange.fromObject(object.portRanges[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {google.cloud.securitycenter.v2.IpRule} message IpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.portRanges = []; - if (options.defaults) - object.protocol = ""; - if (message.protocol != null && message.hasOwnProperty("protocol")) - object.protocol = message.protocol; - if (message.portRanges && message.portRanges.length) { - object.portRanges = []; - for (var j = 0; j < message.portRanges.length; ++j) - object.portRanges[j] = $root.google.cloud.securitycenter.v2.IpRule.PortRange.toObject(message.portRanges[j], options); - } - return object; - }; - - /** - * Converts this IpRule to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.IpRule - * @instance - * @returns {Object.} JSON object - */ - IpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IpRule - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.IpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.IpRule"; - }; - - IpRule.PortRange = (function() { - - /** - * Properties of a PortRange. - * @memberof google.cloud.securitycenter.v2.IpRule - * @interface IPortRange - * @property {number|Long|null} [min] PortRange min - * @property {number|Long|null} [max] PortRange max - */ - - /** - * Constructs a new PortRange. - * @memberof google.cloud.securitycenter.v2.IpRule - * @classdesc Represents a PortRange. - * @implements IPortRange - * @constructor - * @param {google.cloud.securitycenter.v2.IpRule.IPortRange=} [properties] Properties to set - */ - function PortRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PortRange min. - * @member {number|Long} min - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @instance - */ - PortRange.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PortRange max. - * @member {number|Long} max - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @instance - */ - PortRange.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PortRange instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {google.cloud.securitycenter.v2.IpRule.IPortRange=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.IpRule.PortRange} PortRange instance - */ - PortRange.create = function create(properties) { - return new PortRange(properties); - }; - - /** - * Encodes the specified PortRange message. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.PortRange.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {google.cloud.securitycenter.v2.IpRule.IPortRange} message PortRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PortRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.min != null && Object.hasOwnProperty.call(message, "min")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.min); - if (message.max != null && Object.hasOwnProperty.call(message, "max")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.max); - return writer; - }; - - /** - * Encodes the specified PortRange message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.IpRule.PortRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {google.cloud.securitycenter.v2.IpRule.IPortRange} message PortRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PortRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PortRange message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.IpRule.PortRange} PortRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PortRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.IpRule.PortRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.min = reader.int64(); - break; - } - case 2: { - message.max = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PortRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.IpRule.PortRange} PortRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PortRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PortRange message. - * @function verify - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PortRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.min != null && message.hasOwnProperty("min")) - if (!$util.isInteger(message.min) && !(message.min && $util.isInteger(message.min.low) && $util.isInteger(message.min.high))) - return "min: integer|Long expected"; - if (message.max != null && message.hasOwnProperty("max")) - if (!$util.isInteger(message.max) && !(message.max && $util.isInteger(message.max.low) && $util.isInteger(message.max.high))) - return "max: integer|Long expected"; - return null; - }; - - /** - * Creates a PortRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.IpRule.PortRange} PortRange - */ - PortRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.IpRule.PortRange) - return object; - var message = new $root.google.cloud.securitycenter.v2.IpRule.PortRange(); - if (object.min != null) - if ($util.Long) - (message.min = $util.Long.fromValue(object.min)).unsigned = false; - else if (typeof object.min === "string") - message.min = parseInt(object.min, 10); - else if (typeof object.min === "number") - message.min = object.min; - else if (typeof object.min === "object") - message.min = new $util.LongBits(object.min.low >>> 0, object.min.high >>> 0).toNumber(); - if (object.max != null) - if ($util.Long) - (message.max = $util.Long.fromValue(object.max)).unsigned = false; - else if (typeof object.max === "string") - message.max = parseInt(object.max, 10); - else if (typeof object.max === "number") - message.max = object.max; - else if (typeof object.max === "object") - message.max = new $util.LongBits(object.max.low >>> 0, object.max.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PortRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {google.cloud.securitycenter.v2.IpRule.PortRange} message PortRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PortRange.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.min = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.min = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.max = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max = options.longs === String ? "0" : 0; - } - if (message.min != null && message.hasOwnProperty("min")) - if (typeof message.min === "number") - object.min = options.longs === String ? String(message.min) : message.min; - else - object.min = options.longs === String ? $util.Long.prototype.toString.call(message.min) : options.longs === Number ? new $util.LongBits(message.min.low >>> 0, message.min.high >>> 0).toNumber() : message.min; - if (message.max != null && message.hasOwnProperty("max")) - if (typeof message.max === "number") - object.max = options.longs === String ? String(message.max) : message.max; - else - object.max = options.longs === String ? $util.Long.prototype.toString.call(message.max) : options.longs === Number ? new $util.LongBits(message.max.low >>> 0, message.max.high >>> 0).toNumber() : message.max; - return object; - }; - - /** - * Converts this PortRange to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @instance - * @returns {Object.} JSON object - */ - PortRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PortRange - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.IpRule.PortRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PortRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.IpRule.PortRange"; - }; - - return PortRange; - })(); - - return IpRule; - })(); - - v2.Allowed = (function() { - - /** - * Properties of an Allowed. - * @memberof google.cloud.securitycenter.v2 - * @interface IAllowed - * @property {Array.|null} [ipRules] Allowed ipRules - */ - - /** - * Constructs a new Allowed. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an Allowed. - * @implements IAllowed - * @constructor - * @param {google.cloud.securitycenter.v2.IAllowed=} [properties] Properties to set - */ - function Allowed(properties) { - this.ipRules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Allowed ipRules. - * @member {Array.} ipRules - * @memberof google.cloud.securitycenter.v2.Allowed - * @instance - */ - Allowed.prototype.ipRules = $util.emptyArray; - - /** - * Creates a new Allowed instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {google.cloud.securitycenter.v2.IAllowed=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Allowed} Allowed instance - */ - Allowed.create = function create(properties) { - return new Allowed(properties); - }; - - /** - * Encodes the specified Allowed message. Does not implicitly {@link google.cloud.securitycenter.v2.Allowed.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {google.cloud.securitycenter.v2.IAllowed} message Allowed message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Allowed.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ipRules != null && message.ipRules.length) - for (var i = 0; i < message.ipRules.length; ++i) - $root.google.cloud.securitycenter.v2.IpRule.encode(message.ipRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Allowed message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Allowed.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {google.cloud.securitycenter.v2.IAllowed} message Allowed message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Allowed.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Allowed message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Allowed} Allowed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Allowed.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Allowed(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.ipRules && message.ipRules.length)) - message.ipRules = []; - message.ipRules.push($root.google.cloud.securitycenter.v2.IpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Allowed message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Allowed} Allowed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Allowed.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Allowed message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Allowed.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ipRules != null && message.hasOwnProperty("ipRules")) { - if (!Array.isArray(message.ipRules)) - return "ipRules: array expected"; - for (var i = 0; i < message.ipRules.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.IpRule.verify(message.ipRules[i]); - if (error) - return "ipRules." + error; - } - } - return null; - }; - - /** - * Creates an Allowed message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Allowed} Allowed - */ - Allowed.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Allowed) - return object; - var message = new $root.google.cloud.securitycenter.v2.Allowed(); - if (object.ipRules) { - if (!Array.isArray(object.ipRules)) - throw TypeError(".google.cloud.securitycenter.v2.Allowed.ipRules: array expected"); - message.ipRules = []; - for (var i = 0; i < object.ipRules.length; ++i) { - if (typeof object.ipRules[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Allowed.ipRules: object expected"); - message.ipRules[i] = $root.google.cloud.securitycenter.v2.IpRule.fromObject(object.ipRules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Allowed message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {google.cloud.securitycenter.v2.Allowed} message Allowed - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Allowed.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ipRules = []; - if (message.ipRules && message.ipRules.length) { - object.ipRules = []; - for (var j = 0; j < message.ipRules.length; ++j) - object.ipRules[j] = $root.google.cloud.securitycenter.v2.IpRule.toObject(message.ipRules[j], options); - } - return object; - }; - - /** - * Converts this Allowed to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Allowed - * @instance - * @returns {Object.} JSON object - */ - Allowed.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Allowed - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Allowed - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Allowed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Allowed"; - }; - - return Allowed; - })(); - - v2.Denied = (function() { - - /** - * Properties of a Denied. - * @memberof google.cloud.securitycenter.v2 - * @interface IDenied - * @property {Array.|null} [ipRules] Denied ipRules - */ - - /** - * Constructs a new Denied. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Denied. - * @implements IDenied - * @constructor - * @param {google.cloud.securitycenter.v2.IDenied=} [properties] Properties to set - */ - function Denied(properties) { - this.ipRules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Denied ipRules. - * @member {Array.} ipRules - * @memberof google.cloud.securitycenter.v2.Denied - * @instance - */ - Denied.prototype.ipRules = $util.emptyArray; - - /** - * Creates a new Denied instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {google.cloud.securitycenter.v2.IDenied=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Denied} Denied instance - */ - Denied.create = function create(properties) { - return new Denied(properties); - }; - - /** - * Encodes the specified Denied message. Does not implicitly {@link google.cloud.securitycenter.v2.Denied.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {google.cloud.securitycenter.v2.IDenied} message Denied message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Denied.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ipRules != null && message.ipRules.length) - for (var i = 0; i < message.ipRules.length; ++i) - $root.google.cloud.securitycenter.v2.IpRule.encode(message.ipRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Denied message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Denied.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {google.cloud.securitycenter.v2.IDenied} message Denied message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Denied.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Denied message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Denied} Denied - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Denied.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Denied(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.ipRules && message.ipRules.length)) - message.ipRules = []; - message.ipRules.push($root.google.cloud.securitycenter.v2.IpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Denied message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Denied} Denied - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Denied.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Denied message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Denied.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ipRules != null && message.hasOwnProperty("ipRules")) { - if (!Array.isArray(message.ipRules)) - return "ipRules: array expected"; - for (var i = 0; i < message.ipRules.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.IpRule.verify(message.ipRules[i]); - if (error) - return "ipRules." + error; - } - } - return null; - }; - - /** - * Creates a Denied message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Denied} Denied - */ - Denied.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Denied) - return object; - var message = new $root.google.cloud.securitycenter.v2.Denied(); - if (object.ipRules) { - if (!Array.isArray(object.ipRules)) - throw TypeError(".google.cloud.securitycenter.v2.Denied.ipRules: array expected"); - message.ipRules = []; - for (var i = 0; i < object.ipRules.length; ++i) { - if (typeof object.ipRules[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Denied.ipRules: object expected"); - message.ipRules[i] = $root.google.cloud.securitycenter.v2.IpRule.fromObject(object.ipRules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Denied message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {google.cloud.securitycenter.v2.Denied} message Denied - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Denied.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ipRules = []; - if (message.ipRules && message.ipRules.length) { - object.ipRules = []; - for (var j = 0; j < message.ipRules.length; ++j) - object.ipRules[j] = $root.google.cloud.securitycenter.v2.IpRule.toObject(message.ipRules[j], options); - } - return object; - }; - - /** - * Converts this Denied to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Denied - * @instance - * @returns {Object.} JSON object - */ - Denied.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Denied - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Denied - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Denied.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Denied"; - }; - - return Denied; - })(); - - v2.Job = (function() { - - /** - * Properties of a Job. - * @memberof google.cloud.securitycenter.v2 - * @interface IJob - * @property {string|null} [name] Job name - * @property {google.cloud.securitycenter.v2.JobState|null} [state] Job state - * @property {number|null} [errorCode] Job errorCode - * @property {string|null} [location] Job location - */ - - /** - * Constructs a new Job. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Job. - * @implements IJob - * @constructor - * @param {google.cloud.securitycenter.v2.IJob=} [properties] Properties to set - */ - function Job(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Job name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Job - * @instance - */ - Job.prototype.name = ""; - - /** - * Job state. - * @member {google.cloud.securitycenter.v2.JobState} state - * @memberof google.cloud.securitycenter.v2.Job - * @instance - */ - Job.prototype.state = 0; - - /** - * Job errorCode. - * @member {number} errorCode - * @memberof google.cloud.securitycenter.v2.Job - * @instance - */ - Job.prototype.errorCode = 0; - - /** - * Job location. - * @member {string} location - * @memberof google.cloud.securitycenter.v2.Job - * @instance - */ - Job.prototype.location = ""; - - /** - * Creates a new Job instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {google.cloud.securitycenter.v2.IJob=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Job} Job instance - */ - Job.create = function create(properties) { - return new Job(properties); - }; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.securitycenter.v2.Job.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {google.cloud.securitycenter.v2.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.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.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCode); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Job.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {google.cloud.securitycenter.v2.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Job message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Job(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.errorCode = reader.int32(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Job message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Job.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: - case 3: - case 4: - break; - } - if (message.errorCode != null && message.hasOwnProperty("errorCode")) - if (!$util.isInteger(message.errorCode)) - return "errorCode: integer expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Job} Job - */ - Job.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Job) - return object; - var message = new $root.google.cloud.securitycenter.v2.Job(); - 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 "JOB_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "SUCCEEDED": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - } - if (object.errorCode != null) - message.errorCode = object.errorCode | 0; - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {google.cloud.securitycenter.v2.Job} message Job - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Job.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "JOB_STATE_UNSPECIFIED" : 0; - object.errorCode = 0; - object.location = ""; - } - 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.v2.JobState[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.JobState[message.state] : message.state; - if (message.errorCode != null && message.hasOwnProperty("errorCode")) - object.errorCode = message.errorCode; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Job to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Job - * @instance - * @returns {Object.} JSON object - */ - Job.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Job - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Job - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Job"; - }; - - return Job; - })(); - - /** - * JobState enum. - * @name google.cloud.securitycenter.v2.JobState - * @enum {number} - * @property {number} JOB_STATE_UNSPECIFIED=0 JOB_STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} FAILED=4 FAILED value - */ - v2.JobState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JOB_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values[valuesById[4] = "FAILED"] = 4; - return values; - })(); - - v2.KernelRootkit = (function() { - - /** - * Properties of a KernelRootkit. - * @memberof google.cloud.securitycenter.v2 - * @interface IKernelRootkit - * @property {string|null} [name] KernelRootkit name - * @property {boolean|null} [unexpectedCodeModification] KernelRootkit unexpectedCodeModification - * @property {boolean|null} [unexpectedReadOnlyDataModification] KernelRootkit unexpectedReadOnlyDataModification - * @property {boolean|null} [unexpectedFtraceHandler] KernelRootkit unexpectedFtraceHandler - * @property {boolean|null} [unexpectedKprobeHandler] KernelRootkit unexpectedKprobeHandler - * @property {boolean|null} [unexpectedKernelCodePages] KernelRootkit unexpectedKernelCodePages - * @property {boolean|null} [unexpectedSystemCallHandler] KernelRootkit unexpectedSystemCallHandler - * @property {boolean|null} [unexpectedInterruptHandler] KernelRootkit unexpectedInterruptHandler - * @property {boolean|null} [unexpectedProcessesInRunqueue] KernelRootkit unexpectedProcessesInRunqueue - */ - - /** - * Constructs a new KernelRootkit. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a KernelRootkit. - * @implements IKernelRootkit - * @constructor - * @param {google.cloud.securitycenter.v2.IKernelRootkit=} [properties] Properties to set - */ - function KernelRootkit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KernelRootkit name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.name = ""; - - /** - * KernelRootkit unexpectedCodeModification. - * @member {boolean} unexpectedCodeModification - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedCodeModification = false; - - /** - * KernelRootkit unexpectedReadOnlyDataModification. - * @member {boolean} unexpectedReadOnlyDataModification - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedReadOnlyDataModification = false; - - /** - * KernelRootkit unexpectedFtraceHandler. - * @member {boolean} unexpectedFtraceHandler - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedFtraceHandler = false; - - /** - * KernelRootkit unexpectedKprobeHandler. - * @member {boolean} unexpectedKprobeHandler - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedKprobeHandler = false; - - /** - * KernelRootkit unexpectedKernelCodePages. - * @member {boolean} unexpectedKernelCodePages - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedKernelCodePages = false; - - /** - * KernelRootkit unexpectedSystemCallHandler. - * @member {boolean} unexpectedSystemCallHandler - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedSystemCallHandler = false; - - /** - * KernelRootkit unexpectedInterruptHandler. - * @member {boolean} unexpectedInterruptHandler - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedInterruptHandler = false; - - /** - * KernelRootkit unexpectedProcessesInRunqueue. - * @member {boolean} unexpectedProcessesInRunqueue - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - */ - KernelRootkit.prototype.unexpectedProcessesInRunqueue = false; - - /** - * Creates a new KernelRootkit instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {google.cloud.securitycenter.v2.IKernelRootkit=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.KernelRootkit} KernelRootkit instance - */ - KernelRootkit.create = function create(properties) { - return new KernelRootkit(properties); - }; - - /** - * Encodes the specified KernelRootkit message. Does not implicitly {@link google.cloud.securitycenter.v2.KernelRootkit.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {google.cloud.securitycenter.v2.IKernelRootkit} message KernelRootkit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KernelRootkit.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.unexpectedCodeModification != null && Object.hasOwnProperty.call(message, "unexpectedCodeModification")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.unexpectedCodeModification); - if (message.unexpectedReadOnlyDataModification != null && Object.hasOwnProperty.call(message, "unexpectedReadOnlyDataModification")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unexpectedReadOnlyDataModification); - if (message.unexpectedFtraceHandler != null && Object.hasOwnProperty.call(message, "unexpectedFtraceHandler")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.unexpectedFtraceHandler); - if (message.unexpectedKprobeHandler != null && Object.hasOwnProperty.call(message, "unexpectedKprobeHandler")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.unexpectedKprobeHandler); - if (message.unexpectedKernelCodePages != null && Object.hasOwnProperty.call(message, "unexpectedKernelCodePages")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.unexpectedKernelCodePages); - if (message.unexpectedSystemCallHandler != null && Object.hasOwnProperty.call(message, "unexpectedSystemCallHandler")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.unexpectedSystemCallHandler); - if (message.unexpectedInterruptHandler != null && Object.hasOwnProperty.call(message, "unexpectedInterruptHandler")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.unexpectedInterruptHandler); - if (message.unexpectedProcessesInRunqueue != null && Object.hasOwnProperty.call(message, "unexpectedProcessesInRunqueue")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.unexpectedProcessesInRunqueue); - return writer; - }; - - /** - * Encodes the specified KernelRootkit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.KernelRootkit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {google.cloud.securitycenter.v2.IKernelRootkit} message KernelRootkit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KernelRootkit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KernelRootkit message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.KernelRootkit} KernelRootkit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KernelRootkit.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.KernelRootkit(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.unexpectedCodeModification = reader.bool(); - break; - } - case 3: { - message.unexpectedReadOnlyDataModification = reader.bool(); - break; - } - case 4: { - message.unexpectedFtraceHandler = reader.bool(); - break; - } - case 5: { - message.unexpectedKprobeHandler = reader.bool(); - break; - } - case 6: { - message.unexpectedKernelCodePages = reader.bool(); - break; - } - case 7: { - message.unexpectedSystemCallHandler = reader.bool(); - break; - } - case 8: { - message.unexpectedInterruptHandler = reader.bool(); - break; - } - case 9: { - message.unexpectedProcessesInRunqueue = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KernelRootkit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.KernelRootkit} KernelRootkit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KernelRootkit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KernelRootkit message. - * @function verify - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KernelRootkit.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.unexpectedCodeModification != null && message.hasOwnProperty("unexpectedCodeModification")) - if (typeof message.unexpectedCodeModification !== "boolean") - return "unexpectedCodeModification: boolean expected"; - if (message.unexpectedReadOnlyDataModification != null && message.hasOwnProperty("unexpectedReadOnlyDataModification")) - if (typeof message.unexpectedReadOnlyDataModification !== "boolean") - return "unexpectedReadOnlyDataModification: boolean expected"; - if (message.unexpectedFtraceHandler != null && message.hasOwnProperty("unexpectedFtraceHandler")) - if (typeof message.unexpectedFtraceHandler !== "boolean") - return "unexpectedFtraceHandler: boolean expected"; - if (message.unexpectedKprobeHandler != null && message.hasOwnProperty("unexpectedKprobeHandler")) - if (typeof message.unexpectedKprobeHandler !== "boolean") - return "unexpectedKprobeHandler: boolean expected"; - if (message.unexpectedKernelCodePages != null && message.hasOwnProperty("unexpectedKernelCodePages")) - if (typeof message.unexpectedKernelCodePages !== "boolean") - return "unexpectedKernelCodePages: boolean expected"; - if (message.unexpectedSystemCallHandler != null && message.hasOwnProperty("unexpectedSystemCallHandler")) - if (typeof message.unexpectedSystemCallHandler !== "boolean") - return "unexpectedSystemCallHandler: boolean expected"; - if (message.unexpectedInterruptHandler != null && message.hasOwnProperty("unexpectedInterruptHandler")) - if (typeof message.unexpectedInterruptHandler !== "boolean") - return "unexpectedInterruptHandler: boolean expected"; - if (message.unexpectedProcessesInRunqueue != null && message.hasOwnProperty("unexpectedProcessesInRunqueue")) - if (typeof message.unexpectedProcessesInRunqueue !== "boolean") - return "unexpectedProcessesInRunqueue: boolean expected"; - return null; - }; - - /** - * Creates a KernelRootkit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.KernelRootkit} KernelRootkit - */ - KernelRootkit.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.KernelRootkit) - return object; - var message = new $root.google.cloud.securitycenter.v2.KernelRootkit(); - if (object.name != null) - message.name = String(object.name); - if (object.unexpectedCodeModification != null) - message.unexpectedCodeModification = Boolean(object.unexpectedCodeModification); - if (object.unexpectedReadOnlyDataModification != null) - message.unexpectedReadOnlyDataModification = Boolean(object.unexpectedReadOnlyDataModification); - if (object.unexpectedFtraceHandler != null) - message.unexpectedFtraceHandler = Boolean(object.unexpectedFtraceHandler); - if (object.unexpectedKprobeHandler != null) - message.unexpectedKprobeHandler = Boolean(object.unexpectedKprobeHandler); - if (object.unexpectedKernelCodePages != null) - message.unexpectedKernelCodePages = Boolean(object.unexpectedKernelCodePages); - if (object.unexpectedSystemCallHandler != null) - message.unexpectedSystemCallHandler = Boolean(object.unexpectedSystemCallHandler); - if (object.unexpectedInterruptHandler != null) - message.unexpectedInterruptHandler = Boolean(object.unexpectedInterruptHandler); - if (object.unexpectedProcessesInRunqueue != null) - message.unexpectedProcessesInRunqueue = Boolean(object.unexpectedProcessesInRunqueue); - return message; - }; - - /** - * Creates a plain object from a KernelRootkit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {google.cloud.securitycenter.v2.KernelRootkit} message KernelRootkit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KernelRootkit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.unexpectedCodeModification = false; - object.unexpectedReadOnlyDataModification = false; - object.unexpectedFtraceHandler = false; - object.unexpectedKprobeHandler = false; - object.unexpectedKernelCodePages = false; - object.unexpectedSystemCallHandler = false; - object.unexpectedInterruptHandler = false; - object.unexpectedProcessesInRunqueue = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.unexpectedCodeModification != null && message.hasOwnProperty("unexpectedCodeModification")) - object.unexpectedCodeModification = message.unexpectedCodeModification; - if (message.unexpectedReadOnlyDataModification != null && message.hasOwnProperty("unexpectedReadOnlyDataModification")) - object.unexpectedReadOnlyDataModification = message.unexpectedReadOnlyDataModification; - if (message.unexpectedFtraceHandler != null && message.hasOwnProperty("unexpectedFtraceHandler")) - object.unexpectedFtraceHandler = message.unexpectedFtraceHandler; - if (message.unexpectedKprobeHandler != null && message.hasOwnProperty("unexpectedKprobeHandler")) - object.unexpectedKprobeHandler = message.unexpectedKprobeHandler; - if (message.unexpectedKernelCodePages != null && message.hasOwnProperty("unexpectedKernelCodePages")) - object.unexpectedKernelCodePages = message.unexpectedKernelCodePages; - if (message.unexpectedSystemCallHandler != null && message.hasOwnProperty("unexpectedSystemCallHandler")) - object.unexpectedSystemCallHandler = message.unexpectedSystemCallHandler; - if (message.unexpectedInterruptHandler != null && message.hasOwnProperty("unexpectedInterruptHandler")) - object.unexpectedInterruptHandler = message.unexpectedInterruptHandler; - if (message.unexpectedProcessesInRunqueue != null && message.hasOwnProperty("unexpectedProcessesInRunqueue")) - object.unexpectedProcessesInRunqueue = message.unexpectedProcessesInRunqueue; - return object; - }; - - /** - * Converts this KernelRootkit to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @instance - * @returns {Object.} JSON object - */ - KernelRootkit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KernelRootkit - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.KernelRootkit - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KernelRootkit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.KernelRootkit"; - }; - - return KernelRootkit; - })(); - - v2.Kubernetes = (function() { - - /** - * Properties of a Kubernetes. - * @memberof google.cloud.securitycenter.v2 - * @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 - * @property {Array.|null} [objects] Kubernetes objects - */ - - /** - * Constructs a new Kubernetes. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Kubernetes. - * @implements IKubernetes - * @constructor - * @param {google.cloud.securitycenter.v2.IKubernetes=} [properties] Properties to set - */ - function Kubernetes(properties) { - this.pods = []; - this.nodes = []; - this.nodePools = []; - this.roles = []; - this.bindings = []; - this.accessReviews = []; - this.objects = []; - if (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.v2.Kubernetes - * @instance - */ - Kubernetes.prototype.pods = $util.emptyArray; - - /** - * Kubernetes nodes. - * @member {Array.} nodes - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @instance - */ - Kubernetes.prototype.nodes = $util.emptyArray; - - /** - * Kubernetes nodePools. - * @member {Array.} nodePools - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @instance - */ - Kubernetes.prototype.nodePools = $util.emptyArray; - - /** - * Kubernetes roles. - * @member {Array.} roles - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @instance - */ - Kubernetes.prototype.roles = $util.emptyArray; - - /** - * Kubernetes bindings. - * @member {Array.} bindings - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @instance - */ - Kubernetes.prototype.bindings = $util.emptyArray; - - /** - * Kubernetes accessReviews. - * @member {Array.} accessReviews - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @instance - */ - Kubernetes.prototype.accessReviews = $util.emptyArray; - - /** - * Kubernetes objects. - * @member {Array.} objects - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @instance - */ - Kubernetes.prototype.objects = $util.emptyArray; - - /** - * Creates a new Kubernetes instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @static - * @param {google.cloud.securitycenter.v2.IKubernetes=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Kubernetes} Kubernetes instance - */ - Kubernetes.create = function create(properties) { - return new Kubernetes(properties); - }; - - /** - * Encodes the specified Kubernetes message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.AccessReview.encode(message.accessReviews[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.objects != null && message.objects.length) - for (var i = 0; i < message.objects.length; ++i) - $root.google.cloud.securitycenter.v2.Kubernetes.Object.encode(message.objects[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Kubernetes message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.pods && message.pods.length)) - message.pods = []; - message.pods.push($root.google.cloud.securitycenter.v2.Kubernetes.Pod.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.securitycenter.v2.Kubernetes.Node.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nodePools && message.nodePools.length)) - message.nodePools = []; - message.nodePools.push($root.google.cloud.securitycenter.v2.Kubernetes.NodePool.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.roles && message.roles.length)) - message.roles = []; - message.roles.push($root.google.cloud.securitycenter.v2.Kubernetes.Role.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.cloud.securitycenter.v2.Kubernetes.Binding.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.accessReviews && message.accessReviews.length)) - message.accessReviews = []; - message.accessReviews.push($root.google.cloud.securitycenter.v2.Kubernetes.AccessReview.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.objects && message.objects.length)) - message.objects = []; - message.objects.push($root.google.cloud.securitycenter.v2.Kubernetes.Object.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.v2.Kubernetes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.AccessReview.verify(message.accessReviews[i]); - if (error) - return "accessReviews." + error; - } - } - if (message.objects != null && message.hasOwnProperty("objects")) { - if (!Array.isArray(message.objects)) - return "objects: array expected"; - for (var i = 0; i < message.objects.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.Kubernetes.Object.verify(message.objects[i]); - if (error) - return "objects." + 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.v2.Kubernetes - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes} Kubernetes - */ - Kubernetes.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes) - return object; - var message = new $root.google.cloud.securitycenter.v2.Kubernetes(); - if (object.pods) { - if (!Array.isArray(object.pods)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.pods: object expected"); - message.pods[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Pod.fromObject(object.pods[i]); - } - } - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.nodes: object expected"); - message.nodes[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Node.fromObject(object.nodes[i]); - } - } - if (object.nodePools) { - if (!Array.isArray(object.nodePools)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.nodePools: object expected"); - message.nodePools[i] = $root.google.cloud.securitycenter.v2.Kubernetes.NodePool.fromObject(object.nodePools[i]); - } - } - if (object.roles) { - if (!Array.isArray(object.roles)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.roles: object expected"); - message.roles[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Role.fromObject(object.roles[i]); - } - } - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.bindings: object expected"); - message.bindings[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Binding.fromObject(object.bindings[i]); - } - } - if (object.accessReviews) { - if (!Array.isArray(object.accessReviews)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.accessReviews: object expected"); - message.accessReviews[i] = $root.google.cloud.securitycenter.v2.Kubernetes.AccessReview.fromObject(object.accessReviews[i]); - } - } - if (object.objects) { - if (!Array.isArray(object.objects)) - throw TypeError(".google.cloud.securitycenter.v2.Kubernetes.objects: array expected"); - message.objects = []; - for (var i = 0; i < object.objects.length; ++i) { - if (typeof object.objects[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Kubernetes.objects: object expected"); - message.objects[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Object.fromObject(object.objects[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.v2.Kubernetes - * @static - * @param {google.cloud.securitycenter.v2.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 = []; - object.objects = []; - } - if (message.pods && message.pods.length) { - object.pods = []; - for (var j = 0; j < message.pods.length; ++j) - object.pods[j] = $root.google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.AccessReview.toObject(message.accessReviews[j], options); - } - if (message.objects && message.objects.length) { - object.objects = []; - for (var j = 0; j < message.objects.length; ++j) - object.objects[j] = $root.google.cloud.securitycenter.v2.Kubernetes.Object.toObject(message.objects[j], options); - } - return object; - }; - - /** - * Converts this Kubernetes to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @instance - * @returns {Object.} JSON object - */ - Kubernetes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Kubernetes - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes"; - }; - - Kubernetes.Pod = (function() { - - /** - * Properties of a Pod. - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes - * @classdesc Represents a Pod. - * @implements IPod - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod - * @instance - */ - Pod.prototype.ns = ""; - - /** - * Pod name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod - * @instance - */ - Pod.prototype.name = ""; - - /** - * Pod labels. - * @member {Array.} labels - * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod - * @instance - */ - Pod.prototype.labels = $util.emptyArray; - - /** - * Pod containers. - * @member {Array.} containers - * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod - * @instance - */ - Pod.prototype.containers = $util.emptyArray; - - /** - * Creates a new Pod instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.IPod=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.Kubernetes.Pod.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Pod(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Label.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Pod - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes.Pod} Pod - */ - Pod.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Pod) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.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.v2.Kubernetes.Pod.labels: object expected"); - message.labels[i] = $root.google.cloud.securitycenter.v2.Label.fromObject(object.labels[i]); - } - } - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod.containers: object expected"); - message.containers[i] = $root.google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Container.toObject(message.containers[j], options); - } - return object; - }; - - /** - * Converts this Pod to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Kubernetes.Pod - * @instance - * @returns {Object.} JSON object - */ - Pod.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Pod - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Pod"; - }; - - return Pod; - })(); - - Kubernetes.Node = (function() { - - /** - * Properties of a Node. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @interface INode - * @property {string|null} [name] Node name - */ - - /** - * Constructs a new Node. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node - * @instance - */ - Node.prototype.name = ""; - - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes.Node - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.INode=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes.Node - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.Node - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Kubernetes.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Kubernetes.Node - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Node) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Kubernetes.Node - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Node - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Node"; - }; - - return Node; - })(); - - Kubernetes.NodePool = (function() { - - /** - * Properties of a NodePool. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @interface INodePool - * @property {string|null} [name] NodePool name - * @property {Array.|null} [nodes] NodePool nodes - */ - - /** - * Constructs a new NodePool. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @classdesc Represents a NodePool. - * @implements INodePool - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool - * @instance - */ - NodePool.prototype.name = ""; - - /** - * NodePool nodes. - * @member {Array.} nodes - * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool - * @instance - */ - NodePool.prototype.nodes = $util.emptyArray; - - /** - * Creates a new NodePool instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.INodePool=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Kubernetes.NodePool} NodePool instance - */ - NodePool.create = function create(properties) { - return new NodePool(properties); - }; - - /** - * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.NodePool.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.INodePool} message NodePool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodePool.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.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.securitycenter.v2.Kubernetes.Node.encode(message.nodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.NodePool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.INodePool} message NodePool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodePool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodePool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool} NodePool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodePool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.NodePool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Kubernetes.Node.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodePool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Kubernetes.NodePool} NodePool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodePool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodePool message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodePool.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.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.v2.Kubernetes.Node.verify(message.nodes[i]); - if (error) - return "nodes." + 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.v2.Kubernetes.NodePool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes.NodePool} NodePool - */ - NodePool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.NodePool) - return object; - var message = new $root.google.cloud.securitycenter.v2.Kubernetes.NodePool(); - if (object.name != null) - message.name = String(object.name); - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool.nodes: object expected"); - message.nodes[i] = $root.google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Node.toObject(message.nodes[j], options); - } - return object; - }; - - /** - * Converts this NodePool to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Kubernetes.NodePool - * @instance - * @returns {Object.} JSON object - */ - NodePool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodePool - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.NodePool"; - }; - - return NodePool; - })(); - - Kubernetes.Role = (function() { - - /** - * Properties of a Role. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @interface IRole - * @property {google.cloud.securitycenter.v2.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.v2.Kubernetes - * @classdesc Represents a Role. - * @implements IRole - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Role.Kind} kind - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @instance - */ - Role.prototype.kind = 0; - - /** - * Role ns. - * @member {string} ns - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @instance - */ - Role.prototype.ns = ""; - - /** - * Role name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @instance - */ - Role.prototype.name = ""; - - /** - * Creates a new Role instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.IRole=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.Kubernetes.Role.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Role.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Role(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Kubernetes.Role - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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 Role message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes.Role} Role - */ - Role.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Role) - return object; - var message = new $root.google.cloud.securitycenter.v2.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; - 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 Role message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.Role} message Role - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Role.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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.v2.Kubernetes.Role.Kind[message.kind] === undefined ? message.kind : $root.google.cloud.securitycenter.v2.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 Role to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Kubernetes.Role - * @instance - * @returns {Object.} JSON object - */ - Role.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Role - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Role"; - }; - - /** - * Kind enum. - * @name google.cloud.securitycenter.v2.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; - })(); - - return Role; - })(); - - Kubernetes.Binding = (function() { - - /** - * Properties of a Binding. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @interface IBinding - * @property {string|null} [ns] Binding ns - * @property {string|null} [name] Binding name - * @property {google.cloud.securitycenter.v2.Kubernetes.IRole|null} [role] Binding role - * @property {Array.|null} [subjects] Binding subjects - */ - - /** - * Constructs a new Binding. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.cloud.securitycenter.v2.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]]; - } - - /** - * Binding ns. - * @member {string} ns - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @instance - */ - Binding.prototype.ns = ""; - - /** - * Binding name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @instance - */ - Binding.prototype.name = ""; - - /** - * Binding role. - * @member {google.cloud.securitycenter.v2.Kubernetes.IRole|null|undefined} role - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @instance - */ - Binding.prototype.role = null; - - /** - * Binding subjects. - * @member {Array.} subjects - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @instance - */ - Binding.prototype.subjects = $util.emptyArray; - - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.IBinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Kubernetes.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Binding.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Kubernetes.Subject.encode(message.subjects[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Kubernetes.Role.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.subjects && message.subjects.length)) - message.subjects = []; - message.subjects.push($root.google.cloud.securitycenter.v2.Kubernetes.Subject.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.cloud.securitycenter.v2.Kubernetes.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.Kubernetes.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Binding) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Kubernetes.Binding.role: object expected"); - message.role = $root.google.cloud.securitycenter.v2.Kubernetes.Role.fromObject(object.role); - } - if (object.subjects) { - if (!Array.isArray(object.subjects)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Kubernetes.Binding.subjects: object expected"); - message.subjects[i] = $root.google.cloud.securitycenter.v2.Kubernetes.Subject.fromObject(object.subjects[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Kubernetes.Subject.toObject(message.subjects[j], options); - } - return object; - }; - - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Kubernetes.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Binding - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Binding"; - }; - - return Binding; - })(); - - Kubernetes.Subject = (function() { - - /** - * Properties of a Subject. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @interface ISubject - * @property {google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType|null} [kind] Subject kind - * @property {string|null} [ns] Subject ns - * @property {string|null} [name] Subject name - */ - - /** - * Constructs a new Subject. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @classdesc Represents a Subject. - * @implements ISubject - * @constructor - * @param {google.cloud.securitycenter.v2.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]]; - } - - /** - * Subject kind. - * @member {google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType} kind - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @instance - */ - Subject.prototype.kind = 0; - - /** - * Subject ns. - * @member {string} ns - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @instance - */ - Subject.prototype.ns = ""; - - /** - * Subject name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @instance - */ - Subject.prototype.name = ""; - - /** - * Creates a new Subject instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.ISubject=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.Kubernetes.Subject.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Subject.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Subject(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Kubernetes.Subject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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; - }; - - /** - * Creates a Subject message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes.Subject} Subject - */ - Subject.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Subject) - return object; - var message = new $root.google.cloud.securitycenter.v2.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; - 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; - }; - - /** - * Creates a plain object from a Subject message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Kubernetes.Subject.AuthType[message.kind] === undefined ? message.kind : $root.google.cloud.securitycenter.v2.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; - }; - - /** - * Converts this Subject to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Kubernetes.Subject - * @instance - * @returns {Object.} JSON object - */ - Subject.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Subject - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.Subject"; - }; - - /** - * AuthType enum. - * @name google.cloud.securitycenter.v2.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; - })(); - - return Subject; - })(); - - Kubernetes.AccessReview = (function() { - - /** - * Properties of an AccessReview. - * @memberof google.cloud.securitycenter.v2.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 - */ - - /** - * Constructs a new AccessReview. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @classdesc Represents an AccessReview. - * @implements IAccessReview - * @constructor - * @param {google.cloud.securitycenter.v2.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]]; - } - - /** - * AccessReview group. - * @member {string} group - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.group = ""; - - /** - * AccessReview ns. - * @member {string} ns - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.ns = ""; - - /** - * AccessReview name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.name = ""; - - /** - * AccessReview resource. - * @member {string} resource - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.resource = ""; - - /** - * AccessReview subresource. - * @member {string} subresource - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.subresource = ""; - - /** - * AccessReview verb. - * @member {string} verb - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.verb = ""; - - /** - * AccessReview version. - * @member {string} version - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @instance - */ - AccessReview.prototype.version = ""; - - /** - * Creates a new AccessReview instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.IAccessReview=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Kubernetes.AccessReview} AccessReview instance - */ - AccessReview.create = function create(properties) { - return new AccessReview(properties); - }; - - /** - * Encodes the specified AccessReview message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.AccessReview.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @static - * @param {google.cloud.securitycenter.v2.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 AccessReview message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.AccessReview.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @static - * @param {google.cloud.securitycenter.v2.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 an AccessReview message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.AccessReview(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 an AccessReview message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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()); - }; - - /** - * Verifies an AccessReview message. - * @function verify - * @memberof google.cloud.securitycenter.v2.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 an AccessReview message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes.AccessReview} AccessReview - */ - AccessReview.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.AccessReview) - return object; - var message = new $root.google.cloud.securitycenter.v2.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; - }; - - /** - * Creates a plain object from an AccessReview message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @static - * @param {google.cloud.securitycenter.v2.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; - }; - - /** - * Converts this AccessReview to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Kubernetes.AccessReview - * @instance - * @returns {Object.} JSON object - */ - AccessReview.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AccessReview - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Kubernetes.AccessReview"; - }; - - return AccessReview; - })(); - - Kubernetes.Object = (function() { - - /** - * Properties of an Object. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @interface IObject - * @property {string|null} [group] Object group - * @property {string|null} [kind] Object kind - * @property {string|null} [ns] Object ns - * @property {string|null} [name] Object name - * @property {Array.|null} [containers] Object containers - */ - - /** - * Constructs a new Object. - * @memberof google.cloud.securitycenter.v2.Kubernetes - * @classdesc Represents an Object. - * @implements IObject - * @constructor - * @param {google.cloud.securitycenter.v2.Kubernetes.IObject=} [properties] Properties to set - */ - function Object(properties) { - 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]]; - } - - /** - * Object group. - * @member {string} group - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @instance - */ - Object.prototype.group = ""; - - /** - * Object kind. - * @member {string} kind - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @instance - */ - Object.prototype.kind = ""; - - /** - * Object ns. - * @member {string} ns - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @instance - */ - Object.prototype.ns = ""; - - /** - * Object name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @instance - */ - Object.prototype.name = ""; - - /** - * Object containers. - * @member {Array.} containers - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @instance - */ - Object.prototype.containers = $util.emptyArray; - - /** - * Creates a new Object instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.IObject=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Kubernetes.Object} Object instance - */ - Object.create = function create(properties) { - return new Object(properties); - }; - - /** - * Encodes the specified Object message. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Object.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.IObject} message Object message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Object.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.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); - if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ns); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.securitycenter.v2.Container.encode(message.containers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Object message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Kubernetes.Object.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.IObject} message Object message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Object.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Object message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Kubernetes.Object} Object - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Object.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Kubernetes.Object(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.group = reader.string(); - break; - } - case 2: { - message.kind = reader.string(); - break; - } - case 3: { - message.ns = reader.string(); - break; - } - case 4: { - message.name = reader.string(); - break; - } - case 5: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.securitycenter.v2.Container.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Object message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Kubernetes.Object} Object - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Object.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Object message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Object.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.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: 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.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.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - return null; - }; - - /** - * Creates an Object message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Kubernetes.Object} Object - */ - Object.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Kubernetes.Object) - return object; - var message = new $root.google.cloud.securitycenter.v2.Kubernetes.Object(); - if (object.group != null) - message.group = String(object.group); - if (object.kind != null) - message.kind = String(object.kind); - if (object.ns != null) - message.ns = String(object.ns); - if (object.name != null) - message.name = String(object.name); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.securitycenter.v2.Kubernetes.Object.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.v2.Kubernetes.Object.containers: object expected"); - message.containers[i] = $root.google.cloud.securitycenter.v2.Container.fromObject(object.containers[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Object message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {google.cloud.securitycenter.v2.Kubernetes.Object} message Object - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Object.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.containers = []; - if (options.defaults) { - object.group = ""; - object.kind = ""; - object.ns = ""; - object.name = ""; - } - if (message.group != null && message.hasOwnProperty("group")) - object.group = message.group; - if (message.kind != null && message.hasOwnProperty("kind")) - object.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; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.securitycenter.v2.Container.toObject(message.containers[j], options); - } - return object; - }; - - /** - * Converts this Object to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @instance - * @returns {Object.} JSON object - */ - Object.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Object - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Kubernetes.Object - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Object.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Kubernetes.Object"; - }; - - return Object; - })(); - - return Kubernetes; - })(); - - v2.LoadBalancer = (function() { - - /** - * Properties of a LoadBalancer. - * @memberof google.cloud.securitycenter.v2 - * @interface ILoadBalancer - * @property {string|null} [name] LoadBalancer name - */ - - /** - * Constructs a new LoadBalancer. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a LoadBalancer. - * @implements ILoadBalancer - * @constructor - * @param {google.cloud.securitycenter.v2.ILoadBalancer=} [properties] Properties to set - */ - function LoadBalancer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LoadBalancer name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @instance - */ - LoadBalancer.prototype.name = ""; - - /** - * Creates a new LoadBalancer instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {google.cloud.securitycenter.v2.ILoadBalancer=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.LoadBalancer} LoadBalancer instance - */ - LoadBalancer.create = function create(properties) { - return new LoadBalancer(properties); - }; - - /** - * Encodes the specified LoadBalancer message. Does not implicitly {@link google.cloud.securitycenter.v2.LoadBalancer.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {google.cloud.securitycenter.v2.ILoadBalancer} message LoadBalancer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoadBalancer.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 LoadBalancer message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.LoadBalancer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {google.cloud.securitycenter.v2.ILoadBalancer} message LoadBalancer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoadBalancer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LoadBalancer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.LoadBalancer} LoadBalancer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoadBalancer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.LoadBalancer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LoadBalancer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.LoadBalancer} LoadBalancer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoadBalancer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LoadBalancer message. - * @function verify - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LoadBalancer.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 LoadBalancer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.LoadBalancer} LoadBalancer - */ - LoadBalancer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.LoadBalancer) - return object; - var message = new $root.google.cloud.securitycenter.v2.LoadBalancer(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a LoadBalancer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {google.cloud.securitycenter.v2.LoadBalancer} message LoadBalancer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LoadBalancer.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 LoadBalancer to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @instance - * @returns {Object.} JSON object - */ - LoadBalancer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LoadBalancer - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.LoadBalancer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LoadBalancer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.LoadBalancer"; - }; - - return LoadBalancer; - })(); - - v2.LogEntry = (function() { - - /** - * Properties of a LogEntry. - * @memberof google.cloud.securitycenter.v2 - * @interface ILogEntry - * @property {google.cloud.securitycenter.v2.ICloudLoggingEntry|null} [cloudLoggingEntry] LogEntry cloudLoggingEntry - */ - - /** - * Constructs a new LogEntry. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a LogEntry. - * @implements ILogEntry - * @constructor - * @param {google.cloud.securitycenter.v2.ILogEntry=} [properties] Properties to set - */ - function LogEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LogEntry cloudLoggingEntry. - * @member {google.cloud.securitycenter.v2.ICloudLoggingEntry|null|undefined} cloudLoggingEntry - * @memberof google.cloud.securitycenter.v2.LogEntry - * @instance - */ - LogEntry.prototype.cloudLoggingEntry = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LogEntry logEntry. - * @member {"cloudLoggingEntry"|undefined} logEntry - * @memberof google.cloud.securitycenter.v2.LogEntry - * @instance - */ - Object.defineProperty(LogEntry.prototype, "logEntry", { - get: $util.oneOfGetter($oneOfFields = ["cloudLoggingEntry"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LogEntry instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {google.cloud.securitycenter.v2.ILogEntry=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.LogEntry} LogEntry instance - */ - LogEntry.create = function create(properties) { - return new LogEntry(properties); - }; - - /** - * Encodes the specified LogEntry message. Does not implicitly {@link google.cloud.securitycenter.v2.LogEntry.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {google.cloud.securitycenter.v2.ILogEntry} message LogEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cloudLoggingEntry != null && Object.hasOwnProperty.call(message, "cloudLoggingEntry")) - $root.google.cloud.securitycenter.v2.CloudLoggingEntry.encode(message.cloudLoggingEntry, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.LogEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {google.cloud.securitycenter.v2.ILogEntry} message LogEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LogEntry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.LogEntry} LogEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogEntry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.LogEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cloudLoggingEntry = $root.google.cloud.securitycenter.v2.CloudLoggingEntry.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LogEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.LogEntry} LogEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LogEntry message. - * @function verify - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudLoggingEntry != null && message.hasOwnProperty("cloudLoggingEntry")) { - properties.logEntry = 1; - { - var error = $root.google.cloud.securitycenter.v2.CloudLoggingEntry.verify(message.cloudLoggingEntry); - if (error) - return "cloudLoggingEntry." + error; - } - } - return null; - }; - - /** - * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.LogEntry} LogEntry - */ - LogEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.LogEntry) - return object; - var message = new $root.google.cloud.securitycenter.v2.LogEntry(); - if (object.cloudLoggingEntry != null) { - if (typeof object.cloudLoggingEntry !== "object") - throw TypeError(".google.cloud.securitycenter.v2.LogEntry.cloudLoggingEntry: object expected"); - message.cloudLoggingEntry = $root.google.cloud.securitycenter.v2.CloudLoggingEntry.fromObject(object.cloudLoggingEntry); - } - return message; - }; - - /** - * Creates a plain object from a LogEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {google.cloud.securitycenter.v2.LogEntry} message LogEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cloudLoggingEntry != null && message.hasOwnProperty("cloudLoggingEntry")) { - object.cloudLoggingEntry = $root.google.cloud.securitycenter.v2.CloudLoggingEntry.toObject(message.cloudLoggingEntry, options); - if (options.oneofs) - object.logEntry = "cloudLoggingEntry"; - } - return object; - }; - - /** - * Converts this LogEntry to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.LogEntry - * @instance - * @returns {Object.} JSON object - */ - LogEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LogEntry - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.LogEntry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.LogEntry"; - }; - - return LogEntry; - })(); - - v2.CloudLoggingEntry = (function() { - - /** - * Properties of a CloudLoggingEntry. - * @memberof google.cloud.securitycenter.v2 - * @interface ICloudLoggingEntry - * @property {string|null} [insertId] CloudLoggingEntry insertId - * @property {string|null} [logId] CloudLoggingEntry logId - * @property {string|null} [resourceContainer] CloudLoggingEntry resourceContainer - * @property {google.protobuf.ITimestamp|null} [timestamp] CloudLoggingEntry timestamp - */ - - /** - * Constructs a new CloudLoggingEntry. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CloudLoggingEntry. - * @implements ICloudLoggingEntry - * @constructor - * @param {google.cloud.securitycenter.v2.ICloudLoggingEntry=} [properties] Properties to set - */ - function CloudLoggingEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudLoggingEntry insertId. - * @member {string} insertId - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @instance - */ - CloudLoggingEntry.prototype.insertId = ""; - - /** - * CloudLoggingEntry logId. - * @member {string} logId - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @instance - */ - CloudLoggingEntry.prototype.logId = ""; - - /** - * CloudLoggingEntry resourceContainer. - * @member {string} resourceContainer - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @instance - */ - CloudLoggingEntry.prototype.resourceContainer = ""; - - /** - * CloudLoggingEntry timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @instance - */ - CloudLoggingEntry.prototype.timestamp = null; - - /** - * Creates a new CloudLoggingEntry instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {google.cloud.securitycenter.v2.ICloudLoggingEntry=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CloudLoggingEntry} CloudLoggingEntry instance - */ - CloudLoggingEntry.create = function create(properties) { - return new CloudLoggingEntry(properties); - }; - - /** - * Encodes the specified CloudLoggingEntry message. Does not implicitly {@link google.cloud.securitycenter.v2.CloudLoggingEntry.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {google.cloud.securitycenter.v2.ICloudLoggingEntry} message CloudLoggingEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.insertId != null && Object.hasOwnProperty.call(message, "insertId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.insertId); - if (message.logId != null && Object.hasOwnProperty.call(message, "logId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.logId); - if (message.resourceContainer != null && Object.hasOwnProperty.call(message, "resourceContainer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceContainer); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudLoggingEntry message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CloudLoggingEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {google.cloud.securitycenter.v2.ICloudLoggingEntry} message CloudLoggingEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudLoggingEntry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.CloudLoggingEntry} CloudLoggingEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingEntry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CloudLoggingEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.insertId = reader.string(); - break; - } - case 2: { - message.logId = reader.string(); - break; - } - case 3: { - message.resourceContainer = reader.string(); - break; - } - case 4: { - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudLoggingEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.CloudLoggingEntry} CloudLoggingEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudLoggingEntry message. - * @function verify - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudLoggingEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.insertId != null && message.hasOwnProperty("insertId")) - if (!$util.isString(message.insertId)) - return "insertId: string expected"; - if (message.logId != null && message.hasOwnProperty("logId")) - if (!$util.isString(message.logId)) - return "logId: string expected"; - if (message.resourceContainer != null && message.hasOwnProperty("resourceContainer")) - if (!$util.isString(message.resourceContainer)) - return "resourceContainer: string expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - return null; - }; - - /** - * Creates a CloudLoggingEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CloudLoggingEntry} CloudLoggingEntry - */ - CloudLoggingEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CloudLoggingEntry) - return object; - var message = new $root.google.cloud.securitycenter.v2.CloudLoggingEntry(); - if (object.insertId != null) - message.insertId = String(object.insertId); - if (object.logId != null) - message.logId = String(object.logId); - if (object.resourceContainer != null) - message.resourceContainer = String(object.resourceContainer); - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CloudLoggingEntry.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - return message; - }; - - /** - * Creates a plain object from a CloudLoggingEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {google.cloud.securitycenter.v2.CloudLoggingEntry} message CloudLoggingEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudLoggingEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.insertId = ""; - object.logId = ""; - object.resourceContainer = ""; - object.timestamp = null; - } - if (message.insertId != null && message.hasOwnProperty("insertId")) - object.insertId = message.insertId; - if (message.logId != null && message.hasOwnProperty("logId")) - object.logId = message.logId; - if (message.resourceContainer != null && message.hasOwnProperty("resourceContainer")) - object.resourceContainer = message.resourceContainer; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - return object; - }; - - /** - * Converts this CloudLoggingEntry to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @instance - * @returns {Object.} JSON object - */ - CloudLoggingEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudLoggingEntry - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.CloudLoggingEntry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudLoggingEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.CloudLoggingEntry"; - }; - - return CloudLoggingEntry; - })(); - - v2.MitreAttack = (function() { - - /** - * Properties of a MitreAttack. - * @memberof google.cloud.securitycenter.v2 - * @interface IMitreAttack - * @property {google.cloud.securitycenter.v2.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.v2 - * @classdesc Represents a MitreAttack. - * @implements IMitreAttack - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.MitreAttack.Tactic} primaryTactic - * @memberof google.cloud.securitycenter.v2.MitreAttack - * @instance - */ - MitreAttack.prototype.primaryTactic = 0; - - /** - * MitreAttack primaryTechniques. - * @member {Array.} primaryTechniques - * @memberof google.cloud.securitycenter.v2.MitreAttack - * @instance - */ - MitreAttack.prototype.primaryTechniques = $util.emptyArray; - - /** - * MitreAttack additionalTactics. - * @member {Array.} additionalTactics - * @memberof google.cloud.securitycenter.v2.MitreAttack - * @instance - */ - MitreAttack.prototype.additionalTactics = $util.emptyArray; - - /** - * MitreAttack additionalTechniques. - * @member {Array.} additionalTechniques - * @memberof google.cloud.securitycenter.v2.MitreAttack - * @instance - */ - MitreAttack.prototype.additionalTechniques = $util.emptyArray; - - /** - * MitreAttack version. - * @member {string} version - * @memberof google.cloud.securitycenter.v2.MitreAttack - * @instance - */ - MitreAttack.prototype.version = ""; - - /** - * Creates a new MitreAttack instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.MitreAttack - * @static - * @param {google.cloud.securitycenter.v2.IMitreAttack=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.MitreAttack} MitreAttack instance - */ - MitreAttack.create = function create(properties) { - return new MitreAttack(properties); - }; - - /** - * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v2.MitreAttack.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.MitreAttack - * @static - * @param {google.cloud.securitycenter.v2.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.v2.MitreAttack.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.MitreAttack - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.MitreAttack(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.MitreAttack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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 70: - case 71: - case 114: - case 115: - case 122: - case 117: - case 68: - case 72: - case 73: - case 74: - case 75: - case 120: - case 118: - case 49: - case 50: - case 37: - case 38: - case 32: - case 89: - case 119: - case 90: - case 93: - case 103: - case 104: - case 56: - case 6: - case 7: - case 59: - case 63: - case 18: - case 19: - case 123: - case 124: - case 125: - case 64: - case 128: - case 126: - case 45: - case 46: - case 47: - case 14: - case 35: - case 15: - case 16: - case 121: - case 116: - case 9: - case 10: - case 11: - case 22: - case 40: - case 67: - case 23: - case 58: - case 76: - case 3: - case 4: - case 44: - case 94: - case 5: - case 77: - case 78: - case 33: - case 39: - case 79: - case 80: - case 95: - case 27: - case 129: - case 130: - case 134: - case 69: - case 135: - case 30: - case 29: - case 132: - case 52: - case 36: - case 81: - case 8: - case 17: - case 48: - case 42: - case 51: - case 91: - case 25: - case 24: - case 65: - case 82: - case 83: - case 127: - case 34: - case 136: - case 109: - case 13: - case 105: - case 96: - case 97: - case 106: - case 107: - case 84: - case 98: - case 28: - case 108: - case 137: - case 31: - case 55: - case 110: - case 111: - case 85: - case 86: - case 87: - case 20: - case 21: - case 12: - case 41: - case 112: - case 113: - case 26: - case 54: - case 53: - case 99: - case 100: - case 43: - case 101: - case 133: - case 1: - case 2: - case 88: - case 102: - case 60: - case 66: - case 61: - case 57: - case 92: - case 62: - case 131: - 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 70: - case 71: - case 114: - case 115: - case 122: - case 117: - case 68: - case 72: - case 73: - case 74: - case 75: - case 120: - case 118: - case 49: - case 50: - case 37: - case 38: - case 32: - case 89: - case 119: - case 90: - case 93: - case 103: - case 104: - case 56: - case 6: - case 7: - case 59: - case 63: - case 18: - case 19: - case 123: - case 124: - case 125: - case 64: - case 128: - case 126: - case 45: - case 46: - case 47: - case 14: - case 35: - case 15: - case 16: - case 121: - case 116: - case 9: - case 10: - case 11: - case 22: - case 40: - case 67: - case 23: - case 58: - case 76: - case 3: - case 4: - case 44: - case 94: - case 5: - case 77: - case 78: - case 33: - case 39: - case 79: - case 80: - case 95: - case 27: - case 129: - case 130: - case 134: - case 69: - case 135: - case 30: - case 29: - case 132: - case 52: - case 36: - case 81: - case 8: - case 17: - case 48: - case 42: - case 51: - case 91: - case 25: - case 24: - case 65: - case 82: - case 83: - case 127: - case 34: - case 136: - case 109: - case 13: - case 105: - case 96: - case 97: - case 106: - case 107: - case 84: - case 98: - case 28: - case 108: - case 137: - case 31: - case 55: - case 110: - case 111: - case 85: - case 86: - case 87: - case 20: - case 21: - case 12: - case 41: - case 112: - case 113: - case 26: - case 54: - case 53: - case 99: - case 100: - case 43: - case 101: - case 133: - case 1: - case 2: - case 88: - case 102: - case 60: - case 66: - case 61: - case 57: - case 92: - case 62: - case 131: - 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.v2.MitreAttack - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.MitreAttack} MitreAttack - */ - MitreAttack.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.MitreAttack) - return object; - var message = new $root.google.cloud.securitycenter.v2.MitreAttack(); - switch (object.primaryTactic) { - default: - if (typeof object.primaryTactic === "number") { - message.primaryTactic = object.primaryTactic; - break; - } - break; - 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.v2.MitreAttack.primaryTechniques: array expected"); - message.primaryTechniques = []; - 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; - break; - case "DATA_OBFUSCATION": - case 70: - message.primaryTechniques[i] = 70; - break; - case "DATA_OBFUSCATION_STEGANOGRAPHY": - case 71: - message.primaryTechniques[i] = 71; - break; - case "OS_CREDENTIAL_DUMPING": - case 114: - message.primaryTechniques[i] = 114; - break; - case "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM": - case 115: - message.primaryTechniques[i] = 115; - break; - case "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW": - case 122: - message.primaryTechniques[i] = 122; - break; - case "DATA_FROM_LOCAL_SYSTEM": - case 117: - message.primaryTechniques[i] = 117; - break; - case "AUTOMATED_EXFILTRATION": - case 68: - message.primaryTechniques[i] = 68; - break; - case "OBFUSCATED_FILES_OR_INFO": - case 72: - message.primaryTechniques[i] = 72; - break; - case "STEGANOGRAPHY": - case 73: - message.primaryTechniques[i] = 73; - break; - case "COMPILE_AFTER_DELIVERY": - case 74: - message.primaryTechniques[i] = 74; - break; - case "COMMAND_OBFUSCATION": - case 75: - message.primaryTechniques[i] = 75; - break; - case "SCHEDULED_TRANSFER": - case 120: - message.primaryTechniques[i] = 120; - break; - case "SYSTEM_OWNER_USER_DISCOVERY": - case 118: - message.primaryTechniques[i] = 118; - break; - case "MASQUERADING": - case 49: - message.primaryTechniques[i] = 49; - break; - case "MATCH_LEGITIMATE_NAME_OR_LOCATION": - case 50: - message.primaryTechniques[i] = 50; - break; - case "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": - case 37: - message.primaryTechniques[i] = 37; - break; - case "STARTUP_ITEMS": - case 38: - message.primaryTechniques[i] = 38; - break; - case "NETWORK_SERVICE_DISCOVERY": - case 32: - message.primaryTechniques[i] = 32; - break; - case "SCHEDULED_TASK_JOB": - case 89: - message.primaryTechniques[i] = 89; - break; - case "SCHEDULED_TASK_JOB_CRON": - case 119: - message.primaryTechniques[i] = 119; - break; - case "CONTAINER_ORCHESTRATION_JOB": - case 90: - message.primaryTechniques[i] = 90; - break; - case "PROCESS_INJECTION": - case 93: - message.primaryTechniques[i] = 93; - break; - case "INPUT_CAPTURE": - case 103: - message.primaryTechniques[i] = 103; - break; - case "INPUT_CAPTURE_KEYLOGGING": - case 104: - message.primaryTechniques[i] = 104; - break; - case "PROCESS_DISCOVERY": - case 56: - message.primaryTechniques[i] = 56; - break; - case "COMMAND_AND_SCRIPTING_INTERPRETER": - case 6: - message.primaryTechniques[i] = 6; - break; - case "UNIX_SHELL": - case 7: - message.primaryTechniques[i] = 7; - break; - case "PYTHON": - case 59: - message.primaryTechniques[i] = 59; - break; - case "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": - case 63: - message.primaryTechniques[i] = 63; - break; - case "PERMISSION_GROUPS_DISCOVERY": - case 18: - message.primaryTechniques[i] = 18; - break; - case "CLOUD_GROUPS": - case 19: - message.primaryTechniques[i] = 19; - break; - case "INDICATOR_REMOVAL": - case 123: - message.primaryTechniques[i] = 123; - break; - case "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS": - case 124: - message.primaryTechniques[i] = 124; - break; - case "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY": - case 125: - message.primaryTechniques[i] = 125; - break; - case "INDICATOR_REMOVAL_FILE_DELETION": - case 64: - message.primaryTechniques[i] = 64; - break; - case "INDICATOR_REMOVAL_TIMESTOMP": - case 128: - message.primaryTechniques[i] = 128; - break; - case "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA": - case 126: - message.primaryTechniques[i] = 126; - break; - case "APPLICATION_LAYER_PROTOCOL": - case 45: - message.primaryTechniques[i] = 45; - break; - case "DNS": - case 46: - message.primaryTechniques[i] = 46; - break; - case "SOFTWARE_DEPLOYMENT_TOOLS": - case 47: - message.primaryTechniques[i] = 47; - break; - case "VALID_ACCOUNTS": - case 14: - message.primaryTechniques[i] = 14; - break; - case "DEFAULT_ACCOUNTS": - case 35: - message.primaryTechniques[i] = 35; - break; - case "LOCAL_ACCOUNTS": - case 15: - message.primaryTechniques[i] = 15; - break; - case "CLOUD_ACCOUNTS": - case 16: - message.primaryTechniques[i] = 16; - break; - case "FILE_AND_DIRECTORY_DISCOVERY": - case 121: - message.primaryTechniques[i] = 121; - break; - case "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT": - case 116: - message.primaryTechniques[i] = 116; - 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 "ACCOUNT_MANIPULATION": - case 22: - message.primaryTechniques[i] = 22; - break; - case "ADDITIONAL_CLOUD_CREDENTIALS": - case 40: - message.primaryTechniques[i] = 40; - break; - case "ADDITIONAL_CLOUD_ROLES": - case 67: - message.primaryTechniques[i] = 67; - break; - case "SSH_AUTHORIZED_KEYS": - case 23: - message.primaryTechniques[i] = 23; - break; - case "ADDITIONAL_CONTAINER_CLUSTER_ROLES": - case 58: - message.primaryTechniques[i] = 58; - break; - case "MULTI_STAGE_CHANNELS": - case 76: - message.primaryTechniques[i] = 76; - break; - case "INGRESS_TOOL_TRANSFER": - case 3: - message.primaryTechniques[i] = 3; - break; - case "NATIVE_API": - case 4: - message.primaryTechniques[i] = 4; - break; - case "BRUTE_FORCE": - case 44: - message.primaryTechniques[i] = 44; - break; - case "AUTOMATED_COLLECTION": - case 94: - message.primaryTechniques[i] = 94; - break; - case "SHARED_MODULES": - case 5: - message.primaryTechniques[i] = 5; - break; - case "DATA_ENCODING": - case 77: - message.primaryTechniques[i] = 77; - break; - case "STANDARD_ENCODING": - case 78: - message.primaryTechniques[i] = 78; - break; - case "ACCESS_TOKEN_MANIPULATION": - case 33: - message.primaryTechniques[i] = 33; - break; - case "TOKEN_IMPERSONATION_OR_THEFT": - case 39: - message.primaryTechniques[i] = 39; - break; - case "CREATE_ACCOUNT": - case 79: - message.primaryTechniques[i] = 79; - break; - case "LOCAL_ACCOUNT": - case 80: - message.primaryTechniques[i] = 80; - break; - case "DEOBFUSCATE_DECODE_FILES_OR_INFO": - case 95: - message.primaryTechniques[i] = 95; - break; - case "EXPLOIT_PUBLIC_FACING_APPLICATION": - case 27: - message.primaryTechniques[i] = 27; - break; - case "SUPPLY_CHAIN_COMPROMISE": - case 129: - message.primaryTechniques[i] = 129; - break; - case "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS": - case 130: - message.primaryTechniques[i] = 130; - break; - case "EXPLOITATION_FOR_CLIENT_EXECUTION": - case 134: - message.primaryTechniques[i] = 134; - break; - case "USER_EXECUTION": - case 69: - message.primaryTechniques[i] = 69; - break; - case "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION": - case 135: - message.primaryTechniques[i] = 135; - break; - case "DOMAIN_POLICY_MODIFICATION": - case 30: - message.primaryTechniques[i] = 30; - break; - case "DATA_DESTRUCTION": - case 29: - message.primaryTechniques[i] = 29; - break; - case "DATA_ENCRYPTED_FOR_IMPACT": - case 132: - message.primaryTechniques[i] = 132; - break; - case "SERVICE_STOP": - case 52: - message.primaryTechniques[i] = 52; - break; - case "INHIBIT_SYSTEM_RECOVERY": - case 36: - message.primaryTechniques[i] = 36; - break; - case "FIRMWARE_CORRUPTION": - case 81: - message.primaryTechniques[i] = 81; - break; - case "RESOURCE_HIJACKING": - case 8: - message.primaryTechniques[i] = 8; - break; - case "NETWORK_DENIAL_OF_SERVICE": - case 17: - message.primaryTechniques[i] = 17; - break; - case "CLOUD_SERVICE_DISCOVERY": - case 48: - message.primaryTechniques[i] = 48; - break; - case "STEAL_APPLICATION_ACCESS_TOKEN": - case 42: - message.primaryTechniques[i] = 42; - break; - case "ACCOUNT_ACCESS_REMOVAL": - case 51: - message.primaryTechniques[i] = 51; - break; - case "TRANSFER_DATA_TO_CLOUD_ACCOUNT": - case 91: - message.primaryTechniques[i] = 91; - break; - case "STEAL_WEB_SESSION_COOKIE": - case 25: - message.primaryTechniques[i] = 25; - break; - case "CREATE_OR_MODIFY_SYSTEM_PROCESS": - case 24: - message.primaryTechniques[i] = 24; - break; - case "EVENT_TRIGGERED_EXECUTION": - case 65: - message.primaryTechniques[i] = 65; - break; - case "BOOT_OR_LOGON_AUTOSTART_EXECUTION": - case 82: - message.primaryTechniques[i] = 82; - break; - case "KERNEL_MODULES_AND_EXTENSIONS": - case 83: - message.primaryTechniques[i] = 83; - break; - case "SHORTCUT_MODIFICATION": - case 127: - message.primaryTechniques[i] = 127; - break; - case "ABUSE_ELEVATION_CONTROL_MECHANISM": - case 34: - message.primaryTechniques[i] = 34; - break; - case "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID": - case 136: - message.primaryTechniques[i] = 136; - break; - case "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING": - case 109: - message.primaryTechniques[i] = 109; - break; - case "UNSECURED_CREDENTIALS": - case 13: - message.primaryTechniques[i] = 13; - break; - case "CREDENTIALS_IN_FILES": - case 105: - message.primaryTechniques[i] = 105; - break; - case "BASH_HISTORY": - case 96: - message.primaryTechniques[i] = 96; - break; - case "PRIVATE_KEYS": - case 97: - message.primaryTechniques[i] = 97; - break; - case "SUBVERT_TRUST_CONTROL": - case 106: - message.primaryTechniques[i] = 106; - break; - case "INSTALL_ROOT_CERTIFICATE": - case 107: - message.primaryTechniques[i] = 107; - break; - case "COMPROMISE_HOST_SOFTWARE_BINARY": - case 84: - message.primaryTechniques[i] = 84; - break; - case "CREDENTIALS_FROM_PASSWORD_STORES": - case 98: - message.primaryTechniques[i] = 98; - break; - case "MODIFY_AUTHENTICATION_PROCESS": - case 28: - message.primaryTechniques[i] = 28; - break; - case "PLUGGABLE_AUTHENTICATION_MODULES": - case 108: - message.primaryTechniques[i] = 108; - break; - case "MULTI_FACTOR_AUTHENTICATION": - case 137: - message.primaryTechniques[i] = 137; - break; - case "IMPAIR_DEFENSES": - case 31: - message.primaryTechniques[i] = 31; - break; - case "DISABLE_OR_MODIFY_TOOLS": - case 55: - message.primaryTechniques[i] = 55; - break; - case "INDICATOR_BLOCKING": - case 110: - message.primaryTechniques[i] = 110; - break; - case "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM": - case 111: - message.primaryTechniques[i] = 111; - break; - case "HIDE_ARTIFACTS": - case 85: - message.primaryTechniques[i] = 85; - break; - case "HIDDEN_FILES_AND_DIRECTORIES": - case 86: - message.primaryTechniques[i] = 86; - break; - case "HIDDEN_USERS": - case 87: - message.primaryTechniques[i] = 87; - 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 "DYNAMIC_RESOLUTION": - case 12: - message.primaryTechniques[i] = 12; - break; - case "LATERAL_TOOL_TRANSFER": - case 41: - message.primaryTechniques[i] = 41; - break; - case "HIJACK_EXECUTION_FLOW": - case 112: - message.primaryTechniques[i] = 112; - break; - case "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING": - case 113: - message.primaryTechniques[i] = 113; - break; - case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": - case 26: - message.primaryTechniques[i] = 26; - break; - case "CREATE_SNAPSHOT": - case 54: - message.primaryTechniques[i] = 54; - break; - case "CLOUD_INFRASTRUCTURE_DISCOVERY": - case 53: - message.primaryTechniques[i] = 53; - break; - case "DEVELOP_CAPABILITIES": - case 99: - message.primaryTechniques[i] = 99; - break; - case "DEVELOP_CAPABILITIES_MALWARE": - case 100: - message.primaryTechniques[i] = 100; - break; - case "OBTAIN_CAPABILITIES": - case 43: - message.primaryTechniques[i] = 43; - break; - case "OBTAIN_CAPABILITIES_MALWARE": - case 101: - message.primaryTechniques[i] = 101; - break; - case "OBTAIN_CAPABILITIES_VULNERABILITIES": - case 133: - message.primaryTechniques[i] = 133; - break; - case "ACTIVE_SCANNING": - case 1: - message.primaryTechniques[i] = 1; - break; - case "SCANNING_IP_BLOCKS": - case 2: - message.primaryTechniques[i] = 2; - break; - case "STAGE_CAPABILITIES": - case 88: - message.primaryTechniques[i] = 88; - break; - case "UPLOAD_MALWARE": - case 102: - message.primaryTechniques[i] = 102; - break; - case "CONTAINER_ADMINISTRATION_COMMAND": - case 60: - message.primaryTechniques[i] = 60; - break; - case "DEPLOY_CONTAINER": - case 66: - message.primaryTechniques[i] = 66; - break; - case "ESCAPE_TO_HOST": - case 61: - message.primaryTechniques[i] = 61; - break; - case "CONTAINER_AND_RESOURCE_DISCOVERY": - case 57: - message.primaryTechniques[i] = 57; - break; - case "REFLECTIVE_CODE_LOADING": - case 92: - message.primaryTechniques[i] = 92; - break; - case "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": - case 62: - message.primaryTechniques[i] = 62; - break; - case "FINANCIAL_THEFT": - case 131: - message.primaryTechniques[i] = 131; - break; - } - } - if (object.additionalTactics) { - if (!Array.isArray(object.additionalTactics)) - throw TypeError(".google.cloud.securitycenter.v2.MitreAttack.additionalTactics: array expected"); - message.additionalTactics = []; - 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; - 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.v2.MitreAttack.additionalTechniques: array expected"); - message.additionalTechniques = []; - 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; - break; - case "DATA_OBFUSCATION": - case 70: - message.additionalTechniques[i] = 70; - break; - case "DATA_OBFUSCATION_STEGANOGRAPHY": - case 71: - message.additionalTechniques[i] = 71; - break; - case "OS_CREDENTIAL_DUMPING": - case 114: - message.additionalTechniques[i] = 114; - break; - case "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM": - case 115: - message.additionalTechniques[i] = 115; - break; - case "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW": - case 122: - message.additionalTechniques[i] = 122; - break; - case "DATA_FROM_LOCAL_SYSTEM": - case 117: - message.additionalTechniques[i] = 117; - break; - case "AUTOMATED_EXFILTRATION": - case 68: - message.additionalTechniques[i] = 68; - break; - case "OBFUSCATED_FILES_OR_INFO": - case 72: - message.additionalTechniques[i] = 72; - break; - case "STEGANOGRAPHY": - case 73: - message.additionalTechniques[i] = 73; - break; - case "COMPILE_AFTER_DELIVERY": - case 74: - message.additionalTechniques[i] = 74; - break; - case "COMMAND_OBFUSCATION": - case 75: - message.additionalTechniques[i] = 75; - break; - case "SCHEDULED_TRANSFER": - case 120: - message.additionalTechniques[i] = 120; - break; - case "SYSTEM_OWNER_USER_DISCOVERY": - case 118: - message.additionalTechniques[i] = 118; - break; - case "MASQUERADING": - case 49: - message.additionalTechniques[i] = 49; - break; - case "MATCH_LEGITIMATE_NAME_OR_LOCATION": - case 50: - message.additionalTechniques[i] = 50; - break; - case "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": - case 37: - message.additionalTechniques[i] = 37; - break; - case "STARTUP_ITEMS": - case 38: - message.additionalTechniques[i] = 38; - break; - case "NETWORK_SERVICE_DISCOVERY": - case 32: - message.additionalTechniques[i] = 32; - break; - case "SCHEDULED_TASK_JOB": - case 89: - message.additionalTechniques[i] = 89; - break; - case "SCHEDULED_TASK_JOB_CRON": - case 119: - message.additionalTechniques[i] = 119; - break; - case "CONTAINER_ORCHESTRATION_JOB": - case 90: - message.additionalTechniques[i] = 90; - break; - case "PROCESS_INJECTION": - case 93: - message.additionalTechniques[i] = 93; - break; - case "INPUT_CAPTURE": - case 103: - message.additionalTechniques[i] = 103; - break; - case "INPUT_CAPTURE_KEYLOGGING": - case 104: - message.additionalTechniques[i] = 104; - break; - case "PROCESS_DISCOVERY": - case 56: - message.additionalTechniques[i] = 56; - break; - case "COMMAND_AND_SCRIPTING_INTERPRETER": - case 6: - message.additionalTechniques[i] = 6; - break; - case "UNIX_SHELL": - case 7: - message.additionalTechniques[i] = 7; - break; - case "PYTHON": - case 59: - message.additionalTechniques[i] = 59; - break; - case "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": - case 63: - message.additionalTechniques[i] = 63; - break; - case "PERMISSION_GROUPS_DISCOVERY": - case 18: - message.additionalTechniques[i] = 18; - break; - case "CLOUD_GROUPS": - case 19: - message.additionalTechniques[i] = 19; - break; - case "INDICATOR_REMOVAL": - case 123: - message.additionalTechniques[i] = 123; - break; - case "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS": - case 124: - message.additionalTechniques[i] = 124; - break; - case "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY": - case 125: - message.additionalTechniques[i] = 125; - break; - case "INDICATOR_REMOVAL_FILE_DELETION": - case 64: - message.additionalTechniques[i] = 64; - break; - case "INDICATOR_REMOVAL_TIMESTOMP": - case 128: - message.additionalTechniques[i] = 128; - break; - case "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA": - case 126: - message.additionalTechniques[i] = 126; - break; - case "APPLICATION_LAYER_PROTOCOL": - case 45: - message.additionalTechniques[i] = 45; - break; - case "DNS": - case 46: - message.additionalTechniques[i] = 46; - break; - case "SOFTWARE_DEPLOYMENT_TOOLS": - case 47: - message.additionalTechniques[i] = 47; - break; - case "VALID_ACCOUNTS": - case 14: - message.additionalTechniques[i] = 14; - break; - case "DEFAULT_ACCOUNTS": - case 35: - message.additionalTechniques[i] = 35; - break; - case "LOCAL_ACCOUNTS": - case 15: - message.additionalTechniques[i] = 15; - break; - case "CLOUD_ACCOUNTS": - case 16: - message.additionalTechniques[i] = 16; - break; - case "FILE_AND_DIRECTORY_DISCOVERY": - case 121: - message.additionalTechniques[i] = 121; - break; - case "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT": - case 116: - message.additionalTechniques[i] = 116; - 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 "ACCOUNT_MANIPULATION": - case 22: - message.additionalTechniques[i] = 22; - break; - case "ADDITIONAL_CLOUD_CREDENTIALS": - case 40: - message.additionalTechniques[i] = 40; - break; - case "ADDITIONAL_CLOUD_ROLES": - case 67: - message.additionalTechniques[i] = 67; - break; - case "SSH_AUTHORIZED_KEYS": - case 23: - message.additionalTechniques[i] = 23; - break; - case "ADDITIONAL_CONTAINER_CLUSTER_ROLES": - case 58: - message.additionalTechniques[i] = 58; - break; - case "MULTI_STAGE_CHANNELS": - case 76: - message.additionalTechniques[i] = 76; - break; - case "INGRESS_TOOL_TRANSFER": - case 3: - message.additionalTechniques[i] = 3; - break; - case "NATIVE_API": - case 4: - message.additionalTechniques[i] = 4; - break; - case "BRUTE_FORCE": - case 44: - message.additionalTechniques[i] = 44; - break; - case "AUTOMATED_COLLECTION": - case 94: - message.additionalTechniques[i] = 94; - break; - case "SHARED_MODULES": - case 5: - message.additionalTechniques[i] = 5; - break; - case "DATA_ENCODING": - case 77: - message.additionalTechniques[i] = 77; - break; - case "STANDARD_ENCODING": - case 78: - message.additionalTechniques[i] = 78; - break; - case "ACCESS_TOKEN_MANIPULATION": - case 33: - message.additionalTechniques[i] = 33; - break; - case "TOKEN_IMPERSONATION_OR_THEFT": - case 39: - message.additionalTechniques[i] = 39; - break; - case "CREATE_ACCOUNT": - case 79: - message.additionalTechniques[i] = 79; - break; - case "LOCAL_ACCOUNT": - case 80: - message.additionalTechniques[i] = 80; - break; - case "DEOBFUSCATE_DECODE_FILES_OR_INFO": - case 95: - message.additionalTechniques[i] = 95; - break; - case "EXPLOIT_PUBLIC_FACING_APPLICATION": - case 27: - message.additionalTechniques[i] = 27; - break; - case "SUPPLY_CHAIN_COMPROMISE": - case 129: - message.additionalTechniques[i] = 129; - break; - case "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS": - case 130: - message.additionalTechniques[i] = 130; - break; - case "EXPLOITATION_FOR_CLIENT_EXECUTION": - case 134: - message.additionalTechniques[i] = 134; - break; - case "USER_EXECUTION": - case 69: - message.additionalTechniques[i] = 69; - break; - case "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION": - case 135: - message.additionalTechniques[i] = 135; - break; - case "DOMAIN_POLICY_MODIFICATION": - case 30: - message.additionalTechniques[i] = 30; - break; - case "DATA_DESTRUCTION": - case 29: - message.additionalTechniques[i] = 29; - break; - case "DATA_ENCRYPTED_FOR_IMPACT": - case 132: - message.additionalTechniques[i] = 132; - break; - case "SERVICE_STOP": - case 52: - message.additionalTechniques[i] = 52; - break; - case "INHIBIT_SYSTEM_RECOVERY": - case 36: - message.additionalTechniques[i] = 36; - break; - case "FIRMWARE_CORRUPTION": - case 81: - message.additionalTechniques[i] = 81; - break; - case "RESOURCE_HIJACKING": - case 8: - message.additionalTechniques[i] = 8; - break; - case "NETWORK_DENIAL_OF_SERVICE": - case 17: - message.additionalTechniques[i] = 17; - break; - case "CLOUD_SERVICE_DISCOVERY": - case 48: - message.additionalTechniques[i] = 48; - break; - case "STEAL_APPLICATION_ACCESS_TOKEN": - case 42: - message.additionalTechniques[i] = 42; - break; - case "ACCOUNT_ACCESS_REMOVAL": - case 51: - message.additionalTechniques[i] = 51; - break; - case "TRANSFER_DATA_TO_CLOUD_ACCOUNT": - case 91: - message.additionalTechniques[i] = 91; - break; - case "STEAL_WEB_SESSION_COOKIE": - case 25: - message.additionalTechniques[i] = 25; - break; - case "CREATE_OR_MODIFY_SYSTEM_PROCESS": - case 24: - message.additionalTechniques[i] = 24; - break; - case "EVENT_TRIGGERED_EXECUTION": - case 65: - message.additionalTechniques[i] = 65; - break; - case "BOOT_OR_LOGON_AUTOSTART_EXECUTION": - case 82: - message.additionalTechniques[i] = 82; - break; - case "KERNEL_MODULES_AND_EXTENSIONS": - case 83: - message.additionalTechniques[i] = 83; - break; - case "SHORTCUT_MODIFICATION": - case 127: - message.additionalTechniques[i] = 127; - break; - case "ABUSE_ELEVATION_CONTROL_MECHANISM": - case 34: - message.additionalTechniques[i] = 34; - break; - case "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID": - case 136: - message.additionalTechniques[i] = 136; - break; - case "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING": - case 109: - message.additionalTechniques[i] = 109; - break; - case "UNSECURED_CREDENTIALS": - case 13: - message.additionalTechniques[i] = 13; - break; - case "CREDENTIALS_IN_FILES": - case 105: - message.additionalTechniques[i] = 105; - break; - case "BASH_HISTORY": - case 96: - message.additionalTechniques[i] = 96; - break; - case "PRIVATE_KEYS": - case 97: - message.additionalTechniques[i] = 97; - break; - case "SUBVERT_TRUST_CONTROL": - case 106: - message.additionalTechniques[i] = 106; - break; - case "INSTALL_ROOT_CERTIFICATE": - case 107: - message.additionalTechniques[i] = 107; - break; - case "COMPROMISE_HOST_SOFTWARE_BINARY": - case 84: - message.additionalTechniques[i] = 84; - break; - case "CREDENTIALS_FROM_PASSWORD_STORES": - case 98: - message.additionalTechniques[i] = 98; - break; - case "MODIFY_AUTHENTICATION_PROCESS": - case 28: - message.additionalTechniques[i] = 28; - break; - case "PLUGGABLE_AUTHENTICATION_MODULES": - case 108: - message.additionalTechniques[i] = 108; - break; - case "MULTI_FACTOR_AUTHENTICATION": - case 137: - message.additionalTechniques[i] = 137; - break; - case "IMPAIR_DEFENSES": - case 31: - message.additionalTechniques[i] = 31; - break; - case "DISABLE_OR_MODIFY_TOOLS": - case 55: - message.additionalTechniques[i] = 55; - break; - case "INDICATOR_BLOCKING": - case 110: - message.additionalTechniques[i] = 110; - break; - case "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM": - case 111: - message.additionalTechniques[i] = 111; - break; - case "HIDE_ARTIFACTS": - case 85: - message.additionalTechniques[i] = 85; - break; - case "HIDDEN_FILES_AND_DIRECTORIES": - case 86: - message.additionalTechniques[i] = 86; - break; - case "HIDDEN_USERS": - case 87: - message.additionalTechniques[i] = 87; - 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 "DYNAMIC_RESOLUTION": - case 12: - message.additionalTechniques[i] = 12; - break; - case "LATERAL_TOOL_TRANSFER": - case 41: - message.additionalTechniques[i] = 41; - break; - case "HIJACK_EXECUTION_FLOW": - case 112: - message.additionalTechniques[i] = 112; - break; - case "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING": - case 113: - message.additionalTechniques[i] = 113; - break; - case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": - case 26: - message.additionalTechniques[i] = 26; - break; - case "CREATE_SNAPSHOT": - case 54: - message.additionalTechniques[i] = 54; - break; - case "CLOUD_INFRASTRUCTURE_DISCOVERY": - case 53: - message.additionalTechniques[i] = 53; - break; - case "DEVELOP_CAPABILITIES": - case 99: - message.additionalTechniques[i] = 99; - break; - case "DEVELOP_CAPABILITIES_MALWARE": - case 100: - message.additionalTechniques[i] = 100; - break; - case "OBTAIN_CAPABILITIES": - case 43: - message.additionalTechniques[i] = 43; - break; - case "OBTAIN_CAPABILITIES_MALWARE": - case 101: - message.additionalTechniques[i] = 101; - break; - case "OBTAIN_CAPABILITIES_VULNERABILITIES": - case 133: - message.additionalTechniques[i] = 133; - break; - case "ACTIVE_SCANNING": - case 1: - message.additionalTechniques[i] = 1; - break; - case "SCANNING_IP_BLOCKS": - case 2: - message.additionalTechniques[i] = 2; - break; - case "STAGE_CAPABILITIES": - case 88: - message.additionalTechniques[i] = 88; - break; - case "UPLOAD_MALWARE": - case 102: - message.additionalTechniques[i] = 102; - break; - case "CONTAINER_ADMINISTRATION_COMMAND": - case 60: - message.additionalTechniques[i] = 60; - break; - case "DEPLOY_CONTAINER": - case 66: - message.additionalTechniques[i] = 66; - break; - case "ESCAPE_TO_HOST": - case 61: - message.additionalTechniques[i] = 61; - break; - case "CONTAINER_AND_RESOURCE_DISCOVERY": - case 57: - message.additionalTechniques[i] = 57; - break; - case "REFLECTIVE_CODE_LOADING": - case 92: - message.additionalTechniques[i] = 92; - break; - case "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": - case 62: - message.additionalTechniques[i] = 62; - break; - case "FINANCIAL_THEFT": - case 131: - message.additionalTechniques[i] = 131; - 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.v2.MitreAttack - * @static - * @param {google.cloud.securitycenter.v2.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.v2.MitreAttack.Tactic[message.primaryTactic] === undefined ? message.primaryTactic : $root.google.cloud.securitycenter.v2.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.v2.MitreAttack.Technique[message.primaryTechniques[j]] === undefined ? message.primaryTechniques[j] : $root.google.cloud.securitycenter.v2.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.v2.MitreAttack.Tactic[message.additionalTactics[j]] === undefined ? message.additionalTactics[j] : $root.google.cloud.securitycenter.v2.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.v2.MitreAttack.Technique[message.additionalTechniques[j]] === undefined ? message.additionalTechniques[j] : $root.google.cloud.securitycenter.v2.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.v2.MitreAttack - * @instance - * @returns {Object.} JSON object - */ - MitreAttack.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MitreAttack - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.MitreAttack"; - }; - - /** - * Tactic enum. - * @name google.cloud.securitycenter.v2.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.v2.MitreAttack.Technique - * @enum {number} - * @property {number} TECHNIQUE_UNSPECIFIED=0 TECHNIQUE_UNSPECIFIED value - * @property {number} DATA_OBFUSCATION=70 DATA_OBFUSCATION value - * @property {number} DATA_OBFUSCATION_STEGANOGRAPHY=71 DATA_OBFUSCATION_STEGANOGRAPHY value - * @property {number} OS_CREDENTIAL_DUMPING=114 OS_CREDENTIAL_DUMPING value - * @property {number} OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM=115 OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM value - * @property {number} OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW=122 OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW value - * @property {number} DATA_FROM_LOCAL_SYSTEM=117 DATA_FROM_LOCAL_SYSTEM value - * @property {number} AUTOMATED_EXFILTRATION=68 AUTOMATED_EXFILTRATION value - * @property {number} OBFUSCATED_FILES_OR_INFO=72 OBFUSCATED_FILES_OR_INFO value - * @property {number} STEGANOGRAPHY=73 STEGANOGRAPHY value - * @property {number} COMPILE_AFTER_DELIVERY=74 COMPILE_AFTER_DELIVERY value - * @property {number} COMMAND_OBFUSCATION=75 COMMAND_OBFUSCATION value - * @property {number} SCHEDULED_TRANSFER=120 SCHEDULED_TRANSFER value - * @property {number} SYSTEM_OWNER_USER_DISCOVERY=118 SYSTEM_OWNER_USER_DISCOVERY value - * @property {number} MASQUERADING=49 MASQUERADING value - * @property {number} MATCH_LEGITIMATE_NAME_OR_LOCATION=50 MATCH_LEGITIMATE_NAME_OR_LOCATION value - * @property {number} BOOT_OR_LOGON_INITIALIZATION_SCRIPTS=37 BOOT_OR_LOGON_INITIALIZATION_SCRIPTS value - * @property {number} STARTUP_ITEMS=38 STARTUP_ITEMS value - * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value - * @property {number} SCHEDULED_TASK_JOB=89 SCHEDULED_TASK_JOB value - * @property {number} SCHEDULED_TASK_JOB_CRON=119 SCHEDULED_TASK_JOB_CRON value - * @property {number} CONTAINER_ORCHESTRATION_JOB=90 CONTAINER_ORCHESTRATION_JOB value - * @property {number} PROCESS_INJECTION=93 PROCESS_INJECTION value - * @property {number} INPUT_CAPTURE=103 INPUT_CAPTURE value - * @property {number} INPUT_CAPTURE_KEYLOGGING=104 INPUT_CAPTURE_KEYLOGGING value - * @property {number} PROCESS_DISCOVERY=56 PROCESS_DISCOVERY value - * @property {number} COMMAND_AND_SCRIPTING_INTERPRETER=6 COMMAND_AND_SCRIPTING_INTERPRETER value - * @property {number} UNIX_SHELL=7 UNIX_SHELL value - * @property {number} PYTHON=59 PYTHON value - * @property {number} EXPLOITATION_FOR_PRIVILEGE_ESCALATION=63 EXPLOITATION_FOR_PRIVILEGE_ESCALATION value - * @property {number} PERMISSION_GROUPS_DISCOVERY=18 PERMISSION_GROUPS_DISCOVERY value - * @property {number} CLOUD_GROUPS=19 CLOUD_GROUPS value - * @property {number} INDICATOR_REMOVAL=123 INDICATOR_REMOVAL value - * @property {number} INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS=124 INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS value - * @property {number} INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY=125 INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY value - * @property {number} INDICATOR_REMOVAL_FILE_DELETION=64 INDICATOR_REMOVAL_FILE_DELETION value - * @property {number} INDICATOR_REMOVAL_TIMESTOMP=128 INDICATOR_REMOVAL_TIMESTOMP value - * @property {number} INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA=126 INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA value - * @property {number} APPLICATION_LAYER_PROTOCOL=45 APPLICATION_LAYER_PROTOCOL value - * @property {number} DNS=46 DNS value - * @property {number} SOFTWARE_DEPLOYMENT_TOOLS=47 SOFTWARE_DEPLOYMENT_TOOLS value - * @property {number} VALID_ACCOUNTS=14 VALID_ACCOUNTS value - * @property {number} DEFAULT_ACCOUNTS=35 DEFAULT_ACCOUNTS value - * @property {number} LOCAL_ACCOUNTS=15 LOCAL_ACCOUNTS value - * @property {number} CLOUD_ACCOUNTS=16 CLOUD_ACCOUNTS value - * @property {number} FILE_AND_DIRECTORY_DISCOVERY=121 FILE_AND_DIRECTORY_DISCOVERY value - * @property {number} ACCOUNT_DISCOVERY_LOCAL_ACCOUNT=116 ACCOUNT_DISCOVERY_LOCAL_ACCOUNT 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} ACCOUNT_MANIPULATION=22 ACCOUNT_MANIPULATION value - * @property {number} ADDITIONAL_CLOUD_CREDENTIALS=40 ADDITIONAL_CLOUD_CREDENTIALS value - * @property {number} ADDITIONAL_CLOUD_ROLES=67 ADDITIONAL_CLOUD_ROLES value - * @property {number} SSH_AUTHORIZED_KEYS=23 SSH_AUTHORIZED_KEYS value - * @property {number} ADDITIONAL_CONTAINER_CLUSTER_ROLES=58 ADDITIONAL_CONTAINER_CLUSTER_ROLES value - * @property {number} MULTI_STAGE_CHANNELS=76 MULTI_STAGE_CHANNELS value - * @property {number} INGRESS_TOOL_TRANSFER=3 INGRESS_TOOL_TRANSFER value - * @property {number} NATIVE_API=4 NATIVE_API value - * @property {number} BRUTE_FORCE=44 BRUTE_FORCE value - * @property {number} AUTOMATED_COLLECTION=94 AUTOMATED_COLLECTION value - * @property {number} SHARED_MODULES=5 SHARED_MODULES value - * @property {number} DATA_ENCODING=77 DATA_ENCODING value - * @property {number} STANDARD_ENCODING=78 STANDARD_ENCODING value - * @property {number} ACCESS_TOKEN_MANIPULATION=33 ACCESS_TOKEN_MANIPULATION value - * @property {number} TOKEN_IMPERSONATION_OR_THEFT=39 TOKEN_IMPERSONATION_OR_THEFT value - * @property {number} CREATE_ACCOUNT=79 CREATE_ACCOUNT value - * @property {number} LOCAL_ACCOUNT=80 LOCAL_ACCOUNT value - * @property {number} DEOBFUSCATE_DECODE_FILES_OR_INFO=95 DEOBFUSCATE_DECODE_FILES_OR_INFO value - * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value - * @property {number} SUPPLY_CHAIN_COMPROMISE=129 SUPPLY_CHAIN_COMPROMISE value - * @property {number} COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS=130 COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS value - * @property {number} EXPLOITATION_FOR_CLIENT_EXECUTION=134 EXPLOITATION_FOR_CLIENT_EXECUTION value - * @property {number} USER_EXECUTION=69 USER_EXECUTION value - * @property {number} LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION=135 LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION value - * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value - * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value - * @property {number} DATA_ENCRYPTED_FOR_IMPACT=132 DATA_ENCRYPTED_FOR_IMPACT value - * @property {number} SERVICE_STOP=52 SERVICE_STOP value - * @property {number} INHIBIT_SYSTEM_RECOVERY=36 INHIBIT_SYSTEM_RECOVERY value - * @property {number} FIRMWARE_CORRUPTION=81 FIRMWARE_CORRUPTION value - * @property {number} RESOURCE_HIJACKING=8 RESOURCE_HIJACKING value - * @property {number} NETWORK_DENIAL_OF_SERVICE=17 NETWORK_DENIAL_OF_SERVICE value - * @property {number} CLOUD_SERVICE_DISCOVERY=48 CLOUD_SERVICE_DISCOVERY value - * @property {number} STEAL_APPLICATION_ACCESS_TOKEN=42 STEAL_APPLICATION_ACCESS_TOKEN value - * @property {number} ACCOUNT_ACCESS_REMOVAL=51 ACCOUNT_ACCESS_REMOVAL value - * @property {number} TRANSFER_DATA_TO_CLOUD_ACCOUNT=91 TRANSFER_DATA_TO_CLOUD_ACCOUNT value - * @property {number} STEAL_WEB_SESSION_COOKIE=25 STEAL_WEB_SESSION_COOKIE value - * @property {number} CREATE_OR_MODIFY_SYSTEM_PROCESS=24 CREATE_OR_MODIFY_SYSTEM_PROCESS value - * @property {number} EVENT_TRIGGERED_EXECUTION=65 EVENT_TRIGGERED_EXECUTION value - * @property {number} BOOT_OR_LOGON_AUTOSTART_EXECUTION=82 BOOT_OR_LOGON_AUTOSTART_EXECUTION value - * @property {number} KERNEL_MODULES_AND_EXTENSIONS=83 KERNEL_MODULES_AND_EXTENSIONS value - * @property {number} SHORTCUT_MODIFICATION=127 SHORTCUT_MODIFICATION value - * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM=34 ABUSE_ELEVATION_CONTROL_MECHANISM value - * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID=136 ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID value - * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING=109 ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING value - * @property {number} UNSECURED_CREDENTIALS=13 UNSECURED_CREDENTIALS value - * @property {number} CREDENTIALS_IN_FILES=105 CREDENTIALS_IN_FILES value - * @property {number} BASH_HISTORY=96 BASH_HISTORY value - * @property {number} PRIVATE_KEYS=97 PRIVATE_KEYS value - * @property {number} SUBVERT_TRUST_CONTROL=106 SUBVERT_TRUST_CONTROL value - * @property {number} INSTALL_ROOT_CERTIFICATE=107 INSTALL_ROOT_CERTIFICATE value - * @property {number} COMPROMISE_HOST_SOFTWARE_BINARY=84 COMPROMISE_HOST_SOFTWARE_BINARY value - * @property {number} CREDENTIALS_FROM_PASSWORD_STORES=98 CREDENTIALS_FROM_PASSWORD_STORES value - * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value - * @property {number} PLUGGABLE_AUTHENTICATION_MODULES=108 PLUGGABLE_AUTHENTICATION_MODULES value - * @property {number} MULTI_FACTOR_AUTHENTICATION=137 MULTI_FACTOR_AUTHENTICATION value - * @property {number} IMPAIR_DEFENSES=31 IMPAIR_DEFENSES value - * @property {number} DISABLE_OR_MODIFY_TOOLS=55 DISABLE_OR_MODIFY_TOOLS value - * @property {number} INDICATOR_BLOCKING=110 INDICATOR_BLOCKING value - * @property {number} DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM=111 DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM value - * @property {number} HIDE_ARTIFACTS=85 HIDE_ARTIFACTS value - * @property {number} HIDDEN_FILES_AND_DIRECTORIES=86 HIDDEN_FILES_AND_DIRECTORIES value - * @property {number} HIDDEN_USERS=87 HIDDEN_USERS 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} DYNAMIC_RESOLUTION=12 DYNAMIC_RESOLUTION value - * @property {number} LATERAL_TOOL_TRANSFER=41 LATERAL_TOOL_TRANSFER value - * @property {number} HIJACK_EXECUTION_FLOW=112 HIJACK_EXECUTION_FLOW value - * @property {number} HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING=113 HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING value - * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value - * @property {number} CREATE_SNAPSHOT=54 CREATE_SNAPSHOT value - * @property {number} CLOUD_INFRASTRUCTURE_DISCOVERY=53 CLOUD_INFRASTRUCTURE_DISCOVERY value - * @property {number} DEVELOP_CAPABILITIES=99 DEVELOP_CAPABILITIES value - * @property {number} DEVELOP_CAPABILITIES_MALWARE=100 DEVELOP_CAPABILITIES_MALWARE value - * @property {number} OBTAIN_CAPABILITIES=43 OBTAIN_CAPABILITIES value - * @property {number} OBTAIN_CAPABILITIES_MALWARE=101 OBTAIN_CAPABILITIES_MALWARE value - * @property {number} OBTAIN_CAPABILITIES_VULNERABILITIES=133 OBTAIN_CAPABILITIES_VULNERABILITIES value - * @property {number} ACTIVE_SCANNING=1 ACTIVE_SCANNING value - * @property {number} SCANNING_IP_BLOCKS=2 SCANNING_IP_BLOCKS value - * @property {number} STAGE_CAPABILITIES=88 STAGE_CAPABILITIES value - * @property {number} UPLOAD_MALWARE=102 UPLOAD_MALWARE value - * @property {number} CONTAINER_ADMINISTRATION_COMMAND=60 CONTAINER_ADMINISTRATION_COMMAND value - * @property {number} DEPLOY_CONTAINER=66 DEPLOY_CONTAINER value - * @property {number} ESCAPE_TO_HOST=61 ESCAPE_TO_HOST value - * @property {number} CONTAINER_AND_RESOURCE_DISCOVERY=57 CONTAINER_AND_RESOURCE_DISCOVERY value - * @property {number} REFLECTIVE_CODE_LOADING=92 REFLECTIVE_CODE_LOADING value - * @property {number} STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES=62 STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES value - * @property {number} FINANCIAL_THEFT=131 FINANCIAL_THEFT value - */ - MitreAttack.Technique = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TECHNIQUE_UNSPECIFIED"] = 0; - values[valuesById[70] = "DATA_OBFUSCATION"] = 70; - values[valuesById[71] = "DATA_OBFUSCATION_STEGANOGRAPHY"] = 71; - values[valuesById[114] = "OS_CREDENTIAL_DUMPING"] = 114; - values[valuesById[115] = "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM"] = 115; - values[valuesById[122] = "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW"] = 122; - values[valuesById[117] = "DATA_FROM_LOCAL_SYSTEM"] = 117; - values[valuesById[68] = "AUTOMATED_EXFILTRATION"] = 68; - values[valuesById[72] = "OBFUSCATED_FILES_OR_INFO"] = 72; - values[valuesById[73] = "STEGANOGRAPHY"] = 73; - values[valuesById[74] = "COMPILE_AFTER_DELIVERY"] = 74; - values[valuesById[75] = "COMMAND_OBFUSCATION"] = 75; - values[valuesById[120] = "SCHEDULED_TRANSFER"] = 120; - values[valuesById[118] = "SYSTEM_OWNER_USER_DISCOVERY"] = 118; - values[valuesById[49] = "MASQUERADING"] = 49; - values[valuesById[50] = "MATCH_LEGITIMATE_NAME_OR_LOCATION"] = 50; - values[valuesById[37] = "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS"] = 37; - values[valuesById[38] = "STARTUP_ITEMS"] = 38; - values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; - values[valuesById[89] = "SCHEDULED_TASK_JOB"] = 89; - values[valuesById[119] = "SCHEDULED_TASK_JOB_CRON"] = 119; - values[valuesById[90] = "CONTAINER_ORCHESTRATION_JOB"] = 90; - values[valuesById[93] = "PROCESS_INJECTION"] = 93; - values[valuesById[103] = "INPUT_CAPTURE"] = 103; - values[valuesById[104] = "INPUT_CAPTURE_KEYLOGGING"] = 104; - values[valuesById[56] = "PROCESS_DISCOVERY"] = 56; - values[valuesById[6] = "COMMAND_AND_SCRIPTING_INTERPRETER"] = 6; - values[valuesById[7] = "UNIX_SHELL"] = 7; - values[valuesById[59] = "PYTHON"] = 59; - values[valuesById[63] = "EXPLOITATION_FOR_PRIVILEGE_ESCALATION"] = 63; - values[valuesById[18] = "PERMISSION_GROUPS_DISCOVERY"] = 18; - values[valuesById[19] = "CLOUD_GROUPS"] = 19; - values[valuesById[123] = "INDICATOR_REMOVAL"] = 123; - values[valuesById[124] = "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS"] = 124; - values[valuesById[125] = "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY"] = 125; - values[valuesById[64] = "INDICATOR_REMOVAL_FILE_DELETION"] = 64; - values[valuesById[128] = "INDICATOR_REMOVAL_TIMESTOMP"] = 128; - values[valuesById[126] = "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA"] = 126; - values[valuesById[45] = "APPLICATION_LAYER_PROTOCOL"] = 45; - values[valuesById[46] = "DNS"] = 46; - values[valuesById[47] = "SOFTWARE_DEPLOYMENT_TOOLS"] = 47; - values[valuesById[14] = "VALID_ACCOUNTS"] = 14; - values[valuesById[35] = "DEFAULT_ACCOUNTS"] = 35; - values[valuesById[15] = "LOCAL_ACCOUNTS"] = 15; - values[valuesById[16] = "CLOUD_ACCOUNTS"] = 16; - values[valuesById[121] = "FILE_AND_DIRECTORY_DISCOVERY"] = 121; - values[valuesById[116] = "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT"] = 116; - values[valuesById[9] = "PROXY"] = 9; - values[valuesById[10] = "EXTERNAL_PROXY"] = 10; - values[valuesById[11] = "MULTI_HOP_PROXY"] = 11; - values[valuesById[22] = "ACCOUNT_MANIPULATION"] = 22; - values[valuesById[40] = "ADDITIONAL_CLOUD_CREDENTIALS"] = 40; - values[valuesById[67] = "ADDITIONAL_CLOUD_ROLES"] = 67; - values[valuesById[23] = "SSH_AUTHORIZED_KEYS"] = 23; - values[valuesById[58] = "ADDITIONAL_CONTAINER_CLUSTER_ROLES"] = 58; - values[valuesById[76] = "MULTI_STAGE_CHANNELS"] = 76; - values[valuesById[3] = "INGRESS_TOOL_TRANSFER"] = 3; - values[valuesById[4] = "NATIVE_API"] = 4; - values[valuesById[44] = "BRUTE_FORCE"] = 44; - values[valuesById[94] = "AUTOMATED_COLLECTION"] = 94; - values[valuesById[5] = "SHARED_MODULES"] = 5; - values[valuesById[77] = "DATA_ENCODING"] = 77; - values[valuesById[78] = "STANDARD_ENCODING"] = 78; - values[valuesById[33] = "ACCESS_TOKEN_MANIPULATION"] = 33; - values[valuesById[39] = "TOKEN_IMPERSONATION_OR_THEFT"] = 39; - values[valuesById[79] = "CREATE_ACCOUNT"] = 79; - values[valuesById[80] = "LOCAL_ACCOUNT"] = 80; - values[valuesById[95] = "DEOBFUSCATE_DECODE_FILES_OR_INFO"] = 95; - values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; - values[valuesById[129] = "SUPPLY_CHAIN_COMPROMISE"] = 129; - values[valuesById[130] = "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS"] = 130; - values[valuesById[134] = "EXPLOITATION_FOR_CLIENT_EXECUTION"] = 134; - values[valuesById[69] = "USER_EXECUTION"] = 69; - values[valuesById[135] = "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION"] = 135; - values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; - values[valuesById[29] = "DATA_DESTRUCTION"] = 29; - values[valuesById[132] = "DATA_ENCRYPTED_FOR_IMPACT"] = 132; - values[valuesById[52] = "SERVICE_STOP"] = 52; - values[valuesById[36] = "INHIBIT_SYSTEM_RECOVERY"] = 36; - values[valuesById[81] = "FIRMWARE_CORRUPTION"] = 81; - values[valuesById[8] = "RESOURCE_HIJACKING"] = 8; - values[valuesById[17] = "NETWORK_DENIAL_OF_SERVICE"] = 17; - values[valuesById[48] = "CLOUD_SERVICE_DISCOVERY"] = 48; - values[valuesById[42] = "STEAL_APPLICATION_ACCESS_TOKEN"] = 42; - values[valuesById[51] = "ACCOUNT_ACCESS_REMOVAL"] = 51; - values[valuesById[91] = "TRANSFER_DATA_TO_CLOUD_ACCOUNT"] = 91; - values[valuesById[25] = "STEAL_WEB_SESSION_COOKIE"] = 25; - values[valuesById[24] = "CREATE_OR_MODIFY_SYSTEM_PROCESS"] = 24; - values[valuesById[65] = "EVENT_TRIGGERED_EXECUTION"] = 65; - values[valuesById[82] = "BOOT_OR_LOGON_AUTOSTART_EXECUTION"] = 82; - values[valuesById[83] = "KERNEL_MODULES_AND_EXTENSIONS"] = 83; - values[valuesById[127] = "SHORTCUT_MODIFICATION"] = 127; - values[valuesById[34] = "ABUSE_ELEVATION_CONTROL_MECHANISM"] = 34; - values[valuesById[136] = "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID"] = 136; - values[valuesById[109] = "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING"] = 109; - values[valuesById[13] = "UNSECURED_CREDENTIALS"] = 13; - values[valuesById[105] = "CREDENTIALS_IN_FILES"] = 105; - values[valuesById[96] = "BASH_HISTORY"] = 96; - values[valuesById[97] = "PRIVATE_KEYS"] = 97; - values[valuesById[106] = "SUBVERT_TRUST_CONTROL"] = 106; - values[valuesById[107] = "INSTALL_ROOT_CERTIFICATE"] = 107; - values[valuesById[84] = "COMPROMISE_HOST_SOFTWARE_BINARY"] = 84; - values[valuesById[98] = "CREDENTIALS_FROM_PASSWORD_STORES"] = 98; - values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; - values[valuesById[108] = "PLUGGABLE_AUTHENTICATION_MODULES"] = 108; - values[valuesById[137] = "MULTI_FACTOR_AUTHENTICATION"] = 137; - values[valuesById[31] = "IMPAIR_DEFENSES"] = 31; - values[valuesById[55] = "DISABLE_OR_MODIFY_TOOLS"] = 55; - values[valuesById[110] = "INDICATOR_BLOCKING"] = 110; - values[valuesById[111] = "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM"] = 111; - values[valuesById[85] = "HIDE_ARTIFACTS"] = 85; - values[valuesById[86] = "HIDDEN_FILES_AND_DIRECTORIES"] = 86; - values[valuesById[87] = "HIDDEN_USERS"] = 87; - values[valuesById[20] = "EXFILTRATION_OVER_WEB_SERVICE"] = 20; - values[valuesById[21] = "EXFILTRATION_TO_CLOUD_STORAGE"] = 21; - values[valuesById[12] = "DYNAMIC_RESOLUTION"] = 12; - values[valuesById[41] = "LATERAL_TOOL_TRANSFER"] = 41; - values[valuesById[112] = "HIJACK_EXECUTION_FLOW"] = 112; - values[valuesById[113] = "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING"] = 113; - values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; - values[valuesById[54] = "CREATE_SNAPSHOT"] = 54; - values[valuesById[53] = "CLOUD_INFRASTRUCTURE_DISCOVERY"] = 53; - values[valuesById[99] = "DEVELOP_CAPABILITIES"] = 99; - values[valuesById[100] = "DEVELOP_CAPABILITIES_MALWARE"] = 100; - values[valuesById[43] = "OBTAIN_CAPABILITIES"] = 43; - values[valuesById[101] = "OBTAIN_CAPABILITIES_MALWARE"] = 101; - values[valuesById[133] = "OBTAIN_CAPABILITIES_VULNERABILITIES"] = 133; - values[valuesById[1] = "ACTIVE_SCANNING"] = 1; - values[valuesById[2] = "SCANNING_IP_BLOCKS"] = 2; - values[valuesById[88] = "STAGE_CAPABILITIES"] = 88; - values[valuesById[102] = "UPLOAD_MALWARE"] = 102; - values[valuesById[60] = "CONTAINER_ADMINISTRATION_COMMAND"] = 60; - values[valuesById[66] = "DEPLOY_CONTAINER"] = 66; - values[valuesById[61] = "ESCAPE_TO_HOST"] = 61; - values[valuesById[57] = "CONTAINER_AND_RESOURCE_DISCOVERY"] = 57; - values[valuesById[92] = "REFLECTIVE_CODE_LOADING"] = 92; - values[valuesById[62] = "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES"] = 62; - values[valuesById[131] = "FINANCIAL_THEFT"] = 131; - return values; - })(); - - return MitreAttack; - })(); - - v2.Network = (function() { - - /** - * Properties of a Network. - * @memberof google.cloud.securitycenter.v2 - * @interface INetwork - * @property {string|null} [name] Network name - */ - - /** - * Constructs a new Network. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Network. - * @implements INetwork - * @constructor - * @param {google.cloud.securitycenter.v2.INetwork=} [properties] Properties to set - */ - function Network(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Network name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Network - * @instance - */ - Network.prototype.name = ""; - - /** - * Creates a new Network instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {google.cloud.securitycenter.v2.INetwork=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Network} Network instance - */ - Network.create = function create(properties) { - return new Network(properties); - }; - - /** - * Encodes the specified Network message. Does not implicitly {@link google.cloud.securitycenter.v2.Network.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {google.cloud.securitycenter.v2.INetwork} message Network message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Network.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 Network message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Network.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {google.cloud.securitycenter.v2.INetwork} message Network message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Network.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Network message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Network.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Network(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Network message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Network.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Network message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Network.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 Network message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Network} Network - */ - Network.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Network) - return object; - var message = new $root.google.cloud.securitycenter.v2.Network(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a Network message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {google.cloud.securitycenter.v2.Network} message Network - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Network.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 Network to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Network - * @instance - * @returns {Object.} JSON object - */ - Network.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Network - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Network - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Network.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Network"; - }; - - return Network; - })(); - - v2.Notebook = (function() { - - /** - * Properties of a Notebook. - * @memberof google.cloud.securitycenter.v2 - * @interface INotebook - * @property {string|null} [name] Notebook name - * @property {string|null} [service] Notebook service - * @property {string|null} [lastAuthor] Notebook lastAuthor - * @property {google.protobuf.ITimestamp|null} [notebookUpdateTime] Notebook notebookUpdateTime - */ - - /** - * Constructs a new Notebook. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Notebook. - * @implements INotebook - * @constructor - * @param {google.cloud.securitycenter.v2.INotebook=} [properties] Properties to set - */ - function Notebook(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Notebook name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Notebook - * @instance - */ - Notebook.prototype.name = ""; - - /** - * Notebook service. - * @member {string} service - * @memberof google.cloud.securitycenter.v2.Notebook - * @instance - */ - Notebook.prototype.service = ""; - - /** - * Notebook lastAuthor. - * @member {string} lastAuthor - * @memberof google.cloud.securitycenter.v2.Notebook - * @instance - */ - Notebook.prototype.lastAuthor = ""; - - /** - * Notebook notebookUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} notebookUpdateTime - * @memberof google.cloud.securitycenter.v2.Notebook - * @instance - */ - Notebook.prototype.notebookUpdateTime = null; - - /** - * Creates a new Notebook instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {google.cloud.securitycenter.v2.INotebook=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Notebook} Notebook instance - */ - Notebook.create = function create(properties) { - return new Notebook(properties); - }; - - /** - * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.securitycenter.v2.Notebook.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {google.cloud.securitycenter.v2.INotebook} message Notebook message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Notebook.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.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.lastAuthor != null && Object.hasOwnProperty.call(message, "lastAuthor")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.lastAuthor); - if (message.notebookUpdateTime != null && Object.hasOwnProperty.call(message, "notebookUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.notebookUpdateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Notebook.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {google.cloud.securitycenter.v2.INotebook} message Notebook message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Notebook.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Notebook message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Notebook} Notebook - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Notebook.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Notebook(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.lastAuthor = reader.string(); - break; - } - case 4: { - message.notebookUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Notebook message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Notebook} Notebook - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Notebook.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Notebook message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Notebook.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.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.lastAuthor != null && message.hasOwnProperty("lastAuthor")) - if (!$util.isString(message.lastAuthor)) - return "lastAuthor: string expected"; - if (message.notebookUpdateTime != null && message.hasOwnProperty("notebookUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.notebookUpdateTime); - if (error) - return "notebookUpdateTime." + error; - } - return null; - }; - - /** - * Creates a Notebook message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Notebook} Notebook - */ - Notebook.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Notebook) - return object; - var message = new $root.google.cloud.securitycenter.v2.Notebook(); - if (object.name != null) - message.name = String(object.name); - if (object.service != null) - message.service = String(object.service); - if (object.lastAuthor != null) - message.lastAuthor = String(object.lastAuthor); - if (object.notebookUpdateTime != null) { - if (typeof object.notebookUpdateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Notebook.notebookUpdateTime: object expected"); - message.notebookUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.notebookUpdateTime); - } - return message; - }; - - /** - * Creates a plain object from a Notebook message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {google.cloud.securitycenter.v2.Notebook} message Notebook - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Notebook.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.service = ""; - object.lastAuthor = ""; - object.notebookUpdateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.lastAuthor != null && message.hasOwnProperty("lastAuthor")) - object.lastAuthor = message.lastAuthor; - if (message.notebookUpdateTime != null && message.hasOwnProperty("notebookUpdateTime")) - object.notebookUpdateTime = $root.google.protobuf.Timestamp.toObject(message.notebookUpdateTime, options); - return object; - }; - - /** - * Converts this Notebook to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Notebook - * @instance - * @returns {Object.} JSON object - */ - Notebook.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Notebook - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Notebook - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Notebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Notebook"; - }; - - return Notebook; - })(); - - v2.OrgPolicy = (function() { - - /** - * Properties of an OrgPolicy. - * @memberof google.cloud.securitycenter.v2 - * @interface IOrgPolicy - * @property {string|null} [name] OrgPolicy name - */ - - /** - * Constructs a new OrgPolicy. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an OrgPolicy. - * @implements IOrgPolicy - * @constructor - * @param {google.cloud.securitycenter.v2.IOrgPolicy=} [properties] Properties to set - */ - function OrgPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OrgPolicy name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @instance - */ - OrgPolicy.prototype.name = ""; - - /** - * Creates a new OrgPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {google.cloud.securitycenter.v2.IOrgPolicy=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.OrgPolicy} OrgPolicy instance - */ - OrgPolicy.create = function create(properties) { - return new OrgPolicy(properties); - }; - - /** - * Encodes the specified OrgPolicy message. Does not implicitly {@link google.cloud.securitycenter.v2.OrgPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {google.cloud.securitycenter.v2.IOrgPolicy} message OrgPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrgPolicy.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 OrgPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.OrgPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {google.cloud.securitycenter.v2.IOrgPolicy} message OrgPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrgPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OrgPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.OrgPolicy} OrgPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrgPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.OrgPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OrgPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.OrgPolicy} OrgPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrgPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OrgPolicy message. - * @function verify - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OrgPolicy.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 an OrgPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.OrgPolicy} OrgPolicy - */ - OrgPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.OrgPolicy) - return object; - var message = new $root.google.cloud.securitycenter.v2.OrgPolicy(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an OrgPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {google.cloud.securitycenter.v2.OrgPolicy} message OrgPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OrgPolicy.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 OrgPolicy to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @instance - * @returns {Object.} JSON object - */ - OrgPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OrgPolicy - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.OrgPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OrgPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.OrgPolicy"; - }; - - return OrgPolicy; - })(); - - v2.Process = (function() { - - /** - * Properties of a Process. - * @memberof google.cloud.securitycenter.v2 - * @interface IProcess - * @property {string|null} [name] Process name - * @property {google.cloud.securitycenter.v2.IFile|null} [binary] Process binary - * @property {Array.|null} [libraries] Process libraries - * @property {google.cloud.securitycenter.v2.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 - * @property {number|Long|null} [userId] Process userId - */ - - /** - * Constructs a new Process. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Process. - * @implements IProcess - * @constructor - * @param {google.cloud.securitycenter.v2.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 name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.name = ""; - - /** - * Process binary. - * @member {google.cloud.securitycenter.v2.IFile|null|undefined} binary - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.binary = null; - - /** - * Process libraries. - * @member {Array.} libraries - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.libraries = $util.emptyArray; - - /** - * Process script. - * @member {google.cloud.securitycenter.v2.IFile|null|undefined} script - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.script = null; - - /** - * Process args. - * @member {Array.} args - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.args = $util.emptyArray; - - /** - * Process argumentsTruncated. - * @member {boolean} argumentsTruncated - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.argumentsTruncated = false; - - /** - * Process envVariables. - * @member {Array.} envVariables - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.envVariables = $util.emptyArray; - - /** - * Process envVariablesTruncated. - * @member {boolean} envVariablesTruncated - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.envVariablesTruncated = false; - - /** - * Process pid. - * @member {number|Long} pid - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.pid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Process parentPid. - * @member {number|Long} parentPid - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.parentPid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Process userId. - * @member {number|Long} userId - * @memberof google.cloud.securitycenter.v2.Process - * @instance - */ - Process.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Process instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Process - * @static - * @param {google.cloud.securitycenter.v2.IProcess=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Process} Process instance - */ - Process.create = function create(properties) { - return new Process(properties); - }; - - /** - * Encodes the specified Process message. Does not implicitly {@link google.cloud.securitycenter.v2.Process.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Process - * @static - * @param {google.cloud.securitycenter.v2.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.binary != null && Object.hasOwnProperty.call(message, "binary")) - $root.google.cloud.securitycenter.v2.File.encode(message.binary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.libraries != null && message.libraries.length) - for (var i = 0; i < message.libraries.length; ++i) - $root.google.cloud.securitycenter.v2.File.encode(message.libraries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.script != null && Object.hasOwnProperty.call(message, "script")) - $root.google.cloud.securitycenter.v2.File.encode(message.script, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.args[i]); - if (message.argumentsTruncated != null && Object.hasOwnProperty.call(message, "argumentsTruncated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.argumentsTruncated); - if (message.envVariables != null && message.envVariables.length) - for (var i = 0; i < message.envVariables.length; ++i) - $root.google.cloud.securitycenter.v2.EnvironmentVariable.encode(message.envVariables[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.envVariablesTruncated != null && Object.hasOwnProperty.call(message, "envVariablesTruncated")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.envVariablesTruncated); - if (message.pid != null && Object.hasOwnProperty.call(message, "pid")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.pid); - if (message.parentPid != null && Object.hasOwnProperty.call(message, "parentPid")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.parentPid); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 11, wireType 0 =*/88).int64(message.userId); - return writer; - }; - - /** - * Encodes the specified Process message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Process.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Process - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Process(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.binary = $root.google.cloud.securitycenter.v2.File.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.libraries && message.libraries.length)) - message.libraries = []; - message.libraries.push($root.google.cloud.securitycenter.v2.File.decode(reader, reader.uint32())); - break; - } - case 4: { - message.script = $root.google.cloud.securitycenter.v2.File.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 6: { - message.argumentsTruncated = reader.bool(); - break; - } - case 7: { - if (!(message.envVariables && message.envVariables.length)) - message.envVariables = []; - message.envVariables.push($root.google.cloud.securitycenter.v2.EnvironmentVariable.decode(reader, reader.uint32())); - break; - } - case 8: { - message.envVariablesTruncated = reader.bool(); - break; - } - case 9: { - message.pid = reader.int64(); - break; - } - case 10: { - message.parentPid = reader.int64(); - break; - } - case 11: { - message.userId = 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.v2.Process - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.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.v2.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.v2.File.verify(message.libraries[i]); - if (error) - return "libraries." + error; - } - } - if (message.script != null && message.hasOwnProperty("script")) { - var error = $root.google.cloud.securitycenter.v2.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.v2.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"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high))) - return "userId: 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.v2.Process - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Process} Process - */ - Process.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Process) - return object; - var message = new $root.google.cloud.securitycenter.v2.Process(); - if (object.name != null) - message.name = String(object.name); - if (object.binary != null) { - if (typeof object.binary !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Process.binary: object expected"); - message.binary = $root.google.cloud.securitycenter.v2.File.fromObject(object.binary); - } - if (object.libraries) { - if (!Array.isArray(object.libraries)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Process.libraries: object expected"); - message.libraries[i] = $root.google.cloud.securitycenter.v2.File.fromObject(object.libraries[i]); - } - } - if (object.script != null) { - if (typeof object.script !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Process.script: object expected"); - message.script = $root.google.cloud.securitycenter.v2.File.fromObject(object.script); - } - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.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.v2.Process.envVariables: object expected"); - message.envVariables[i] = $root.google.cloud.securitycenter.v2.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(); - if (object.userId != null) - if ($util.Long) - (message.userId = $util.Long.fromValue(object.userId)).unsigned = false; - else if (typeof object.userId === "string") - message.userId = parseInt(object.userId, 10); - else if (typeof object.userId === "number") - message.userId = object.userId; - else if (typeof object.userId === "object") - message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.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.v2.Process - * @static - * @param {google.cloud.securitycenter.v2.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 (options.defaults) { - object.name = ""; - 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 ($util.Long) { - var long = new $util.Long(0, 0, false); - object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.userId = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.binary != null && message.hasOwnProperty("binary")) - object.binary = $root.google.cloud.securitycenter.v2.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.v2.File.toObject(message.libraries[j], options); - } - if (message.script != null && message.hasOwnProperty("script")) - object.script = $root.google.cloud.securitycenter.v2.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.v2.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; - if (message.userId != null && message.hasOwnProperty("userId")) - if (typeof message.userId === "number") - object.userId = options.longs === String ? String(message.userId) : message.userId; - else - object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId; - return object; - }; - - /** - * Converts this Process to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Process - * @instance - * @returns {Object.} JSON object - */ - Process.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Process - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Process"; - }; - - return Process; - })(); - - v2.EnvironmentVariable = (function() { - - /** - * Properties of an EnvironmentVariable. - * @memberof google.cloud.securitycenter.v2 - * @interface IEnvironmentVariable - * @property {string|null} [name] EnvironmentVariable name - * @property {string|null} [val] EnvironmentVariable val - */ - - /** - * Constructs a new EnvironmentVariable. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an EnvironmentVariable. - * @implements IEnvironmentVariable - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.EnvironmentVariable - * @instance - */ - EnvironmentVariable.prototype.name = ""; - - /** - * EnvironmentVariable val. - * @member {string} val - * @memberof google.cloud.securitycenter.v2.EnvironmentVariable - * @instance - */ - EnvironmentVariable.prototype.val = ""; - - /** - * Creates a new EnvironmentVariable instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.EnvironmentVariable - * @static - * @param {google.cloud.securitycenter.v2.IEnvironmentVariable=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.EnvironmentVariable} EnvironmentVariable instance - */ - EnvironmentVariable.create = function create(properties) { - return new EnvironmentVariable(properties); - }; - - /** - * Encodes the specified EnvironmentVariable message. Does not implicitly {@link google.cloud.securitycenter.v2.EnvironmentVariable.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.EnvironmentVariable - * @static - * @param {google.cloud.securitycenter.v2.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.v2.EnvironmentVariable.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.EnvironmentVariable - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.EnvironmentVariable(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.val = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnvironmentVariable message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.EnvironmentVariable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.EnvironmentVariable - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.EnvironmentVariable} EnvironmentVariable - */ - EnvironmentVariable.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.EnvironmentVariable) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.EnvironmentVariable - * @static - * @param {google.cloud.securitycenter.v2.EnvironmentVariable} message EnvironmentVariable - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnvironmentVariable.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.val = ""; - } - 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 EnvironmentVariable to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.EnvironmentVariable - * @instance - * @returns {Object.} JSON object - */ - EnvironmentVariable.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnvironmentVariable - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.EnvironmentVariable"; - }; - - return EnvironmentVariable; - })(); - - v2.SecurityMarks = (function() { - - /** - * Properties of a SecurityMarks. - * @memberof google.cloud.securitycenter.v2 - * @interface ISecurityMarks - * @property {string|null} [name] SecurityMarks name - * @property {Object.|null} [marks] SecurityMarks marks - * @property {string|null} [canonicalName] SecurityMarks canonicalName - */ - - /** - * Constructs a new SecurityMarks. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a SecurityMarks. - * @implements ISecurityMarks - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.SecurityMarks - * @instance - */ - SecurityMarks.prototype.name = ""; - - /** - * SecurityMarks marks. - * @member {Object.} marks - * @memberof google.cloud.securitycenter.v2.SecurityMarks - * @instance - */ - SecurityMarks.prototype.marks = $util.emptyObject; - - /** - * SecurityMarks canonicalName. - * @member {string} canonicalName - * @memberof google.cloud.securitycenter.v2.SecurityMarks - * @instance - */ - SecurityMarks.prototype.canonicalName = ""; - - /** - * Creates a new SecurityMarks instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v2.ISecurityMarks=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.SecurityMarks} SecurityMarks instance - */ - SecurityMarks.create = function create(properties) { - return new SecurityMarks(properties); - }; - - /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityMarks.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - 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; - }; - - /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityMarks.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityMarks(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - } - } - message.marks[key] = value; - break; - } - case 3: { - message.canonicalName = 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.v2.SecurityMarks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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"; - } - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - if (!$util.isString(message.canonicalName)) - return "canonicalName: 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.v2.SecurityMarks - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.SecurityMarks} SecurityMarks - */ - SecurityMarks.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.SecurityMarks) - return object; - var message = new $root.google.cloud.securitycenter.v2.SecurityMarks(); - if (object.name != null) - message.name = String(object.name); - if (object.marks) { - if (typeof object.marks !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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]]); - } - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); - return message; - }; - - /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v2.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 = ""; - object.canonicalName = ""; - } - 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.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; - return object; - }; - - /** - * Converts this SecurityMarks to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.SecurityMarks - * @instance - * @returns {Object.} JSON object - */ - SecurityMarks.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityMarks - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.SecurityMarks"; - }; - - return SecurityMarks; - })(); - - v2.SecurityPosture = (function() { - - /** - * Properties of a SecurityPosture. - * @memberof google.cloud.securitycenter.v2 - * @interface ISecurityPosture - * @property {string|null} [name] SecurityPosture name - * @property {string|null} [revisionId] SecurityPosture revisionId - * @property {string|null} [postureDeploymentResource] SecurityPosture postureDeploymentResource - * @property {string|null} [postureDeployment] SecurityPosture postureDeployment - * @property {string|null} [changedPolicy] SecurityPosture changedPolicy - * @property {string|null} [policySet] SecurityPosture policySet - * @property {string|null} [policy] SecurityPosture policy - * @property {Array.|null} [policyDriftDetails] SecurityPosture policyDriftDetails - */ - - /** - * Constructs a new SecurityPosture. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a SecurityPosture. - * @implements ISecurityPosture - * @constructor - * @param {google.cloud.securitycenter.v2.ISecurityPosture=} [properties] Properties to set - */ - function SecurityPosture(properties) { - this.policyDriftDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityPosture name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - */ - SecurityPosture.prototype.name = ""; - - /** - * SecurityPosture revisionId. - * @member {string} revisionId - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - */ - SecurityPosture.prototype.revisionId = ""; - - /** - * SecurityPosture postureDeploymentResource. - * @member {string} postureDeploymentResource - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - */ - SecurityPosture.prototype.postureDeploymentResource = ""; - - /** - * SecurityPosture postureDeployment. - * @member {string} postureDeployment - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - */ - SecurityPosture.prototype.postureDeployment = ""; - - /** - * SecurityPosture changedPolicy. - * @member {string} changedPolicy - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - */ - SecurityPosture.prototype.changedPolicy = ""; - - /** - * SecurityPosture policySet. - * @member {string} policySet - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - */ - SecurityPosture.prototype.policySet = ""; - - /** - * SecurityPosture policy. - * @member {string} policy - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - */ - SecurityPosture.prototype.policy = ""; - - /** - * SecurityPosture policyDriftDetails. - * @member {Array.} policyDriftDetails - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - */ - SecurityPosture.prototype.policyDriftDetails = $util.emptyArray; - - /** - * Creates a new SecurityPosture instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {google.cloud.securitycenter.v2.ISecurityPosture=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.SecurityPosture} SecurityPosture instance - */ - SecurityPosture.create = function create(properties) { - return new SecurityPosture(properties); - }; - - /** - * Encodes the specified SecurityPosture message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {google.cloud.securitycenter.v2.ISecurityPosture} message SecurityPosture message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityPosture.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); - if (message.postureDeploymentResource != null && Object.hasOwnProperty.call(message, "postureDeploymentResource")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.postureDeploymentResource); - if (message.postureDeployment != null && Object.hasOwnProperty.call(message, "postureDeployment")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.postureDeployment); - if (message.changedPolicy != null && Object.hasOwnProperty.call(message, "changedPolicy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.changedPolicy); - if (message.policySet != null && Object.hasOwnProperty.call(message, "policySet")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.policySet); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.policy); - if (message.policyDriftDetails != null && message.policyDriftDetails.length) - for (var i = 0; i < message.policyDriftDetails.length; ++i) - $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.encode(message.policyDriftDetails[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SecurityPosture message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {google.cloud.securitycenter.v2.ISecurityPosture} message SecurityPosture message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityPosture.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityPosture message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.SecurityPosture} SecurityPosture - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityPosture.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityPosture(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.revisionId = reader.string(); - break; - } - case 3: { - message.postureDeploymentResource = reader.string(); - break; - } - case 4: { - message.postureDeployment = reader.string(); - break; - } - case 5: { - message.changedPolicy = reader.string(); - break; - } - case 6: { - message.policySet = reader.string(); - break; - } - case 7: { - message.policy = reader.string(); - break; - } - case 8: { - if (!(message.policyDriftDetails && message.policyDriftDetails.length)) - message.policyDriftDetails = []; - message.policyDriftDetails.push($root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityPosture message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.SecurityPosture} SecurityPosture - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityPosture.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityPosture message. - * @function verify - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityPosture.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.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - if (message.postureDeploymentResource != null && message.hasOwnProperty("postureDeploymentResource")) - if (!$util.isString(message.postureDeploymentResource)) - return "postureDeploymentResource: string expected"; - if (message.postureDeployment != null && message.hasOwnProperty("postureDeployment")) - if (!$util.isString(message.postureDeployment)) - return "postureDeployment: string expected"; - if (message.changedPolicy != null && message.hasOwnProperty("changedPolicy")) - if (!$util.isString(message.changedPolicy)) - return "changedPolicy: string expected"; - if (message.policySet != null && message.hasOwnProperty("policySet")) - if (!$util.isString(message.policySet)) - return "policySet: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) - if (!$util.isString(message.policy)) - return "policy: string expected"; - if (message.policyDriftDetails != null && message.hasOwnProperty("policyDriftDetails")) { - if (!Array.isArray(message.policyDriftDetails)) - return "policyDriftDetails: array expected"; - for (var i = 0; i < message.policyDriftDetails.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify(message.policyDriftDetails[i]); - if (error) - return "policyDriftDetails." + error; - } - } - return null; - }; - - /** - * Creates a SecurityPosture message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.SecurityPosture} SecurityPosture - */ - SecurityPosture.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.SecurityPosture) - return object; - var message = new $root.google.cloud.securitycenter.v2.SecurityPosture(); - if (object.name != null) - message.name = String(object.name); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.postureDeploymentResource != null) - message.postureDeploymentResource = String(object.postureDeploymentResource); - if (object.postureDeployment != null) - message.postureDeployment = String(object.postureDeployment); - if (object.changedPolicy != null) - message.changedPolicy = String(object.changedPolicy); - if (object.policySet != null) - message.policySet = String(object.policySet); - if (object.policy != null) - message.policy = String(object.policy); - if (object.policyDriftDetails) { - if (!Array.isArray(object.policyDriftDetails)) - throw TypeError(".google.cloud.securitycenter.v2.SecurityPosture.policyDriftDetails: array expected"); - message.policyDriftDetails = []; - for (var i = 0; i < object.policyDriftDetails.length; ++i) { - if (typeof object.policyDriftDetails[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.SecurityPosture.policyDriftDetails: object expected"); - message.policyDriftDetails[i] = $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.fromObject(object.policyDriftDetails[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SecurityPosture message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {google.cloud.securitycenter.v2.SecurityPosture} message SecurityPosture - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityPosture.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.policyDriftDetails = []; - if (options.defaults) { - object.name = ""; - object.revisionId = ""; - object.postureDeploymentResource = ""; - object.postureDeployment = ""; - object.changedPolicy = ""; - object.policySet = ""; - object.policy = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - if (message.postureDeploymentResource != null && message.hasOwnProperty("postureDeploymentResource")) - object.postureDeploymentResource = message.postureDeploymentResource; - if (message.postureDeployment != null && message.hasOwnProperty("postureDeployment")) - object.postureDeployment = message.postureDeployment; - if (message.changedPolicy != null && message.hasOwnProperty("changedPolicy")) - object.changedPolicy = message.changedPolicy; - if (message.policySet != null && message.hasOwnProperty("policySet")) - object.policySet = message.policySet; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = message.policy; - if (message.policyDriftDetails && message.policyDriftDetails.length) { - object.policyDriftDetails = []; - for (var j = 0; j < message.policyDriftDetails.length; ++j) - object.policyDriftDetails[j] = $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.toObject(message.policyDriftDetails[j], options); - } - return object; - }; - - /** - * Converts this SecurityPosture to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @instance - * @returns {Object.} JSON object - */ - SecurityPosture.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityPosture - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecurityPosture.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.SecurityPosture"; - }; - - SecurityPosture.PolicyDriftDetails = (function() { - - /** - * Properties of a PolicyDriftDetails. - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @interface IPolicyDriftDetails - * @property {string|null} [field] PolicyDriftDetails field - * @property {string|null} [expectedValue] PolicyDriftDetails expectedValue - * @property {string|null} [detectedValue] PolicyDriftDetails detectedValue - */ - - /** - * Constructs a new PolicyDriftDetails. - * @memberof google.cloud.securitycenter.v2.SecurityPosture - * @classdesc Represents a PolicyDriftDetails. - * @implements IPolicyDriftDetails - * @constructor - * @param {google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails=} [properties] Properties to set - */ - function PolicyDriftDetails(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolicyDriftDetails field. - * @member {string} field - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @instance - */ - PolicyDriftDetails.prototype.field = ""; - - /** - * PolicyDriftDetails expectedValue. - * @member {string} expectedValue - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @instance - */ - PolicyDriftDetails.prototype.expectedValue = ""; - - /** - * PolicyDriftDetails detectedValue. - * @member {string} detectedValue - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @instance - */ - PolicyDriftDetails.prototype.detectedValue = ""; - - /** - * Creates a new PolicyDriftDetails instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails instance - */ - PolicyDriftDetails.create = function create(properties) { - return new PolicyDriftDetails(properties); - }; - - /** - * Encodes the specified PolicyDriftDetails message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails} message PolicyDriftDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDriftDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.expectedValue != null && Object.hasOwnProperty.call(message, "expectedValue")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.expectedValue); - if (message.detectedValue != null && Object.hasOwnProperty.call(message, "detectedValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedValue); - return writer; - }; - - /** - * Encodes the specified PolicyDriftDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {google.cloud.securitycenter.v2.SecurityPosture.IPolicyDriftDetails} message PolicyDriftDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDriftDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDriftDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDriftDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.field = reader.string(); - break; - } - case 2: { - message.expectedValue = reader.string(); - break; - } - case 3: { - message.detectedValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDriftDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDriftDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDriftDetails message. - * @function verify - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDriftDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.expectedValue != null && message.hasOwnProperty("expectedValue")) - if (!$util.isString(message.expectedValue)) - return "expectedValue: string expected"; - if (message.detectedValue != null && message.hasOwnProperty("detectedValue")) - if (!$util.isString(message.detectedValue)) - return "detectedValue: string expected"; - return null; - }; - - /** - * Creates a PolicyDriftDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} PolicyDriftDetails - */ - PolicyDriftDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails) - return object; - var message = new $root.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails(); - if (object.field != null) - message.field = String(object.field); - if (object.expectedValue != null) - message.expectedValue = String(object.expectedValue); - if (object.detectedValue != null) - message.detectedValue = String(object.detectedValue); - return message; - }; - - /** - * Creates a plain object from a PolicyDriftDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails} message PolicyDriftDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDriftDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.field = ""; - object.expectedValue = ""; - object.detectedValue = ""; - } - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.expectedValue != null && message.hasOwnProperty("expectedValue")) - object.expectedValue = message.expectedValue; - if (message.detectedValue != null && message.hasOwnProperty("detectedValue")) - object.detectedValue = message.detectedValue; - return object; - }; - - /** - * Converts this PolicyDriftDetails to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @instance - * @returns {Object.} JSON object - */ - PolicyDriftDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDriftDetails - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDriftDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails"; - }; - - return PolicyDriftDetails; - })(); - - return SecurityPosture; - })(); - - v2.ToxicCombination = (function() { - - /** - * Properties of a ToxicCombination. - * @memberof google.cloud.securitycenter.v2 - * @interface IToxicCombination - * @property {number|null} [attackExposureScore] ToxicCombination attackExposureScore - * @property {Array.|null} [relatedFindings] ToxicCombination relatedFindings - */ - - /** - * Constructs a new ToxicCombination. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ToxicCombination. - * @implements IToxicCombination - * @constructor - * @param {google.cloud.securitycenter.v2.IToxicCombination=} [properties] Properties to set - */ - function ToxicCombination(properties) { - this.relatedFindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToxicCombination attackExposureScore. - * @member {number} attackExposureScore - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @instance - */ - ToxicCombination.prototype.attackExposureScore = 0; - - /** - * ToxicCombination relatedFindings. - * @member {Array.} relatedFindings - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @instance - */ - ToxicCombination.prototype.relatedFindings = $util.emptyArray; - - /** - * Creates a new ToxicCombination instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {google.cloud.securitycenter.v2.IToxicCombination=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination instance - */ - ToxicCombination.create = function create(properties) { - return new ToxicCombination(properties); - }; - - /** - * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {google.cloud.securitycenter.v2.IToxicCombination} message ToxicCombination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToxicCombination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attackExposureScore != null && Object.hasOwnProperty.call(message, "attackExposureScore")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.attackExposureScore); - if (message.relatedFindings != null && message.relatedFindings.length) - for (var i = 0; i < message.relatedFindings.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relatedFindings[i]); - return writer; - }; - - /** - * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {google.cloud.securitycenter.v2.IToxicCombination} message ToxicCombination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToxicCombination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToxicCombination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToxicCombination.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ToxicCombination(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.attackExposureScore = reader.double(); - break; - } - case 2: { - if (!(message.relatedFindings && message.relatedFindings.length)) - message.relatedFindings = []; - message.relatedFindings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToxicCombination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToxicCombination message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToxicCombination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) - if (typeof message.attackExposureScore !== "number") - return "attackExposureScore: number expected"; - if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { - if (!Array.isArray(message.relatedFindings)) - return "relatedFindings: array expected"; - for (var i = 0; i < message.relatedFindings.length; ++i) - if (!$util.isString(message.relatedFindings[i])) - return "relatedFindings: string[] expected"; - } - return null; - }; - - /** - * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination - */ - ToxicCombination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ToxicCombination) - return object; - var message = new $root.google.cloud.securitycenter.v2.ToxicCombination(); - if (object.attackExposureScore != null) - message.attackExposureScore = Number(object.attackExposureScore); - if (object.relatedFindings) { - if (!Array.isArray(object.relatedFindings)) - throw TypeError(".google.cloud.securitycenter.v2.ToxicCombination.relatedFindings: array expected"); - message.relatedFindings = []; - for (var i = 0; i < object.relatedFindings.length; ++i) - message.relatedFindings[i] = String(object.relatedFindings[i]); - } - return message; - }; - - /** - * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {google.cloud.securitycenter.v2.ToxicCombination} message ToxicCombination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToxicCombination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.relatedFindings = []; - if (options.defaults) - object.attackExposureScore = 0; - if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) - object.attackExposureScore = options.json && !isFinite(message.attackExposureScore) ? String(message.attackExposureScore) : message.attackExposureScore; - if (message.relatedFindings && message.relatedFindings.length) { - object.relatedFindings = []; - for (var j = 0; j < message.relatedFindings.length; ++j) - object.relatedFindings[j] = message.relatedFindings[j]; - } - return object; - }; - - /** - * Converts this ToxicCombination to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @instance - * @returns {Object.} JSON object - */ - ToxicCombination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToxicCombination - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ToxicCombination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToxicCombination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ToxicCombination"; - }; - - return ToxicCombination; - })(); - - v2.VertexAi = (function() { - - /** - * Properties of a VertexAi. - * @memberof google.cloud.securitycenter.v2 - * @interface IVertexAi - * @property {Array.|null} [datasets] VertexAi datasets - * @property {Array.|null} [pipelines] VertexAi pipelines - */ - - /** - * Constructs a new VertexAi. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a VertexAi. - * @implements IVertexAi - * @constructor - * @param {google.cloud.securitycenter.v2.IVertexAi=} [properties] Properties to set - */ - function VertexAi(properties) { - this.datasets = []; - this.pipelines = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VertexAi datasets. - * @member {Array.} datasets - * @memberof google.cloud.securitycenter.v2.VertexAi - * @instance - */ - VertexAi.prototype.datasets = $util.emptyArray; - - /** - * VertexAi pipelines. - * @member {Array.} pipelines - * @memberof google.cloud.securitycenter.v2.VertexAi - * @instance - */ - VertexAi.prototype.pipelines = $util.emptyArray; - - /** - * Creates a new VertexAi instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {google.cloud.securitycenter.v2.IVertexAi=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.VertexAi} VertexAi instance - */ - VertexAi.create = function create(properties) { - return new VertexAi(properties); - }; - - /** - * Encodes the specified VertexAi message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {google.cloud.securitycenter.v2.IVertexAi} message VertexAi message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VertexAi.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.datasets != null && message.datasets.length) - for (var i = 0; i < message.datasets.length; ++i) - $root.google.cloud.securitycenter.v2.VertexAi.Dataset.encode(message.datasets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pipelines != null && message.pipelines.length) - for (var i = 0; i < message.pipelines.length; ++i) - $root.google.cloud.securitycenter.v2.VertexAi.Pipeline.encode(message.pipelines[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VertexAi message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {google.cloud.securitycenter.v2.IVertexAi} message VertexAi message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VertexAi.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VertexAi message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.VertexAi} VertexAi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VertexAi.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.VertexAi(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.datasets && message.datasets.length)) - message.datasets = []; - message.datasets.push($root.google.cloud.securitycenter.v2.VertexAi.Dataset.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.pipelines && message.pipelines.length)) - message.pipelines = []; - message.pipelines.push($root.google.cloud.securitycenter.v2.VertexAi.Pipeline.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VertexAi message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.VertexAi} VertexAi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VertexAi.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VertexAi message. - * @function verify - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VertexAi.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.datasets != null && message.hasOwnProperty("datasets")) { - if (!Array.isArray(message.datasets)) - return "datasets: array expected"; - for (var i = 0; i < message.datasets.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.VertexAi.Dataset.verify(message.datasets[i]); - if (error) - return "datasets." + error; - } - } - if (message.pipelines != null && message.hasOwnProperty("pipelines")) { - if (!Array.isArray(message.pipelines)) - return "pipelines: array expected"; - for (var i = 0; i < message.pipelines.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.VertexAi.Pipeline.verify(message.pipelines[i]); - if (error) - return "pipelines." + error; - } - } - return null; - }; - - /** - * Creates a VertexAi message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.VertexAi} VertexAi - */ - VertexAi.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.VertexAi) - return object; - var message = new $root.google.cloud.securitycenter.v2.VertexAi(); - if (object.datasets) { - if (!Array.isArray(object.datasets)) - throw TypeError(".google.cloud.securitycenter.v2.VertexAi.datasets: array expected"); - message.datasets = []; - for (var i = 0; i < object.datasets.length; ++i) { - if (typeof object.datasets[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.VertexAi.datasets: object expected"); - message.datasets[i] = $root.google.cloud.securitycenter.v2.VertexAi.Dataset.fromObject(object.datasets[i]); - } - } - if (object.pipelines) { - if (!Array.isArray(object.pipelines)) - throw TypeError(".google.cloud.securitycenter.v2.VertexAi.pipelines: array expected"); - message.pipelines = []; - for (var i = 0; i < object.pipelines.length; ++i) { - if (typeof object.pipelines[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.VertexAi.pipelines: object expected"); - message.pipelines[i] = $root.google.cloud.securitycenter.v2.VertexAi.Pipeline.fromObject(object.pipelines[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a VertexAi message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {google.cloud.securitycenter.v2.VertexAi} message VertexAi - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VertexAi.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.datasets = []; - object.pipelines = []; - } - if (message.datasets && message.datasets.length) { - object.datasets = []; - for (var j = 0; j < message.datasets.length; ++j) - object.datasets[j] = $root.google.cloud.securitycenter.v2.VertexAi.Dataset.toObject(message.datasets[j], options); - } - if (message.pipelines && message.pipelines.length) { - object.pipelines = []; - for (var j = 0; j < message.pipelines.length; ++j) - object.pipelines[j] = $root.google.cloud.securitycenter.v2.VertexAi.Pipeline.toObject(message.pipelines[j], options); - } - return object; - }; - - /** - * Converts this VertexAi to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.VertexAi - * @instance - * @returns {Object.} JSON object - */ - VertexAi.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VertexAi - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.VertexAi - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VertexAi.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.VertexAi"; - }; - - VertexAi.Dataset = (function() { - - /** - * Properties of a Dataset. - * @memberof google.cloud.securitycenter.v2.VertexAi - * @interface IDataset - * @property {string|null} [name] Dataset name - * @property {string|null} [displayName] Dataset displayName - * @property {string|null} [source] Dataset source - */ - - /** - * Constructs a new Dataset. - * @memberof google.cloud.securitycenter.v2.VertexAi - * @classdesc Represents a Dataset. - * @implements IDataset - * @constructor - * @param {google.cloud.securitycenter.v2.VertexAi.IDataset=} [properties] Properties to set - */ - function Dataset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Dataset name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @instance - */ - Dataset.prototype.name = ""; - - /** - * Dataset displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @instance - */ - Dataset.prototype.displayName = ""; - - /** - * Dataset source. - * @member {string} source - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @instance - */ - Dataset.prototype.source = ""; - - /** - * Creates a new Dataset instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {google.cloud.securitycenter.v2.VertexAi.IDataset=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.VertexAi.Dataset} Dataset instance - */ - Dataset.create = function create(properties) { - return new Dataset(properties); - }; - - /** - * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Dataset.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {google.cloud.securitycenter.v2.VertexAi.IDataset} message Dataset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dataset.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.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.source); - return writer; - }; - - /** - * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Dataset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {google.cloud.securitycenter.v2.VertexAi.IDataset} message Dataset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dataset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Dataset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.VertexAi.Dataset} Dataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dataset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.VertexAi.Dataset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.source = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Dataset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.VertexAi.Dataset} Dataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dataset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Dataset message. - * @function verify - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Dataset.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.source != null && message.hasOwnProperty("source")) - if (!$util.isString(message.source)) - return "source: string expected"; - return null; - }; - - /** - * Creates a Dataset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.VertexAi.Dataset} Dataset - */ - Dataset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.VertexAi.Dataset) - return object; - var message = new $root.google.cloud.securitycenter.v2.VertexAi.Dataset(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.source != null) - message.source = String(object.source); - return message; - }; - - /** - * Creates a plain object from a Dataset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {google.cloud.securitycenter.v2.VertexAi.Dataset} message Dataset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Dataset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.source = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - return object; - }; - - /** - * Converts this Dataset to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @instance - * @returns {Object.} JSON object - */ - Dataset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Dataset - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.VertexAi.Dataset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.VertexAi.Dataset"; - }; - - return Dataset; - })(); - - VertexAi.Pipeline = (function() { - - /** - * Properties of a Pipeline. - * @memberof google.cloud.securitycenter.v2.VertexAi - * @interface IPipeline - * @property {string|null} [name] Pipeline name - * @property {string|null} [displayName] Pipeline displayName - */ - - /** - * Constructs a new Pipeline. - * @memberof google.cloud.securitycenter.v2.VertexAi - * @classdesc Represents a Pipeline. - * @implements IPipeline - * @constructor - * @param {google.cloud.securitycenter.v2.VertexAi.IPipeline=} [properties] Properties to set - */ - function Pipeline(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Pipeline name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @instance - */ - Pipeline.prototype.name = ""; - - /** - * Pipeline displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @instance - */ - Pipeline.prototype.displayName = ""; - - /** - * Creates a new Pipeline instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {google.cloud.securitycenter.v2.VertexAi.IPipeline=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.VertexAi.Pipeline} Pipeline instance - */ - Pipeline.create = function create(properties) { - return new Pipeline(properties); - }; - - /** - * Encodes the specified Pipeline message. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Pipeline.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {google.cloud.securitycenter.v2.VertexAi.IPipeline} message Pipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Pipeline.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); - return writer; - }; - - /** - * Encodes the specified Pipeline message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.VertexAi.Pipeline.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {google.cloud.securitycenter.v2.VertexAi.IPipeline} message Pipeline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Pipeline.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Pipeline message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.VertexAi.Pipeline} Pipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Pipeline.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.VertexAi.Pipeline(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Pipeline message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.VertexAi.Pipeline} Pipeline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Pipeline.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Pipeline message. - * @function verify - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Pipeline.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"; - return null; - }; - - /** - * Creates a Pipeline message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.VertexAi.Pipeline} Pipeline - */ - Pipeline.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.VertexAi.Pipeline) - return object; - var message = new $root.google.cloud.securitycenter.v2.VertexAi.Pipeline(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a Pipeline message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {google.cloud.securitycenter.v2.VertexAi.Pipeline} message Pipeline - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Pipeline.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this Pipeline to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @instance - * @returns {Object.} JSON object - */ - Pipeline.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Pipeline - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.VertexAi.Pipeline - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Pipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.VertexAi.Pipeline"; - }; - - return Pipeline; - })(); - - return VertexAi; - })(); - - v2.Vulnerability = (function() { - - /** - * Properties of a Vulnerability. - * @memberof google.cloud.securitycenter.v2 - * @interface IVulnerability - * @property {google.cloud.securitycenter.v2.ICve|null} [cve] Vulnerability cve - * @property {google.cloud.securitycenter.v2.IPackage|null} [offendingPackage] Vulnerability offendingPackage - * @property {google.cloud.securitycenter.v2.IPackage|null} [fixedPackage] Vulnerability fixedPackage - * @property {google.cloud.securitycenter.v2.ISecurityBulletin|null} [securityBulletin] Vulnerability securityBulletin - * @property {number|Long|null} [providerRiskScore] Vulnerability providerRiskScore - * @property {boolean|null} [reachable] Vulnerability reachable - * @property {Array.|null} [cwes] Vulnerability cwes - */ - - /** - * Constructs a new Vulnerability. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Vulnerability. - * @implements IVulnerability - * @constructor - * @param {google.cloud.securitycenter.v2.IVulnerability=} [properties] Properties to set - */ - function Vulnerability(properties) { - this.cwes = []; - if (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.v2.ICve|null|undefined} cve - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @instance - */ - Vulnerability.prototype.cve = null; - - /** - * Vulnerability offendingPackage. - * @member {google.cloud.securitycenter.v2.IPackage|null|undefined} offendingPackage - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @instance - */ - Vulnerability.prototype.offendingPackage = null; - - /** - * Vulnerability fixedPackage. - * @member {google.cloud.securitycenter.v2.IPackage|null|undefined} fixedPackage - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @instance - */ - Vulnerability.prototype.fixedPackage = null; - - /** - * Vulnerability securityBulletin. - * @member {google.cloud.securitycenter.v2.ISecurityBulletin|null|undefined} securityBulletin - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @instance - */ - Vulnerability.prototype.securityBulletin = null; - - /** - * Vulnerability providerRiskScore. - * @member {number|Long} providerRiskScore - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @instance - */ - Vulnerability.prototype.providerRiskScore = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Vulnerability reachable. - * @member {boolean} reachable - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @instance - */ - Vulnerability.prototype.reachable = false; - - /** - * Vulnerability cwes. - * @member {Array.} cwes - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @instance - */ - Vulnerability.prototype.cwes = $util.emptyArray; - - /** - * Creates a new Vulnerability instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @static - * @param {google.cloud.securitycenter.v2.IVulnerability=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Vulnerability} Vulnerability instance - */ - Vulnerability.create = function create(properties) { - return new Vulnerability(properties); - }; - - /** - * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.securitycenter.v2.Vulnerability.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Cve.encode(message.cve, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.offendingPackage != null && Object.hasOwnProperty.call(message, "offendingPackage")) - $root.google.cloud.securitycenter.v2.Package.encode(message.offendingPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.fixedPackage != null && Object.hasOwnProperty.call(message, "fixedPackage")) - $root.google.cloud.securitycenter.v2.Package.encode(message.fixedPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.securityBulletin != null && Object.hasOwnProperty.call(message, "securityBulletin")) - $root.google.cloud.securitycenter.v2.SecurityBulletin.encode(message.securityBulletin, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.providerRiskScore != null && Object.hasOwnProperty.call(message, "providerRiskScore")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.providerRiskScore); - if (message.reachable != null && Object.hasOwnProperty.call(message, "reachable")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.reachable); - if (message.cwes != null && message.cwes.length) - for (var i = 0; i < message.cwes.length; ++i) - $root.google.cloud.securitycenter.v2.Cwe.encode(message.cwes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Vulnerability.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Vulnerability(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cve = $root.google.cloud.securitycenter.v2.Cve.decode(reader, reader.uint32()); - break; - } - case 2: { - message.offendingPackage = $root.google.cloud.securitycenter.v2.Package.decode(reader, reader.uint32()); - break; - } - case 3: { - message.fixedPackage = $root.google.cloud.securitycenter.v2.Package.decode(reader, reader.uint32()); - break; - } - case 4: { - message.securityBulletin = $root.google.cloud.securitycenter.v2.SecurityBulletin.decode(reader, reader.uint32()); - break; - } - case 5: { - message.providerRiskScore = reader.int64(); - break; - } - case 6: { - message.reachable = reader.bool(); - break; - } - case 7: { - if (!(message.cwes && message.cwes.length)) - message.cwes = []; - message.cwes.push($root.google.cloud.securitycenter.v2.Cwe.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.v2.Vulnerability - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Cve.verify(message.cve); - if (error) - return "cve." + error; - } - if (message.offendingPackage != null && message.hasOwnProperty("offendingPackage")) { - var error = $root.google.cloud.securitycenter.v2.Package.verify(message.offendingPackage); - if (error) - return "offendingPackage." + error; - } - if (message.fixedPackage != null && message.hasOwnProperty("fixedPackage")) { - var error = $root.google.cloud.securitycenter.v2.Package.verify(message.fixedPackage); - if (error) - return "fixedPackage." + error; - } - if (message.securityBulletin != null && message.hasOwnProperty("securityBulletin")) { - var error = $root.google.cloud.securitycenter.v2.SecurityBulletin.verify(message.securityBulletin); - if (error) - return "securityBulletin." + error; - } - if (message.providerRiskScore != null && message.hasOwnProperty("providerRiskScore")) - if (!$util.isInteger(message.providerRiskScore) && !(message.providerRiskScore && $util.isInteger(message.providerRiskScore.low) && $util.isInteger(message.providerRiskScore.high))) - return "providerRiskScore: integer|Long expected"; - if (message.reachable != null && message.hasOwnProperty("reachable")) - if (typeof message.reachable !== "boolean") - return "reachable: boolean expected"; - if (message.cwes != null && message.hasOwnProperty("cwes")) { - if (!Array.isArray(message.cwes)) - return "cwes: array expected"; - for (var i = 0; i < message.cwes.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.Cwe.verify(message.cwes[i]); - if (error) - return "cwes." + 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.v2.Vulnerability - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Vulnerability} Vulnerability - */ - Vulnerability.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Vulnerability) - return object; - var message = new $root.google.cloud.securitycenter.v2.Vulnerability(); - if (object.cve != null) { - if (typeof object.cve !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.cve: object expected"); - message.cve = $root.google.cloud.securitycenter.v2.Cve.fromObject(object.cve); - } - if (object.offendingPackage != null) { - if (typeof object.offendingPackage !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.offendingPackage: object expected"); - message.offendingPackage = $root.google.cloud.securitycenter.v2.Package.fromObject(object.offendingPackage); - } - if (object.fixedPackage != null) { - if (typeof object.fixedPackage !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.fixedPackage: object expected"); - message.fixedPackage = $root.google.cloud.securitycenter.v2.Package.fromObject(object.fixedPackage); - } - if (object.securityBulletin != null) { - if (typeof object.securityBulletin !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.securityBulletin: object expected"); - message.securityBulletin = $root.google.cloud.securitycenter.v2.SecurityBulletin.fromObject(object.securityBulletin); - } - if (object.providerRiskScore != null) - if ($util.Long) - (message.providerRiskScore = $util.Long.fromValue(object.providerRiskScore)).unsigned = false; - else if (typeof object.providerRiskScore === "string") - message.providerRiskScore = parseInt(object.providerRiskScore, 10); - else if (typeof object.providerRiskScore === "number") - message.providerRiskScore = object.providerRiskScore; - else if (typeof object.providerRiskScore === "object") - message.providerRiskScore = new $util.LongBits(object.providerRiskScore.low >>> 0, object.providerRiskScore.high >>> 0).toNumber(); - if (object.reachable != null) - message.reachable = Boolean(object.reachable); - if (object.cwes) { - if (!Array.isArray(object.cwes)) - throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.cwes: array expected"); - message.cwes = []; - for (var i = 0; i < object.cwes.length; ++i) { - if (typeof object.cwes[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Vulnerability.cwes: object expected"); - message.cwes[i] = $root.google.cloud.securitycenter.v2.Cwe.fromObject(object.cwes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Vulnerability message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @static - * @param {google.cloud.securitycenter.v2.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.arrays || options.defaults) - object.cwes = []; - if (options.defaults) { - object.cve = null; - object.offendingPackage = null; - object.fixedPackage = null; - object.securityBulletin = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.providerRiskScore = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.providerRiskScore = options.longs === String ? "0" : 0; - object.reachable = false; - } - if (message.cve != null && message.hasOwnProperty("cve")) - object.cve = $root.google.cloud.securitycenter.v2.Cve.toObject(message.cve, options); - if (message.offendingPackage != null && message.hasOwnProperty("offendingPackage")) - object.offendingPackage = $root.google.cloud.securitycenter.v2.Package.toObject(message.offendingPackage, options); - if (message.fixedPackage != null && message.hasOwnProperty("fixedPackage")) - object.fixedPackage = $root.google.cloud.securitycenter.v2.Package.toObject(message.fixedPackage, options); - if (message.securityBulletin != null && message.hasOwnProperty("securityBulletin")) - object.securityBulletin = $root.google.cloud.securitycenter.v2.SecurityBulletin.toObject(message.securityBulletin, options); - if (message.providerRiskScore != null && message.hasOwnProperty("providerRiskScore")) - if (typeof message.providerRiskScore === "number") - object.providerRiskScore = options.longs === String ? String(message.providerRiskScore) : message.providerRiskScore; - else - object.providerRiskScore = options.longs === String ? $util.Long.prototype.toString.call(message.providerRiskScore) : options.longs === Number ? new $util.LongBits(message.providerRiskScore.low >>> 0, message.providerRiskScore.high >>> 0).toNumber() : message.providerRiskScore; - if (message.reachable != null && message.hasOwnProperty("reachable")) - object.reachable = message.reachable; - if (message.cwes && message.cwes.length) { - object.cwes = []; - for (var j = 0; j < message.cwes.length; ++j) - object.cwes[j] = $root.google.cloud.securitycenter.v2.Cwe.toObject(message.cwes[j], options); - } - return object; - }; - - /** - * Converts this Vulnerability to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Vulnerability - * @instance - * @returns {Object.} JSON object - */ - Vulnerability.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Vulnerability - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Vulnerability"; - }; - - return Vulnerability; - })(); - - v2.Cve = (function() { - - /** - * Properties of a Cve. - * @memberof google.cloud.securitycenter.v2 - * @interface ICve - * @property {string|null} [id] Cve id - * @property {Array.|null} [references] Cve references - * @property {google.cloud.securitycenter.v2.ICvssv3|null} [cvssv3] Cve cvssv3 - * @property {boolean|null} [upstreamFixAvailable] Cve upstreamFixAvailable - * @property {google.cloud.securitycenter.v2.Cve.RiskRating|null} [impact] Cve impact - * @property {google.cloud.securitycenter.v2.Cve.ExploitationActivity|null} [exploitationActivity] Cve exploitationActivity - * @property {boolean|null} [observedInTheWild] Cve observedInTheWild - * @property {boolean|null} [zeroDay] Cve zeroDay - * @property {google.protobuf.ITimestamp|null} [exploitReleaseDate] Cve exploitReleaseDate - * @property {google.protobuf.ITimestamp|null} [firstExploitationDate] Cve firstExploitationDate - */ - - /** - * Constructs a new Cve. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Cve. - * @implements ICve - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Cve - * @instance - */ - Cve.prototype.id = ""; - - /** - * Cve references. - * @member {Array.} references - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.references = $util.emptyArray; - - /** - * Cve cvssv3. - * @member {google.cloud.securitycenter.v2.ICvssv3|null|undefined} cvssv3 - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.cvssv3 = null; - - /** - * Cve upstreamFixAvailable. - * @member {boolean} upstreamFixAvailable - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.upstreamFixAvailable = false; - - /** - * Cve impact. - * @member {google.cloud.securitycenter.v2.Cve.RiskRating} impact - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.impact = 0; - - /** - * Cve exploitationActivity. - * @member {google.cloud.securitycenter.v2.Cve.ExploitationActivity} exploitationActivity - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.exploitationActivity = 0; - - /** - * Cve observedInTheWild. - * @member {boolean} observedInTheWild - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.observedInTheWild = false; - - /** - * Cve zeroDay. - * @member {boolean} zeroDay - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.zeroDay = false; - - /** - * Cve exploitReleaseDate. - * @member {google.protobuf.ITimestamp|null|undefined} exploitReleaseDate - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.exploitReleaseDate = null; - - /** - * Cve firstExploitationDate. - * @member {google.protobuf.ITimestamp|null|undefined} firstExploitationDate - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - */ - Cve.prototype.firstExploitationDate = null; - - /** - * Creates a new Cve instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Cve - * @static - * @param {google.cloud.securitycenter.v2.ICve=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Cve} Cve instance - */ - Cve.create = function create(properties) { - return new Cve(properties); - }; - - /** - * Encodes the specified Cve message. Does not implicitly {@link google.cloud.securitycenter.v2.Cve.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Cve - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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); - if (message.impact != null && Object.hasOwnProperty.call(message, "impact")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.impact); - if (message.exploitationActivity != null && Object.hasOwnProperty.call(message, "exploitationActivity")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.exploitationActivity); - if (message.observedInTheWild != null && Object.hasOwnProperty.call(message, "observedInTheWild")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.observedInTheWild); - if (message.zeroDay != null && Object.hasOwnProperty.call(message, "zeroDay")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.zeroDay); - if (message.exploitReleaseDate != null && Object.hasOwnProperty.call(message, "exploitReleaseDate")) - $root.google.protobuf.Timestamp.encode(message.exploitReleaseDate, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.firstExploitationDate != null && Object.hasOwnProperty.call(message, "firstExploitationDate")) - $root.google.protobuf.Timestamp.encode(message.firstExploitationDate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Cve message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Cve.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Cve - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Cve(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Reference.decode(reader, reader.uint32())); - break; - } - case 3: { - message.cvssv3 = $root.google.cloud.securitycenter.v2.Cvssv3.decode(reader, reader.uint32()); - break; - } - case 4: { - message.upstreamFixAvailable = reader.bool(); - break; - } - case 5: { - message.impact = reader.int32(); - break; - } - case 6: { - message.exploitationActivity = reader.int32(); - break; - } - case 7: { - message.observedInTheWild = reader.bool(); - break; - } - case 8: { - message.zeroDay = reader.bool(); - break; - } - case 9: { - message.exploitReleaseDate = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.firstExploitationDate = $root.google.protobuf.Timestamp.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.v2.Cve - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Reference.verify(message.references[i]); - if (error) - return "references." + error; - } - } - if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) { - var error = $root.google.cloud.securitycenter.v2.Cvssv3.verify(message.cvssv3); - if (error) - return "cvssv3." + error; - } - if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) - if (typeof message.upstreamFixAvailable !== "boolean") - return "upstreamFixAvailable: boolean expected"; - if (message.impact != null && message.hasOwnProperty("impact")) - switch (message.impact) { - default: - return "impact: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.exploitationActivity != null && message.hasOwnProperty("exploitationActivity")) - switch (message.exploitationActivity) { - default: - return "exploitationActivity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.observedInTheWild != null && message.hasOwnProperty("observedInTheWild")) - if (typeof message.observedInTheWild !== "boolean") - return "observedInTheWild: boolean expected"; - if (message.zeroDay != null && message.hasOwnProperty("zeroDay")) - if (typeof message.zeroDay !== "boolean") - return "zeroDay: boolean expected"; - if (message.exploitReleaseDate != null && message.hasOwnProperty("exploitReleaseDate")) { - var error = $root.google.protobuf.Timestamp.verify(message.exploitReleaseDate); - if (error) - return "exploitReleaseDate." + error; - } - if (message.firstExploitationDate != null && message.hasOwnProperty("firstExploitationDate")) { - var error = $root.google.protobuf.Timestamp.verify(message.firstExploitationDate); - if (error) - return "firstExploitationDate." + 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.v2.Cve - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Cve} Cve - */ - Cve.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Cve) - return object; - var message = new $root.google.cloud.securitycenter.v2.Cve(); - if (object.id != null) - message.id = String(object.id); - if (object.references) { - if (!Array.isArray(object.references)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.Cve.references: object expected"); - message.references[i] = $root.google.cloud.securitycenter.v2.Reference.fromObject(object.references[i]); - } - } - if (object.cvssv3 != null) { - if (typeof object.cvssv3 !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Cve.cvssv3: object expected"); - message.cvssv3 = $root.google.cloud.securitycenter.v2.Cvssv3.fromObject(object.cvssv3); - } - if (object.upstreamFixAvailable != null) - message.upstreamFixAvailable = Boolean(object.upstreamFixAvailable); - switch (object.impact) { - default: - if (typeof object.impact === "number") { - message.impact = object.impact; - break; - } - break; - case "RISK_RATING_UNSPECIFIED": - case 0: - message.impact = 0; - break; - case "LOW": - case 1: - message.impact = 1; - break; - case "MEDIUM": - case 2: - message.impact = 2; - break; - case "HIGH": - case 3: - message.impact = 3; - break; - case "CRITICAL": - case 4: - message.impact = 4; - break; - } - switch (object.exploitationActivity) { - default: - if (typeof object.exploitationActivity === "number") { - message.exploitationActivity = object.exploitationActivity; - break; - } - break; - case "EXPLOITATION_ACTIVITY_UNSPECIFIED": - case 0: - message.exploitationActivity = 0; - break; - case "WIDE": - case 1: - message.exploitationActivity = 1; - break; - case "CONFIRMED": - case 2: - message.exploitationActivity = 2; - break; - case "AVAILABLE": - case 3: - message.exploitationActivity = 3; - break; - case "ANTICIPATED": - case 4: - message.exploitationActivity = 4; - break; - case "NO_KNOWN": - case 5: - message.exploitationActivity = 5; - break; - } - if (object.observedInTheWild != null) - message.observedInTheWild = Boolean(object.observedInTheWild); - if (object.zeroDay != null) - message.zeroDay = Boolean(object.zeroDay); - if (object.exploitReleaseDate != null) { - if (typeof object.exploitReleaseDate !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Cve.exploitReleaseDate: object expected"); - message.exploitReleaseDate = $root.google.protobuf.Timestamp.fromObject(object.exploitReleaseDate); - } - if (object.firstExploitationDate != null) { - if (typeof object.firstExploitationDate !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Cve.firstExploitationDate: object expected"); - message.firstExploitationDate = $root.google.protobuf.Timestamp.fromObject(object.firstExploitationDate); - } - return message; - }; - - /** - * Creates a plain object from a Cve message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Cve - * @static - * @param {google.cloud.securitycenter.v2.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; - object.upstreamFixAvailable = false; - object.impact = options.enums === String ? "RISK_RATING_UNSPECIFIED" : 0; - object.exploitationActivity = options.enums === String ? "EXPLOITATION_ACTIVITY_UNSPECIFIED" : 0; - object.observedInTheWild = false; - object.zeroDay = false; - object.exploitReleaseDate = null; - object.firstExploitationDate = 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.v2.Reference.toObject(message.references[j], options); - } - if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) - object.cvssv3 = $root.google.cloud.securitycenter.v2.Cvssv3.toObject(message.cvssv3, options); - if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) - object.upstreamFixAvailable = message.upstreamFixAvailable; - if (message.impact != null && message.hasOwnProperty("impact")) - object.impact = options.enums === String ? $root.google.cloud.securitycenter.v2.Cve.RiskRating[message.impact] === undefined ? message.impact : $root.google.cloud.securitycenter.v2.Cve.RiskRating[message.impact] : message.impact; - if (message.exploitationActivity != null && message.hasOwnProperty("exploitationActivity")) - object.exploitationActivity = options.enums === String ? $root.google.cloud.securitycenter.v2.Cve.ExploitationActivity[message.exploitationActivity] === undefined ? message.exploitationActivity : $root.google.cloud.securitycenter.v2.Cve.ExploitationActivity[message.exploitationActivity] : message.exploitationActivity; - if (message.observedInTheWild != null && message.hasOwnProperty("observedInTheWild")) - object.observedInTheWild = message.observedInTheWild; - if (message.zeroDay != null && message.hasOwnProperty("zeroDay")) - object.zeroDay = message.zeroDay; - if (message.exploitReleaseDate != null && message.hasOwnProperty("exploitReleaseDate")) - object.exploitReleaseDate = $root.google.protobuf.Timestamp.toObject(message.exploitReleaseDate, options); - if (message.firstExploitationDate != null && message.hasOwnProperty("firstExploitationDate")) - object.firstExploitationDate = $root.google.protobuf.Timestamp.toObject(message.firstExploitationDate, options); - return object; - }; - - /** - * Converts this Cve to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Cve - * @instance - * @returns {Object.} JSON object - */ - Cve.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Cve - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Cve"; - }; - - /** - * RiskRating enum. - * @name google.cloud.securitycenter.v2.Cve.RiskRating - * @enum {number} - * @property {number} RISK_RATING_UNSPECIFIED=0 RISK_RATING_UNSPECIFIED value - * @property {number} LOW=1 LOW value - * @property {number} MEDIUM=2 MEDIUM value - * @property {number} HIGH=3 HIGH value - * @property {number} CRITICAL=4 CRITICAL value - */ - Cve.RiskRating = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RISK_RATING_UNSPECIFIED"] = 0; - values[valuesById[1] = "LOW"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - values[valuesById[3] = "HIGH"] = 3; - values[valuesById[4] = "CRITICAL"] = 4; - return values; - })(); - - /** - * ExploitationActivity enum. - * @name google.cloud.securitycenter.v2.Cve.ExploitationActivity - * @enum {number} - * @property {number} EXPLOITATION_ACTIVITY_UNSPECIFIED=0 EXPLOITATION_ACTIVITY_UNSPECIFIED value - * @property {number} WIDE=1 WIDE value - * @property {number} CONFIRMED=2 CONFIRMED value - * @property {number} AVAILABLE=3 AVAILABLE value - * @property {number} ANTICIPATED=4 ANTICIPATED value - * @property {number} NO_KNOWN=5 NO_KNOWN value - */ - Cve.ExploitationActivity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXPLOITATION_ACTIVITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "WIDE"] = 1; - values[valuesById[2] = "CONFIRMED"] = 2; - values[valuesById[3] = "AVAILABLE"] = 3; - values[valuesById[4] = "ANTICIPATED"] = 4; - values[valuesById[5] = "NO_KNOWN"] = 5; - return values; - })(); - - return Cve; - })(); - - v2.Reference = (function() { - - /** - * Properties of a Reference. - * @memberof google.cloud.securitycenter.v2 - * @interface IReference - * @property {string|null} [source] Reference source - * @property {string|null} [uri] Reference uri - */ - - /** - * Constructs a new Reference. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Reference. - * @implements IReference - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Reference - * @instance - */ - Reference.prototype.source = ""; - - /** - * Reference uri. - * @member {string} uri - * @memberof google.cloud.securitycenter.v2.Reference - * @instance - */ - Reference.prototype.uri = ""; - - /** - * Creates a new Reference instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Reference - * @static - * @param {google.cloud.securitycenter.v2.IReference=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Reference} Reference instance - */ - Reference.create = function create(properties) { - return new Reference(properties); - }; - - /** - * Encodes the specified Reference message. Does not implicitly {@link google.cloud.securitycenter.v2.Reference.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Reference - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Reference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Reference - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Reference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Reference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Reference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Reference} Reference - */ - Reference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Reference) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Reference - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Reference - * @instance - * @returns {Object.} JSON object - */ - Reference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Reference - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Reference"; - }; - - return Reference; - })(); - - v2.Cvssv3 = (function() { - - /** - * Properties of a Cvssv3. - * @memberof google.cloud.securitycenter.v2 - * @interface ICvssv3 - * @property {number|null} [baseScore] Cvssv3 baseScore - * @property {google.cloud.securitycenter.v2.Cvssv3.AttackVector|null} [attackVector] Cvssv3 attackVector - * @property {google.cloud.securitycenter.v2.Cvssv3.AttackComplexity|null} [attackComplexity] Cvssv3 attackComplexity - * @property {google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired|null} [privilegesRequired] Cvssv3 privilegesRequired - * @property {google.cloud.securitycenter.v2.Cvssv3.UserInteraction|null} [userInteraction] Cvssv3 userInteraction - * @property {google.cloud.securitycenter.v2.Cvssv3.Scope|null} [scope] Cvssv3 scope - * @property {google.cloud.securitycenter.v2.Cvssv3.Impact|null} [confidentialityImpact] Cvssv3 confidentialityImpact - * @property {google.cloud.securitycenter.v2.Cvssv3.Impact|null} [integrityImpact] Cvssv3 integrityImpact - * @property {google.cloud.securitycenter.v2.Cvssv3.Impact|null} [availabilityImpact] Cvssv3 availabilityImpact - */ - - /** - * Constructs a new Cvssv3. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Cvssv3. - * @implements ICvssv3 - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.baseScore = 0; - - /** - * Cvssv3 attackVector. - * @member {google.cloud.securitycenter.v2.Cvssv3.AttackVector} attackVector - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.attackVector = 0; - - /** - * Cvssv3 attackComplexity. - * @member {google.cloud.securitycenter.v2.Cvssv3.AttackComplexity} attackComplexity - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.attackComplexity = 0; - - /** - * Cvssv3 privilegesRequired. - * @member {google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired} privilegesRequired - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.privilegesRequired = 0; - - /** - * Cvssv3 userInteraction. - * @member {google.cloud.securitycenter.v2.Cvssv3.UserInteraction} userInteraction - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.userInteraction = 0; - - /** - * Cvssv3 scope. - * @member {google.cloud.securitycenter.v2.Cvssv3.Scope} scope - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.scope = 0; - - /** - * Cvssv3 confidentialityImpact. - * @member {google.cloud.securitycenter.v2.Cvssv3.Impact} confidentialityImpact - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.confidentialityImpact = 0; - - /** - * Cvssv3 integrityImpact. - * @member {google.cloud.securitycenter.v2.Cvssv3.Impact} integrityImpact - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.integrityImpact = 0; - - /** - * Cvssv3 availabilityImpact. - * @member {google.cloud.securitycenter.v2.Cvssv3.Impact} availabilityImpact - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - */ - Cvssv3.prototype.availabilityImpact = 0; - - /** - * Creates a new Cvssv3 instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @static - * @param {google.cloud.securitycenter.v2.ICvssv3=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Cvssv3} Cvssv3 instance - */ - Cvssv3.create = function create(properties) { - return new Cvssv3(properties); - }; - - /** - * Encodes the specified Cvssv3 message. Does not implicitly {@link google.cloud.securitycenter.v2.Cvssv3.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @static - * @param {google.cloud.securitycenter.v2.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 2, wireType 0 =*/16).int32(message.attackVector); - if (message.attackComplexity != null && Object.hasOwnProperty.call(message, "attackComplexity")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.attackComplexity); - if (message.privilegesRequired != null && Object.hasOwnProperty.call(message, "privilegesRequired")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.privilegesRequired); - if (message.userInteraction != null && Object.hasOwnProperty.call(message, "userInteraction")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userInteraction); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); - if (message.confidentialityImpact != null && Object.hasOwnProperty.call(message, "confidentialityImpact")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.confidentialityImpact); - if (message.integrityImpact != null && Object.hasOwnProperty.call(message, "integrityImpact")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.integrityImpact); - if (message.availabilityImpact != null && Object.hasOwnProperty.call(message, "availabilityImpact")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.availabilityImpact); - return writer; - }; - - /** - * Encodes the specified Cvssv3 message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Cvssv3.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.Cvssv3} Cvssv3 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cvssv3.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Cvssv3(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.baseScore = reader.double(); - break; - } - case 2: { - message.attackVector = reader.int32(); - break; - } - case 3: { - message.attackComplexity = reader.int32(); - break; - } - case 4: { - message.privilegesRequired = reader.int32(); - break; - } - case 5: { - message.userInteraction = reader.int32(); - break; - } - case 6: { - message.scope = reader.int32(); - break; - } - case 7: { - message.confidentialityImpact = reader.int32(); - break; - } - case 8: { - message.integrityImpact = reader.int32(); - break; - } - case 9: { - message.availabilityImpact = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Cvssv3 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Cvssv3} Cvssv3 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cvssv3.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Cvssv3 message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Cvssv3.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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 a Cvssv3 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Cvssv3} Cvssv3 - */ - Cvssv3.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Cvssv3) - return object; - var message = new $root.google.cloud.securitycenter.v2.Cvssv3(); - 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; - 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; - } - switch (object.attackComplexity) { - default: - if (typeof object.attackComplexity === "number") { - message.attackComplexity = object.attackComplexity; - break; - } - break; - 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) { - default: - if (typeof object.privilegesRequired === "number") { - message.privilegesRequired = object.privilegesRequired; - break; - } - break; - 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) { - default: - if (typeof object.userInteraction === "number") { - message.userInteraction = object.userInteraction; - break; - } - break; - 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) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - 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) { - default: - if (typeof object.confidentialityImpact === "number") { - message.confidentialityImpact = object.confidentialityImpact; - break; - } - break; - 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) { - default: - if (typeof object.integrityImpact === "number") { - message.integrityImpact = object.integrityImpact; - break; - } - break; - 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) { - default: - if (typeof object.availabilityImpact === "number") { - message.availabilityImpact = object.availabilityImpact; - break; - } - break; - 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 a Cvssv3 message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @static - * @param {google.cloud.securitycenter.v2.Cvssv3} message Cvssv3 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Cvssv3.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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.v2.Cvssv3.AttackVector[message.attackVector] === undefined ? message.attackVector : $root.google.cloud.securitycenter.v2.Cvssv3.AttackVector[message.attackVector] : message.attackVector; - if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) - object.attackComplexity = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.AttackComplexity[message.attackComplexity] === undefined ? message.attackComplexity : $root.google.cloud.securitycenter.v2.Cvssv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; - if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) - object.privilegesRequired = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired[message.privilegesRequired] === undefined ? message.privilegesRequired : $root.google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; - if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) - object.userInteraction = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.UserInteraction[message.userInteraction] === undefined ? message.userInteraction : $root.google.cloud.securitycenter.v2.Cvssv3.UserInteraction[message.userInteraction] : message.userInteraction; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.securitycenter.v2.Cvssv3.Scope[message.scope] : message.scope; - if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) - object.confidentialityImpact = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.confidentialityImpact] === undefined ? message.confidentialityImpact : $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; - if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) - object.integrityImpact = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.integrityImpact] === undefined ? message.integrityImpact : $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.integrityImpact] : message.integrityImpact; - if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) - object.availabilityImpact = options.enums === String ? $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.availabilityImpact] === undefined ? message.availabilityImpact : $root.google.cloud.securitycenter.v2.Cvssv3.Impact[message.availabilityImpact] : message.availabilityImpact; - return object; - }; - - /** - * Converts this Cvssv3 to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Cvssv3 - * @instance - * @returns {Object.} JSON object - */ - Cvssv3.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Cvssv3 - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Cvssv3"; - }; - - /** - * AttackVector enum. - * @name google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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; - })(); - - v2.Package = (function() { - - /** - * Properties of a Package. - * @memberof google.cloud.securitycenter.v2 - * @interface IPackage - * @property {string|null} [packageName] Package packageName - * @property {string|null} [cpeUri] Package cpeUri - * @property {string|null} [packageType] Package packageType - * @property {string|null} [packageVersion] Package packageVersion - */ - - /** - * Constructs a new Package. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Package. - * @implements IPackage - * @constructor - * @param {google.cloud.securitycenter.v2.IPackage=} [properties] Properties to set - */ - function Package(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Package packageName. - * @member {string} packageName - * @memberof google.cloud.securitycenter.v2.Package - * @instance - */ - Package.prototype.packageName = ""; - - /** - * Package cpeUri. - * @member {string} cpeUri - * @memberof google.cloud.securitycenter.v2.Package - * @instance - */ - Package.prototype.cpeUri = ""; - - /** - * Package packageType. - * @member {string} packageType - * @memberof google.cloud.securitycenter.v2.Package - * @instance - */ - Package.prototype.packageType = ""; - - /** - * Package packageVersion. - * @member {string} packageVersion - * @memberof google.cloud.securitycenter.v2.Package - * @instance - */ - Package.prototype.packageVersion = ""; - - /** - * Creates a new Package instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {google.cloud.securitycenter.v2.IPackage=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Package} Package instance - */ - Package.create = function create(properties) { - return new Package(properties); - }; - - /** - * Encodes the specified Package message. Does not implicitly {@link google.cloud.securitycenter.v2.Package.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {google.cloud.securitycenter.v2.IPackage} message Package message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Package.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.packageName); - if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cpeUri); - if (message.packageType != null && Object.hasOwnProperty.call(message, "packageType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.packageType); - if (message.packageVersion != null && Object.hasOwnProperty.call(message, "packageVersion")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageVersion); - return writer; - }; - - /** - * Encodes the specified Package message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Package.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {google.cloud.securitycenter.v2.IPackage} message Package message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Package.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Package message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Package} Package - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Package.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Package(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.packageName = reader.string(); - break; - } - case 2: { - message.cpeUri = reader.string(); - break; - } - case 3: { - message.packageType = reader.string(); - break; - } - case 4: { - message.packageVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Package message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Package} Package - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Package.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Package message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Package.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packageName != null && message.hasOwnProperty("packageName")) - if (!$util.isString(message.packageName)) - return "packageName: string expected"; - if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) - if (!$util.isString(message.cpeUri)) - return "cpeUri: string expected"; - if (message.packageType != null && message.hasOwnProperty("packageType")) - if (!$util.isString(message.packageType)) - return "packageType: string expected"; - if (message.packageVersion != null && message.hasOwnProperty("packageVersion")) - if (!$util.isString(message.packageVersion)) - return "packageVersion: string expected"; - return null; - }; - - /** - * Creates a Package message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Package} Package - */ - Package.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Package) - return object; - var message = new $root.google.cloud.securitycenter.v2.Package(); - if (object.packageName != null) - message.packageName = String(object.packageName); - if (object.cpeUri != null) - message.cpeUri = String(object.cpeUri); - if (object.packageType != null) - message.packageType = String(object.packageType); - if (object.packageVersion != null) - message.packageVersion = String(object.packageVersion); - return message; - }; - - /** - * Creates a plain object from a Package message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {google.cloud.securitycenter.v2.Package} message Package - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Package.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packageName = ""; - object.cpeUri = ""; - object.packageType = ""; - object.packageVersion = ""; - } - if (message.packageName != null && message.hasOwnProperty("packageName")) - object.packageName = message.packageName; - if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) - object.cpeUri = message.cpeUri; - if (message.packageType != null && message.hasOwnProperty("packageType")) - object.packageType = message.packageType; - if (message.packageVersion != null && message.hasOwnProperty("packageVersion")) - object.packageVersion = message.packageVersion; - return object; - }; - - /** - * Converts this Package to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Package - * @instance - * @returns {Object.} JSON object - */ - Package.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Package - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Package - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Package.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Package"; - }; - - return Package; - })(); - - v2.SecurityBulletin = (function() { - - /** - * Properties of a SecurityBulletin. - * @memberof google.cloud.securitycenter.v2 - * @interface ISecurityBulletin - * @property {string|null} [bulletinId] SecurityBulletin bulletinId - * @property {google.protobuf.ITimestamp|null} [submissionTime] SecurityBulletin submissionTime - * @property {string|null} [suggestedUpgradeVersion] SecurityBulletin suggestedUpgradeVersion - */ - - /** - * Constructs a new SecurityBulletin. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a SecurityBulletin. - * @implements ISecurityBulletin - * @constructor - * @param {google.cloud.securitycenter.v2.ISecurityBulletin=} [properties] Properties to set - */ - function SecurityBulletin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityBulletin bulletinId. - * @member {string} bulletinId - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @instance - */ - SecurityBulletin.prototype.bulletinId = ""; - - /** - * SecurityBulletin submissionTime. - * @member {google.protobuf.ITimestamp|null|undefined} submissionTime - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @instance - */ - SecurityBulletin.prototype.submissionTime = null; - - /** - * SecurityBulletin suggestedUpgradeVersion. - * @member {string} suggestedUpgradeVersion - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @instance - */ - SecurityBulletin.prototype.suggestedUpgradeVersion = ""; - - /** - * Creates a new SecurityBulletin instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {google.cloud.securitycenter.v2.ISecurityBulletin=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.SecurityBulletin} SecurityBulletin instance - */ - SecurityBulletin.create = function create(properties) { - return new SecurityBulletin(properties); - }; - - /** - * Encodes the specified SecurityBulletin message. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityBulletin.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {google.cloud.securitycenter.v2.ISecurityBulletin} message SecurityBulletin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityBulletin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bulletinId != null && Object.hasOwnProperty.call(message, "bulletinId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bulletinId); - if (message.submissionTime != null && Object.hasOwnProperty.call(message, "submissionTime")) - $root.google.protobuf.Timestamp.encode(message.submissionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.suggestedUpgradeVersion != null && Object.hasOwnProperty.call(message, "suggestedUpgradeVersion")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.suggestedUpgradeVersion); - return writer; - }; - - /** - * Encodes the specified SecurityBulletin message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SecurityBulletin.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {google.cloud.securitycenter.v2.ISecurityBulletin} message SecurityBulletin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityBulletin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityBulletin message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.SecurityBulletin} SecurityBulletin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityBulletin.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SecurityBulletin(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bulletinId = reader.string(); - break; - } - case 2: { - message.submissionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.suggestedUpgradeVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityBulletin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.SecurityBulletin} SecurityBulletin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityBulletin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityBulletin message. - * @function verify - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityBulletin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bulletinId != null && message.hasOwnProperty("bulletinId")) - if (!$util.isString(message.bulletinId)) - return "bulletinId: string expected"; - if (message.submissionTime != null && message.hasOwnProperty("submissionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submissionTime); - if (error) - return "submissionTime." + error; - } - if (message.suggestedUpgradeVersion != null && message.hasOwnProperty("suggestedUpgradeVersion")) - if (!$util.isString(message.suggestedUpgradeVersion)) - return "suggestedUpgradeVersion: string expected"; - return null; - }; - - /** - * Creates a SecurityBulletin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.SecurityBulletin} SecurityBulletin - */ - SecurityBulletin.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.SecurityBulletin) - return object; - var message = new $root.google.cloud.securitycenter.v2.SecurityBulletin(); - if (object.bulletinId != null) - message.bulletinId = String(object.bulletinId); - if (object.submissionTime != null) { - if (typeof object.submissionTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.SecurityBulletin.submissionTime: object expected"); - message.submissionTime = $root.google.protobuf.Timestamp.fromObject(object.submissionTime); - } - if (object.suggestedUpgradeVersion != null) - message.suggestedUpgradeVersion = String(object.suggestedUpgradeVersion); - return message; - }; - - /** - * Creates a plain object from a SecurityBulletin message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {google.cloud.securitycenter.v2.SecurityBulletin} message SecurityBulletin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityBulletin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bulletinId = ""; - object.submissionTime = null; - object.suggestedUpgradeVersion = ""; - } - if (message.bulletinId != null && message.hasOwnProperty("bulletinId")) - object.bulletinId = message.bulletinId; - if (message.submissionTime != null && message.hasOwnProperty("submissionTime")) - object.submissionTime = $root.google.protobuf.Timestamp.toObject(message.submissionTime, options); - if (message.suggestedUpgradeVersion != null && message.hasOwnProperty("suggestedUpgradeVersion")) - object.suggestedUpgradeVersion = message.suggestedUpgradeVersion; - return object; - }; - - /** - * Converts this SecurityBulletin to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @instance - * @returns {Object.} JSON object - */ - SecurityBulletin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityBulletin - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.SecurityBulletin - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecurityBulletin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.SecurityBulletin"; - }; - - return SecurityBulletin; - })(); - - v2.Cwe = (function() { - - /** - * Properties of a Cwe. - * @memberof google.cloud.securitycenter.v2 - * @interface ICwe - * @property {string|null} [id] Cwe id - * @property {Array.|null} [references] Cwe references - */ - - /** - * Constructs a new Cwe. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Cwe. - * @implements ICwe - * @constructor - * @param {google.cloud.securitycenter.v2.ICwe=} [properties] Properties to set - */ - function Cwe(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]]; - } - - /** - * Cwe id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.Cwe - * @instance - */ - Cwe.prototype.id = ""; - - /** - * Cwe references. - * @member {Array.} references - * @memberof google.cloud.securitycenter.v2.Cwe - * @instance - */ - Cwe.prototype.references = $util.emptyArray; - - /** - * Creates a new Cwe instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {google.cloud.securitycenter.v2.ICwe=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Cwe} Cwe instance - */ - Cwe.create = function create(properties) { - return new Cwe(properties); - }; - - /** - * Encodes the specified Cwe message. Does not implicitly {@link google.cloud.securitycenter.v2.Cwe.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {google.cloud.securitycenter.v2.ICwe} message Cwe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cwe.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.v2.Reference.encode(message.references[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Cwe message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Cwe.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {google.cloud.securitycenter.v2.ICwe} message Cwe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cwe.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Cwe message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Cwe} Cwe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cwe.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Cwe(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Reference.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Cwe message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Cwe} Cwe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cwe.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Cwe message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Cwe.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.v2.Reference.verify(message.references[i]); - if (error) - return "references." + error; - } - } - return null; - }; - - /** - * Creates a Cwe message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Cwe} Cwe - */ - Cwe.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Cwe) - return object; - var message = new $root.google.cloud.securitycenter.v2.Cwe(); - if (object.id != null) - message.id = String(object.id); - if (object.references) { - if (!Array.isArray(object.references)) - throw TypeError(".google.cloud.securitycenter.v2.Cwe.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.v2.Cwe.references: object expected"); - message.references[i] = $root.google.cloud.securitycenter.v2.Reference.fromObject(object.references[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Cwe message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {google.cloud.securitycenter.v2.Cwe} message Cwe - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Cwe.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.references = []; - if (options.defaults) - object.id = ""; - 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.v2.Reference.toObject(message.references[j], options); - } - return object; - }; - - /** - * Converts this Cwe to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Cwe - * @instance - * @returns {Object.} JSON object - */ - Cwe.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Cwe - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Cwe - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Cwe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Cwe"; - }; - - return Cwe; - })(); - - v2.Folder = (function() { - - /** - * Properties of a Folder. - * @memberof google.cloud.securitycenter.v2 - * @interface IFolder - * @property {string|null} [resourceFolder] Folder resourceFolder - * @property {string|null} [resourceFolderDisplayName] Folder resourceFolderDisplayName - */ - - /** - * Constructs a new Folder. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Folder. - * @implements IFolder - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Folder - * @instance - */ - Folder.prototype.resourceFolder = ""; - - /** - * Folder resourceFolderDisplayName. - * @member {string} resourceFolderDisplayName - * @memberof google.cloud.securitycenter.v2.Folder - * @instance - */ - Folder.prototype.resourceFolderDisplayName = ""; - - /** - * Creates a new Folder instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Folder - * @static - * @param {google.cloud.securitycenter.v2.IFolder=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Folder} Folder instance - */ - Folder.create = function create(properties) { - return new Folder(properties); - }; - - /** - * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v2.Folder.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Folder - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Folder.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Folder - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Folder(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.Folder - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Folder - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Folder} Folder - */ - Folder.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Folder) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Folder - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Folder - * @instance - * @returns {Object.} JSON object - */ - Folder.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Folder - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Folder"; - }; - - return Folder; - })(); - - v2.MuteConfig = (function() { - - /** - * Properties of a MuteConfig. - * @memberof google.cloud.securitycenter.v2 - * @interface IMuteConfig - * @property {string|null} [name] MuteConfig name - * @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 - * @property {google.cloud.securitycenter.v2.MuteConfig.MuteConfigType|null} [type] MuteConfig type - * @property {google.protobuf.ITimestamp|null} [expiryTime] MuteConfig expiryTime - */ - - /** - * Constructs a new MuteConfig. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a MuteConfig. - * @implements IMuteConfig - * @constructor - * @param {google.cloud.securitycenter.v2.IMuteConfig=} [properties] Properties to set - */ - function MuteConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MuteConfig name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - */ - MuteConfig.prototype.name = ""; - - /** - * MuteConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - */ - MuteConfig.prototype.description = ""; - - /** - * MuteConfig filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - */ - MuteConfig.prototype.filter = ""; - - /** - * MuteConfig createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - */ - MuteConfig.prototype.createTime = null; - - /** - * MuteConfig updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - */ - MuteConfig.prototype.updateTime = null; - - /** - * MuteConfig mostRecentEditor. - * @member {string} mostRecentEditor - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - */ - MuteConfig.prototype.mostRecentEditor = ""; - - /** - * MuteConfig type. - * @member {google.cloud.securitycenter.v2.MuteConfig.MuteConfigType} type - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - */ - MuteConfig.prototype.type = 0; - - /** - * MuteConfig expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - */ - MuteConfig.prototype.expiryTime = null; - - /** - * Creates a new MuteConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @static - * @param {google.cloud.securitycenter.v2.IMuteConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.MuteConfig} MuteConfig instance - */ - MuteConfig.create = function create(properties) { - return new MuteConfig(properties); - }; - - /** - * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.MuteConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @static - * @param {google.cloud.securitycenter.v2.IMuteConfig} message MuteConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} 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.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.mostRecentEditor != null && Object.hasOwnProperty.call(message, "mostRecentEditor")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.mostRecentEditor); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.MuteConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @static - * @param {google.cloud.securitycenter.v2.IMuteConfig} message MuteConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MuteConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MuteConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.MuteConfig} MuteConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MuteConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.MuteConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.mostRecentEditor = reader.string(); - break; - } - case 8: { - message.type = reader.int32(); - break; - } - case 9: { - message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MuteConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.MuteConfig} MuteConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MuteConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MuteConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MuteConfig.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.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.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); - if (error) - return "expiryTime." + error; - } - return null; - }; - - /** - * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.MuteConfig} MuteConfig - */ - MuteConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.MuteConfig) - return object; - var message = new $root.google.cloud.securitycenter.v2.MuteConfig(); - 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.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.MuteConfig.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.mostRecentEditor != null) - message.mostRecentEditor = String(object.mostRecentEditor); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "MUTE_CONFIG_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "STATIC": - case 1: - message.type = 1; - break; - case "DYNAMIC": - case 2: - message.type = 2; - break; - } - if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.MuteConfig.expiryTime: object expected"); - message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); - } - return message; - }; - - /** - * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @static - * @param {google.cloud.securitycenter.v2.MuteConfig} message MuteConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MuteConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.filter = ""; - object.createTime = null; - object.updateTime = null; - object.mostRecentEditor = ""; - object.type = options.enums === String ? "MUTE_CONFIG_TYPE_UNSPECIFIED" : 0; - object.expiryTime = null; - } - 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.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.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.securitycenter.v2.MuteConfig.MuteConfigType[message.type] === undefined ? message.type : $root.google.cloud.securitycenter.v2.MuteConfig.MuteConfigType[message.type] : message.type; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); - return object; - }; - - /** - * Converts this MuteConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.MuteConfig - * @instance - * @returns {Object.} JSON object - */ - MuteConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MuteConfig - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.MuteConfig"; - }; - - /** - * MuteConfigType enum. - * @name google.cloud.securitycenter.v2.MuteConfig.MuteConfigType - * @enum {number} - * @property {number} MUTE_CONFIG_TYPE_UNSPECIFIED=0 MUTE_CONFIG_TYPE_UNSPECIFIED value - * @property {number} STATIC=1 STATIC value - * @property {number} DYNAMIC=2 DYNAMIC value - */ - MuteConfig.MuteConfigType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MUTE_CONFIG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STATIC"] = 1; - values[valuesById[2] = "DYNAMIC"] = 2; - return values; - })(); - - return MuteConfig; - })(); - - v2.NotificationConfig = (function() { - - /** - * Properties of a NotificationConfig. - * @memberof google.cloud.securitycenter.v2 - * @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.v2.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig - * @property {google.protobuf.ITimestamp|null} [updateTime] NotificationConfig updateTime - */ - - /** - * Constructs a new NotificationConfig. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a NotificationConfig. - * @implements INotificationConfig - * @constructor - * @param {google.cloud.securitycenter.v2.INotificationConfig=} [properties] Properties to set - */ - function NotificationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NotificationConfig name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @instance - */ - NotificationConfig.prototype.name = ""; - - /** - * NotificationConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @instance - */ - NotificationConfig.prototype.description = ""; - - /** - * NotificationConfig pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @instance - */ - NotificationConfig.prototype.pubsubTopic = ""; - - /** - * NotificationConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @instance - */ - NotificationConfig.prototype.serviceAccount = ""; - - /** - * NotificationConfig streamingConfig. - * @member {google.cloud.securitycenter.v2.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @instance - */ - NotificationConfig.prototype.streamingConfig = null; - - /** - * NotificationConfig updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @instance - */ - NotificationConfig.prototype.updateTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * NotificationConfig notifyConfig. - * @member {"streamingConfig"|undefined} notifyConfig - * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig - * @static - * @param {google.cloud.securitycenter.v2.INotificationConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.NotificationConfig} NotificationConfig instance - */ - NotificationConfig.create = function create(properties) { - return new NotificationConfig(properties); - }; - - /** - * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.NotificationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @static - * @param {google.cloud.securitycenter.v2.INotificationConfig} message NotificationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NotificationConfig.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.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.v2.NotificationConfig.StreamingConfig.encode(message.streamingConfig, 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 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.NotificationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @static - * @param {google.cloud.securitycenter.v2.INotificationConfig} message NotificationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NotificationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig} NotificationConfig - * @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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.NotificationConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.NotificationConfig} NotificationConfig - * @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) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NotificationConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @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) { - 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.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.v2.NotificationConfig.StreamingConfig.verify(message.streamingConfig); - if (error) - return "streamingConfig." + 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 a NotificationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.NotificationConfig} NotificationConfig - */ - NotificationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.NotificationConfig) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.NotificationConfig.streamingConfig: object expected"); - message.streamingConfig = $root.google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.NotificationConfig.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @static - * @param {google.cloud.securitycenter.v2.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.pubsubTopic = ""; - object.serviceAccount = ""; - object.updateTime = null; - } - 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.v2.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); - if (options.oneofs) - object.notifyConfig = "streamingConfig"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - return object; - }; - - /** - * Converts this NotificationConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @instance - * @returns {Object.} JSON object - */ - NotificationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NotificationConfig - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig"; - }; - - NotificationConfig.StreamingConfig = (function() { - - /** - * Properties of a StreamingConfig. - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @interface IStreamingConfig - * @property {string|null} [filter] StreamingConfig filter - */ - - /** - * Constructs a new StreamingConfig. - * @memberof google.cloud.securitycenter.v2.NotificationConfig - * @classdesc Represents a StreamingConfig. - * @implements IStreamingConfig - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig - * @instance - */ - StreamingConfig.prototype.filter = ""; - - /** - * Creates a new StreamingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v2.NotificationConfig.IStreamingConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.NotificationConfig.StreamingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.NotificationConfig.StreamingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig} StreamingConfig - */ - StreamingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig - * @instance - * @returns {Object.} JSON object - */ - StreamingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StreamingConfig - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig.StreamingConfig"; - }; - - return StreamingConfig; - })(); - - return NotificationConfig; - })(); - - v2.NotificationMessage = (function() { - - /** - * Properties of a NotificationMessage. - * @memberof google.cloud.securitycenter.v2 - * @interface INotificationMessage - * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName - * @property {google.cloud.securitycenter.v2.IFinding|null} [finding] NotificationMessage finding - * @property {google.cloud.securitycenter.v2.IResource|null} [resource] NotificationMessage resource - */ - - /** - * Constructs a new NotificationMessage. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a NotificationMessage. - * @implements INotificationMessage - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.NotificationMessage - * @instance - */ - NotificationMessage.prototype.notificationConfigName = ""; - - /** - * NotificationMessage finding. - * @member {google.cloud.securitycenter.v2.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @instance - */ - NotificationMessage.prototype.finding = null; - - /** - * NotificationMessage resource. - * @member {google.cloud.securitycenter.v2.IResource|null|undefined} resource - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @instance - */ - NotificationMessage.prototype.resource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * NotificationMessage event. - * @member {"finding"|undefined} event - * @memberof google.cloud.securitycenter.v2.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.v2.NotificationMessage - * @static - * @param {google.cloud.securitycenter.v2.INotificationMessage=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.NotificationMessage} NotificationMessage instance - */ - NotificationMessage.create = function create(properties) { - return new NotificationMessage(properties); - }; - - /** - * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v2.NotificationMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @static - * @param {google.cloud.securitycenter.v2.INotificationMessage} message NotificationMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NotificationMessage.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.v2.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.v2.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.NotificationMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @static - * @param {google.cloud.securitycenter.v2.INotificationMessage} message NotificationMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NotificationMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.NotificationMessage} NotificationMessage - * @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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.NotificationMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.notificationConfigName = reader.string(); - break; - } - case 2: { - message.finding = $root.google.cloud.securitycenter.v2.Finding.decode(reader, reader.uint32()); - break; - } - case 3: { - message.resource = $root.google.cloud.securitycenter.v2.Resource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.NotificationMessage} NotificationMessage - * @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) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NotificationMessage message. - * @function verify - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @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) { - 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; - { - var error = $root.google.cloud.securitycenter.v2.Finding.verify(message.finding); - if (error) - return "finding." + error; - } - } - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.securitycenter.v2.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. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.NotificationMessage} NotificationMessage - */ - NotificationMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.NotificationMessage) - return object; - var message = new $root.google.cloud.securitycenter.v2.NotificationMessage(); - if (object.notificationConfigName != null) - message.notificationConfigName = String(object.notificationConfigName); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v2.NotificationMessage.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v2.Finding.fromObject(object.finding); - } - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.securitycenter.v2.NotificationMessage.resource: object expected"); - message.resource = $root.google.cloud.securitycenter.v2.Resource.fromObject(object.resource); - } - return message; - }; - - /** - * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @static - * @param {google.cloud.securitycenter.v2.NotificationMessage} message NotificationMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NotificationMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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")) { - object.finding = $root.google.cloud.securitycenter.v2.Finding.toObject(message.finding, options); - if (options.oneofs) - object.event = "finding"; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.securitycenter.v2.Resource.toObject(message.resource, options); - return object; - }; - - /** - * Converts this NotificationMessage to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.NotificationMessage - * @instance - * @returns {Object.} JSON object - */ - NotificationMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NotificationMessage - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.NotificationMessage"; - }; - - return NotificationMessage; - })(); - - v2.Resource = (function() { - - /** - * Properties of a Resource. - * @memberof google.cloud.securitycenter.v2 - * @interface IResource - * @property {string|null} [name] Resource name - * @property {string|null} [displayName] Resource displayName - * @property {string|null} [type] Resource type - * @property {google.cloud.securitycenter.v2.CloudProvider|null} [cloudProvider] Resource cloudProvider - * @property {string|null} [service] Resource service - * @property {string|null} [location] Resource location - * @property {google.cloud.securitycenter.v2.IGcpMetadata|null} [gcpMetadata] Resource gcpMetadata - * @property {google.cloud.securitycenter.v2.IAwsMetadata|null} [awsMetadata] Resource awsMetadata - * @property {google.cloud.securitycenter.v2.IAzureMetadata|null} [azureMetadata] Resource azureMetadata - * @property {google.cloud.securitycenter.v2.IResourcePath|null} [resourcePath] Resource resourcePath - * @property {string|null} [resourcePathString] Resource resourcePathString - */ - - /** - * Constructs a new Resource. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Resource - * @instance - */ - Resource.prototype.name = ""; - - /** - * Resource displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.displayName = ""; - - /** - * Resource type. - * @member {string} type - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.type = ""; - - /** - * Resource cloudProvider. - * @member {google.cloud.securitycenter.v2.CloudProvider} cloudProvider - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.cloudProvider = 0; - - /** - * Resource service. - * @member {string} service - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.service = ""; - - /** - * Resource location. - * @member {string} location - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.location = ""; - - /** - * Resource gcpMetadata. - * @member {google.cloud.securitycenter.v2.IGcpMetadata|null|undefined} gcpMetadata - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.gcpMetadata = null; - - /** - * Resource awsMetadata. - * @member {google.cloud.securitycenter.v2.IAwsMetadata|null|undefined} awsMetadata - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.awsMetadata = null; - - /** - * Resource azureMetadata. - * @member {google.cloud.securitycenter.v2.IAzureMetadata|null|undefined} azureMetadata - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.azureMetadata = null; - - /** - * Resource resourcePath. - * @member {google.cloud.securitycenter.v2.IResourcePath|null|undefined} resourcePath - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.resourcePath = null; - - /** - * Resource resourcePathString. - * @member {string} resourcePathString - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Resource.prototype.resourcePathString = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Resource cloudProviderMetadata. - * @member {"gcpMetadata"|"awsMetadata"|"azureMetadata"|undefined} cloudProviderMetadata - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - */ - Object.defineProperty(Resource.prototype, "cloudProviderMetadata", { - get: $util.oneOfGetter($oneOfFields = ["gcpMetadata", "awsMetadata", "azureMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Resource - * @static - * @param {google.cloud.securitycenter.v2.IResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Resource} Resource instance - */ - Resource.create = function create(properties) { - return new Resource(properties); - }; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v2.Resource.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Resource - * @static - * @param {google.cloud.securitycenter.v2.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cloudProvider); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.service); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - if (message.gcpMetadata != null && Object.hasOwnProperty.call(message, "gcpMetadata")) - $root.google.cloud.securitycenter.v2.GcpMetadata.encode(message.gcpMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.awsMetadata != null && Object.hasOwnProperty.call(message, "awsMetadata")) - $root.google.cloud.securitycenter.v2.AwsMetadata.encode(message.awsMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.azureMetadata != null && Object.hasOwnProperty.call(message, "azureMetadata")) - $root.google.cloud.securitycenter.v2.AzureMetadata.encode(message.azureMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.resourcePath != null && Object.hasOwnProperty.call(message, "resourcePath")) - $root.google.cloud.securitycenter.v2.ResourcePath.encode(message.resourcePath, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.resourcePathString != null && Object.hasOwnProperty.call(message, "resourcePathString")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.resourcePathString); - return writer; - }; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Resource - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 4: { - message.cloudProvider = reader.int32(); - break; - } - case 5: { - message.service = reader.string(); - break; - } - case 6: { - message.location = reader.string(); - break; - } - case 7: { - message.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.decode(reader, reader.uint32()); - break; - } - case 8: { - message.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.decode(reader, reader.uint32()); - break; - } - case 9: { - message.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.decode(reader, reader.uint32()); - break; - } - case 10: { - message.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.decode(reader, reader.uint32()); - break; - } - case 11: { - message.resourcePathString = 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.v2.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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"; - 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.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - switch (message.cloudProvider) { - default: - return "cloudProvider: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.gcpMetadata != null && message.hasOwnProperty("gcpMetadata")) { - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v2.GcpMetadata.verify(message.gcpMetadata); - if (error) - return "gcpMetadata." + error; - } - } - if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { - if (properties.cloudProviderMetadata === 1) - return "cloudProviderMetadata: multiple values"; - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v2.AwsMetadata.verify(message.awsMetadata); - if (error) - return "awsMetadata." + error; - } - } - if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { - if (properties.cloudProviderMetadata === 1) - return "cloudProviderMetadata: multiple values"; - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v2.AzureMetadata.verify(message.azureMetadata); - if (error) - return "azureMetadata." + error; - } - } - if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) { - var error = $root.google.cloud.securitycenter.v2.ResourcePath.verify(message.resourcePath); - if (error) - return "resourcePath." + error; - } - if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) - if (!$util.isString(message.resourcePathString)) - return "resourcePathString: 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.v2.Resource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Resource} Resource - */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Resource) - return object; - var message = new $root.google.cloud.securitycenter.v2.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); - switch (object.cloudProvider) { - default: - if (typeof object.cloudProvider === "number") { - message.cloudProvider = object.cloudProvider; - break; - } - break; - case "CLOUD_PROVIDER_UNSPECIFIED": - case 0: - message.cloudProvider = 0; - break; - case "GOOGLE_CLOUD_PLATFORM": - case 1: - message.cloudProvider = 1; - break; - case "AMAZON_WEB_SERVICES": - case 2: - message.cloudProvider = 2; - break; - case "MICROSOFT_AZURE": - case 3: - message.cloudProvider = 3; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.location != null) - message.location = String(object.location); - if (object.gcpMetadata != null) { - if (typeof object.gcpMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Resource.gcpMetadata: object expected"); - message.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.fromObject(object.gcpMetadata); - } - if (object.awsMetadata != null) { - if (typeof object.awsMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Resource.awsMetadata: object expected"); - message.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.fromObject(object.awsMetadata); - } - if (object.azureMetadata != null) { - if (typeof object.azureMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Resource.azureMetadata: object expected"); - message.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.fromObject(object.azureMetadata); - } - if (object.resourcePath != null) { - if (typeof object.resourcePath !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Resource.resourcePath: object expected"); - message.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.fromObject(object.resourcePath); - } - if (object.resourcePathString != null) - message.resourcePathString = String(object.resourcePathString); - return message; - }; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Resource - * @static - * @param {google.cloud.securitycenter.v2.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.displayName = ""; - object.type = ""; - object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; - object.service = ""; - object.location = ""; - object.resourcePath = null; - object.resourcePathString = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] : message.cloudProvider; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.gcpMetadata != null && message.hasOwnProperty("gcpMetadata")) { - object.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.toObject(message.gcpMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "gcpMetadata"; - } - if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { - object.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.toObject(message.awsMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "awsMetadata"; - } - if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { - object.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.toObject(message.azureMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "azureMetadata"; - } - if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) - object.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.toObject(message.resourcePath, options); - if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) - object.resourcePathString = message.resourcePathString; - return object; - }; - - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Resource - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Resource"; - }; - - return Resource; - })(); - - /** - * CloudProvider enum. - * @name google.cloud.securitycenter.v2.CloudProvider - * @enum {number} - * @property {number} CLOUD_PROVIDER_UNSPECIFIED=0 CLOUD_PROVIDER_UNSPECIFIED value - * @property {number} GOOGLE_CLOUD_PLATFORM=1 GOOGLE_CLOUD_PLATFORM value - * @property {number} AMAZON_WEB_SERVICES=2 AMAZON_WEB_SERVICES value - * @property {number} MICROSOFT_AZURE=3 MICROSOFT_AZURE value - */ - v2.CloudProvider = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLOUD_PROVIDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_CLOUD_PLATFORM"] = 1; - values[valuesById[2] = "AMAZON_WEB_SERVICES"] = 2; - values[valuesById[3] = "MICROSOFT_AZURE"] = 3; - return values; - })(); - - v2.GcpMetadata = (function() { - - /** - * Properties of a GcpMetadata. - * @memberof google.cloud.securitycenter.v2 - * @interface IGcpMetadata - * @property {string|null} [project] GcpMetadata project - * @property {string|null} [projectDisplayName] GcpMetadata projectDisplayName - * @property {string|null} [parent] GcpMetadata parent - * @property {string|null} [parentDisplayName] GcpMetadata parentDisplayName - * @property {Array.|null} [folders] GcpMetadata folders - * @property {string|null} [organization] GcpMetadata organization - */ - - /** - * Constructs a new GcpMetadata. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GcpMetadata. - * @implements IGcpMetadata - * @constructor - * @param {google.cloud.securitycenter.v2.IGcpMetadata=} [properties] Properties to set - */ - function GcpMetadata(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]]; - } - - /** - * GcpMetadata project. - * @member {string} project - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @instance - */ - GcpMetadata.prototype.project = ""; - - /** - * GcpMetadata projectDisplayName. - * @member {string} projectDisplayName - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @instance - */ - GcpMetadata.prototype.projectDisplayName = ""; - - /** - * GcpMetadata parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @instance - */ - GcpMetadata.prototype.parent = ""; - - /** - * GcpMetadata parentDisplayName. - * @member {string} parentDisplayName - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @instance - */ - GcpMetadata.prototype.parentDisplayName = ""; - - /** - * GcpMetadata folders. - * @member {Array.} folders - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @instance - */ - GcpMetadata.prototype.folders = $util.emptyArray; - - /** - * GcpMetadata organization. - * @member {string} organization - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @instance - */ - GcpMetadata.prototype.organization = ""; - - /** - * Creates a new GcpMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {google.cloud.securitycenter.v2.IGcpMetadata=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GcpMetadata} GcpMetadata instance - */ - GcpMetadata.create = function create(properties) { - return new GcpMetadata(properties); - }; - - /** - * Encodes the specified GcpMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.GcpMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {google.cloud.securitycenter.v2.IGcpMetadata} message GcpMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcpMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectDisplayName); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); - if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentDisplayName); - if (message.folders != null && message.folders.length) - for (var i = 0; i < message.folders.length; ++i) - $root.google.cloud.securitycenter.v2.Folder.encode(message.folders[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.organization); - return writer; - }; - - /** - * Encodes the specified GcpMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GcpMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {google.cloud.securitycenter.v2.IGcpMetadata} message GcpMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcpMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcpMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.GcpMetadata} GcpMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcpMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GcpMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.projectDisplayName = reader.string(); - break; - } - case 3: { - message.parent = reader.string(); - break; - } - case 4: { - message.parentDisplayName = reader.string(); - break; - } - case 5: { - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v2.Folder.decode(reader, reader.uint32())); - break; - } - case 6: { - message.organization = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcpMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.GcpMetadata} GcpMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcpMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcpMetadata message. - * @function verify - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcpMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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.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.v2.Folder.verify(message.folders[i]); - if (error) - return "folders." + error; - } - } - if (message.organization != null && message.hasOwnProperty("organization")) - if (!$util.isString(message.organization)) - return "organization: string expected"; - return null; - }; - - /** - * Creates a GcpMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GcpMetadata} GcpMetadata - */ - GcpMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GcpMetadata) - return object; - var message = new $root.google.cloud.securitycenter.v2.GcpMetadata(); - 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.folders) { - if (!Array.isArray(object.folders)) - throw TypeError(".google.cloud.securitycenter.v2.GcpMetadata.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.v2.GcpMetadata.folders: object expected"); - message.folders[i] = $root.google.cloud.securitycenter.v2.Folder.fromObject(object.folders[i]); - } - } - if (object.organization != null) - message.organization = String(object.organization); - return message; - }; - - /** - * Creates a plain object from a GcpMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {google.cloud.securitycenter.v2.GcpMetadata} message GcpMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcpMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.folders = []; - if (options.defaults) { - object.project = ""; - object.projectDisplayName = ""; - object.parent = ""; - object.parentDisplayName = ""; - object.organization = ""; - } - 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.folders && message.folders.length) { - object.folders = []; - for (var j = 0; j < message.folders.length; ++j) - object.folders[j] = $root.google.cloud.securitycenter.v2.Folder.toObject(message.folders[j], options); - } - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = message.organization; - return object; - }; - - /** - * Converts this GcpMetadata to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @instance - * @returns {Object.} JSON object - */ - GcpMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcpMetadata - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.GcpMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcpMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.GcpMetadata"; - }; - - return GcpMetadata; - })(); - - v2.AwsMetadata = (function() { - - /** - * Properties of an AwsMetadata. - * @memberof google.cloud.securitycenter.v2 - * @interface IAwsMetadata - * @property {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization|null} [organization] AwsMetadata organization - * @property {Array.|null} [organizationalUnits] AwsMetadata organizationalUnits - * @property {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount|null} [account] AwsMetadata account - */ - - /** - * Constructs a new AwsMetadata. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an AwsMetadata. - * @implements IAwsMetadata - * @constructor - * @param {google.cloud.securitycenter.v2.IAwsMetadata=} [properties] Properties to set - */ - function AwsMetadata(properties) { - this.organizationalUnits = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AwsMetadata organization. - * @member {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization|null|undefined} organization - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @instance - */ - AwsMetadata.prototype.organization = null; - - /** - * AwsMetadata organizationalUnits. - * @member {Array.} organizationalUnits - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @instance - */ - AwsMetadata.prototype.organizationalUnits = $util.emptyArray; - - /** - * AwsMetadata account. - * @member {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount|null|undefined} account - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @instance - */ - AwsMetadata.prototype.account = null; - - /** - * Creates a new AwsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {google.cloud.securitycenter.v2.IAwsMetadata=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AwsMetadata} AwsMetadata instance - */ - AwsMetadata.create = function create(properties) { - return new AwsMetadata(properties); - }; - - /** - * Encodes the specified AwsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {google.cloud.securitycenter.v2.IAwsMetadata} message AwsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.encode(message.organization, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.organizationalUnits != null && message.organizationalUnits.length) - for (var i = 0; i < message.organizationalUnits.length; ++i) - $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.encode(message.organizationalUnits[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.account != null && Object.hasOwnProperty.call(message, "account")) - $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.encode(message.account, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AwsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {google.cloud.securitycenter.v2.IAwsMetadata} message AwsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AwsMetadata} AwsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AwsMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.organization = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.organizationalUnits && message.organizationalUnits.length)) - message.organizationalUnits = []; - message.organizationalUnits.push($root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.decode(reader, reader.uint32())); - break; - } - case 3: { - message.account = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AwsMetadata} AwsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsMetadata message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.organization != null && message.hasOwnProperty("organization")) { - var error = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify(message.organization); - if (error) - return "organization." + error; - } - if (message.organizationalUnits != null && message.hasOwnProperty("organizationalUnits")) { - if (!Array.isArray(message.organizationalUnits)) - return "organizationalUnits: array expected"; - for (var i = 0; i < message.organizationalUnits.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify(message.organizationalUnits[i]); - if (error) - return "organizationalUnits." + error; - } - } - if (message.account != null && message.hasOwnProperty("account")) { - var error = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify(message.account); - if (error) - return "account." + error; - } - return null; - }; - - /** - * Creates an AwsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AwsMetadata} AwsMetadata - */ - AwsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AwsMetadata) - return object; - var message = new $root.google.cloud.securitycenter.v2.AwsMetadata(); - if (object.organization != null) { - if (typeof object.organization !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AwsMetadata.organization: object expected"); - message.organization = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.fromObject(object.organization); - } - if (object.organizationalUnits) { - if (!Array.isArray(object.organizationalUnits)) - throw TypeError(".google.cloud.securitycenter.v2.AwsMetadata.organizationalUnits: array expected"); - message.organizationalUnits = []; - for (var i = 0; i < object.organizationalUnits.length; ++i) { - if (typeof object.organizationalUnits[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AwsMetadata.organizationalUnits: object expected"); - message.organizationalUnits[i] = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.fromObject(object.organizationalUnits[i]); - } - } - if (object.account != null) { - if (typeof object.account !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AwsMetadata.account: object expected"); - message.account = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.fromObject(object.account); - } - return message; - }; - - /** - * Creates a plain object from an AwsMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata} message AwsMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.organizationalUnits = []; - if (options.defaults) { - object.organization = null; - object.account = null; - } - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.toObject(message.organization, options); - if (message.organizationalUnits && message.organizationalUnits.length) { - object.organizationalUnits = []; - for (var j = 0; j < message.organizationalUnits.length; ++j) - object.organizationalUnits[j] = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.toObject(message.organizationalUnits[j], options); - } - if (message.account != null && message.hasOwnProperty("account")) - object.account = $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.toObject(message.account, options); - return object; - }; - - /** - * Converts this AwsMetadata to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @instance - * @returns {Object.} JSON object - */ - AwsMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsMetadata - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AwsMetadata"; - }; - - AwsMetadata.AwsOrganization = (function() { - - /** - * Properties of an AwsOrganization. - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @interface IAwsOrganization - * @property {string|null} [id] AwsOrganization id - */ - - /** - * Constructs a new AwsOrganization. - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @classdesc Represents an AwsOrganization. - * @implements IAwsOrganization - * @constructor - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization=} [properties] Properties to set - */ - function AwsOrganization(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AwsOrganization id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @instance - */ - AwsOrganization.prototype.id = ""; - - /** - * Creates a new AwsOrganization instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} AwsOrganization instance - */ - AwsOrganization.create = function create(properties) { - return new AwsOrganization(properties); - }; - - /** - * Encodes the specified AwsOrganization message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization} message AwsOrganization message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsOrganization.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); - return writer; - }; - - /** - * Encodes the specified AwsOrganization message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganization} message AwsOrganization message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsOrganization.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsOrganization message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} AwsOrganization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsOrganization.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsOrganization message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} AwsOrganization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsOrganization.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsOrganization message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsOrganization.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"; - return null; - }; - - /** - * Creates an AwsOrganization message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} AwsOrganization - */ - AwsOrganization.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization) - return object; - var message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization(); - if (object.id != null) - message.id = String(object.id); - return message; - }; - - /** - * Creates a plain object from an AwsOrganization message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} message AwsOrganization - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsOrganization.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - return object; - }; - - /** - * Converts this AwsOrganization to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @instance - * @returns {Object.} JSON object - */ - AwsOrganization.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsOrganization - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsOrganization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization"; - }; - - return AwsOrganization; - })(); - - AwsMetadata.AwsOrganizationalUnit = (function() { - - /** - * Properties of an AwsOrganizationalUnit. - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @interface IAwsOrganizationalUnit - * @property {string|null} [id] AwsOrganizationalUnit id - * @property {string|null} [name] AwsOrganizationalUnit name - */ - - /** - * Constructs a new AwsOrganizationalUnit. - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @classdesc Represents an AwsOrganizationalUnit. - * @implements IAwsOrganizationalUnit - * @constructor - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit=} [properties] Properties to set - */ - function AwsOrganizationalUnit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AwsOrganizationalUnit id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @instance - */ - AwsOrganizationalUnit.prototype.id = ""; - - /** - * AwsOrganizationalUnit name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @instance - */ - AwsOrganizationalUnit.prototype.name = ""; - - /** - * Creates a new AwsOrganizationalUnit instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit instance - */ - AwsOrganizationalUnit.create = function create(properties) { - return new AwsOrganizationalUnit(properties); - }; - - /** - * Encodes the specified AwsOrganizationalUnit message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit} message AwsOrganizationalUnit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsOrganizationalUnit.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - return writer; - }; - - /** - * Encodes the specified AwsOrganizationalUnit message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsOrganizationalUnit} message AwsOrganizationalUnit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsOrganizationalUnit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsOrganizationalUnit message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsOrganizationalUnit.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsOrganizationalUnit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsOrganizationalUnit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsOrganizationalUnit message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsOrganizationalUnit.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an AwsOrganizationalUnit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} AwsOrganizationalUnit - */ - AwsOrganizationalUnit.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) - return object; - var message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an AwsOrganizationalUnit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} message AwsOrganizationalUnit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsOrganizationalUnit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.name = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this AwsOrganizationalUnit to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @instance - * @returns {Object.} JSON object - */ - AwsOrganizationalUnit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsOrganizationalUnit - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsOrganizationalUnit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit"; - }; - - return AwsOrganizationalUnit; - })(); - - AwsMetadata.AwsAccount = (function() { - - /** - * Properties of an AwsAccount. - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @interface IAwsAccount - * @property {string|null} [id] AwsAccount id - * @property {string|null} [name] AwsAccount name - */ - - /** - * Constructs a new AwsAccount. - * @memberof google.cloud.securitycenter.v2.AwsMetadata - * @classdesc Represents an AwsAccount. - * @implements IAwsAccount - * @constructor - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount=} [properties] Properties to set - */ - function AwsAccount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AwsAccount id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @instance - */ - AwsAccount.prototype.id = ""; - - /** - * AwsAccount name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @instance - */ - AwsAccount.prototype.name = ""; - - /** - * Creates a new AwsAccount instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} AwsAccount instance - */ - AwsAccount.create = function create(properties) { - return new AwsAccount(properties); - }; - - /** - * Encodes the specified AwsAccount message. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount} message AwsAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsAccount.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - return writer; - }; - - /** - * Encodes the specified AwsAccount message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.IAwsAccount} message AwsAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsAccount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} AwsAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsAccount.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} AwsAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsAccount message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsAccount.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an AwsAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} AwsAccount - */ - AwsAccount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount) - return object; - var message = new $root.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an AwsAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} message AwsAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.name = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this AwsAccount to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @instance - * @returns {Object.} JSON object - */ - AwsAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsAccount - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AwsMetadata.AwsAccount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AwsMetadata.AwsAccount"; - }; - - return AwsAccount; - })(); - - return AwsMetadata; - })(); - - v2.AzureMetadata = (function() { - - /** - * Properties of an AzureMetadata. - * @memberof google.cloud.securitycenter.v2 - * @interface IAzureMetadata - * @property {Array.|null} [managementGroups] AzureMetadata managementGroups - * @property {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription|null} [subscription] AzureMetadata subscription - * @property {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup|null} [resourceGroup] AzureMetadata resourceGroup - * @property {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant|null} [tenant] AzureMetadata tenant - */ - - /** - * Constructs a new AzureMetadata. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an AzureMetadata. - * @implements IAzureMetadata - * @constructor - * @param {google.cloud.securitycenter.v2.IAzureMetadata=} [properties] Properties to set - */ - function AzureMetadata(properties) { - this.managementGroups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureMetadata managementGroups. - * @member {Array.} managementGroups - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @instance - */ - AzureMetadata.prototype.managementGroups = $util.emptyArray; - - /** - * AzureMetadata subscription. - * @member {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription|null|undefined} subscription - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @instance - */ - AzureMetadata.prototype.subscription = null; - - /** - * AzureMetadata resourceGroup. - * @member {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup|null|undefined} resourceGroup - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @instance - */ - AzureMetadata.prototype.resourceGroup = null; - - /** - * AzureMetadata tenant. - * @member {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant|null|undefined} tenant - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @instance - */ - AzureMetadata.prototype.tenant = null; - - /** - * Creates a new AzureMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {google.cloud.securitycenter.v2.IAzureMetadata=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AzureMetadata} AzureMetadata instance - */ - AzureMetadata.create = function create(properties) { - return new AzureMetadata(properties); - }; - - /** - * Encodes the specified AzureMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {google.cloud.securitycenter.v2.IAzureMetadata} message AzureMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.managementGroups != null && message.managementGroups.length) - for (var i = 0; i < message.managementGroups.length; ++i) - $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.encode(message.managementGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.encode(message.subscription, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceGroup != null && Object.hasOwnProperty.call(message, "resourceGroup")) - $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.encode(message.resourceGroup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tenant != null && Object.hasOwnProperty.call(message, "tenant")) - $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.encode(message.tenant, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AzureMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {google.cloud.securitycenter.v2.IAzureMetadata} message AzureMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AzureMetadata} AzureMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.managementGroups && message.managementGroups.length)) - message.managementGroups = []; - message.managementGroups.push($root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.decode(reader, reader.uint32())); - break; - } - case 2: { - message.subscription = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.decode(reader, reader.uint32()); - break; - } - case 3: { - message.resourceGroup = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.decode(reader, reader.uint32()); - break; - } - case 7: { - message.tenant = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AzureMetadata} AzureMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureMetadata message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.managementGroups != null && message.hasOwnProperty("managementGroups")) { - if (!Array.isArray(message.managementGroups)) - return "managementGroups: array expected"; - for (var i = 0; i < message.managementGroups.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify(message.managementGroups[i]); - if (error) - return "managementGroups." + error; - } - } - if (message.subscription != null && message.hasOwnProperty("subscription")) { - var error = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify(message.subscription); - if (error) - return "subscription." + error; - } - if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) { - var error = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify(message.resourceGroup); - if (error) - return "resourceGroup." + error; - } - if (message.tenant != null && message.hasOwnProperty("tenant")) { - var error = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify(message.tenant); - if (error) - return "tenant." + error; - } - return null; - }; - - /** - * Creates an AzureMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AzureMetadata} AzureMetadata - */ - AzureMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata) - return object; - var message = new $root.google.cloud.securitycenter.v2.AzureMetadata(); - if (object.managementGroups) { - if (!Array.isArray(object.managementGroups)) - throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.managementGroups: array expected"); - message.managementGroups = []; - for (var i = 0; i < object.managementGroups.length; ++i) { - if (typeof object.managementGroups[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.managementGroups: object expected"); - message.managementGroups[i] = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.fromObject(object.managementGroups[i]); - } - } - if (object.subscription != null) { - if (typeof object.subscription !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.subscription: object expected"); - message.subscription = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.fromObject(object.subscription); - } - if (object.resourceGroup != null) { - if (typeof object.resourceGroup !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.resourceGroup: object expected"); - message.resourceGroup = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.fromObject(object.resourceGroup); - } - if (object.tenant != null) { - if (typeof object.tenant !== "object") - throw TypeError(".google.cloud.securitycenter.v2.AzureMetadata.tenant: object expected"); - message.tenant = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.fromObject(object.tenant); - } - return message; - }; - - /** - * Creates a plain object from an AzureMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata} message AzureMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.managementGroups = []; - if (options.defaults) { - object.subscription = null; - object.resourceGroup = null; - object.tenant = null; - } - if (message.managementGroups && message.managementGroups.length) { - object.managementGroups = []; - for (var j = 0; j < message.managementGroups.length; ++j) - object.managementGroups[j] = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.toObject(message.managementGroups[j], options); - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.toObject(message.subscription, options); - if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) - object.resourceGroup = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.toObject(message.resourceGroup, options); - if (message.tenant != null && message.hasOwnProperty("tenant")) - object.tenant = $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.toObject(message.tenant, options); - return object; - }; - - /** - * Converts this AzureMetadata to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @instance - * @returns {Object.} JSON object - */ - AzureMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureMetadata - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata"; - }; - - AzureMetadata.AzureManagementGroup = (function() { - - /** - * Properties of an AzureManagementGroup. - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @interface IAzureManagementGroup - * @property {string|null} [id] AzureManagementGroup id - * @property {string|null} [displayName] AzureManagementGroup displayName - */ - - /** - * Constructs a new AzureManagementGroup. - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @classdesc Represents an AzureManagementGroup. - * @implements IAzureManagementGroup - * @constructor - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup=} [properties] Properties to set - */ - function AzureManagementGroup(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureManagementGroup id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @instance - */ - AzureManagementGroup.prototype.id = ""; - - /** - * AzureManagementGroup displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @instance - */ - AzureManagementGroup.prototype.displayName = ""; - - /** - * Creates a new AzureManagementGroup instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} AzureManagementGroup instance - */ - AzureManagementGroup.create = function create(properties) { - return new AzureManagementGroup(properties); - }; - - /** - * Encodes the specified AzureManagementGroup message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup} message AzureManagementGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureManagementGroup.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified AzureManagementGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureManagementGroup} message AzureManagementGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureManagementGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureManagementGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} AzureManagementGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureManagementGroup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureManagementGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} AzureManagementGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureManagementGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureManagementGroup message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureManagementGroup.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an AzureManagementGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} AzureManagementGroup - */ - AzureManagementGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup) - return object; - var message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup(); - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an AzureManagementGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} message AzureManagementGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureManagementGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this AzureManagementGroup to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @instance - * @returns {Object.} JSON object - */ - AzureManagementGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureManagementGroup - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureManagementGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup"; - }; - - return AzureManagementGroup; - })(); - - AzureMetadata.AzureSubscription = (function() { - - /** - * Properties of an AzureSubscription. - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @interface IAzureSubscription - * @property {string|null} [id] AzureSubscription id - * @property {string|null} [displayName] AzureSubscription displayName - */ - - /** - * Constructs a new AzureSubscription. - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @classdesc Represents an AzureSubscription. - * @implements IAzureSubscription - * @constructor - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription=} [properties] Properties to set - */ - function AzureSubscription(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureSubscription id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @instance - */ - AzureSubscription.prototype.id = ""; - - /** - * AzureSubscription displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @instance - */ - AzureSubscription.prototype.displayName = ""; - - /** - * Creates a new AzureSubscription instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} AzureSubscription instance - */ - AzureSubscription.create = function create(properties) { - return new AzureSubscription(properties); - }; - - /** - * Encodes the specified AzureSubscription message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription} message AzureSubscription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureSubscription.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified AzureSubscription message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureSubscription} message AzureSubscription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureSubscription.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureSubscription message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} AzureSubscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureSubscription.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureSubscription message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} AzureSubscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureSubscription.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureSubscription message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureSubscription.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an AzureSubscription message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} AzureSubscription - */ - AzureSubscription.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription) - return object; - var message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription(); - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an AzureSubscription message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} message AzureSubscription - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureSubscription.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this AzureSubscription to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @instance - * @returns {Object.} JSON object - */ - AzureSubscription.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureSubscription - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureSubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription"; - }; - - return AzureSubscription; - })(); - - AzureMetadata.AzureResourceGroup = (function() { - - /** - * Properties of an AzureResourceGroup. - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @interface IAzureResourceGroup - * @property {string|null} [id] AzureResourceGroup id - * @property {string|null} [name] AzureResourceGroup name - */ - - /** - * Constructs a new AzureResourceGroup. - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @classdesc Represents an AzureResourceGroup. - * @implements IAzureResourceGroup - * @constructor - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup=} [properties] Properties to set - */ - function AzureResourceGroup(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureResourceGroup id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @instance - */ - AzureResourceGroup.prototype.id = ""; - - /** - * AzureResourceGroup name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @instance - */ - AzureResourceGroup.prototype.name = ""; - - /** - * Creates a new AzureResourceGroup instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} AzureResourceGroup instance - */ - AzureResourceGroup.create = function create(properties) { - return new AzureResourceGroup(properties); - }; - - /** - * Encodes the specified AzureResourceGroup message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup} message AzureResourceGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureResourceGroup.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.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - return writer; - }; - - /** - * Encodes the specified AzureResourceGroup message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureResourceGroup} message AzureResourceGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureResourceGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureResourceGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} AzureResourceGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureResourceGroup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.id = reader.string(); - break; - } - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureResourceGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} AzureResourceGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureResourceGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureResourceGroup message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureResourceGroup.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an AzureResourceGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} AzureResourceGroup - */ - AzureResourceGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup) - return object; - var message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an AzureResourceGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} message AzureResourceGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureResourceGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.id = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - return object; - }; - - /** - * Converts this AzureResourceGroup to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @instance - * @returns {Object.} JSON object - */ - AzureResourceGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureResourceGroup - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureResourceGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup"; - }; - - return AzureResourceGroup; - })(); - - AzureMetadata.AzureTenant = (function() { - - /** - * Properties of an AzureTenant. - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @interface IAzureTenant - * @property {string|null} [id] AzureTenant id - * @property {string|null} [displayName] AzureTenant displayName - */ - - /** - * Constructs a new AzureTenant. - * @memberof google.cloud.securitycenter.v2.AzureMetadata - * @classdesc Represents an AzureTenant. - * @implements IAzureTenant - * @constructor - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant=} [properties] Properties to set - */ - function AzureTenant(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AzureTenant id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @instance - */ - AzureTenant.prototype.id = ""; - - /** - * AzureTenant displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @instance - */ - AzureTenant.prototype.displayName = ""; - - /** - * Creates a new AzureTenant instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} AzureTenant instance - */ - AzureTenant.create = function create(properties) { - return new AzureTenant(properties); - }; - - /** - * Encodes the specified AzureTenant message. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant} message AzureTenant message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureTenant.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified AzureTenant message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.AzureMetadata.AzureTenant.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.IAzureTenant} message AzureTenant message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AzureTenant.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AzureTenant message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} AzureTenant - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureTenant.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AzureTenant message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} AzureTenant - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AzureTenant.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AzureTenant message. - * @function verify - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AzureTenant.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an AzureTenant message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} AzureTenant - */ - AzureTenant.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant) - return object; - var message = new $root.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant(); - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an AzureTenant message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {google.cloud.securitycenter.v2.AzureMetadata.AzureTenant} message AzureTenant - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AzureTenant.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this AzureTenant to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @instance - * @returns {Object.} JSON object - */ - AzureTenant.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AzureTenant - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.AzureMetadata.AzureTenant - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AzureTenant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.AzureMetadata.AzureTenant"; - }; - - return AzureTenant; - })(); - - return AzureMetadata; - })(); - - v2.ResourcePath = (function() { - - /** - * Properties of a ResourcePath. - * @memberof google.cloud.securitycenter.v2 - * @interface IResourcePath - * @property {Array.|null} [nodes] ResourcePath nodes - */ - - /** - * Constructs a new ResourcePath. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ResourcePath. - * @implements IResourcePath - * @constructor - * @param {google.cloud.securitycenter.v2.IResourcePath=} [properties] Properties to set - */ - function ResourcePath(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]]; - } - - /** - * ResourcePath nodes. - * @member {Array.} nodes - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @instance - */ - ResourcePath.prototype.nodes = $util.emptyArray; - - /** - * Creates a new ResourcePath instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {google.cloud.securitycenter.v2.IResourcePath=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ResourcePath} ResourcePath instance - */ - ResourcePath.create = function create(properties) { - return new ResourcePath(properties); - }; - - /** - * Encodes the specified ResourcePath message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {google.cloud.securitycenter.v2.IResourcePath} message ResourcePath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourcePath.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResourcePath message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {google.cloud.securitycenter.v2.IResourcePath} message ResourcePath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourcePath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourcePath message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ResourcePath} ResourcePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourcePath.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourcePath(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourcePath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ResourcePath} ResourcePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourcePath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourcePath message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourcePath.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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.v2.ResourcePath.ResourcePathNode.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - return null; - }; - - /** - * Creates a ResourcePath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ResourcePath} ResourcePath - */ - ResourcePath.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ResourcePath) - return object; - var message = new $root.google.cloud.securitycenter.v2.ResourcePath(); - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.securitycenter.v2.ResourcePath.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.v2.ResourcePath.nodes: object expected"); - message.nodes[i] = $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.fromObject(object.nodes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ResourcePath message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {google.cloud.securitycenter.v2.ResourcePath} message ResourcePath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourcePath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.nodes = []; - if (message.nodes && message.nodes.length) { - object.nodes = []; - for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.toObject(message.nodes[j], options); - } - return object; - }; - - /** - * Converts this ResourcePath to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @instance - * @returns {Object.} JSON object - */ - ResourcePath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourcePath - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourcePath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourcePath"; - }; - - /** - * ResourcePathNodeType enum. - * @name google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType - * @enum {number} - * @property {number} RESOURCE_PATH_NODE_TYPE_UNSPECIFIED=0 RESOURCE_PATH_NODE_TYPE_UNSPECIFIED value - * @property {number} GCP_ORGANIZATION=1 GCP_ORGANIZATION value - * @property {number} GCP_FOLDER=2 GCP_FOLDER value - * @property {number} GCP_PROJECT=3 GCP_PROJECT value - * @property {number} AWS_ORGANIZATION=4 AWS_ORGANIZATION value - * @property {number} AWS_ORGANIZATIONAL_UNIT=5 AWS_ORGANIZATIONAL_UNIT value - * @property {number} AWS_ACCOUNT=6 AWS_ACCOUNT value - * @property {number} AZURE_MANAGEMENT_GROUP=7 AZURE_MANAGEMENT_GROUP value - * @property {number} AZURE_SUBSCRIPTION=8 AZURE_SUBSCRIPTION value - * @property {number} AZURE_RESOURCE_GROUP=9 AZURE_RESOURCE_GROUP value - */ - ResourcePath.ResourcePathNodeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GCP_ORGANIZATION"] = 1; - values[valuesById[2] = "GCP_FOLDER"] = 2; - values[valuesById[3] = "GCP_PROJECT"] = 3; - values[valuesById[4] = "AWS_ORGANIZATION"] = 4; - values[valuesById[5] = "AWS_ORGANIZATIONAL_UNIT"] = 5; - values[valuesById[6] = "AWS_ACCOUNT"] = 6; - values[valuesById[7] = "AZURE_MANAGEMENT_GROUP"] = 7; - values[valuesById[8] = "AZURE_SUBSCRIPTION"] = 8; - values[valuesById[9] = "AZURE_RESOURCE_GROUP"] = 9; - return values; - })(); - - ResourcePath.ResourcePathNode = (function() { - - /** - * Properties of a ResourcePathNode. - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @interface IResourcePathNode - * @property {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType|null} [nodeType] ResourcePathNode nodeType - * @property {string|null} [id] ResourcePathNode id - * @property {string|null} [displayName] ResourcePathNode displayName - */ - - /** - * Constructs a new ResourcePathNode. - * @memberof google.cloud.securitycenter.v2.ResourcePath - * @classdesc Represents a ResourcePathNode. - * @implements IResourcePathNode - * @constructor - * @param {google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode=} [properties] Properties to set - */ - function ResourcePathNode(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourcePathNode nodeType. - * @member {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType} nodeType - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @instance - */ - ResourcePathNode.prototype.nodeType = 0; - - /** - * ResourcePathNode id. - * @member {string} id - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @instance - */ - ResourcePathNode.prototype.id = ""; - - /** - * ResourcePathNode displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @instance - */ - ResourcePathNode.prototype.displayName = ""; - - /** - * Creates a new ResourcePathNode instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} ResourcePathNode instance - */ - ResourcePathNode.create = function create(properties) { - return new ResourcePathNode(properties); - }; - - /** - * Encodes the specified ResourcePathNode message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode} message ResourcePathNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourcePathNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeType); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified ResourcePathNode message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {google.cloud.securitycenter.v2.ResourcePath.IResourcePathNode} message ResourcePathNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourcePathNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourcePathNode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} ResourcePathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourcePathNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodeType = reader.int32(); - break; - } - case 2: { - message.id = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourcePathNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} ResourcePathNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourcePathNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourcePathNode message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourcePathNode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeType != null && message.hasOwnProperty("nodeType")) - switch (message.nodeType) { - default: - return "nodeType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates a ResourcePathNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} ResourcePathNode - */ - ResourcePathNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode) - return object; - var message = new $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode(); - switch (object.nodeType) { - default: - if (typeof object.nodeType === "number") { - message.nodeType = object.nodeType; - break; - } - break; - case "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED": - case 0: - message.nodeType = 0; - break; - case "GCP_ORGANIZATION": - case 1: - message.nodeType = 1; - break; - case "GCP_FOLDER": - case 2: - message.nodeType = 2; - break; - case "GCP_PROJECT": - case 3: - message.nodeType = 3; - break; - case "AWS_ORGANIZATION": - case 4: - message.nodeType = 4; - break; - case "AWS_ORGANIZATIONAL_UNIT": - case 5: - message.nodeType = 5; - break; - case "AWS_ACCOUNT": - case 6: - message.nodeType = 6; - break; - case "AZURE_MANAGEMENT_GROUP": - case 7: - message.nodeType = 7; - break; - case "AZURE_SUBSCRIPTION": - case 8: - message.nodeType = 8; - break; - case "AZURE_RESOURCE_GROUP": - case 9: - message.nodeType = 9; - break; - } - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a ResourcePathNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} message ResourcePathNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourcePathNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.nodeType = options.enums === String ? "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" : 0; - object.id = ""; - object.displayName = ""; - } - if (message.nodeType != null && message.hasOwnProperty("nodeType")) - object.nodeType = options.enums === String ? $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType[message.nodeType] === undefined ? message.nodeType : $root.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType[message.nodeType] : message.nodeType; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this ResourcePathNode to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @instance - * @returns {Object.} JSON object - */ - ResourcePathNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourcePathNode - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourcePathNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode"; - }; - - return ResourcePathNode; - })(); - - return ResourcePath; - })(); - - v2.ResourceValueConfig = (function() { - - /** - * Properties of a ResourceValueConfig. - * @memberof google.cloud.securitycenter.v2 - * @interface IResourceValueConfig - * @property {string|null} [name] ResourceValueConfig name - * @property {google.cloud.securitycenter.v2.ResourceValue|null} [resourceValue] ResourceValueConfig resourceValue - * @property {Array.|null} [tagValues] ResourceValueConfig tagValues - * @property {string|null} [resourceType] ResourceValueConfig resourceType - * @property {string|null} [scope] ResourceValueConfig scope - * @property {Object.|null} [resourceLabelsSelector] ResourceValueConfig resourceLabelsSelector - * @property {string|null} [description] ResourceValueConfig description - * @property {google.protobuf.ITimestamp|null} [createTime] ResourceValueConfig createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ResourceValueConfig updateTime - * @property {google.cloud.securitycenter.v2.CloudProvider|null} [cloudProvider] ResourceValueConfig cloudProvider - * @property {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping|null} [sensitiveDataProtectionMapping] ResourceValueConfig sensitiveDataProtectionMapping - */ - - /** - * Constructs a new ResourceValueConfig. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ResourceValueConfig. - * @implements IResourceValueConfig - * @constructor - * @param {google.cloud.securitycenter.v2.IResourceValueConfig=} [properties] Properties to set - */ - function ResourceValueConfig(properties) { - this.tagValues = []; - this.resourceLabelsSelector = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceValueConfig name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.name = ""; - - /** - * ResourceValueConfig resourceValue. - * @member {google.cloud.securitycenter.v2.ResourceValue} resourceValue - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.resourceValue = 0; - - /** - * ResourceValueConfig tagValues. - * @member {Array.} tagValues - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.tagValues = $util.emptyArray; - - /** - * ResourceValueConfig resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.resourceType = ""; - - /** - * ResourceValueConfig scope. - * @member {string} scope - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.scope = ""; - - /** - * ResourceValueConfig resourceLabelsSelector. - * @member {Object.} resourceLabelsSelector - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.resourceLabelsSelector = $util.emptyObject; - - /** - * ResourceValueConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.description = ""; - - /** - * ResourceValueConfig createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.createTime = null; - - /** - * ResourceValueConfig updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.updateTime = null; - - /** - * ResourceValueConfig cloudProvider. - * @member {google.cloud.securitycenter.v2.CloudProvider} cloudProvider - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.cloudProvider = 0; - - /** - * ResourceValueConfig sensitiveDataProtectionMapping. - * @member {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping|null|undefined} sensitiveDataProtectionMapping - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - */ - ResourceValueConfig.prototype.sensitiveDataProtectionMapping = null; - - /** - * Creates a new ResourceValueConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {google.cloud.securitycenter.v2.IResourceValueConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ResourceValueConfig} ResourceValueConfig instance - */ - ResourceValueConfig.create = function create(properties) { - return new ResourceValueConfig(properties); - }; - - /** - * Encodes the specified ResourceValueConfig message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {google.cloud.securitycenter.v2.IResourceValueConfig} message ResourceValueConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceValueConfig.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.resourceValue != null && Object.hasOwnProperty.call(message, "resourceValue")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceValue); - if (message.tagValues != null && message.tagValues.length) - for (var i = 0; i < message.tagValues.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tagValues[i]); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceType); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.scope); - if (message.resourceLabelsSelector != null && Object.hasOwnProperty.call(message, "resourceLabelsSelector")) - for (var keys = Object.keys(message.resourceLabelsSelector), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourceLabelsSelector[keys[i]]).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.cloudProvider); - if (message.sensitiveDataProtectionMapping != null && Object.hasOwnProperty.call(message, "sensitiveDataProtectionMapping")) - $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.encode(message.sensitiveDataProtectionMapping, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResourceValueConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {google.cloud.securitycenter.v2.IResourceValueConfig} message ResourceValueConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceValueConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceValueConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ResourceValueConfig} ResourceValueConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceValueConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourceValueConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.resourceValue = reader.int32(); - break; - } - case 3: { - if (!(message.tagValues && message.tagValues.length)) - message.tagValues = []; - message.tagValues.push(reader.string()); - break; - } - case 4: { - message.resourceType = reader.string(); - break; - } - case 5: { - message.scope = reader.string(); - break; - } - case 6: { - if (message.resourceLabelsSelector === $util.emptyObject) - message.resourceLabelsSelector = {}; - 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.resourceLabelsSelector[key] = value; - break; - } - case 7: { - message.description = reader.string(); - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.cloudProvider = reader.int32(); - break; - } - case 11: { - message.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceValueConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ResourceValueConfig} ResourceValueConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceValueConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceValueConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceValueConfig.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.resourceValue != null && message.hasOwnProperty("resourceValue")) - switch (message.resourceValue) { - default: - return "resourceValue: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.tagValues != null && message.hasOwnProperty("tagValues")) { - if (!Array.isArray(message.tagValues)) - return "tagValues: array expected"; - for (var i = 0; i < message.tagValues.length; ++i) - if (!$util.isString(message.tagValues[i])) - return "tagValues: string[] expected"; - } - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.resourceLabelsSelector != null && message.hasOwnProperty("resourceLabelsSelector")) { - if (!$util.isObject(message.resourceLabelsSelector)) - return "resourceLabelsSelector: object expected"; - var key = Object.keys(message.resourceLabelsSelector); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.resourceLabelsSelector[key[i]])) - return "resourceLabelsSelector: string{k:string} expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - switch (message.cloudProvider) { - default: - return "cloudProvider: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sensitiveDataProtectionMapping != null && message.hasOwnProperty("sensitiveDataProtectionMapping")) { - var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify(message.sensitiveDataProtectionMapping); - if (error) - return "sensitiveDataProtectionMapping." + error; - } - return null; - }; - - /** - * Creates a ResourceValueConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ResourceValueConfig} ResourceValueConfig - */ - ResourceValueConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ResourceValueConfig) - return object; - var message = new $root.google.cloud.securitycenter.v2.ResourceValueConfig(); - if (object.name != null) - message.name = String(object.name); - switch (object.resourceValue) { - default: - if (typeof object.resourceValue === "number") { - message.resourceValue = object.resourceValue; - break; - } - break; - case "RESOURCE_VALUE_UNSPECIFIED": - case 0: - message.resourceValue = 0; - break; - case "HIGH": - case 1: - message.resourceValue = 1; - break; - case "MEDIUM": - case 2: - message.resourceValue = 2; - break; - case "LOW": - case 3: - message.resourceValue = 3; - break; - case "NONE": - case 4: - message.resourceValue = 4; - break; - } - if (object.tagValues) { - if (!Array.isArray(object.tagValues)) - throw TypeError(".google.cloud.securitycenter.v2.ResourceValueConfig.tagValues: array expected"); - message.tagValues = []; - for (var i = 0; i < object.tagValues.length; ++i) - message.tagValues[i] = String(object.tagValues[i]); - } - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.scope != null) - message.scope = String(object.scope); - if (object.resourceLabelsSelector) { - if (typeof object.resourceLabelsSelector !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ResourceValueConfig.resourceLabelsSelector: object expected"); - message.resourceLabelsSelector = {}; - for (var keys = Object.keys(object.resourceLabelsSelector), i = 0; i < keys.length; ++i) - message.resourceLabelsSelector[keys[i]] = String(object.resourceLabelsSelector[keys[i]]); - } - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ResourceValueConfig.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.v2.ResourceValueConfig.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - switch (object.cloudProvider) { - default: - if (typeof object.cloudProvider === "number") { - message.cloudProvider = object.cloudProvider; - break; - } - break; - case "CLOUD_PROVIDER_UNSPECIFIED": - case 0: - message.cloudProvider = 0; - break; - case "GOOGLE_CLOUD_PLATFORM": - case 1: - message.cloudProvider = 1; - break; - case "AMAZON_WEB_SERVICES": - case 2: - message.cloudProvider = 2; - break; - case "MICROSOFT_AZURE": - case 3: - message.cloudProvider = 3; - break; - } - if (object.sensitiveDataProtectionMapping != null) { - if (typeof object.sensitiveDataProtectionMapping !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ResourceValueConfig.sensitiveDataProtectionMapping: object expected"); - message.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.fromObject(object.sensitiveDataProtectionMapping); - } - return message; - }; - - /** - * Creates a plain object from a ResourceValueConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {google.cloud.securitycenter.v2.ResourceValueConfig} message ResourceValueConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceValueConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tagValues = []; - if (options.objects || options.defaults) - object.resourceLabelsSelector = {}; - if (options.defaults) { - object.name = ""; - object.resourceValue = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; - object.resourceType = ""; - object.scope = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; - object.sensitiveDataProtectionMapping = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) - object.resourceValue = options.enums === String ? $root.google.cloud.securitycenter.v2.ResourceValue[message.resourceValue] === undefined ? message.resourceValue : $root.google.cloud.securitycenter.v2.ResourceValue[message.resourceValue] : message.resourceValue; - if (message.tagValues && message.tagValues.length) { - object.tagValues = []; - for (var j = 0; j < message.tagValues.length; ++j) - object.tagValues[j] = message.tagValues[j]; - } - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - var keys2; - if (message.resourceLabelsSelector && (keys2 = Object.keys(message.resourceLabelsSelector)).length) { - object.resourceLabelsSelector = {}; - for (var j = 0; j < keys2.length; ++j) - object.resourceLabelsSelector[keys2[j]] = message.resourceLabelsSelector[keys2[j]]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - 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.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] : message.cloudProvider; - if (message.sensitiveDataProtectionMapping != null && message.hasOwnProperty("sensitiveDataProtectionMapping")) - object.sensitiveDataProtectionMapping = $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.toObject(message.sensitiveDataProtectionMapping, options); - return object; - }; - - /** - * Converts this ResourceValueConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @instance - * @returns {Object.} JSON object - */ - ResourceValueConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceValueConfig - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceValueConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourceValueConfig"; - }; - - ResourceValueConfig.SensitiveDataProtectionMapping = (function() { - - /** - * Properties of a SensitiveDataProtectionMapping. - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @interface ISensitiveDataProtectionMapping - * @property {google.cloud.securitycenter.v2.ResourceValue|null} [highSensitivityMapping] SensitiveDataProtectionMapping highSensitivityMapping - * @property {google.cloud.securitycenter.v2.ResourceValue|null} [mediumSensitivityMapping] SensitiveDataProtectionMapping mediumSensitivityMapping - */ - - /** - * Constructs a new SensitiveDataProtectionMapping. - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig - * @classdesc Represents a SensitiveDataProtectionMapping. - * @implements ISensitiveDataProtectionMapping - * @constructor - * @param {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping=} [properties] Properties to set - */ - function SensitiveDataProtectionMapping(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SensitiveDataProtectionMapping highSensitivityMapping. - * @member {google.cloud.securitycenter.v2.ResourceValue} highSensitivityMapping - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @instance - */ - SensitiveDataProtectionMapping.prototype.highSensitivityMapping = 0; - - /** - * SensitiveDataProtectionMapping mediumSensitivityMapping. - * @member {google.cloud.securitycenter.v2.ResourceValue} mediumSensitivityMapping - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @instance - */ - SensitiveDataProtectionMapping.prototype.mediumSensitivityMapping = 0; - - /** - * Creates a new SensitiveDataProtectionMapping instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping instance - */ - SensitiveDataProtectionMapping.create = function create(properties) { - return new SensitiveDataProtectionMapping(properties); - }; - - /** - * Encodes the specified SensitiveDataProtectionMapping message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping} message SensitiveDataProtectionMapping message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SensitiveDataProtectionMapping.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.highSensitivityMapping != null && Object.hasOwnProperty.call(message, "highSensitivityMapping")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highSensitivityMapping); - if (message.mediumSensitivityMapping != null && Object.hasOwnProperty.call(message, "mediumSensitivityMapping")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediumSensitivityMapping); - return writer; - }; - - /** - * Encodes the specified SensitiveDataProtectionMapping message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {google.cloud.securitycenter.v2.ResourceValueConfig.ISensitiveDataProtectionMapping} message SensitiveDataProtectionMapping message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SensitiveDataProtectionMapping.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SensitiveDataProtectionMapping.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.highSensitivityMapping = reader.int32(); - break; - } - case 2: { - message.mediumSensitivityMapping = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SensitiveDataProtectionMapping message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SensitiveDataProtectionMapping.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SensitiveDataProtectionMapping message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SensitiveDataProtectionMapping.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.highSensitivityMapping != null && message.hasOwnProperty("highSensitivityMapping")) - switch (message.highSensitivityMapping) { - default: - return "highSensitivityMapping: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.mediumSensitivityMapping != null && message.hasOwnProperty("mediumSensitivityMapping")) - switch (message.mediumSensitivityMapping) { - default: - return "mediumSensitivityMapping: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a SensitiveDataProtectionMapping message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} SensitiveDataProtectionMapping - */ - SensitiveDataProtectionMapping.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping) - return object; - var message = new $root.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping(); - switch (object.highSensitivityMapping) { - default: - if (typeof object.highSensitivityMapping === "number") { - message.highSensitivityMapping = object.highSensitivityMapping; - break; - } - break; - case "RESOURCE_VALUE_UNSPECIFIED": - case 0: - message.highSensitivityMapping = 0; - break; - case "HIGH": - case 1: - message.highSensitivityMapping = 1; - break; - case "MEDIUM": - case 2: - message.highSensitivityMapping = 2; - break; - case "LOW": - case 3: - message.highSensitivityMapping = 3; - break; - case "NONE": - case 4: - message.highSensitivityMapping = 4; - break; - } - switch (object.mediumSensitivityMapping) { - default: - if (typeof object.mediumSensitivityMapping === "number") { - message.mediumSensitivityMapping = object.mediumSensitivityMapping; - break; - } - break; - case "RESOURCE_VALUE_UNSPECIFIED": - case 0: - message.mediumSensitivityMapping = 0; - break; - case "HIGH": - case 1: - message.mediumSensitivityMapping = 1; - break; - case "MEDIUM": - case 2: - message.mediumSensitivityMapping = 2; - break; - case "LOW": - case 3: - message.mediumSensitivityMapping = 3; - break; - case "NONE": - case 4: - message.mediumSensitivityMapping = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a SensitiveDataProtectionMapping message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping} message SensitiveDataProtectionMapping - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SensitiveDataProtectionMapping.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.highSensitivityMapping = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; - object.mediumSensitivityMapping = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; - } - if (message.highSensitivityMapping != null && message.hasOwnProperty("highSensitivityMapping")) - object.highSensitivityMapping = options.enums === String ? $root.google.cloud.securitycenter.v2.ResourceValue[message.highSensitivityMapping] === undefined ? message.highSensitivityMapping : $root.google.cloud.securitycenter.v2.ResourceValue[message.highSensitivityMapping] : message.highSensitivityMapping; - if (message.mediumSensitivityMapping != null && message.hasOwnProperty("mediumSensitivityMapping")) - object.mediumSensitivityMapping = options.enums === String ? $root.google.cloud.securitycenter.v2.ResourceValue[message.mediumSensitivityMapping] === undefined ? message.mediumSensitivityMapping : $root.google.cloud.securitycenter.v2.ResourceValue[message.mediumSensitivityMapping] : message.mediumSensitivityMapping; - return object; - }; - - /** - * Converts this SensitiveDataProtectionMapping to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @instance - * @returns {Object.} JSON object - */ - SensitiveDataProtectionMapping.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SensitiveDataProtectionMapping - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SensitiveDataProtectionMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping"; - }; - - return SensitiveDataProtectionMapping; - })(); - - return ResourceValueConfig; - })(); - - /** - * ResourceValue enum. - * @name google.cloud.securitycenter.v2.ResourceValue - * @enum {number} - * @property {number} RESOURCE_VALUE_UNSPECIFIED=0 RESOURCE_VALUE_UNSPECIFIED value - * @property {number} HIGH=1 HIGH value - * @property {number} MEDIUM=2 MEDIUM value - * @property {number} LOW=3 LOW value - * @property {number} NONE=4 NONE value - */ - v2.ResourceValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_VALUE_UNSPECIFIED"] = 0; - values[valuesById[1] = "HIGH"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - values[valuesById[3] = "LOW"] = 3; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); - - v2.SecurityCenter = (function() { - - /** - * Constructs a new SecurityCenter service. - * @memberof google.cloud.securitycenter.v2 - * @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.v2.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.v2.SecurityCenter|batchCreateResourceValueConfigs}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef BatchCreateResourceValueConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} [response] BatchCreateResourceValueConfigsResponse - */ - - /** - * Calls BatchCreateResourceValueConfigs. - * @function batchCreateResourceValueConfigs - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest} request BatchCreateResourceValueConfigsRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigsCallback} callback Node-style callback called with the error, if any, and BatchCreateResourceValueConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.batchCreateResourceValueConfigs = function batchCreateResourceValueConfigs(request, callback) { - return this.rpcCall(batchCreateResourceValueConfigs, $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest, $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse, request, callback); - }, "name", { value: "BatchCreateResourceValueConfigs" }); - - /** - * Calls BatchCreateResourceValueConfigs. - * @function batchCreateResourceValueConfigs - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest} request BatchCreateResourceValueConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|bulkMuteFindings}. - * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BulkMuteFindings" }); - - /** - * Calls BulkMuteFindings. - * @function bulkMuteFindings - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createBigQueryExport}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef CreateBigQueryExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.BigQueryExport} [response] BigQueryExport - */ - - /** - * Calls CreateBigQueryExport. - * @function createBigQueryExport - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest} request CreateBigQueryExportRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.CreateBigQueryExportRequest, $root.google.cloud.securitycenter.v2.BigQueryExport, request, callback); - }, "name", { value: "CreateBigQueryExport" }); - - /** - * Calls CreateBigQueryExport. - * @function createBigQueryExport - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest} request CreateBigQueryExportRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createFinding}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef CreateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.Finding} [response] Finding - */ - - /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.CreateFindingRequest, $root.google.cloud.securitycenter.v2.Finding, request, callback); - }, "name", { value: "CreateFinding" }); - - /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createMuteConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef CreateMuteConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.MuteConfig} [response] MuteConfig - */ - - /** - * Calls CreateMuteConfig. - * @function createMuteConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.CreateMuteConfigRequest, $root.google.cloud.securitycenter.v2.MuteConfig, request, callback); - }, "name", { value: "CreateMuteConfig" }); - - /** - * Calls CreateMuteConfig. - * @function createMuteConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createNotificationConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef CreateNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.NotificationConfig} [response] NotificationConfig - */ - - /** - * Calls CreateNotificationConfig. - * @function createNotificationConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v2.NotificationConfig, request, callback); - }, "name", { value: "CreateNotificationConfig" }); - - /** - * Calls CreateNotificationConfig. - * @function createNotificationConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|createSource}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef CreateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.Source} [response] Source - */ - - /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.CreateSourceRequest, $root.google.cloud.securitycenter.v2.Source, request, callback); - }, "name", { value: "CreateSource" }); - - /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|deleteBigQueryExport}. - * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest} request DeleteBigQueryExportRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteBigQueryExport" }); - - /** - * Calls DeleteBigQueryExport. - * @function deleteBigQueryExport - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest} request DeleteBigQueryExportRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|deleteMuteConfig}. - * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.DeleteMuteConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteMuteConfig" }); - - /** - * Calls DeleteMuteConfig. - * @function deleteMuteConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|deleteNotificationConfig}. - * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteNotificationConfig" }); - - /** - * Calls DeleteNotificationConfig. - * @function deleteNotificationConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|deleteResourceValueConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef DeleteResourceValueConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteResourceValueConfig. - * @function deleteResourceValueConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest} request DeleteResourceValueConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.deleteResourceValueConfig = function deleteResourceValueConfig(request, callback) { - return this.rpcCall(deleteResourceValueConfig, $root.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteResourceValueConfig" }); - - /** - * Calls DeleteResourceValueConfig. - * @function deleteResourceValueConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest} request DeleteResourceValueConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getBigQueryExport}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef GetBigQueryExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.BigQueryExport} [response] BigQueryExport - */ - - /** - * Calls GetBigQueryExport. - * @function getBigQueryExport - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetBigQueryExportRequest} request GetBigQueryExportRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest, $root.google.cloud.securitycenter.v2.BigQueryExport, request, callback); - }, "name", { value: "GetBigQueryExport" }); - - /** - * Calls GetBigQueryExport. - * @function getBigQueryExport - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetBigQueryExportRequest} request GetBigQueryExportRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getSimulation}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef GetSimulationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.Simulation} [response] Simulation - */ - - /** - * Calls GetSimulation. - * @function getSimulation - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetSimulationRequest} request GetSimulationRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.GetSimulationCallback} callback Node-style callback called with the error, if any, and Simulation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getSimulation = function getSimulation(request, callback) { - return this.rpcCall(getSimulation, $root.google.cloud.securitycenter.v2.GetSimulationRequest, $root.google.cloud.securitycenter.v2.Simulation, request, callback); - }, "name", { value: "GetSimulation" }); - - /** - * Calls GetSimulation. - * @function getSimulation - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetSimulationRequest} request GetSimulationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getValuedResource}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef GetValuedResourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ValuedResource} [response] ValuedResource - */ - - /** - * Calls GetValuedResource. - * @function getValuedResource - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest} request GetValuedResourceRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.GetValuedResourceCallback} callback Node-style callback called with the error, if any, and ValuedResource - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getValuedResource = function getValuedResource(request, callback) { - return this.rpcCall(getValuedResource, $root.google.cloud.securitycenter.v2.GetValuedResourceRequest, $root.google.cloud.securitycenter.v2.ValuedResource, request, callback); - }, "name", { value: "GetValuedResource" }); - - /** - * Calls GetValuedResource. - * @function getValuedResource - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest} request GetValuedResourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getIamPolicy}. - * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.SecurityCenter|getMuteConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef GetMuteConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.MuteConfig} [response] MuteConfig - */ - - /** - * Calls GetMuteConfig. - * @function getMuteConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.GetMuteConfigRequest, $root.google.cloud.securitycenter.v2.MuteConfig, request, callback); - }, "name", { value: "GetMuteConfig" }); - - /** - * Calls GetMuteConfig. - * @function getMuteConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getNotificationConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef GetNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.NotificationConfig} [response] NotificationConfig - */ - - /** - * Calls GetNotificationConfig. - * @function getNotificationConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v2.NotificationConfig, request, callback); - }, "name", { value: "GetNotificationConfig" }); - - /** - * Calls GetNotificationConfig. - * @function getNotificationConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getResourceValueConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef GetResourceValueConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ResourceValueConfig} [response] ResourceValueConfig - */ - - /** - * Calls GetResourceValueConfig. - * @function getResourceValueConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest} request GetResourceValueConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfigCallback} callback Node-style callback called with the error, if any, and ResourceValueConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.getResourceValueConfig = function getResourceValueConfig(request, callback) { - return this.rpcCall(getResourceValueConfig, $root.google.cloud.securitycenter.v2.GetResourceValueConfigRequest, $root.google.cloud.securitycenter.v2.ResourceValueConfig, request, callback); - }, "name", { value: "GetResourceValueConfig" }); - - /** - * Calls GetResourceValueConfig. - * @function getResourceValueConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest} request GetResourceValueConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|getSource}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef GetSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.Source} [response] Source - */ - - /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetSourceRequest} request GetSourceRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.GetSourceRequest, $root.google.cloud.securitycenter.v2.Source, request, callback); - }, "name", { value: "GetSource" }); - - /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGetSourceRequest} request GetSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|groupFindings}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef GroupFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.GroupFindingsResponse} [response] GroupFindingsResponse - */ - - /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.GroupFindingsRequest, $root.google.cloud.securitycenter.v2.GroupFindingsResponse, request, callback); - }, "name", { value: "GroupFindings" }); - - /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listAttackPaths}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef ListAttackPathsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ListAttackPathsResponse} [response] ListAttackPathsResponse - */ - - /** - * Calls ListAttackPaths. - * @function listAttackPaths - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest} request ListAttackPathsRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.ListAttackPathsCallback} callback Node-style callback called with the error, if any, and ListAttackPathsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listAttackPaths = function listAttackPaths(request, callback) { - return this.rpcCall(listAttackPaths, $root.google.cloud.securitycenter.v2.ListAttackPathsRequest, $root.google.cloud.securitycenter.v2.ListAttackPathsResponse, request, callback); - }, "name", { value: "ListAttackPaths" }); - - /** - * Calls ListAttackPaths. - * @function listAttackPaths - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest} request ListAttackPathsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listBigQueryExports}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef ListBigQueryExportsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ListBigQueryExportsResponse} [response] ListBigQueryExportsResponse - */ - - /** - * Calls ListBigQueryExports. - * @function listBigQueryExports - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListBigQueryExportsRequest} request ListBigQueryExportsRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest, $root.google.cloud.securitycenter.v2.ListBigQueryExportsResponse, request, callback); - }, "name", { value: "ListBigQueryExports" }); - - /** - * Calls ListBigQueryExports. - * @function listBigQueryExports - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListBigQueryExportsRequest} request ListBigQueryExportsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listFindings}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef ListFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ListFindingsResponse} [response] ListFindingsResponse - */ - - /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListFindingsRequest} request ListFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsRequest, $root.google.cloud.securitycenter.v2.ListFindingsResponse, request, callback); - }, "name", { value: "ListFindings" }); - - /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListFindingsRequest} request ListFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listMuteConfigs}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef ListMuteConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ListMuteConfigsResponse} [response] ListMuteConfigsResponse - */ - - /** - * Calls ListMuteConfigs. - * @function listMuteConfigs - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.ListMuteConfigsRequest, $root.google.cloud.securitycenter.v2.ListMuteConfigsResponse, request, callback); - }, "name", { value: "ListMuteConfigs" }); - - /** - * Calls ListMuteConfigs. - * @function listMuteConfigs - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listNotificationConfigs}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef ListNotificationConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse - */ - - /** - * Calls ListNotificationConfigs. - * @function listNotificationConfigs - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v2.ListNotificationConfigsResponse, request, callback); - }, "name", { value: "ListNotificationConfigs" }); - - /** - * Calls ListNotificationConfigs. - * @function listNotificationConfigs - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listResourceValueConfigs}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef ListResourceValueConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} [response] ListResourceValueConfigsResponse - */ - - /** - * Calls ListResourceValueConfigs. - * @function listResourceValueConfigs - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest} request ListResourceValueConfigsRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigsCallback} callback Node-style callback called with the error, if any, and ListResourceValueConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listResourceValueConfigs = function listResourceValueConfigs(request, callback) { - return this.rpcCall(listResourceValueConfigs, $root.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest, $root.google.cloud.securitycenter.v2.ListResourceValueConfigsResponse, request, callback); - }, "name", { value: "ListResourceValueConfigs" }); - - /** - * Calls ListResourceValueConfigs. - * @function listResourceValueConfigs - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest} request ListResourceValueConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listSources}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef ListSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ListSourcesResponse} [response] ListSourcesResponse - */ - - /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListSourcesRequest} request ListSourcesRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.ListSourcesRequest, $root.google.cloud.securitycenter.v2.ListSourcesResponse, request, callback); - }, "name", { value: "ListSources" }); - - /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListSourcesRequest} request ListSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|listValuedResources}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef ListValuedResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ListValuedResourcesResponse} [response] ListValuedResourcesResponse - */ - - /** - * Calls ListValuedResources. - * @function listValuedResources - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest} request ListValuedResourcesRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.ListValuedResourcesCallback} callback Node-style callback called with the error, if any, and ListValuedResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listValuedResources = function listValuedResources(request, callback) { - return this.rpcCall(listValuedResources, $root.google.cloud.securitycenter.v2.ListValuedResourcesRequest, $root.google.cloud.securitycenter.v2.ListValuedResourcesResponse, request, callback); - }, "name", { value: "ListValuedResources" }); - - /** - * Calls ListValuedResources. - * @function listValuedResources - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest} request ListValuedResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|setFindingState}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef SetFindingStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.Finding} [response] Finding - */ - - /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.SetFindingStateRequest, $root.google.cloud.securitycenter.v2.Finding, request, callback); - }, "name", { value: "SetFindingState" }); - - /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|setIamPolicy}. - * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.SecurityCenter|setMute}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef SetMuteCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.Finding} [response] Finding - */ - - /** - * Calls SetMute. - * @function setMute - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ISetMuteRequest} request SetMuteRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.SetMuteRequest, $root.google.cloud.securitycenter.v2.Finding, request, callback); - }, "name", { value: "SetMute" }); - - /** - * Calls SetMute. - * @function setMute - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.ISetMuteRequest} request SetMuteRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|testIamPermissions}. - * @memberof google.cloud.securitycenter.v2.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.v2.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.SecurityCenter|updateBigQueryExport}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef UpdateBigQueryExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.BigQueryExport} [response] BigQueryExport - */ - - /** - * Calls UpdateBigQueryExport. - * @function updateBigQueryExport - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest} request UpdateBigQueryExportRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.UpdateBigQueryExportRequest, $root.google.cloud.securitycenter.v2.BigQueryExport, request, callback); - }, "name", { value: "UpdateBigQueryExport" }); - - /** - * Calls UpdateBigQueryExport. - * @function updateBigQueryExport - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest} request UpdateBigQueryExportRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateExternalSystem}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef UpdateExternalSystemCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ExternalSystem} [response] ExternalSystem - */ - - /** - * Calls UpdateExternalSystem. - * @function updateExternalSystem - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateExternalSystemRequest} request UpdateExternalSystemRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.UpdateExternalSystemRequest, $root.google.cloud.securitycenter.v2.ExternalSystem, request, callback); - }, "name", { value: "UpdateExternalSystem" }); - - /** - * Calls UpdateExternalSystem. - * @function updateExternalSystem - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateExternalSystemRequest} request UpdateExternalSystemRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateFinding}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef UpdateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.Finding} [response] Finding - */ - - /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.UpdateFindingRequest, $root.google.cloud.securitycenter.v2.Finding, request, callback); - }, "name", { value: "UpdateFinding" }); - - /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateMuteConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef UpdateMuteConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.MuteConfig} [response] MuteConfig - */ - - /** - * Calls UpdateMuteConfig. - * @function updateMuteConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.UpdateMuteConfigRequest, $root.google.cloud.securitycenter.v2.MuteConfig, request, callback); - }, "name", { value: "UpdateMuteConfig" }); - - /** - * Calls UpdateMuteConfig. - * @function updateMuteConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateNotificationConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef UpdateNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.NotificationConfig} [response] NotificationConfig - */ - - /** - * Calls UpdateNotificationConfig. - * @function updateNotificationConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v2.NotificationConfig, request, callback); - }, "name", { value: "UpdateNotificationConfig" }); - - /** - * Calls UpdateNotificationConfig. - * @function updateNotificationConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateResourceValueConfig}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef UpdateResourceValueConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.ResourceValueConfig} [response] ResourceValueConfig - */ - - /** - * Calls UpdateResourceValueConfig. - * @function updateResourceValueConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest} request UpdateResourceValueConfigRequest message or plain object - * @param {google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfigCallback} callback Node-style callback called with the error, if any, and ResourceValueConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateResourceValueConfig = function updateResourceValueConfig(request, callback) { - return this.rpcCall(updateResourceValueConfig, $root.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest, $root.google.cloud.securitycenter.v2.ResourceValueConfig, request, callback); - }, "name", { value: "UpdateResourceValueConfig" }); - - /** - * Calls UpdateResourceValueConfig. - * @function updateResourceValueConfig - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest} request UpdateResourceValueConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateSecurityMarks}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef UpdateSecurityMarksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.SecurityMarks} [response] SecurityMarks - */ - - /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v2.SecurityMarks, request, callback); - }, "name", { value: "UpdateSecurityMarks" }); - - /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v2.SecurityCenter|updateSource}. - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @typedef UpdateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v2.Source} [response] Source - */ - - /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v2.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.v2.UpdateSourceRequest, $root.google.cloud.securitycenter.v2.Source, request, callback); - }, "name", { value: "UpdateSource" }); - - /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v2.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v2.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SecurityCenter; - })(); - - v2.BatchCreateResourceValueConfigsRequest = (function() { - - /** - * Properties of a BatchCreateResourceValueConfigsRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IBatchCreateResourceValueConfigsRequest - * @property {string|null} [parent] BatchCreateResourceValueConfigsRequest parent - * @property {Array.|null} [requests] BatchCreateResourceValueConfigsRequest requests - */ - - /** - * Constructs a new BatchCreateResourceValueConfigsRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a BatchCreateResourceValueConfigsRequest. - * @implements IBatchCreateResourceValueConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest=} [properties] Properties to set - */ - function BatchCreateResourceValueConfigsRequest(properties) { - this.requests = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateResourceValueConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @instance - */ - BatchCreateResourceValueConfigsRequest.prototype.parent = ""; - - /** - * BatchCreateResourceValueConfigsRequest requests. - * @member {Array.} requests - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @instance - */ - BatchCreateResourceValueConfigsRequest.prototype.requests = $util.emptyArray; - - /** - * Creates a new BatchCreateResourceValueConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest instance - */ - BatchCreateResourceValueConfigsRequest.create = function create(properties) { - return new BatchCreateResourceValueConfigsRequest(properties); - }; - - /** - * Encodes the specified BatchCreateResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateResourceValueConfigsRequest.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.requests != null && message.requests.length) - for (var i = 0; i < message.requests.length; ++i) - $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateResourceValueConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateResourceValueConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - if (!(message.requests && message.requests.length)) - message.requests = []; - message.requests.push($root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateResourceValueConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateResourceValueConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateResourceValueConfigsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateResourceValueConfigsRequest.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.requests != null && message.hasOwnProperty("requests")) { - if (!Array.isArray(message.requests)) - return "requests: array expected"; - for (var i = 0; i < message.requests.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify(message.requests[i]); - if (error) - return "requests." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} BatchCreateResourceValueConfigsRequest - */ - BatchCreateResourceValueConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests) { - if (!Array.isArray(object.requests)) - throw TypeError(".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.requests: array expected"); - message.requests = []; - for (var i = 0; i < object.requests.length; ++i) { - if (typeof object.requests[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest.requests: object expected"); - message.requests[i] = $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.fromObject(object.requests[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateResourceValueConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest} message BatchCreateResourceValueConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateResourceValueConfigsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.requests = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests && message.requests.length) { - object.requests = []; - for (var j = 0; j < message.requests.length; ++j) - object.requests[j] = $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.toObject(message.requests[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateResourceValueConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchCreateResourceValueConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateResourceValueConfigsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateResourceValueConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest"; - }; - - return BatchCreateResourceValueConfigsRequest; - })(); - - v2.BatchCreateResourceValueConfigsResponse = (function() { - - /** - * Properties of a BatchCreateResourceValueConfigsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IBatchCreateResourceValueConfigsResponse - * @property {Array.|null} [resourceValueConfigs] BatchCreateResourceValueConfigsResponse resourceValueConfigs - */ - - /** - * Constructs a new BatchCreateResourceValueConfigsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a BatchCreateResourceValueConfigsResponse. - * @implements IBatchCreateResourceValueConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse=} [properties] Properties to set - */ - function BatchCreateResourceValueConfigsResponse(properties) { - this.resourceValueConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateResourceValueConfigsResponse resourceValueConfigs. - * @member {Array.} resourceValueConfigs - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @instance - */ - BatchCreateResourceValueConfigsResponse.prototype.resourceValueConfigs = $util.emptyArray; - - /** - * Creates a new BatchCreateResourceValueConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse instance - */ - BatchCreateResourceValueConfigsResponse.create = function create(properties) { - return new BatchCreateResourceValueConfigsResponse(properties); - }; - - /** - * Encodes the specified BatchCreateResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateResourceValueConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceValueConfigs != null && message.resourceValueConfigs.length) - for (var i = 0; i < message.resourceValueConfigs.length; ++i) - $root.google.cloud.securitycenter.v2.ResourceValueConfig.encode(message.resourceValueConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateResourceValueConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateResourceValueConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.resourceValueConfigs && message.resourceValueConfigs.length)) - message.resourceValueConfigs = []; - message.resourceValueConfigs.push($root.google.cloud.securitycenter.v2.ResourceValueConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateResourceValueConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateResourceValueConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateResourceValueConfigsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateResourceValueConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceValueConfigs != null && message.hasOwnProperty("resourceValueConfigs")) { - if (!Array.isArray(message.resourceValueConfigs)) - return "resourceValueConfigs: array expected"; - for (var i = 0; i < message.resourceValueConfigs.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.verify(message.resourceValueConfigs[i]); - if (error) - return "resourceValueConfigs." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} BatchCreateResourceValueConfigsResponse - */ - BatchCreateResourceValueConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse(); - if (object.resourceValueConfigs) { - if (!Array.isArray(object.resourceValueConfigs)) - throw TypeError(".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.resourceValueConfigs: array expected"); - message.resourceValueConfigs = []; - for (var i = 0; i < object.resourceValueConfigs.length; ++i) { - if (typeof object.resourceValueConfigs[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse.resourceValueConfigs: object expected"); - message.resourceValueConfigs[i] = $root.google.cloud.securitycenter.v2.ResourceValueConfig.fromObject(object.resourceValueConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateResourceValueConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse} message BatchCreateResourceValueConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateResourceValueConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceValueConfigs = []; - if (message.resourceValueConfigs && message.resourceValueConfigs.length) { - object.resourceValueConfigs = []; - for (var j = 0; j < message.resourceValueConfigs.length; ++j) - object.resourceValueConfigs[j] = $root.google.cloud.securitycenter.v2.ResourceValueConfig.toObject(message.resourceValueConfigs[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateResourceValueConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchCreateResourceValueConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateResourceValueConfigsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateResourceValueConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse"; - }; - - return BatchCreateResourceValueConfigsResponse; - })(); - - v2.BulkMuteFindingsRequest = (function() { - - /** - * Properties of a BulkMuteFindingsRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IBulkMuteFindingsRequest - * @property {string|null} [parent] BulkMuteFindingsRequest parent - * @property {string|null} [filter] BulkMuteFindingsRequest filter - * @property {google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState|null} [muteState] BulkMuteFindingsRequest muteState - */ - - /** - * Constructs a new BulkMuteFindingsRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a BulkMuteFindingsRequest. - * @implements IBulkMuteFindingsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest=} [properties] Properties to set - */ - function BulkMuteFindingsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BulkMuteFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @instance - */ - BulkMuteFindingsRequest.prototype.parent = ""; - - /** - * BulkMuteFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @instance - */ - BulkMuteFindingsRequest.prototype.filter = ""; - - /** - * BulkMuteFindingsRequest muteState. - * @member {google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState} muteState - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @instance - */ - BulkMuteFindingsRequest.prototype.muteState = 0; - - /** - * Creates a new BulkMuteFindingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsRequest} BulkMuteFindingsRequest instance - */ - BulkMuteFindingsRequest.create = function create(properties) { - return new BulkMuteFindingsRequest(properties); - }; - - /** - * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.BulkMuteFindingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsRequest} message BulkMuteFindingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BulkMuteFindingsRequest.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.muteState != null && Object.hasOwnProperty.call(message, "muteState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.muteState); - return writer; - }; - - /** - * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BulkMuteFindingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.muteState = reader.int32(); - 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.v2.BulkMuteFindingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.muteState != null && message.hasOwnProperty("muteState")) - switch (message.muteState) { - default: - return "muteState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a BulkMuteFindingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsRequest} BulkMuteFindingsRequest - */ - BulkMuteFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - switch (object.muteState) { - default: - if (typeof object.muteState === "number") { - message.muteState = object.muteState; - break; - } - break; - case "MUTE_STATE_UNSPECIFIED": - case 0: - message.muteState = 0; - break; - case "MUTED": - case 1: - message.muteState = 1; - break; - case "UNDEFINED": - case 2: - message.muteState = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a BulkMuteFindingsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.muteState = options.enums === String ? "MUTE_STATE_UNSPECIFIED" : 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.muteState != null && message.hasOwnProperty("muteState")) - object.muteState = options.enums === String ? $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState[message.muteState] === undefined ? message.muteState : $root.google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState[message.muteState] : message.muteState; - return object; - }; - - /** - * Converts this BulkMuteFindingsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsRequest - * @instance - * @returns {Object.} JSON object - */ - BulkMuteFindingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BulkMuteFindingsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsRequest"; - }; - - /** - * MuteState enum. - * @name google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState - * @enum {number} - * @property {number} MUTE_STATE_UNSPECIFIED=0 MUTE_STATE_UNSPECIFIED value - * @property {number} MUTED=1 MUTED value - * @property {number} UNDEFINED=2 UNDEFINED value - */ - BulkMuteFindingsRequest.MuteState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MUTE_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MUTED"] = 1; - values[valuesById[2] = "UNDEFINED"] = 2; - return values; - })(); - - return BulkMuteFindingsRequest; - })(); - - v2.BulkMuteFindingsResponse = (function() { - - /** - * Properties of a BulkMuteFindingsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IBulkMuteFindingsResponse - */ - - /** - * Constructs a new BulkMuteFindingsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a BulkMuteFindingsResponse. - * @implements IBulkMuteFindingsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsResponse} BulkMuteFindingsResponse instance - */ - BulkMuteFindingsResponse.create = function create(properties) { - return new BulkMuteFindingsResponse(properties); - }; - - /** - * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.BulkMuteFindingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.IBulkMuteFindingsResponse} message BulkMuteFindingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BulkMuteFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsResponse} BulkMuteFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BulkMuteFindingsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BulkMuteFindingsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsResponse} BulkMuteFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BulkMuteFindingsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BulkMuteFindingsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BulkMuteFindingsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.BulkMuteFindingsResponse} BulkMuteFindingsResponse - */ - BulkMuteFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.BulkMuteFindingsResponse) - return object; - return new $root.google.cloud.securitycenter.v2.BulkMuteFindingsResponse(); - }; - - /** - * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.BulkMuteFindingsResponse} message BulkMuteFindingsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BulkMuteFindingsResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this BulkMuteFindingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.BulkMuteFindingsResponse - * @instance - * @returns {Object.} JSON object - */ - BulkMuteFindingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BulkMuteFindingsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.BulkMuteFindingsResponse"; - }; - - return BulkMuteFindingsResponse; - })(); - - v2.CreateBigQueryExportRequest = (function() { - - /** - * Properties of a CreateBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface ICreateBigQueryExportRequest - * @property {string|null} [parent] CreateBigQueryExportRequest parent - * @property {google.cloud.securitycenter.v2.IBigQueryExport|null} [bigQueryExport] CreateBigQueryExportRequest bigQueryExport - * @property {string|null} [bigQueryExportId] CreateBigQueryExportRequest bigQueryExportId - */ - - /** - * Constructs a new CreateBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CreateBigQueryExportRequest. - * @implements ICreateBigQueryExportRequest - * @constructor - * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest=} [properties] Properties to set - */ - function CreateBigQueryExportRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBigQueryExportRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @instance - */ - CreateBigQueryExportRequest.prototype.parent = ""; - - /** - * CreateBigQueryExportRequest bigQueryExport. - * @member {google.cloud.securitycenter.v2.IBigQueryExport|null|undefined} bigQueryExport - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @instance - */ - CreateBigQueryExportRequest.prototype.bigQueryExport = null; - - /** - * CreateBigQueryExportRequest bigQueryExportId. - * @member {string} bigQueryExportId - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @instance - */ - CreateBigQueryExportRequest.prototype.bigQueryExportId = ""; - - /** - * Creates a new CreateBigQueryExportRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CreateBigQueryExportRequest} CreateBigQueryExportRequest instance - */ - CreateBigQueryExportRequest.create = function create(properties) { - return new CreateBigQueryExportRequest(properties); - }; - - /** - * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateBigQueryExportRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest} message CreateBigQueryExportRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBigQueryExportRequest.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.bigQueryExport != null && Object.hasOwnProperty.call(message, "bigQueryExport")) - $root.google.cloud.securitycenter.v2.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 CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateBigQueryExportRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateBigQueryExportRequest} message CreateBigQueryExportRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.CreateBigQueryExportRequest} CreateBigQueryExportRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBigQueryExportRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateBigQueryExportRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.bigQueryExport = $root.google.cloud.securitycenter.v2.BigQueryExport.decode(reader, reader.uint32()); - break; - } - case 3: { - message.bigQueryExportId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.CreateBigQueryExportRequest} CreateBigQueryExportRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBigQueryExportRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBigQueryExportRequest.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.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) { - var error = $root.google.cloud.securitycenter.v2.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 CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CreateBigQueryExportRequest} CreateBigQueryExportRequest - */ - CreateBigQueryExportRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CreateBigQueryExportRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.CreateBigQueryExportRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.bigQueryExport != null) { - if (typeof object.bigQueryExport !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CreateBigQueryExportRequest.bigQueryExport: object expected"); - message.bigQueryExport = $root.google.cloud.securitycenter.v2.BigQueryExport.fromObject(object.bigQueryExport); - } - if (object.bigQueryExportId != null) - message.bigQueryExportId = String(object.bigQueryExportId); - return message; - }; - - /** - * Creates a plain object from a CreateBigQueryExportRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.CreateBigQueryExportRequest} message CreateBigQueryExportRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBigQueryExportRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.bigQueryExport = null; - object.bigQueryExportId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) - object.bigQueryExport = $root.google.cloud.securitycenter.v2.BigQueryExport.toObject(message.bigQueryExport, options); - if (message.bigQueryExportId != null && message.hasOwnProperty("bigQueryExportId")) - object.bigQueryExportId = message.bigQueryExportId; - return object; - }; - - /** - * Converts this CreateBigQueryExportRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CreateBigQueryExportRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBigQueryExportRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBigQueryExportRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.CreateBigQueryExportRequest"; - }; - - return CreateBigQueryExportRequest; - })(); - - v2.CreateFindingRequest = (function() { - - /** - * Properties of a CreateFindingRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface ICreateFindingRequest - * @property {string|null} [parent] CreateFindingRequest parent - * @property {string|null} [findingId] CreateFindingRequest findingId - * @property {google.cloud.securitycenter.v2.IFinding|null} [finding] CreateFindingRequest finding - */ - - /** - * Constructs a new CreateFindingRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.parent = ""; - - /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v2.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.findingId = ""; - - /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v2.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v2.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.finding = null; - - /** - * Creates a new CreateFindingRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CreateFindingRequest} CreateFindingRequest instance - */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); - }; - - /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateFindingRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && 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.v2.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.v2.CreateFindingRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateFindingRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.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.v2.CreateFindingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.CreateFindingRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CreateFindingRequest} CreateFindingRequest - */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CreateFindingRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.CreateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v2.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.v2.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Finding.toObject(message.finding, options); - return object; - }; - - /** - * Converts this CreateFindingRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CreateFindingRequest - * @instance - * @returns {Object.} JSON object - */ - CreateFindingRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateFindingRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.CreateFindingRequest"; - }; - - return CreateFindingRequest; - })(); - - v2.CreateMuteConfigRequest = (function() { - - /** - * Properties of a CreateMuteConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface ICreateMuteConfigRequest - * @property {string|null} [parent] CreateMuteConfigRequest parent - * @property {google.cloud.securitycenter.v2.IMuteConfig|null} [muteConfig] CreateMuteConfigRequest muteConfig - * @property {string|null} [muteConfigId] CreateMuteConfigRequest muteConfigId - */ - - /** - * Constructs a new CreateMuteConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CreateMuteConfigRequest. - * @implements ICreateMuteConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest=} [properties] Properties to set - */ - 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]]; - } - - /** - * CreateMuteConfigRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @instance - */ - CreateMuteConfigRequest.prototype.parent = ""; - - /** - * CreateMuteConfigRequest muteConfig. - * @member {google.cloud.securitycenter.v2.IMuteConfig|null|undefined} muteConfig - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @instance - */ - CreateMuteConfigRequest.prototype.muteConfig = null; - - /** - * CreateMuteConfigRequest muteConfigId. - * @member {string} muteConfigId - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @instance - */ - CreateMuteConfigRequest.prototype.muteConfigId = ""; - - /** - * Creates a new CreateMuteConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CreateMuteConfigRequest} CreateMuteConfigRequest instance - */ - CreateMuteConfigRequest.create = function create(properties) { - return new CreateMuteConfigRequest(properties); - }; - - /** - * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateMuteConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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; - }; - - /** - * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateMuteConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateMuteConfigRequest} message CreateMuteConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateMuteConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateMuteConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.muteConfig = $root.google.cloud.securitycenter.v2.MuteConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.muteConfigId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateMuteConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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()); - }; - - /** - * Verifies a CreateMuteConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - 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.v2.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; - }; - - /** - * Creates a CreateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CreateMuteConfigRequest} CreateMuteConfigRequest - */ - CreateMuteConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CreateMuteConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.CreateMuteConfigRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.muteConfig != null) { - if (typeof object.muteConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CreateMuteConfigRequest.muteConfig: object expected"); - message.muteConfig = $root.google.cloud.securitycenter.v2.MuteConfig.fromObject(object.muteConfig); - } - if (object.muteConfigId != null) - message.muteConfigId = String(object.muteConfigId); - return message; - }; - - /** - * Creates a plain object from a CreateMuteConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.MuteConfig.toObject(message.muteConfig, options); - if (message.muteConfigId != null && message.hasOwnProperty("muteConfigId")) - object.muteConfigId = message.muteConfigId; - return object; - }; - - /** - * Converts this CreateMuteConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CreateMuteConfigRequest - * @instance - * @returns {Object.} JSON object - */ - CreateMuteConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateMuteConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.CreateMuteConfigRequest"; - }; - - return CreateMuteConfigRequest; - })(); - - v2.CreateNotificationConfigRequest = (function() { - - /** - * Properties of a CreateNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface ICreateNotificationConfigRequest - * @property {string|null} [parent] CreateNotificationConfigRequest parent - * @property {string|null} [configId] CreateNotificationConfigRequest configId - * @property {google.cloud.securitycenter.v2.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig - */ - - /** - * Constructs a new CreateNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CreateNotificationConfigRequest. - * @implements ICreateNotificationConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.parent = ""; - - /** - * CreateNotificationConfigRequest configId. - * @member {string} configId - * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.configId = ""; - - /** - * CreateNotificationConfigRequest notificationConfig. - * @member {google.cloud.securitycenter.v2.INotificationConfig|null|undefined} notificationConfig - * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.notificationConfig = null; - - /** - * Creates a new CreateNotificationConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance - */ - CreateNotificationConfigRequest.create = function create(properties) { - return new CreateNotificationConfigRequest(properties); - }; - - /** - * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateNotificationConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateNotificationConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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(); - }; - - /** - * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateNotificationConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.NotificationConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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()); - }; - - /** - * Verifies a CreateNotificationConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.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.v2.NotificationConfig.verify(message.notificationConfig); - if (error) - return "notificationConfig." + error; - } - return null; - }; - - /** - * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CreateNotificationConfigRequest} CreateNotificationConfigRequest - */ - CreateNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CreateNotificationConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest.notificationConfig: object expected"); - message.notificationConfig = $root.google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.NotificationConfig.toObject(message.notificationConfig, options); - return object; - }; - - /** - * Converts this CreateNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CreateNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateNotificationConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.CreateNotificationConfigRequest"; - }; - - return CreateNotificationConfigRequest; - })(); - - v2.CreateResourceValueConfigRequest = (function() { - - /** - * Properties of a CreateResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface ICreateResourceValueConfigRequest - * @property {string|null} [parent] CreateResourceValueConfigRequest parent - * @property {google.cloud.securitycenter.v2.IResourceValueConfig|null} [resourceValueConfig] CreateResourceValueConfigRequest resourceValueConfig - */ - - /** - * Constructs a new CreateResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CreateResourceValueConfigRequest. - * @implements ICreateResourceValueConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest=} [properties] Properties to set - */ - function CreateResourceValueConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateResourceValueConfigRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @instance - */ - CreateResourceValueConfigRequest.prototype.parent = ""; - - /** - * CreateResourceValueConfigRequest resourceValueConfig. - * @member {google.cloud.securitycenter.v2.IResourceValueConfig|null|undefined} resourceValueConfig - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @instance - */ - CreateResourceValueConfigRequest.prototype.resourceValueConfig = null; - - /** - * Creates a new CreateResourceValueConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest instance - */ - CreateResourceValueConfigRequest.create = function create(properties) { - return new CreateResourceValueConfigRequest(properties); - }; - - /** - * Encodes the specified CreateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest} message CreateResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateResourceValueConfigRequest.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.resourceValueConfig != null && Object.hasOwnProperty.call(message, "resourceValueConfig")) - $root.google.cloud.securitycenter.v2.ResourceValueConfig.encode(message.resourceValueConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateResourceValueConfigRequest} message CreateResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateResourceValueConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateResourceValueConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateResourceValueConfigRequest.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.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) { - var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.verify(message.resourceValueConfig); - if (error) - return "resourceValueConfig." + error; - } - return null; - }; - - /** - * Creates a CreateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} CreateResourceValueConfigRequest - */ - CreateResourceValueConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceValueConfig != null) { - if (typeof object.resourceValueConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CreateResourceValueConfigRequest.resourceValueConfig: object expected"); - message.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.fromObject(object.resourceValueConfig); - } - return message; - }; - - /** - * Creates a plain object from a CreateResourceValueConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.CreateResourceValueConfigRequest} message CreateResourceValueConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateResourceValueConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.resourceValueConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) - object.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.toObject(message.resourceValueConfig, options); - return object; - }; - - /** - * Converts this CreateResourceValueConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @instance - * @returns {Object.} JSON object - */ - CreateResourceValueConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateResourceValueConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.CreateResourceValueConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.CreateResourceValueConfigRequest"; - }; - - return CreateResourceValueConfigRequest; - })(); - - v2.CreateSourceRequest = (function() { - - /** - * Properties of a CreateSourceRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface ICreateSourceRequest - * @property {string|null} [parent] CreateSourceRequest parent - * @property {google.cloud.securitycenter.v2.ISource|null} [source] CreateSourceRequest source - */ - - /** - * Constructs a new CreateSourceRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a CreateSourceRequest. - * @implements ICreateSourceRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.CreateSourceRequest - * @instance - */ - CreateSourceRequest.prototype.parent = ""; - - /** - * CreateSourceRequest source. - * @member {google.cloud.securitycenter.v2.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v2.CreateSourceRequest - * @instance - */ - CreateSourceRequest.prototype.source = null; - - /** - * Creates a new CreateSourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.CreateSourceRequest} CreateSourceRequest instance - */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); - }; - - /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.CreateSourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && 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.v2.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.v2.CreateSourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.CreateSourceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.source = $root.google.cloud.securitycenter.v2.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.v2.CreateSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.CreateSourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.CreateSourceRequest} CreateSourceRequest - */ - CreateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.CreateSourceRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.CreateSourceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v2.CreateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v2.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.v2.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Source.toObject(message.source, options); - return object; - }; - - /** - * Converts this CreateSourceRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.CreateSourceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSourceRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.CreateSourceRequest"; - }; - - return CreateSourceRequest; - })(); - - v2.DeleteBigQueryExportRequest = (function() { - - /** - * Properties of a DeleteBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IDeleteBigQueryExportRequest - * @property {string|null} [name] DeleteBigQueryExportRequest name - */ - - /** - * Constructs a new DeleteBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a DeleteBigQueryExportRequest. - * @implements IDeleteBigQueryExportRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest - * @instance - */ - DeleteBigQueryExportRequest.prototype.name = ""; - - /** - * Creates a new DeleteBigQueryExportRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.DeleteBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest instance - */ - DeleteBigQueryExportRequest.create = function create(properties) { - return new DeleteBigQueryExportRequest(properties); - }; - - /** - * Encodes the specified DeleteBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteBigQueryExportRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.DeleteBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.DeleteBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.DeleteBigQueryExportRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.DeleteBigQueryExportRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest - */ - DeleteBigQueryExportRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBigQueryExportRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBigQueryExportRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.DeleteBigQueryExportRequest"; - }; - - return DeleteBigQueryExportRequest; - })(); - - v2.DeleteMuteConfigRequest = (function() { - - /** - * Properties of a DeleteMuteConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IDeleteMuteConfigRequest - * @property {string|null} [name] DeleteMuteConfigRequest name - */ - - /** - * Constructs a new DeleteMuteConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a DeleteMuteConfigRequest. - * @implements IDeleteMuteConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest=} [properties] Properties to set - */ - 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]]; - } - - /** - * DeleteMuteConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest - * @instance - */ - DeleteMuteConfigRequest.prototype.name = ""; - - /** - * Creates a new DeleteMuteConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.DeleteMuteConfigRequest} DeleteMuteConfigRequest instance - */ - DeleteMuteConfigRequest.create = function create(properties) { - return new DeleteMuteConfigRequest(properties); - }; - - /** - * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteMuteConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IDeleteMuteConfigRequest} message DeleteMuteConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - 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; - }; - - /** - * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteMuteConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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(); - }; - - /** - * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DeleteMuteConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.DeleteMuteConfigRequest} DeleteMuteConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteMuteConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.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; - }; - - /** - * Creates a DeleteMuteConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.DeleteMuteConfigRequest} DeleteMuteConfigRequest - */ - DeleteMuteConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.DeleteMuteConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.DeleteMuteConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteMuteConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.DeleteMuteConfigRequest} message DeleteMuteConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - 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; - }; - - /** - * Converts this DeleteMuteConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.DeleteMuteConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteMuteConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteMuteConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.DeleteMuteConfigRequest"; - }; - - return DeleteMuteConfigRequest; - })(); - - v2.DeleteNotificationConfigRequest = (function() { - - /** - * Properties of a DeleteNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IDeleteNotificationConfigRequest - * @property {string|null} [name] DeleteNotificationConfigRequest name - */ - - /** - * Constructs a new DeleteNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a DeleteNotificationConfigRequest. - * @implements IDeleteNotificationConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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]]; - } - - /** - * DeleteNotificationConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest - * @instance - */ - DeleteNotificationConfigRequest.prototype.name = ""; - - /** - * Creates a new DeleteNotificationConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance - */ - DeleteNotificationConfigRequest.create = function create(properties) { - return new DeleteNotificationConfigRequest(properties); - }; - - /** - * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteNotificationConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteNotificationConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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(); - }; - - /** - * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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()); - }; - - /** - * Verifies a DeleteNotificationConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.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; - }; - - /** - * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest - */ - DeleteNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest(); - 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. - * @function toObject - * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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; - }; - - /** - * Converts this DeleteNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.DeleteNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteNotificationConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.DeleteNotificationConfigRequest"; - }; - - return DeleteNotificationConfigRequest; - })(); - - v2.DeleteResourceValueConfigRequest = (function() { - - /** - * Properties of a DeleteResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IDeleteResourceValueConfigRequest - * @property {string|null} [name] DeleteResourceValueConfigRequest name - */ - - /** - * Constructs a new DeleteResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a DeleteResourceValueConfigRequest. - * @implements IDeleteResourceValueConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest=} [properties] Properties to set - */ - function DeleteResourceValueConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteResourceValueConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @instance - */ - DeleteResourceValueConfigRequest.prototype.name = ""; - - /** - * Creates a new DeleteResourceValueConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest instance - */ - DeleteResourceValueConfigRequest.create = function create(properties) { - return new DeleteResourceValueConfigRequest(properties); - }; - - /** - * Encodes the specified DeleteResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteResourceValueConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteResourceValueConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} DeleteResourceValueConfigRequest - */ - DeleteResourceValueConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteResourceValueConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest} message DeleteResourceValueConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteResourceValueConfigRequest.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 DeleteResourceValueConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteResourceValueConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteResourceValueConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest"; - }; - - return DeleteResourceValueConfigRequest; - })(); - - v2.BigQueryDestination = (function() { - - /** - * Properties of a BigQueryDestination. - * @memberof google.cloud.securitycenter.v2 - * @interface IBigQueryDestination - * @property {string|null} [dataset] BigQueryDestination dataset - */ - - /** - * Constructs a new BigQueryDestination. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a BigQueryDestination. - * @implements IBigQueryDestination - * @constructor - * @param {google.cloud.securitycenter.v2.IBigQueryDestination=} [properties] Properties to set - */ - function BigQueryDestination(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BigQueryDestination dataset. - * @member {string} dataset - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.dataset = ""; - - /** - * Creates a new BigQueryDestination instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {google.cloud.securitycenter.v2.IBigQueryDestination=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.BigQueryDestination} BigQueryDestination instance - */ - BigQueryDestination.create = function create(properties) { - return new BigQueryDestination(properties); - }; - - /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryDestination.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {google.cloud.securitycenter.v2.IBigQueryDestination} message BigQueryDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - return writer; - }; - - /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.BigQueryDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {google.cloud.securitycenter.v2.IBigQueryDestination} message BigQueryDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BigQueryDestination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.BigQueryDestination} BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryDestination.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.BigQueryDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataset = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.BigQueryDestination} BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BigQueryDestination message. - * @function verify - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BigQueryDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - return null; - }; - - /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.BigQueryDestination} BigQueryDestination - */ - BigQueryDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.BigQueryDestination) - return object; - var message = new $root.google.cloud.securitycenter.v2.BigQueryDestination(); - if (object.dataset != null) - message.dataset = String(object.dataset); - return message; - }; - - /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {google.cloud.securitycenter.v2.BigQueryDestination} message BigQueryDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BigQueryDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dataset = ""; - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - return object; - }; - - /** - * Converts this BigQueryDestination to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @instance - * @returns {Object.} JSON object - */ - BigQueryDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BigQueryDestination - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.BigQueryDestination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.BigQueryDestination"; - }; - - return BigQueryDestination; - })(); - - v2.ExportFindingsMetadata = (function() { - - /** - * Properties of an ExportFindingsMetadata. - * @memberof google.cloud.securitycenter.v2 - * @interface IExportFindingsMetadata - * @property {google.protobuf.ITimestamp|null} [exportStartTime] ExportFindingsMetadata exportStartTime - * @property {google.cloud.securitycenter.v2.IBigQueryDestination|null} [bigQueryDestination] ExportFindingsMetadata bigQueryDestination - */ - - /** - * Constructs a new ExportFindingsMetadata. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an ExportFindingsMetadata. - * @implements IExportFindingsMetadata - * @constructor - * @param {google.cloud.securitycenter.v2.IExportFindingsMetadata=} [properties] Properties to set - */ - function ExportFindingsMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportFindingsMetadata exportStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} exportStartTime - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @instance - */ - ExportFindingsMetadata.prototype.exportStartTime = null; - - /** - * ExportFindingsMetadata bigQueryDestination. - * @member {google.cloud.securitycenter.v2.IBigQueryDestination|null|undefined} bigQueryDestination - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @instance - */ - ExportFindingsMetadata.prototype.bigQueryDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportFindingsMetadata destination. - * @member {"bigQueryDestination"|undefined} destination - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @instance - */ - Object.defineProperty(ExportFindingsMetadata.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["bigQueryDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportFindingsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {google.cloud.securitycenter.v2.IExportFindingsMetadata=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ExportFindingsMetadata} ExportFindingsMetadata instance - */ - ExportFindingsMetadata.create = function create(properties) { - return new ExportFindingsMetadata(properties); - }; - - /** - * Encodes the specified ExportFindingsMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {google.cloud.securitycenter.v2.IExportFindingsMetadata} message ExportFindingsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportFindingsMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exportStartTime != null && Object.hasOwnProperty.call(message, "exportStartTime")) - $root.google.protobuf.Timestamp.encode(message.exportStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bigQueryDestination != null && Object.hasOwnProperty.call(message, "bigQueryDestination")) - $root.google.cloud.securitycenter.v2.BigQueryDestination.encode(message.bigQueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportFindingsMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {google.cloud.securitycenter.v2.IExportFindingsMetadata} message ExportFindingsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportFindingsMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportFindingsMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ExportFindingsMetadata} ExportFindingsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportFindingsMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExportFindingsMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.exportStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.bigQueryDestination = $root.google.cloud.securitycenter.v2.BigQueryDestination.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportFindingsMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ExportFindingsMetadata} ExportFindingsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportFindingsMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportFindingsMetadata message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportFindingsMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.exportStartTime != null && message.hasOwnProperty("exportStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.exportStartTime); - if (error) - return "exportStartTime." + error; - } - if (message.bigQueryDestination != null && message.hasOwnProperty("bigQueryDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.securitycenter.v2.BigQueryDestination.verify(message.bigQueryDestination); - if (error) - return "bigQueryDestination." + error; - } - } - return null; - }; - - /** - * Creates an ExportFindingsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ExportFindingsMetadata} ExportFindingsMetadata - */ - ExportFindingsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ExportFindingsMetadata) - return object; - var message = new $root.google.cloud.securitycenter.v2.ExportFindingsMetadata(); - if (object.exportStartTime != null) { - if (typeof object.exportStartTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ExportFindingsMetadata.exportStartTime: object expected"); - message.exportStartTime = $root.google.protobuf.Timestamp.fromObject(object.exportStartTime); - } - if (object.bigQueryDestination != null) { - if (typeof object.bigQueryDestination !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ExportFindingsMetadata.bigQueryDestination: object expected"); - message.bigQueryDestination = $root.google.cloud.securitycenter.v2.BigQueryDestination.fromObject(object.bigQueryDestination); - } - return message; - }; - - /** - * Creates a plain object from an ExportFindingsMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {google.cloud.securitycenter.v2.ExportFindingsMetadata} message ExportFindingsMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportFindingsMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.exportStartTime = null; - if (message.exportStartTime != null && message.hasOwnProperty("exportStartTime")) - object.exportStartTime = $root.google.protobuf.Timestamp.toObject(message.exportStartTime, options); - if (message.bigQueryDestination != null && message.hasOwnProperty("bigQueryDestination")) { - object.bigQueryDestination = $root.google.cloud.securitycenter.v2.BigQueryDestination.toObject(message.bigQueryDestination, options); - if (options.oneofs) - object.destination = "bigQueryDestination"; - } - return object; - }; - - /** - * Converts this ExportFindingsMetadata to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @instance - * @returns {Object.} JSON object - */ - ExportFindingsMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportFindingsMetadata - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ExportFindingsMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportFindingsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ExportFindingsMetadata"; - }; - - return ExportFindingsMetadata; - })(); - - v2.ExportFindingsResponse = (function() { - - /** - * Properties of an ExportFindingsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IExportFindingsResponse - */ - - /** - * Constructs a new ExportFindingsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an ExportFindingsResponse. - * @implements IExportFindingsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.IExportFindingsResponse=} [properties] Properties to set - */ - function ExportFindingsResponse(properties) { - if (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 ExportFindingsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.IExportFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ExportFindingsResponse} ExportFindingsResponse instance - */ - ExportFindingsResponse.create = function create(properties) { - return new ExportFindingsResponse(properties); - }; - - /** - * Encodes the specified ExportFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.IExportFindingsResponse} message ExportFindingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportFindingsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ExportFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ExportFindingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.IExportFindingsResponse} message ExportFindingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportFindingsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ExportFindingsResponse} ExportFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportFindingsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ExportFindingsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportFindingsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ExportFindingsResponse} ExportFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportFindingsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportFindingsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportFindingsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an ExportFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ExportFindingsResponse} ExportFindingsResponse - */ - ExportFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ExportFindingsResponse) - return object; - return new $root.google.cloud.securitycenter.v2.ExportFindingsResponse(); - }; - - /** - * Creates a plain object from an ExportFindingsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.ExportFindingsResponse} message ExportFindingsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportFindingsResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ExportFindingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @instance - * @returns {Object.} JSON object - */ - ExportFindingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportFindingsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ExportFindingsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ExportFindingsResponse"; - }; - - return ExportFindingsResponse; - })(); - - v2.GetBigQueryExportRequest = (function() { - - /** - * Properties of a GetBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IGetBigQueryExportRequest - * @property {string|null} [name] GetBigQueryExportRequest name - */ - - /** - * Constructs a new GetBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GetBigQueryExportRequest. - * @implements IGetBigQueryExportRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest - * @instance - */ - GetBigQueryExportRequest.prototype.name = ""; - - /** - * Creates a new GetBigQueryExportRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GetBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetBigQueryExportRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GetBigQueryExportRequest} GetBigQueryExportRequest instance - */ - GetBigQueryExportRequest.create = function create(properties) { - return new GetBigQueryExportRequest(properties); - }; - - /** - * Encodes the specified GetBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetBigQueryExportRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GetBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GetBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetBigQueryExportRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.GetBigQueryExportRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.GetBigQueryExportRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GetBigQueryExportRequest} GetBigQueryExportRequest - */ - GetBigQueryExportRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GetBigQueryExportRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest - * @instance - * @returns {Object.} JSON object - */ - GetBigQueryExportRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBigQueryExportRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.GetBigQueryExportRequest"; - }; - - return GetBigQueryExportRequest; - })(); - - v2.GetMuteConfigRequest = (function() { - - /** - * Properties of a GetMuteConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IGetMuteConfigRequest - * @property {string|null} [name] GetMuteConfigRequest name - */ - - /** - * Constructs a new GetMuteConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GetMuteConfigRequest. - * @implements IGetMuteConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest=} [properties] Properties to set - */ - function GetMuteConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetMuteConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @instance - */ - GetMuteConfigRequest.prototype.name = ""; - - /** - * Creates a new GetMuteConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GetMuteConfigRequest} GetMuteConfigRequest instance - */ - GetMuteConfigRequest.create = function create(properties) { - return new GetMuteConfigRequest(properties); - }; - - /** - * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetMuteConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetMuteConfigRequest.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 GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetMuteConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetMuteConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.GetMuteConfigRequest} GetMuteConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetMuteConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetMuteConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.GetMuteConfigRequest} GetMuteConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetMuteConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetMuteConfigRequest.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 GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GetMuteConfigRequest} GetMuteConfigRequest - */ - GetMuteConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GetMuteConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.GetMuteConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.GetMuteConfigRequest} message GetMuteConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetMuteConfigRequest.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 GetMuteConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.GetMuteConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetMuteConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetMuteConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.GetMuteConfigRequest"; - }; - - return GetMuteConfigRequest; - })(); - - v2.GetNotificationConfigRequest = (function() { - - /** - * Properties of a GetNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IGetNotificationConfigRequest - * @property {string|null} [name] GetNotificationConfigRequest name - */ - - /** - * Constructs a new GetNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GetNotificationConfigRequest. - * @implements IGetNotificationConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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]]; - } - - /** - * GetNotificationConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest - * @instance - */ - GetNotificationConfigRequest.prototype.name = ""; - - /** - * Creates a new GetNotificationConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GetNotificationConfigRequest} GetNotificationConfigRequest instance - */ - GetNotificationConfigRequest.create = function create(properties) { - return new GetNotificationConfigRequest(properties); - }; - - /** - * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetNotificationConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetNotificationConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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(); - }; - - /** - * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetNotificationConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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()); - }; - - /** - * Verifies a GetNotificationConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.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; - }; - - /** - * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GetNotificationConfigRequest} GetNotificationConfigRequest - */ - GetNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GetNotificationConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.GetNotificationConfigRequest(); - 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. - * @function toObject - * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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; - }; - - /** - * Converts this GetNotificationConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.GetNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetNotificationConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetNotificationConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.GetNotificationConfigRequest"; - }; - - return GetNotificationConfigRequest; - })(); - - v2.GetResourceValueConfigRequest = (function() { - - /** - * Properties of a GetResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IGetResourceValueConfigRequest - * @property {string|null} [name] GetResourceValueConfigRequest name - */ - - /** - * Constructs a new GetResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GetResourceValueConfigRequest. - * @implements IGetResourceValueConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest=} [properties] Properties to set - */ - function GetResourceValueConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetResourceValueConfigRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @instance - */ - GetResourceValueConfigRequest.prototype.name = ""; - - /** - * Creates a new GetResourceValueConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} GetResourceValueConfigRequest instance - */ - GetResourceValueConfigRequest.create = function create(properties) { - return new GetResourceValueConfigRequest(properties); - }; - - /** - * Encodes the specified GetResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetResourceValueConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest} message GetResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetResourceValueConfigRequest.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 GetResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetResourceValueConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetResourceValueConfigRequest} message GetResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} GetResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetResourceValueConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetResourceValueConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} GetResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetResourceValueConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetResourceValueConfigRequest.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 GetResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} GetResourceValueConfigRequest - */ - GetResourceValueConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GetResourceValueConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.GetResourceValueConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetResourceValueConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.GetResourceValueConfigRequest} message GetResourceValueConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetResourceValueConfigRequest.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 GetResourceValueConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetResourceValueConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetResourceValueConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.GetResourceValueConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.GetResourceValueConfigRequest"; - }; - - return GetResourceValueConfigRequest; - })(); - - v2.GetSourceRequest = (function() { - - /** - * Properties of a GetSourceRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name - */ - - /** - * Constructs a new GetSourceRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GetSourceRequest. - * @implements IGetSourceRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.GetSourceRequest - * @instance - */ - GetSourceRequest.prototype.name = ""; - - /** - * Creates a new GetSourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GetSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GetSourceRequest} GetSourceRequest instance - */ - GetSourceRequest.create = function create(properties) { - return new GetSourceRequest(properties); - }; - - /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetSourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GetSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "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.v2.GetSourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GetSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetSourceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.GetSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.GetSourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GetSourceRequest} GetSourceRequest - */ - GetSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GetSourceRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.GetSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.GetSourceRequest - * @instance - * @returns {Object.} JSON object - */ - GetSourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSourceRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.GetSourceRequest"; - }; - - return GetSourceRequest; - })(); - - v2.GroupFindingsRequest = (function() { - - /** - * Properties of a GroupFindingsRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IGroupFindingsRequest - * @property {string|null} [parent] GroupFindingsRequest parent - * @property {string|null} [filter] GroupFindingsRequest filter - * @property {string|null} [groupBy] GroupFindingsRequest groupBy - * @property {string|null} [pageToken] GroupFindingsRequest pageToken - * @property {number|null} [pageSize] GroupFindingsRequest pageSize - */ - - /** - * Constructs a new GroupFindingsRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GroupFindingsRequest. - * @implements IGroupFindingsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.parent = ""; - - /** - * GroupFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.filter = ""; - - /** - * GroupFindingsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.groupBy = ""; - - /** - * GroupFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.pageToken = ""; - - /** - * GroupFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.pageSize = 0; - - /** - * Creates a new GroupFindingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GroupFindingsRequest} GroupFindingsRequest instance - */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); - }; - - /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupFindingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && 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.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 GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupFindingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupFindingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 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.v2.GroupFindingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.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.v2.GroupFindingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GroupFindingsRequest} GroupFindingsRequest - */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GroupFindingsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.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.v2.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.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.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.v2.GroupFindingsRequest - * @instance - * @returns {Object.} JSON object - */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GroupFindingsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.GroupFindingsRequest"; - }; - - return GroupFindingsRequest; - })(); - - v2.GroupFindingsResponse = (function() { - - /** - * Properties of a GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IGroupFindingsResponse - * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults - * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken - * @property {number|null} [totalSize] GroupFindingsResponse totalSize - */ - - /** - * Constructs a new GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; - - /** - * GroupFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.nextPageToken = ""; - - /** - * GroupFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.totalSize = 0; - - /** - * Creates a new GroupFindingsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GroupFindingsResponse} GroupFindingsResponse instance - */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); - }; - - /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupFindingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).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 GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupFindingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupFindingsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v2.GroupResult.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.v2.GroupFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + 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.v2.GroupFindingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GroupFindingsResponse} GroupFindingsResponse - */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GroupFindingsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.GroupFindingsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.GroupFindingsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v2.GroupResult.fromObject(object.groupByResults[i]); - } - } - 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.v2.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.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.v2.GroupResult.toObject(message.groupByResults[j], 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.v2.GroupFindingsResponse - * @instance - * @returns {Object.} JSON object - */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GroupFindingsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.GroupFindingsResponse"; - }; - - return GroupFindingsResponse; - })(); - - v2.GroupResult = (function() { - - /** - * Properties of a GroupResult. - * @memberof google.cloud.securitycenter.v2 - * @interface IGroupResult - * @property {Object.|null} [properties] GroupResult properties - * @property {number|Long|null} [count] GroupResult count - */ - - /** - * Constructs a new GroupResult. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GroupResult. - * @implements IGroupResult - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.GroupResult - * @instance - */ - GroupResult.prototype.properties = $util.emptyObject; - - /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v2.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.v2.GroupResult - * @static - * @param {google.cloud.securitycenter.v2.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GroupResult} GroupResult instance - */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); - }; - - /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GroupResult - * @static - * @param {google.cloud.securitycenter.v2.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 && 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 GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GroupResult - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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; - 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.v2.GroupResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.GroupResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GroupResult} GroupResult - */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GroupResult) - return object; - var message = new $root.google.cloud.securitycenter.v2.GroupResult(); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.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.v2.GroupResult - * @static - * @param {google.cloud.securitycenter.v2.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.v2.GroupResult - * @instance - * @returns {Object.} JSON object - */ - GroupResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GroupResult - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.GroupResult"; - }; - - return GroupResult; - })(); - - v2.ListAttackPathsRequest = (function() { - - /** - * Properties of a ListAttackPathsRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IListAttackPathsRequest - * @property {string|null} [parent] ListAttackPathsRequest parent - * @property {string|null} [filter] ListAttackPathsRequest filter - * @property {string|null} [pageToken] ListAttackPathsRequest pageToken - * @property {number|null} [pageSize] ListAttackPathsRequest pageSize - */ - - /** - * Constructs a new ListAttackPathsRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListAttackPathsRequest. - * @implements IListAttackPathsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest=} [properties] Properties to set - */ - function ListAttackPathsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttackPathsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @instance - */ - ListAttackPathsRequest.prototype.parent = ""; - - /** - * ListAttackPathsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @instance - */ - ListAttackPathsRequest.prototype.filter = ""; - - /** - * ListAttackPathsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @instance - */ - ListAttackPathsRequest.prototype.pageToken = ""; - - /** - * ListAttackPathsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @instance - */ - ListAttackPathsRequest.prototype.pageSize = 0; - - /** - * Creates a new ListAttackPathsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListAttackPathsRequest} ListAttackPathsRequest instance - */ - ListAttackPathsRequest.create = function create(properties) { - return new ListAttackPathsRequest(properties); - }; - - /** - * Encodes the specified ListAttackPathsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest} message ListAttackPathsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttackPathsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - return writer; - }; - - /** - * Encodes the specified ListAttackPathsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListAttackPathsRequest} message ListAttackPathsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttackPathsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttackPathsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ListAttackPathsRequest} ListAttackPathsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttackPathsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListAttackPathsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttackPathsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListAttackPathsRequest} ListAttackPathsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttackPathsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttackPathsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttackPathsRequest.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.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 ListAttackPathsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListAttackPathsRequest} ListAttackPathsRequest - */ - ListAttackPathsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListAttackPathsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListAttackPathsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - 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 ListAttackPathsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {google.cloud.securitycenter.v2.ListAttackPathsRequest} message ListAttackPathsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttackPathsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - 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.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - return object; - }; - - /** - * Converts this ListAttackPathsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAttackPathsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttackPathsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ListAttackPathsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttackPathsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListAttackPathsRequest"; - }; - - return ListAttackPathsRequest; - })(); - - v2.ListAttackPathsResponse = (function() { - - /** - * Properties of a ListAttackPathsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IListAttackPathsResponse - * @property {Array.|null} [attackPaths] ListAttackPathsResponse attackPaths - * @property {string|null} [nextPageToken] ListAttackPathsResponse nextPageToken - */ - - /** - * Constructs a new ListAttackPathsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListAttackPathsResponse. - * @implements IListAttackPathsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.IListAttackPathsResponse=} [properties] Properties to set - */ - function ListAttackPathsResponse(properties) { - this.attackPaths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttackPathsResponse attackPaths. - * @member {Array.} attackPaths - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @instance - */ - ListAttackPathsResponse.prototype.attackPaths = $util.emptyArray; - - /** - * ListAttackPathsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @instance - */ - ListAttackPathsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAttackPathsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListAttackPathsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListAttackPathsResponse} ListAttackPathsResponse instance - */ - ListAttackPathsResponse.create = function create(properties) { - return new ListAttackPathsResponse(properties); - }; - - /** - * Encodes the specified ListAttackPathsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListAttackPathsResponse} message ListAttackPathsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttackPathsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attackPaths != null && message.attackPaths.length) - for (var i = 0; i < message.attackPaths.length; ++i) - $root.google.cloud.securitycenter.v2.AttackPath.encode(message.attackPaths[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 ListAttackPathsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListAttackPathsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListAttackPathsResponse} message ListAttackPathsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttackPathsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttackPathsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ListAttackPathsResponse} ListAttackPathsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttackPathsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListAttackPathsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.attackPaths && message.attackPaths.length)) - message.attackPaths = []; - message.attackPaths.push($root.google.cloud.securitycenter.v2.AttackPath.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttackPathsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListAttackPathsResponse} ListAttackPathsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttackPathsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttackPathsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttackPathsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attackPaths != null && message.hasOwnProperty("attackPaths")) { - if (!Array.isArray(message.attackPaths)) - return "attackPaths: array expected"; - for (var i = 0; i < message.attackPaths.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.AttackPath.verify(message.attackPaths[i]); - if (error) - return "attackPaths." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAttackPathsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListAttackPathsResponse} ListAttackPathsResponse - */ - ListAttackPathsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListAttackPathsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListAttackPathsResponse(); - if (object.attackPaths) { - if (!Array.isArray(object.attackPaths)) - throw TypeError(".google.cloud.securitycenter.v2.ListAttackPathsResponse.attackPaths: array expected"); - message.attackPaths = []; - for (var i = 0; i < object.attackPaths.length; ++i) { - if (typeof object.attackPaths[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListAttackPathsResponse.attackPaths: object expected"); - message.attackPaths[i] = $root.google.cloud.securitycenter.v2.AttackPath.fromObject(object.attackPaths[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAttackPathsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {google.cloud.securitycenter.v2.ListAttackPathsResponse} message ListAttackPathsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttackPathsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attackPaths = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.attackPaths && message.attackPaths.length) { - object.attackPaths = []; - for (var j = 0; j < message.attackPaths.length; ++j) - object.attackPaths[j] = $root.google.cloud.securitycenter.v2.AttackPath.toObject(message.attackPaths[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAttackPathsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAttackPathsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttackPathsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ListAttackPathsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttackPathsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListAttackPathsResponse"; - }; - - return ListAttackPathsResponse; - })(); - - v2.GetSimulationRequest = (function() { - - /** - * Properties of a GetSimulationRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IGetSimulationRequest - * @property {string|null} [name] GetSimulationRequest name - */ - - /** - * Constructs a new GetSimulationRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GetSimulationRequest. - * @implements IGetSimulationRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IGetSimulationRequest=} [properties] Properties to set - */ - function GetSimulationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetSimulationRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @instance - */ - GetSimulationRequest.prototype.name = ""; - - /** - * Creates a new GetSimulationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetSimulationRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GetSimulationRequest} GetSimulationRequest instance - */ - GetSimulationRequest.create = function create(properties) { - return new GetSimulationRequest(properties); - }; - - /** - * Encodes the specified GetSimulationRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetSimulationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetSimulationRequest} message GetSimulationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSimulationRequest.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 GetSimulationRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetSimulationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetSimulationRequest} message GetSimulationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSimulationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSimulationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.GetSimulationRequest} GetSimulationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSimulationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetSimulationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSimulationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.GetSimulationRequest} GetSimulationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSimulationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSimulationRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSimulationRequest.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 GetSimulationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GetSimulationRequest} GetSimulationRequest - */ - GetSimulationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GetSimulationRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.GetSimulationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSimulationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {google.cloud.securitycenter.v2.GetSimulationRequest} message GetSimulationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSimulationRequest.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 GetSimulationRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @instance - * @returns {Object.} JSON object - */ - GetSimulationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSimulationRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.GetSimulationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSimulationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.GetSimulationRequest"; - }; - - return GetSimulationRequest; - })(); - - v2.GetValuedResourceRequest = (function() { - - /** - * Properties of a GetValuedResourceRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IGetValuedResourceRequest - * @property {string|null} [name] GetValuedResourceRequest name - */ - - /** - * Constructs a new GetValuedResourceRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a GetValuedResourceRequest. - * @implements IGetValuedResourceRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest=} [properties] Properties to set - */ - function GetValuedResourceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetValuedResourceRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @instance - */ - GetValuedResourceRequest.prototype.name = ""; - - /** - * Creates a new GetValuedResourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.GetValuedResourceRequest} GetValuedResourceRequest instance - */ - GetValuedResourceRequest.create = function create(properties) { - return new GetValuedResourceRequest(properties); - }; - - /** - * Encodes the specified GetValuedResourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.GetValuedResourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest} message GetValuedResourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetValuedResourceRequest.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 GetValuedResourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GetValuedResourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {google.cloud.securitycenter.v2.IGetValuedResourceRequest} message GetValuedResourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetValuedResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetValuedResourceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.GetValuedResourceRequest} GetValuedResourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetValuedResourceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GetValuedResourceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetValuedResourceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.GetValuedResourceRequest} GetValuedResourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetValuedResourceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetValuedResourceRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetValuedResourceRequest.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 GetValuedResourceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.GetValuedResourceRequest} GetValuedResourceRequest - */ - GetValuedResourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.GetValuedResourceRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.GetValuedResourceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetValuedResourceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {google.cloud.securitycenter.v2.GetValuedResourceRequest} message GetValuedResourceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetValuedResourceRequest.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 GetValuedResourceRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @instance - * @returns {Object.} JSON object - */ - GetValuedResourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetValuedResourceRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.GetValuedResourceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetValuedResourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.GetValuedResourceRequest"; - }; - - return GetValuedResourceRequest; - })(); - - v2.ListBigQueryExportsRequest = (function() { - - /** - * Properties of a ListBigQueryExportsRequest. - * @memberof google.cloud.securitycenter.v2 - * @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.v2 - * @classdesc Represents a ListBigQueryExportsRequest. - * @implements IListBigQueryExportsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest - * @instance - */ - ListBigQueryExportsRequest.prototype.parent = ""; - - /** - * ListBigQueryExportsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest - * @instance - */ - ListBigQueryExportsRequest.prototype.pageSize = 0; - - /** - * ListBigQueryExportsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest - * @instance - */ - ListBigQueryExportsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBigQueryExportsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListBigQueryExportsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListBigQueryExportsRequest} ListBigQueryExportsRequest instance - */ - ListBigQueryExportsRequest.create = function create(properties) { - return new ListBigQueryExportsRequest(properties); - }; - - /** - * Encodes the specified ListBigQueryExportsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListBigQueryExportsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListBigQueryExportsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.ListBigQueryExportsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.ListBigQueryExportsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListBigQueryExportsRequest} ListBigQueryExportsRequest - */ - ListBigQueryExportsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListBigQueryExportsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBigQueryExportsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBigQueryExportsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsRequest"; - }; - - return ListBigQueryExportsRequest; - })(); - - v2.ListBigQueryExportsResponse = (function() { - - /** - * Properties of a ListBigQueryExportsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IListBigQueryExportsResponse - * @property {Array.|null} [bigQueryExports] ListBigQueryExportsResponse bigQueryExports - * @property {string|null} [nextPageToken] ListBigQueryExportsResponse nextPageToken - */ - - /** - * Constructs a new ListBigQueryExportsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListBigQueryExportsResponse. - * @implements IListBigQueryExportsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse - * @instance - */ - ListBigQueryExportsResponse.prototype.bigQueryExports = $util.emptyArray; - - /** - * ListBigQueryExportsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsResponse - * @instance - */ - ListBigQueryExportsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListBigQueryExportsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListBigQueryExportsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListBigQueryExportsResponse} ListBigQueryExportsResponse instance - */ - ListBigQueryExportsResponse.create = function create(properties) { - return new ListBigQueryExportsResponse(properties); - }; - - /** - * Encodes the specified ListBigQueryExportsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListBigQueryExportsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.ListBigQueryExportsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListBigQueryExportsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListBigQueryExportsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bigQueryExports && message.bigQueryExports.length)) - message.bigQueryExports = []; - message.bigQueryExports.push($root.google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.ListBigQueryExportsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListBigQueryExportsResponse} ListBigQueryExportsResponse - */ - ListBigQueryExportsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListBigQueryExportsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListBigQueryExportsResponse(); - if (object.bigQueryExports) { - if (!Array.isArray(object.bigQueryExports)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse.bigQueryExports: object expected"); - message.bigQueryExports[i] = $root.google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.ListBigQueryExportsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBigQueryExportsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBigQueryExportsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse"; - }; - - return ListBigQueryExportsResponse; - })(); - - v2.ListFindingsRequest = (function() { - - /** - * Properties of a ListFindingsRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IListFindingsRequest - * @property {string|null} [parent] ListFindingsRequest parent - * @property {string|null} [filter] ListFindingsRequest filter - * @property {string|null} [orderBy] ListFindingsRequest orderBy - * @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.v2 - * @classdesc Represents a ListFindingsRequest. - * @implements IListFindingsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.parent = ""; - - /** - * ListFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v2.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.filter = ""; - - /** - * ListFindingsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v2.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.orderBy = ""; - - /** - * ListFindingsRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v2.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.fieldMask = null; - - /** - * ListFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.pageToken = ""; - - /** - * ListFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.pageSize = 0; - - /** - * Creates a new ListFindingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListFindingsRequest} ListFindingsRequest instance - */ - ListFindingsRequest.create = function create(properties) { - return new ListFindingsRequest(properties); - }; - - /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListFindingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - 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")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v2.ListFindingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListFindingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 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.v2.ListFindingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.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.v2.ListFindingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListFindingsRequest} ListFindingsRequest - */ - ListFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListFindingsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListFindingsRequest - * @static - * @param {google.cloud.securitycenter.v2.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.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.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.v2.ListFindingsRequest - * @instance - * @returns {Object.} JSON object - */ - ListFindingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListFindingsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListFindingsRequest"; - }; - - return ListFindingsRequest; - })(); - - v2.ListFindingsResponse = (function() { - - /** - * Properties of a ListFindingsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IListFindingsResponse - * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults - * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken - * @property {number|null} [totalSize] ListFindingsResponse totalSize - */ - - /** - * Constructs a new ListFindingsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListFindingsResponse. - * @implements IListFindingsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; - - /** - * ListFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.nextPageToken = ""; - - /** - * ListFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.totalSize = 0; - - /** - * Creates a new ListFindingsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListFindingsResponse} ListFindingsResponse instance - */ - ListFindingsResponse.create = function create(properties) { - return new ListFindingsResponse(properties); - }; - - /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListFindingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).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 ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListFindingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.listFindingsResults && message.listFindingsResults.length)) - message.listFindingsResults = []; - message.listFindingsResults.push($root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.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.v2.ListFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); - if (error) - return "listFindingsResults." + 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.v2.ListFindingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListFindingsResponse} ListFindingsResponse - */ - ListFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListFindingsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse(); - if (object.listFindingsResults) { - if (!Array.isArray(object.listFindingsResults)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.listFindingsResults: object expected"); - message.listFindingsResults[i] = $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); - } - } - 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.v2.ListFindingsResponse - * @static - * @param {google.cloud.securitycenter.v2.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.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.v2.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], 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.v2.ListFindingsResponse - * @instance - * @returns {Object.} JSON object - */ - ListFindingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListFindingsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListFindingsResponse"; - }; - - ListFindingsResponse.ListFindingsResult = (function() { - - /** - * Properties of a ListFindingsResult. - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse - * @interface IListFindingsResult - * @property {google.cloud.securitycenter.v2.IFinding|null} [finding] ListFindingsResult finding - * @property {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource|null} [resource] ListFindingsResult resource - */ - - /** - * Constructs a new ListFindingsResult. - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse - * @classdesc Represents a ListFindingsResult. - * @implements IListFindingsResult - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.finding = null; - - /** - * ListFindingsResult resource. - * @member {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource|null|undefined} resource - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.resource = null; - - /** - * Creates a new ListFindingsResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "finding")) - $root.google.cloud.securitycenter.v2.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.finding = $root.google.cloud.securitycenter.v2.Finding.decode(reader, reader.uint32()); - break; - } - case 3: { - message.resource = $root.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Finding.verify(message.finding); - if (error) - return "finding." + error; - } - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult} ListFindingsResult - */ - ListFindingsResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v2.Finding.fromObject(object.finding); - } - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.resource: object expected"); - message.resource = $root.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v2.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.resource = null; - } - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v2.Finding.toObject(message.finding, options); - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); - return object; - }; - - /** - * Converts this ListFindingsResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - * @instance - * @returns {Object.} JSON object - */ - ListFindingsResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListFindingsResult - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult"; - }; - - ListFindingsResult.Resource = (function() { - - /** - * Properties of a Resource. - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - * @interface IResource - * @property {string|null} [name] Resource name - * @property {string|null} [displayName] Resource displayName - * @property {string|null} [type] Resource type - * @property {google.cloud.securitycenter.v2.CloudProvider|null} [cloudProvider] Resource cloudProvider - * @property {string|null} [service] Resource service - * @property {string|null} [location] Resource location - * @property {google.cloud.securitycenter.v2.IGcpMetadata|null} [gcpMetadata] Resource gcpMetadata - * @property {google.cloud.securitycenter.v2.IAwsMetadata|null} [awsMetadata] Resource awsMetadata - * @property {google.cloud.securitycenter.v2.IAzureMetadata|null} [azureMetadata] Resource azureMetadata - * @property {google.cloud.securitycenter.v2.IResourcePath|null} [resourcePath] Resource resourcePath - * @property {string|null} [resourcePathString] Resource resourcePathString - */ - - /** - * Constructs a new Resource. - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.name = ""; - - /** - * Resource displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.displayName = ""; - - /** - * Resource type. - * @member {string} type - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.type = ""; - - /** - * Resource cloudProvider. - * @member {google.cloud.securitycenter.v2.CloudProvider} cloudProvider - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.cloudProvider = 0; - - /** - * Resource service. - * @member {string} service - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.service = ""; - - /** - * Resource location. - * @member {string} location - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.location = ""; - - /** - * Resource gcpMetadata. - * @member {google.cloud.securitycenter.v2.IGcpMetadata|null|undefined} gcpMetadata - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.gcpMetadata = null; - - /** - * Resource awsMetadata. - * @member {google.cloud.securitycenter.v2.IAwsMetadata|null|undefined} awsMetadata - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.awsMetadata = null; - - /** - * Resource azureMetadata. - * @member {google.cloud.securitycenter.v2.IAzureMetadata|null|undefined} azureMetadata - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.azureMetadata = null; - - /** - * Resource resourcePath. - * @member {google.cloud.securitycenter.v2.IResourcePath|null|undefined} resourcePath - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.resourcePath = null; - - /** - * Resource resourcePathString. - * @member {string} resourcePathString - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.resourcePathString = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Resource cloudProviderMetadata. - * @member {"gcpMetadata"|"awsMetadata"|"azureMetadata"|undefined} cloudProviderMetadata - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Object.defineProperty(Resource.prototype, "cloudProviderMetadata", { - get: $util.oneOfGetter($oneOfFields = ["gcpMetadata", "awsMetadata", "azureMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {google.cloud.securitycenter.v2.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 && 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.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cloudProvider); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.service); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - if (message.gcpMetadata != null && Object.hasOwnProperty.call(message, "gcpMetadata")) - $root.google.cloud.securitycenter.v2.GcpMetadata.encode(message.gcpMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.awsMetadata != null && Object.hasOwnProperty.call(message, "awsMetadata")) - $root.google.cloud.securitycenter.v2.AwsMetadata.encode(message.awsMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.azureMetadata != null && Object.hasOwnProperty.call(message, "azureMetadata")) - $root.google.cloud.securitycenter.v2.AzureMetadata.encode(message.azureMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.resourcePath != null && Object.hasOwnProperty.call(message, "resourcePath")) - $root.google.cloud.securitycenter.v2.ResourcePath.encode(message.resourcePath, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.resourcePathString != null && Object.hasOwnProperty.call(message, "resourcePathString")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.resourcePathString); - return writer; - }; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 4: { - message.cloudProvider = reader.int32(); - break; - } - case 5: { - message.service = reader.string(); - break; - } - case 6: { - message.location = reader.string(); - break; - } - case 7: { - message.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.decode(reader, reader.uint32()); - break; - } - case 8: { - message.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.decode(reader, reader.uint32()); - break; - } - case 9: { - message.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.decode(reader, reader.uint32()); - break; - } - case 10: { - message.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.decode(reader, reader.uint32()); - break; - } - case 11: { - message.resourcePathString = 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.v2.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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"; - 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.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - switch (message.cloudProvider) { - default: - return "cloudProvider: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.gcpMetadata != null && message.hasOwnProperty("gcpMetadata")) { - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v2.GcpMetadata.verify(message.gcpMetadata); - if (error) - return "gcpMetadata." + error; - } - } - if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { - if (properties.cloudProviderMetadata === 1) - return "cloudProviderMetadata: multiple values"; - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v2.AwsMetadata.verify(message.awsMetadata); - if (error) - return "awsMetadata." + error; - } - } - if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { - if (properties.cloudProviderMetadata === 1) - return "cloudProviderMetadata: multiple values"; - properties.cloudProviderMetadata = 1; - { - var error = $root.google.cloud.securitycenter.v2.AzureMetadata.verify(message.azureMetadata); - if (error) - return "azureMetadata." + error; - } - } - if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) { - var error = $root.google.cloud.securitycenter.v2.ResourcePath.verify(message.resourcePath); - if (error) - return "resourcePath." + error; - } - if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) - if (!$util.isString(message.resourcePathString)) - return "resourcePathString: 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.v2.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource} Resource - */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource) - return object; - var message = new $root.google.cloud.securitycenter.v2.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); - switch (object.cloudProvider) { - default: - if (typeof object.cloudProvider === "number") { - message.cloudProvider = object.cloudProvider; - break; - } - break; - case "CLOUD_PROVIDER_UNSPECIFIED": - case 0: - message.cloudProvider = 0; - break; - case "GOOGLE_CLOUD_PLATFORM": - case 1: - message.cloudProvider = 1; - break; - case "AMAZON_WEB_SERVICES": - case 2: - message.cloudProvider = 2; - break; - case "MICROSOFT_AZURE": - case 3: - message.cloudProvider = 3; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.location != null) - message.location = String(object.location); - if (object.gcpMetadata != null) { - if (typeof object.gcpMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.gcpMetadata: object expected"); - message.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.fromObject(object.gcpMetadata); - } - if (object.awsMetadata != null) { - if (typeof object.awsMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.awsMetadata: object expected"); - message.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.fromObject(object.awsMetadata); - } - if (object.azureMetadata != null) { - if (typeof object.azureMetadata !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.azureMetadata: object expected"); - message.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.fromObject(object.azureMetadata); - } - if (object.resourcePath != null) { - if (typeof object.resourcePath !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.resourcePath: object expected"); - message.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.fromObject(object.resourcePath); - } - if (object.resourcePathString != null) - message.resourcePathString = String(object.resourcePathString); - return message; - }; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {google.cloud.securitycenter.v2.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.displayName = ""; - object.type = ""; - object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; - object.service = ""; - object.location = ""; - object.resourcePath = null; - object.resourcePathString = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] : message.cloudProvider; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.gcpMetadata != null && message.hasOwnProperty("gcpMetadata")) { - object.gcpMetadata = $root.google.cloud.securitycenter.v2.GcpMetadata.toObject(message.gcpMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "gcpMetadata"; - } - if (message.awsMetadata != null && message.hasOwnProperty("awsMetadata")) { - object.awsMetadata = $root.google.cloud.securitycenter.v2.AwsMetadata.toObject(message.awsMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "awsMetadata"; - } - if (message.azureMetadata != null && message.hasOwnProperty("azureMetadata")) { - object.azureMetadata = $root.google.cloud.securitycenter.v2.AzureMetadata.toObject(message.azureMetadata, options); - if (options.oneofs) - object.cloudProviderMetadata = "azureMetadata"; - } - if (message.resourcePath != null && message.hasOwnProperty("resourcePath")) - object.resourcePath = $root.google.cloud.securitycenter.v2.ResourcePath.toObject(message.resourcePath, options); - if (message.resourcePathString != null && message.hasOwnProperty("resourcePathString")) - object.resourcePathString = message.resourcePathString; - return object; - }; - - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Resource - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult.Resource"; - }; - - return Resource; - })(); - - return ListFindingsResult; - })(); - - return ListFindingsResponse; - })(); - - v2.ListMuteConfigsRequest = (function() { - - /** - * Properties of a ListMuteConfigsRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IListMuteConfigsRequest - * @property {string|null} [parent] ListMuteConfigsRequest parent - * @property {number|null} [pageSize] ListMuteConfigsRequest pageSize - * @property {string|null} [pageToken] ListMuteConfigsRequest pageToken - */ - - /** - * Constructs a new ListMuteConfigsRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListMuteConfigsRequest. - * @implements IListMuteConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest=} [properties] Properties to set - */ - function ListMuteConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListMuteConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @instance - */ - ListMuteConfigsRequest.prototype.parent = ""; - - /** - * ListMuteConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @instance - */ - ListMuteConfigsRequest.prototype.pageSize = 0; - - /** - * ListMuteConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @instance - */ - ListMuteConfigsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListMuteConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListMuteConfigsRequest} ListMuteConfigsRequest instance - */ - ListMuteConfigsRequest.create = function create(properties) { - return new ListMuteConfigsRequest(properties); - }; - - /** - * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListMuteConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListMuteConfigsRequest.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 ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListMuteConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListMuteConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.ListMuteConfigsRequest} ListMuteConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListMuteConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListMuteConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListMuteConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListMuteConfigsRequest} ListMuteConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListMuteConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListMuteConfigsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListMuteConfigsRequest.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 ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListMuteConfigsRequest} ListMuteConfigsRequest - */ - ListMuteConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListMuteConfigsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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 ListMuteConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.ListMuteConfigsRequest} message ListMuteConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListMuteConfigsRequest.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 ListMuteConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListMuteConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListMuteConfigsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListMuteConfigsRequest"; - }; - - return ListMuteConfigsRequest; - })(); - - v2.ListMuteConfigsResponse = (function() { - - /** - * Properties of a ListMuteConfigsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IListMuteConfigsResponse - * @property {Array.|null} [muteConfigs] ListMuteConfigsResponse muteConfigs - * @property {string|null} [nextPageToken] ListMuteConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListMuteConfigsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListMuteConfigsResponse. - * @implements IListMuteConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.IListMuteConfigsResponse=} [properties] Properties to set - */ - function ListMuteConfigsResponse(properties) { - this.muteConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListMuteConfigsResponse muteConfigs. - * @member {Array.} muteConfigs - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @instance - */ - ListMuteConfigsResponse.prototype.muteConfigs = $util.emptyArray; - - /** - * ListMuteConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @instance - */ - ListMuteConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListMuteConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListMuteConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListMuteConfigsResponse} ListMuteConfigsResponse instance - */ - ListMuteConfigsResponse.create = function create(properties) { - return new ListMuteConfigsResponse(properties); - }; - - /** - * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListMuteConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListMuteConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.muteConfigs != null && message.muteConfigs.length) - for (var i = 0; i < message.muteConfigs.length; ++i) - $root.google.cloud.securitycenter.v2.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 ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListMuteConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListMuteConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.ListMuteConfigsResponse} ListMuteConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListMuteConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListMuteConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.muteConfigs && message.muteConfigs.length)) - message.muteConfigs = []; - message.muteConfigs.push($root.google.cloud.securitycenter.v2.MuteConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListMuteConfigsResponse} ListMuteConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListMuteConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListMuteConfigsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListMuteConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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.v2.MuteConfig.verify(message.muteConfigs[i]); - if (error) - return "muteConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListMuteConfigsResponse} ListMuteConfigsResponse - */ - ListMuteConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListMuteConfigsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListMuteConfigsResponse(); - if (object.muteConfigs) { - if (!Array.isArray(object.muteConfigs)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListMuteConfigsResponse.muteConfigs: object expected"); - message.muteConfigs[i] = $root.google.cloud.securitycenter.v2.MuteConfig.fromObject(object.muteConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.ListMuteConfigsResponse} message ListMuteConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListMuteConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.muteConfigs = []; - if (options.defaults) - 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.v2.MuteConfig.toObject(message.muteConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListMuteConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListMuteConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListMuteConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListMuteConfigsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListMuteConfigsResponse"; - }; - - return ListMuteConfigsResponse; - })(); - - v2.ListNotificationConfigsRequest = (function() { - - /** - * Properties of a ListNotificationConfigsRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IListNotificationConfigsRequest - * @property {string|null} [parent] ListNotificationConfigsRequest parent - * @property {string|null} [pageToken] ListNotificationConfigsRequest pageToken - * @property {number|null} [pageSize] ListNotificationConfigsRequest pageSize - */ - - /** - * Constructs a new ListNotificationConfigsRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListNotificationConfigsRequest. - * @implements IListNotificationConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest=} [properties] Properties to set - */ - function ListNotificationConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListNotificationConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.parent = ""; - - /** - * ListNotificationConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.pageToken = ""; - - /** - * ListNotificationConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @instance - */ - ListNotificationConfigsRequest.prototype.pageSize = 0; - - /** - * Creates a new ListNotificationConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance - */ - ListNotificationConfigsRequest.create = function create(properties) { - return new ListNotificationConfigsRequest(properties); - }; - - /** - * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListNotificationConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListNotificationConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - return writer; - }; - - /** - * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListNotificationConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsRequest} ListNotificationConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListNotificationConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListNotificationConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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; - } - } - return message; - }; - - /** - * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsRequest} ListNotificationConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - 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.v2.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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsRequest} ListNotificationConfigsRequest - */ - ListNotificationConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListNotificationConfigsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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 ListNotificationConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.ListNotificationConfigsRequest} message ListNotificationConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListNotificationConfigsRequest.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 ListNotificationConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListNotificationConfigsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsRequest"; - }; - - return ListNotificationConfigsRequest; - })(); - - v2.ListNotificationConfigsResponse = (function() { - - /** - * Properties of a ListNotificationConfigsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IListNotificationConfigsResponse - * @property {Array.|null} [notificationConfigs] ListNotificationConfigsResponse notificationConfigs - * @property {string|null} [nextPageToken] ListNotificationConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListNotificationConfigsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListNotificationConfigsResponse. - * @implements IListNotificationConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsResponse=} [properties] Properties to set - */ - function ListNotificationConfigsResponse(properties) { - this.notificationConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListNotificationConfigsResponse notificationConfigs. - * @member {Array.} notificationConfigs - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @instance - */ - ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; - - /** - * ListNotificationConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @instance - */ - ListNotificationConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListNotificationConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance - */ - ListNotificationConfigsResponse.create = function create(properties) { - return new ListNotificationConfigsResponse(properties); - }; - - /** - * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListNotificationConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListNotificationConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.notificationConfigs != null && message.notificationConfigs.length) - for (var i = 0; i < message.notificationConfigs.length; ++i) - $root.google.cloud.securitycenter.v2.NotificationConfig.encode(message.notificationConfigs[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 ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListNotificationConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsResponse} ListNotificationConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListNotificationConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListNotificationConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.notificationConfigs && message.notificationConfigs.length)) - message.notificationConfigs = []; - message.notificationConfigs.push($root.google.cloud.securitycenter.v2.NotificationConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} ListNotificationConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListNotificationConfigsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListNotificationConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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.v2.NotificationConfig.verify(message.notificationConfigs[i]); - if (error) - return "notificationConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} ListNotificationConfigsResponse - */ - ListNotificationConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListNotificationConfigsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListNotificationConfigsResponse(); - if (object.notificationConfigs) { - if (!Array.isArray(object.notificationConfigs)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsResponse.notificationConfigs: object expected"); - message.notificationConfigs[i] = $root.google.cloud.securitycenter.v2.NotificationConfig.fromObject(object.notificationConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.ListNotificationConfigsResponse} message ListNotificationConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - 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.v2.NotificationConfig.toObject(message.notificationConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListNotificationConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListNotificationConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListNotificationConfigsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsResponse"; - }; - - return ListNotificationConfigsResponse; - })(); - - v2.ListResourceValueConfigsRequest = (function() { - - /** - * Properties of a ListResourceValueConfigsRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IListResourceValueConfigsRequest - * @property {string|null} [parent] ListResourceValueConfigsRequest parent - * @property {number|null} [pageSize] ListResourceValueConfigsRequest pageSize - * @property {string|null} [pageToken] ListResourceValueConfigsRequest pageToken - */ - - /** - * Constructs a new ListResourceValueConfigsRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListResourceValueConfigsRequest. - * @implements IListResourceValueConfigsRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest=} [properties] Properties to set - */ - function ListResourceValueConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceValueConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @instance - */ - ListResourceValueConfigsRequest.prototype.parent = ""; - - /** - * ListResourceValueConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @instance - */ - ListResourceValueConfigsRequest.prototype.pageSize = 0; - - /** - * ListResourceValueConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @instance - */ - ListResourceValueConfigsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListResourceValueConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest instance - */ - ListResourceValueConfigsRequest.create = function create(properties) { - return new ListResourceValueConfigsRequest(properties); - }; - - /** - * Encodes the specified ListResourceValueConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest} message ListResourceValueConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsRequest} message ListResourceValueConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceValueConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceValueConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceValueConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListResourceValueConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceValueConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceValueConfigsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} ListResourceValueConfigsRequest - */ - ListResourceValueConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest(); - 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 ListResourceValueConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {google.cloud.securitycenter.v2.ListResourceValueConfigsRequest} message ListResourceValueConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceValueConfigsRequest.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 ListResourceValueConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListResourceValueConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceValueConfigsRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceValueConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListResourceValueConfigsRequest"; - }; - - return ListResourceValueConfigsRequest; - })(); - - v2.ListResourceValueConfigsResponse = (function() { - - /** - * Properties of a ListResourceValueConfigsResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IListResourceValueConfigsResponse - * @property {Array.|null} [resourceValueConfigs] ListResourceValueConfigsResponse resourceValueConfigs - * @property {string|null} [nextPageToken] ListResourceValueConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListResourceValueConfigsResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListResourceValueConfigsResponse. - * @implements IListResourceValueConfigsResponse - * @constructor - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsResponse=} [properties] Properties to set - */ - function ListResourceValueConfigsResponse(properties) { - this.resourceValueConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceValueConfigsResponse resourceValueConfigs. - * @member {Array.} resourceValueConfigs - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @instance - */ - ListResourceValueConfigsResponse.prototype.resourceValueConfigs = $util.emptyArray; - - /** - * ListResourceValueConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @instance - */ - ListResourceValueConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListResourceValueConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse instance - */ - ListResourceValueConfigsResponse.create = function create(properties) { - return new ListResourceValueConfigsResponse(properties); - }; - - /** - * Encodes the specified ListResourceValueConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsResponse} message ListResourceValueConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceValueConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceValueConfigs != null && message.resourceValueConfigs.length) - for (var i = 0; i < message.resourceValueConfigs.length; ++i) - $root.google.cloud.securitycenter.v2.ResourceValueConfig.encode(message.resourceValueConfigs[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 ListResourceValueConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.IListResourceValueConfigsResponse} message ListResourceValueConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceValueConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceValueConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListResourceValueConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.resourceValueConfigs && message.resourceValueConfigs.length)) - message.resourceValueConfigs = []; - message.resourceValueConfigs.push($root.google.cloud.securitycenter.v2.ResourceValueConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListResourceValueConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceValueConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceValueConfigsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceValueConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceValueConfigs != null && message.hasOwnProperty("resourceValueConfigs")) { - if (!Array.isArray(message.resourceValueConfigs)) - return "resourceValueConfigs: array expected"; - for (var i = 0; i < message.resourceValueConfigs.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.verify(message.resourceValueConfigs[i]); - if (error) - return "resourceValueConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListResourceValueConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} ListResourceValueConfigsResponse - */ - ListResourceValueConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListResourceValueConfigsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListResourceValueConfigsResponse(); - if (object.resourceValueConfigs) { - if (!Array.isArray(object.resourceValueConfigs)) - throw TypeError(".google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.resourceValueConfigs: array expected"); - message.resourceValueConfigs = []; - for (var i = 0; i < object.resourceValueConfigs.length; ++i) { - if (typeof object.resourceValueConfigs[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListResourceValueConfigsResponse.resourceValueConfigs: object expected"); - message.resourceValueConfigs[i] = $root.google.cloud.securitycenter.v2.ResourceValueConfig.fromObject(object.resourceValueConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListResourceValueConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {google.cloud.securitycenter.v2.ListResourceValueConfigsResponse} message ListResourceValueConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceValueConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceValueConfigs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.resourceValueConfigs && message.resourceValueConfigs.length) { - object.resourceValueConfigs = []; - for (var j = 0; j < message.resourceValueConfigs.length; ++j) - object.resourceValueConfigs[j] = $root.google.cloud.securitycenter.v2.ResourceValueConfig.toObject(message.resourceValueConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListResourceValueConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListResourceValueConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceValueConfigsResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ListResourceValueConfigsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceValueConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListResourceValueConfigsResponse"; - }; - - return ListResourceValueConfigsResponse; - })(); - - v2.ListSourcesRequest = (function() { - - /** - * Properties of a ListSourcesRequest. - * @memberof google.cloud.securitycenter.v2 - * @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.v2 - * @classdesc Represents a ListSourcesRequest. - * @implements IListSourcesRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ListSourcesRequest - * @instance - */ - ListSourcesRequest.prototype.parent = ""; - - /** - * ListSourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.ListSourcesRequest - * @instance - */ - ListSourcesRequest.prototype.pageToken = ""; - - /** - * ListSourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.ListSourcesRequest - * @instance - */ - ListSourcesRequest.prototype.pageSize = 0; - - /** - * Creates a new ListSourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v2.IListSourcesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListSourcesRequest} ListSourcesRequest instance - */ - ListSourcesRequest.create = function create(properties) { - return new ListSourcesRequest(properties); - }; - - /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListSourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "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.v2.ListSourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListSourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.v2.ListSourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.ListSourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListSourcesRequest} ListSourcesRequest - */ - ListSourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListSourcesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.ListSourcesRequest - * @instance - * @returns {Object.} JSON object - */ - ListSourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSourcesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListSourcesRequest"; - }; - - return ListSourcesRequest; - })(); - - v2.ListSourcesResponse = (function() { - - /** - * Properties of a ListSourcesResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IListSourcesResponse - * @property {Array.|null} [sources] ListSourcesResponse sources - * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken - */ - - /** - * Constructs a new ListSourcesResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListSourcesResponse. - * @implements IListSourcesResponse - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ListSourcesResponse - * @instance - */ - ListSourcesResponse.prototype.sources = $util.emptyArray; - - /** - * ListSourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.ListSourcesResponse - * @instance - */ - ListSourcesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v2.IListSourcesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListSourcesResponse} ListSourcesResponse instance - */ - ListSourcesResponse.create = function create(properties) { - return new ListSourcesResponse(properties); - }; - - /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListSourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Source.encode(message.sources[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 ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListSourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListSourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v2.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.v2.ListSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.ListSourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListSourcesResponse} ListSourcesResponse - */ - ListSourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListSourcesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListSourcesResponse(); - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.securitycenter.v2.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.v2.ListSourcesResponse.sources: object expected"); - message.sources[i] = $root.google.cloud.securitycenter.v2.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.v2.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.ListSourcesResponse - * @instance - * @returns {Object.} JSON object - */ - ListSourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSourcesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.ListSourcesResponse"; - }; - - return ListSourcesResponse; - })(); - - v2.ListValuedResourcesRequest = (function() { - - /** - * Properties of a ListValuedResourcesRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IListValuedResourcesRequest - * @property {string|null} [parent] ListValuedResourcesRequest parent - * @property {string|null} [filter] ListValuedResourcesRequest filter - * @property {string|null} [pageToken] ListValuedResourcesRequest pageToken - * @property {number|null} [pageSize] ListValuedResourcesRequest pageSize - * @property {string|null} [orderBy] ListValuedResourcesRequest orderBy - */ - - /** - * Constructs a new ListValuedResourcesRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListValuedResourcesRequest. - * @implements IListValuedResourcesRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest=} [properties] Properties to set - */ - function ListValuedResourcesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValuedResourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.parent = ""; - - /** - * ListValuedResourcesRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.filter = ""; - - /** - * ListValuedResourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.pageToken = ""; - - /** - * ListValuedResourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.pageSize = 0; - - /** - * ListValuedResourcesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @instance - */ - ListValuedResourcesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListValuedResourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListValuedResourcesRequest} ListValuedResourcesRequest instance - */ - ListValuedResourcesRequest.create = function create(properties) { - return new ListValuedResourcesRequest(properties); - }; - - /** - * Encodes the specified ListValuedResourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest} message ListValuedResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValuedResourcesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListValuedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {google.cloud.securitycenter.v2.IListValuedResourcesRequest} message ListValuedResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValuedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValuedResourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ListValuedResourcesRequest} ListValuedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValuedResourcesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListValuedResourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValuedResourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListValuedResourcesRequest} ListValuedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValuedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValuedResourcesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValuedResourcesRequest.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.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.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListValuedResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListValuedResourcesRequest} ListValuedResourcesRequest - */ - ListValuedResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListValuedResourcesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListValuedResourcesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListValuedResourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {google.cloud.securitycenter.v2.ListValuedResourcesRequest} message ListValuedResourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValuedResourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageToken = ""; - object.pageSize = 0; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListValuedResourcesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @instance - * @returns {Object.} JSON object - */ - ListValuedResourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValuedResourcesRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValuedResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListValuedResourcesRequest"; - }; - - return ListValuedResourcesRequest; - })(); - - v2.ListValuedResourcesResponse = (function() { - - /** - * Properties of a ListValuedResourcesResponse. - * @memberof google.cloud.securitycenter.v2 - * @interface IListValuedResourcesResponse - * @property {Array.|null} [valuedResources] ListValuedResourcesResponse valuedResources - * @property {string|null} [nextPageToken] ListValuedResourcesResponse nextPageToken - * @property {number|null} [totalSize] ListValuedResourcesResponse totalSize - */ - - /** - * Constructs a new ListValuedResourcesResponse. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ListValuedResourcesResponse. - * @implements IListValuedResourcesResponse - * @constructor - * @param {google.cloud.securitycenter.v2.IListValuedResourcesResponse=} [properties] Properties to set - */ - function ListValuedResourcesResponse(properties) { - this.valuedResources = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValuedResourcesResponse valuedResources. - * @member {Array.} valuedResources - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @instance - */ - ListValuedResourcesResponse.prototype.valuedResources = $util.emptyArray; - - /** - * ListValuedResourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @instance - */ - ListValuedResourcesResponse.prototype.nextPageToken = ""; - - /** - * ListValuedResourcesResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @instance - */ - ListValuedResourcesResponse.prototype.totalSize = 0; - - /** - * Creates a new ListValuedResourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {google.cloud.securitycenter.v2.IListValuedResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ListValuedResourcesResponse} ListValuedResourcesResponse instance - */ - ListValuedResourcesResponse.create = function create(properties) { - return new ListValuedResourcesResponse(properties); - }; - - /** - * Encodes the specified ListValuedResourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {google.cloud.securitycenter.v2.IListValuedResourcesResponse} message ListValuedResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValuedResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.valuedResources != null && message.valuedResources.length) - for (var i = 0; i < message.valuedResources.length; ++i) - $root.google.cloud.securitycenter.v2.ValuedResource.encode(message.valuedResources[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); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - return writer; - }; - - /** - * Encodes the specified ListValuedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ListValuedResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {google.cloud.securitycenter.v2.IListValuedResourcesResponse} message ListValuedResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValuedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValuedResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ListValuedResourcesResponse} ListValuedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValuedResourcesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ListValuedResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.valuedResources && message.valuedResources.length)) - message.valuedResources = []; - message.valuedResources.push($root.google.cloud.securitycenter.v2.ValuedResource.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.totalSize = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValuedResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ListValuedResourcesResponse} ListValuedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValuedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValuedResourcesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValuedResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.valuedResources != null && message.hasOwnProperty("valuedResources")) { - if (!Array.isArray(message.valuedResources)) - return "valuedResources: array expected"; - for (var i = 0; i < message.valuedResources.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.ValuedResource.verify(message.valuedResources[i]); - if (error) - return "valuedResources." + 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 ListValuedResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ListValuedResourcesResponse} ListValuedResourcesResponse - */ - ListValuedResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ListValuedResourcesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v2.ListValuedResourcesResponse(); - if (object.valuedResources) { - if (!Array.isArray(object.valuedResources)) - throw TypeError(".google.cloud.securitycenter.v2.ListValuedResourcesResponse.valuedResources: array expected"); - message.valuedResources = []; - for (var i = 0; i < object.valuedResources.length; ++i) { - if (typeof object.valuedResources[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ListValuedResourcesResponse.valuedResources: object expected"); - message.valuedResources[i] = $root.google.cloud.securitycenter.v2.ValuedResource.fromObject(object.valuedResources[i]); - } - } - 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 ListValuedResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {google.cloud.securitycenter.v2.ListValuedResourcesResponse} message ListValuedResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValuedResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.valuedResources = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.valuedResources && message.valuedResources.length) { - object.valuedResources = []; - for (var j = 0; j < message.valuedResources.length; ++j) - object.valuedResources[j] = $root.google.cloud.securitycenter.v2.ValuedResource.toObject(message.valuedResources[j], 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 ListValuedResourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @instance - * @returns {Object.} JSON object - */ - ListValuedResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValuedResourcesResponse - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ListValuedResourcesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValuedResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ListValuedResourcesResponse"; - }; - - return ListValuedResourcesResponse; - })(); - - v2.SetFindingStateRequest = (function() { - - /** - * Properties of a SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface ISetFindingStateRequest - * @property {string|null} [name] SetFindingStateRequest name - * @property {google.cloud.securitycenter.v2.Finding.State|null} [state] SetFindingStateRequest state - */ - - /** - * Constructs a new SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a SetFindingStateRequest. - * @implements ISetFindingStateRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.name = ""; - - /** - * SetFindingStateRequest state. - * @member {google.cloud.securitycenter.v2.Finding.State} state - * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.state = 0; - - /** - * Creates a new SetFindingStateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest - * @static - * @param {google.cloud.securitycenter.v2.ISetFindingStateRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.SetFindingStateRequest} SetFindingStateRequest instance - */ - SetFindingStateRequest.create = function create(properties) { - return new SetFindingStateRequest(properties); - }; - - /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.SetFindingStateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest - * @static - * @param {google.cloud.securitycenter.v2.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); - return writer; - }; - - /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SetFindingStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SetFindingStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - 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.v2.SetFindingStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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; - } - return null; - }; - - /** - * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.SetFindingStateRequest} SetFindingStateRequest - */ - SetFindingStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.SetFindingStateRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.SetFindingStateRequest(); - 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; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest - * @static - * @param {google.cloud.securitycenter.v2.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; - } - 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.v2.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v2.Finding.State[message.state] : message.state; - return object; - }; - - /** - * Converts this SetFindingStateRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.SetFindingStateRequest - * @instance - * @returns {Object.} JSON object - */ - SetFindingStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetFindingStateRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.SetFindingStateRequest"; - }; - - return SetFindingStateRequest; - })(); - - v2.SetMuteRequest = (function() { - - /** - * Properties of a SetMuteRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface ISetMuteRequest - * @property {string|null} [name] SetMuteRequest name - * @property {google.cloud.securitycenter.v2.Finding.Mute|null} [mute] SetMuteRequest mute - */ - - /** - * Constructs a new SetMuteRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a SetMuteRequest. - * @implements ISetMuteRequest - * @constructor - * @param {google.cloud.securitycenter.v2.ISetMuteRequest=} [properties] Properties to set - */ - function SetMuteRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetMuteRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @instance - */ - SetMuteRequest.prototype.name = ""; - - /** - * SetMuteRequest mute. - * @member {google.cloud.securitycenter.v2.Finding.Mute} mute - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @instance - */ - SetMuteRequest.prototype.mute = 0; - - /** - * Creates a new SetMuteRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @static - * @param {google.cloud.securitycenter.v2.ISetMuteRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.SetMuteRequest} SetMuteRequest instance - */ - SetMuteRequest.create = function create(properties) { - return new SetMuteRequest(properties); - }; - - /** - * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.SetMuteRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @static - * @param {google.cloud.securitycenter.v2.ISetMuteRequest} message SetMuteRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} 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.mute != null && Object.hasOwnProperty.call(message, "mute")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mute); - return writer; - }; - - /** - * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.SetMuteRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @static - * @param {google.cloud.securitycenter.v2.ISetMuteRequest} message SetMuteRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetMuteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetMuteRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.SetMuteRequest} SetMuteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetMuteRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.SetMuteRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.mute = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.SetMuteRequest} SetMuteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetMuteRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetMuteRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - 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.mute != null && message.hasOwnProperty("mute")) - switch (message.mute) { - default: - return "mute: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.SetMuteRequest} SetMuteRequest - */ - SetMuteRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.SetMuteRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.SetMuteRequest(); - 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; - break; - case "MUTED": - case 1: - message.mute = 1; - break; - case "UNMUTED": - case 2: - message.mute = 2; - break; - case "UNDEFINED": - case 3: - message.mute = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @static - * @param {google.cloud.securitycenter.v2.SetMuteRequest} message SetMuteRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetMuteRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; - } - 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.v2.Finding.Mute[message.mute] === undefined ? message.mute : $root.google.cloud.securitycenter.v2.Finding.Mute[message.mute] : message.mute; - return object; - }; - - /** - * Converts this SetMuteRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.SetMuteRequest - * @instance - * @returns {Object.} JSON object - */ - SetMuteRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetMuteRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.SetMuteRequest"; - }; - - return SetMuteRequest; - })(); - - v2.UpdateBigQueryExportRequest = (function() { - - /** - * Properties of an UpdateBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IUpdateBigQueryExportRequest - * @property {google.cloud.securitycenter.v2.IBigQueryExport|null} [bigQueryExport] UpdateBigQueryExportRequest bigQueryExport - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBigQueryExportRequest updateMask - */ - - /** - * Constructs a new UpdateBigQueryExportRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an UpdateBigQueryExportRequest. - * @implements IUpdateBigQueryExportRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest=} [properties] Properties to set - */ - function UpdateBigQueryExportRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBigQueryExportRequest bigQueryExport. - * @member {google.cloud.securitycenter.v2.IBigQueryExport|null|undefined} bigQueryExport - * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest - * @instance - */ - UpdateBigQueryExportRequest.prototype.bigQueryExport = null; - - /** - * UpdateBigQueryExportRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest - * @instance - */ - UpdateBigQueryExportRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBigQueryExportRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest instance - */ - UpdateBigQueryExportRequest.create = function create(properties) { - return new UpdateBigQueryExportRequest(properties); - }; - - /** - * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateBigQueryExportRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest} message UpdateBigQueryExportRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBigQueryExportRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bigQueryExport != null && Object.hasOwnProperty.call(message, "bigQueryExport")) - $root.google.cloud.securitycenter.v2.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 UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateBigQueryExportRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest} message UpdateBigQueryExportRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.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.v2.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBigQueryExportRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bigQueryExport = $root.google.cloud.securitycenter.v2.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; - } - } - return message; - }; - - /** - * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateBigQueryExportRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBigQueryExportRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.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.v2.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.v2.UpdateBigQueryExportRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest - */ - UpdateBigQueryExportRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest(); - if (object.bigQueryExport != null) { - if (typeof object.bigQueryExport !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateBigQueryExportRequest.bigQueryExport: object expected"); - message.bigQueryExport = $root.google.cloud.securitycenter.v2.BigQueryExport.fromObject(object.bigQueryExport); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateBigQueryExportRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateBigQueryExportRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBigQueryExportRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBigQueryExportRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.UpdateBigQueryExportRequest"; - }; - - return UpdateBigQueryExportRequest; - })(); - - v2.UpdateExternalSystemRequest = (function() { - - /** - * Properties of an UpdateExternalSystemRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IUpdateExternalSystemRequest - * @property {google.cloud.securitycenter.v2.IExternalSystem|null} [externalSystem] UpdateExternalSystemRequest externalSystem - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExternalSystemRequest updateMask - */ - - /** - * Constructs a new UpdateExternalSystemRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an UpdateExternalSystemRequest. - * @implements IUpdateExternalSystemRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.IExternalSystem|null|undefined} externalSystem - * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest - * @instance - */ - UpdateExternalSystemRequest.prototype.externalSystem = null; - - /** - * UpdateExternalSystemRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest - * @instance - */ - UpdateExternalSystemRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateExternalSystemRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateExternalSystemRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.UpdateExternalSystemRequest} UpdateExternalSystemRequest instance - */ - UpdateExternalSystemRequest.create = function create(properties) { - return new UpdateExternalSystemRequest(properties); - }; - - /** - * Encodes the specified UpdateExternalSystemRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateExternalSystemRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateExternalSystemRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateExternalSystemRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateExternalSystemRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.externalSystem = $root.google.cloud.securitycenter.v2.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.v2.UpdateExternalSystemRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateExternalSystemRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.UpdateExternalSystemRequest} UpdateExternalSystemRequest - */ - UpdateExternalSystemRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.UpdateExternalSystemRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.UpdateExternalSystemRequest(); - if (object.externalSystem != null) { - if (typeof object.externalSystem !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateExternalSystemRequest.externalSystem: object expected"); - message.externalSystem = $root.google.cloud.securitycenter.v2.ExternalSystem.fromObject(object.externalSystem); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateExternalSystemRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateExternalSystemRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateExternalSystemRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateExternalSystemRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.UpdateExternalSystemRequest"; - }; - - return UpdateExternalSystemRequest; - })(); - - v2.UpdateFindingRequest = (function() { - - /** - * Properties of an UpdateFindingRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IUpdateFindingRequest - * @property {google.cloud.securitycenter.v2.IFinding|null} [finding] UpdateFindingRequest finding - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask - */ - - /** - * Constructs a new UpdateFindingRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an UpdateFindingRequest. - * @implements IUpdateFindingRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest - * @instance - */ - UpdateFindingRequest.prototype.finding = null; - - /** - * UpdateFindingRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest - * @instance - */ - UpdateFindingRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateFindingRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.UpdateFindingRequest} UpdateFindingRequest instance - */ - UpdateFindingRequest.create = function create(properties) { - return new UpdateFindingRequest(properties); - }; - - /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateFindingRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "finding")) - $root.google.cloud.securitycenter.v2.Finding.encode(message.finding, 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 UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateFindingRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateFindingRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.finding = $root.google.cloud.securitycenter.v2.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.v2.UpdateFindingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateFindingRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.UpdateFindingRequest} UpdateFindingRequest - */ - UpdateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.UpdateFindingRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.UpdateFindingRequest(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v2.Finding.fromObject(object.finding); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateFindingRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateFindingRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateFindingRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.UpdateFindingRequest"; - }; - - return UpdateFindingRequest; - })(); - - v2.UpdateMuteConfigRequest = (function() { - - /** - * Properties of an UpdateMuteConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IUpdateMuteConfigRequest - * @property {google.cloud.securitycenter.v2.IMuteConfig|null} [muteConfig] UpdateMuteConfigRequest muteConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMuteConfigRequest updateMask - */ - - /** - * Constructs a new UpdateMuteConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an UpdateMuteConfigRequest. - * @implements IUpdateMuteConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.IMuteConfig|null|undefined} muteConfig - * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest - * @instance - */ - UpdateMuteConfigRequest.prototype.muteConfig = null; - - /** - * UpdateMuteConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest - * @instance - */ - UpdateMuteConfigRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateMuteConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateMuteConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.UpdateMuteConfigRequest} UpdateMuteConfigRequest instance - */ - UpdateMuteConfigRequest.create = function create(properties) { - return new UpdateMuteConfigRequest(properties); - }; - - /** - * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateMuteConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateMuteConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateMuteConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.muteConfig = $root.google.cloud.securitycenter.v2.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.v2.UpdateMuteConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateMuteConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.UpdateMuteConfigRequest} UpdateMuteConfigRequest - */ - UpdateMuteConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.UpdateMuteConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.UpdateMuteConfigRequest(); - if (object.muteConfig != null) { - if (typeof object.muteConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateMuteConfigRequest.muteConfig: object expected"); - message.muteConfig = $root.google.cloud.securitycenter.v2.MuteConfig.fromObject(object.muteConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateMuteConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateMuteConfigRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateMuteConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateMuteConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.UpdateMuteConfigRequest"; - }; - - return UpdateMuteConfigRequest; - })(); - - v2.UpdateNotificationConfigRequest = (function() { - - /** - * Properties of an UpdateNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IUpdateNotificationConfigRequest - * @property {google.cloud.securitycenter.v2.INotificationConfig|null} [notificationConfig] UpdateNotificationConfigRequest notificationConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNotificationConfigRequest updateMask - */ - - /** - * Constructs a new UpdateNotificationConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an UpdateNotificationConfigRequest. - * @implements IUpdateNotificationConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.INotificationConfig|null|undefined} notificationConfig - * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest - * @instance - */ - UpdateNotificationConfigRequest.prototype.notificationConfig = null; - - /** - * UpdateNotificationConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest - * @instance - */ - UpdateNotificationConfigRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateNotificationConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest instance - */ - UpdateNotificationConfigRequest.create = function create(properties) { - return new UpdateNotificationConfigRequest(properties); - }; - - /** - * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateNotificationConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "notificationConfig")) - $root.google.cloud.securitycenter.v2.NotificationConfig.encode(message.notificationConfig, 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 UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateNotificationConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.notificationConfig = $root.google.cloud.securitycenter.v2.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.v2.UpdateNotificationConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateNotificationConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest - */ - UpdateNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest(); - if (object.notificationConfig != null) { - if (typeof object.notificationConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateNotificationConfigRequest.notificationConfig: object expected"); - message.notificationConfig = $root.google.cloud.securitycenter.v2.NotificationConfig.fromObject(object.notificationConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateNotificationConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateNotificationConfigRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateNotificationConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateNotificationConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.UpdateNotificationConfigRequest"; - }; - - return UpdateNotificationConfigRequest; - })(); - - v2.UpdateResourceValueConfigRequest = (function() { - - /** - * Properties of an UpdateResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IUpdateResourceValueConfigRequest - * @property {google.cloud.securitycenter.v2.IResourceValueConfig|null} [resourceValueConfig] UpdateResourceValueConfigRequest resourceValueConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateResourceValueConfigRequest updateMask - */ - - /** - * Constructs a new UpdateResourceValueConfigRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an UpdateResourceValueConfigRequest. - * @implements IUpdateResourceValueConfigRequest - * @constructor - * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest=} [properties] Properties to set - */ - function UpdateResourceValueConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateResourceValueConfigRequest resourceValueConfig. - * @member {google.cloud.securitycenter.v2.IResourceValueConfig|null|undefined} resourceValueConfig - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @instance - */ - UpdateResourceValueConfigRequest.prototype.resourceValueConfig = null; - - /** - * UpdateResourceValueConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @instance - */ - UpdateResourceValueConfigRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateResourceValueConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest instance - */ - UpdateResourceValueConfigRequest.create = function create(properties) { - return new UpdateResourceValueConfigRequest(properties); - }; - - /** - * Encodes the specified UpdateResourceValueConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateResourceValueConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceValueConfig != null && Object.hasOwnProperty.call(message, "resourceValueConfig")) - $root.google.cloud.securitycenter.v2.ResourceValueConfig.encode(message.resourceValueConfig, 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 UpdateResourceValueConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateResourceValueConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateResourceValueConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateResourceValueConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.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 UpdateResourceValueConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateResourceValueConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateResourceValueConfigRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateResourceValueConfigRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) { - var error = $root.google.cloud.securitycenter.v2.ResourceValueConfig.verify(message.resourceValueConfig); - if (error) - return "resourceValueConfig." + 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 UpdateResourceValueConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} UpdateResourceValueConfigRequest - */ - UpdateResourceValueConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest(); - if (object.resourceValueConfig != null) { - if (typeof object.resourceValueConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.resourceValueConfig: object expected"); - message.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.fromObject(object.resourceValueConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateResourceValueConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest} message UpdateResourceValueConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateResourceValueConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resourceValueConfig = null; - object.updateMask = null; - } - if (message.resourceValueConfig != null && message.hasOwnProperty("resourceValueConfig")) - object.resourceValueConfig = $root.google.cloud.securitycenter.v2.ResourceValueConfig.toObject(message.resourceValueConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateResourceValueConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateResourceValueConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateResourceValueConfigRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateResourceValueConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest"; - }; - - return UpdateResourceValueConfigRequest; - })(); - - v2.UpdateSecurityMarksRequest = (function() { - - /** - * Properties of an UpdateSecurityMarksRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IUpdateSecurityMarksRequest - * @property {google.cloud.securitycenter.v2.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask - */ - - /** - * Constructs a new UpdateSecurityMarksRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an UpdateSecurityMarksRequest. - * @implements IUpdateSecurityMarksRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @instance - */ - UpdateSecurityMarksRequest.prototype.securityMarks = null; - - /** - * UpdateSecurityMarksRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @instance - */ - UpdateSecurityMarksRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateSecurityMarksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance - */ - UpdateSecurityMarksRequest.create = function create(properties) { - return new UpdateSecurityMarksRequest(properties); - }; - - /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateSecurityMarksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "securityMarks")) - $root.google.cloud.securitycenter.v2.SecurityMarks.encode(message.securityMarks, 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 UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateSecurityMarksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.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 UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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; - } - return null; - }; - - /** - * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest - */ - UpdateSecurityMarksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest(); - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateSecurityMarksRequest.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.fromObject(object.securityMarks); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateSecurityMarksRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v2.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; - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v2.SecurityMarks.toObject(message.securityMarks, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateSecurityMarksRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.UpdateSecurityMarksRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateSecurityMarksRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.UpdateSecurityMarksRequest"; - }; - - return UpdateSecurityMarksRequest; - })(); - - v2.UpdateSourceRequest = (function() { - - /** - * Properties of an UpdateSourceRequest. - * @memberof google.cloud.securitycenter.v2 - * @interface IUpdateSourceRequest - * @property {google.cloud.securitycenter.v2.ISource|null} [source] UpdateSourceRequest source - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask - */ - - /** - * Constructs a new UpdateSourceRequest. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents an UpdateSourceRequest. - * @implements IUpdateSourceRequest - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest - * @instance - */ - UpdateSourceRequest.prototype.source = null; - - /** - * UpdateSourceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest - * @instance - */ - UpdateSourceRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateSourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.IUpdateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.UpdateSourceRequest} UpdateSourceRequest instance - */ - UpdateSourceRequest.create = function create(properties) { - return new UpdateSourceRequest(properties); - }; - - /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateSourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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 && Object.hasOwnProperty.call(message, "source")) - $root.google.cloud.securitycenter.v2.Source.encode(message.source, 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 UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.UpdateSourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.UpdateSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.UpdateSourceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.source = $root.google.cloud.securitycenter.v2.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.v2.UpdateSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.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.v2.UpdateSourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.UpdateSourceRequest} UpdateSourceRequest - */ - UpdateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.UpdateSourceRequest) - return object; - var message = new $root.google.cloud.securitycenter.v2.UpdateSourceRequest(); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v2.UpdateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v2.Source.fromObject(object.source); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v2.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.v2.UpdateSourceRequest - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.UpdateSourceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateSourceRequest - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.UpdateSourceRequest"; - }; - - return UpdateSourceRequest; - })(); - - v2.Simulation = (function() { - - /** - * Properties of a Simulation. - * @memberof google.cloud.securitycenter.v2 - * @interface ISimulation - * @property {string|null} [name] Simulation name - * @property {google.protobuf.ITimestamp|null} [createTime] Simulation createTime - * @property {Array.|null} [resourceValueConfigsMetadata] Simulation resourceValueConfigsMetadata - * @property {google.cloud.securitycenter.v2.CloudProvider|null} [cloudProvider] Simulation cloudProvider - */ - - /** - * Constructs a new Simulation. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a Simulation. - * @implements ISimulation - * @constructor - * @param {google.cloud.securitycenter.v2.ISimulation=} [properties] Properties to set - */ - function Simulation(properties) { - this.resourceValueConfigsMetadata = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Simulation name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.Simulation - * @instance - */ - Simulation.prototype.name = ""; - - /** - * Simulation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v2.Simulation - * @instance - */ - Simulation.prototype.createTime = null; - - /** - * Simulation resourceValueConfigsMetadata. - * @member {Array.} resourceValueConfigsMetadata - * @memberof google.cloud.securitycenter.v2.Simulation - * @instance - */ - Simulation.prototype.resourceValueConfigsMetadata = $util.emptyArray; - - /** - * Simulation cloudProvider. - * @member {google.cloud.securitycenter.v2.CloudProvider} cloudProvider - * @memberof google.cloud.securitycenter.v2.Simulation - * @instance - */ - Simulation.prototype.cloudProvider = 0; - - /** - * Creates a new Simulation instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {google.cloud.securitycenter.v2.ISimulation=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Simulation} Simulation instance - */ - Simulation.create = function create(properties) { - return new Simulation(properties); - }; - - /** - * Encodes the specified Simulation message. Does not implicitly {@link google.cloud.securitycenter.v2.Simulation.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {google.cloud.securitycenter.v2.ISimulation} message Simulation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Simulation.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceValueConfigsMetadata != null && message.resourceValueConfigsMetadata.length) - for (var i = 0; i < message.resourceValueConfigsMetadata.length; ++i) - $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.encode(message.resourceValueConfigsMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cloudProvider != null && Object.hasOwnProperty.call(message, "cloudProvider")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cloudProvider); - return writer; - }; - - /** - * Encodes the specified Simulation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Simulation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {google.cloud.securitycenter.v2.ISimulation} message Simulation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Simulation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Simulation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.Simulation} Simulation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Simulation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Simulation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.resourceValueConfigsMetadata && message.resourceValueConfigsMetadata.length)) - message.resourceValueConfigsMetadata = []; - message.resourceValueConfigsMetadata.push($root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.decode(reader, reader.uint32())); - break; - } - case 4: { - message.cloudProvider = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Simulation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.Simulation} Simulation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Simulation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Simulation message. - * @function verify - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Simulation.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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.resourceValueConfigsMetadata != null && message.hasOwnProperty("resourceValueConfigsMetadata")) { - if (!Array.isArray(message.resourceValueConfigsMetadata)) - return "resourceValueConfigsMetadata: array expected"; - for (var i = 0; i < message.resourceValueConfigsMetadata.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify(message.resourceValueConfigsMetadata[i]); - if (error) - return "resourceValueConfigsMetadata." + error; - } - } - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - switch (message.cloudProvider) { - default: - return "cloudProvider: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a Simulation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Simulation} Simulation - */ - Simulation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Simulation) - return object; - var message = new $root.google.cloud.securitycenter.v2.Simulation(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Simulation.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.resourceValueConfigsMetadata) { - if (!Array.isArray(object.resourceValueConfigsMetadata)) - throw TypeError(".google.cloud.securitycenter.v2.Simulation.resourceValueConfigsMetadata: array expected"); - message.resourceValueConfigsMetadata = []; - for (var i = 0; i < object.resourceValueConfigsMetadata.length; ++i) { - if (typeof object.resourceValueConfigsMetadata[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.Simulation.resourceValueConfigsMetadata: object expected"); - message.resourceValueConfigsMetadata[i] = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.fromObject(object.resourceValueConfigsMetadata[i]); - } - } - switch (object.cloudProvider) { - default: - if (typeof object.cloudProvider === "number") { - message.cloudProvider = object.cloudProvider; - break; - } - break; - case "CLOUD_PROVIDER_UNSPECIFIED": - case 0: - message.cloudProvider = 0; - break; - case "GOOGLE_CLOUD_PLATFORM": - case 1: - message.cloudProvider = 1; - break; - case "AMAZON_WEB_SERVICES": - case 2: - message.cloudProvider = 2; - break; - case "MICROSOFT_AZURE": - case 3: - message.cloudProvider = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a Simulation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {google.cloud.securitycenter.v2.Simulation} message Simulation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Simulation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceValueConfigsMetadata = []; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.cloudProvider = options.enums === String ? "CLOUD_PROVIDER_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.resourceValueConfigsMetadata && message.resourceValueConfigsMetadata.length) { - object.resourceValueConfigsMetadata = []; - for (var j = 0; j < message.resourceValueConfigsMetadata.length; ++j) - object.resourceValueConfigsMetadata[j] = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.toObject(message.resourceValueConfigsMetadata[j], options); - } - if (message.cloudProvider != null && message.hasOwnProperty("cloudProvider")) - object.cloudProvider = options.enums === String ? $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] === undefined ? message.cloudProvider : $root.google.cloud.securitycenter.v2.CloudProvider[message.cloudProvider] : message.cloudProvider; - return object; - }; - - /** - * Converts this Simulation to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.Simulation - * @instance - * @returns {Object.} JSON object - */ - Simulation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Simulation - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.Simulation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Simulation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.Simulation"; - }; - - return Simulation; - })(); - - v2.ValuedResource = (function() { - - /** - * Properties of a ValuedResource. - * @memberof google.cloud.securitycenter.v2 - * @interface IValuedResource - * @property {string|null} [name] ValuedResource name - * @property {string|null} [resource] ValuedResource resource - * @property {string|null} [resourceType] ValuedResource resourceType - * @property {string|null} [displayName] ValuedResource displayName - * @property {google.cloud.securitycenter.v2.ValuedResource.ResourceValue|null} [resourceValue] ValuedResource resourceValue - * @property {number|null} [exposedScore] ValuedResource exposedScore - * @property {Array.|null} [resourceValueConfigsUsed] ValuedResource resourceValueConfigsUsed - */ - - /** - * Constructs a new ValuedResource. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ValuedResource. - * @implements IValuedResource - * @constructor - * @param {google.cloud.securitycenter.v2.IValuedResource=} [properties] Properties to set - */ - function ValuedResource(properties) { - this.resourceValueConfigsUsed = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValuedResource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @instance - */ - ValuedResource.prototype.name = ""; - - /** - * ValuedResource resource. - * @member {string} resource - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @instance - */ - ValuedResource.prototype.resource = ""; - - /** - * ValuedResource resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @instance - */ - ValuedResource.prototype.resourceType = ""; - - /** - * ValuedResource displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @instance - */ - ValuedResource.prototype.displayName = ""; - - /** - * ValuedResource resourceValue. - * @member {google.cloud.securitycenter.v2.ValuedResource.ResourceValue} resourceValue - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @instance - */ - ValuedResource.prototype.resourceValue = 0; - - /** - * ValuedResource exposedScore. - * @member {number} exposedScore - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @instance - */ - ValuedResource.prototype.exposedScore = 0; - - /** - * ValuedResource resourceValueConfigsUsed. - * @member {Array.} resourceValueConfigsUsed - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @instance - */ - ValuedResource.prototype.resourceValueConfigsUsed = $util.emptyArray; - - /** - * Creates a new ValuedResource instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {google.cloud.securitycenter.v2.IValuedResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ValuedResource} ValuedResource instance - */ - ValuedResource.create = function create(properties) { - return new ValuedResource(properties); - }; - - /** - * Encodes the specified ValuedResource message. Does not implicitly {@link google.cloud.securitycenter.v2.ValuedResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {google.cloud.securitycenter.v2.IValuedResource} message ValuedResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValuedResource.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.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceType); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.resourceValue != null && Object.hasOwnProperty.call(message, "resourceValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resourceValue); - if (message.exposedScore != null && Object.hasOwnProperty.call(message, "exposedScore")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.exposedScore); - if (message.resourceValueConfigsUsed != null && message.resourceValueConfigsUsed.length) - for (var i = 0; i < message.resourceValueConfigsUsed.length; ++i) - $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.encode(message.resourceValueConfigsUsed[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ValuedResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ValuedResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {google.cloud.securitycenter.v2.IValuedResource} message ValuedResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValuedResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValuedResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ValuedResource} ValuedResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValuedResource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ValuedResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.resource = reader.string(); - break; - } - case 3: { - message.resourceType = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - case 5: { - message.resourceValue = reader.int32(); - break; - } - case 6: { - message.exposedScore = reader.double(); - break; - } - case 7: { - if (!(message.resourceValueConfigsUsed && message.resourceValueConfigsUsed.length)) - message.resourceValueConfigsUsed = []; - message.resourceValueConfigsUsed.push($root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValuedResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ValuedResource} ValuedResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValuedResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValuedResource message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValuedResource.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.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) - switch (message.resourceValue) { - default: - return "resourceValue: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exposedScore != null && message.hasOwnProperty("exposedScore")) - if (typeof message.exposedScore !== "number") - return "exposedScore: number expected"; - if (message.resourceValueConfigsUsed != null && message.hasOwnProperty("resourceValueConfigsUsed")) { - if (!Array.isArray(message.resourceValueConfigsUsed)) - return "resourceValueConfigsUsed: array expected"; - for (var i = 0; i < message.resourceValueConfigsUsed.length; ++i) { - var error = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify(message.resourceValueConfigsUsed[i]); - if (error) - return "resourceValueConfigsUsed." + error; - } - } - return null; - }; - - /** - * Creates a ValuedResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ValuedResource} ValuedResource - */ - ValuedResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ValuedResource) - return object; - var message = new $root.google.cloud.securitycenter.v2.ValuedResource(); - if (object.name != null) - message.name = String(object.name); - if (object.resource != null) - message.resource = String(object.resource); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.resourceValue) { - default: - if (typeof object.resourceValue === "number") { - message.resourceValue = object.resourceValue; - break; - } - break; - case "RESOURCE_VALUE_UNSPECIFIED": - case 0: - message.resourceValue = 0; - break; - case "RESOURCE_VALUE_LOW": - case 1: - message.resourceValue = 1; - break; - case "RESOURCE_VALUE_MEDIUM": - case 2: - message.resourceValue = 2; - break; - case "RESOURCE_VALUE_HIGH": - case 3: - message.resourceValue = 3; - break; - } - if (object.exposedScore != null) - message.exposedScore = Number(object.exposedScore); - if (object.resourceValueConfigsUsed) { - if (!Array.isArray(object.resourceValueConfigsUsed)) - throw TypeError(".google.cloud.securitycenter.v2.ValuedResource.resourceValueConfigsUsed: array expected"); - message.resourceValueConfigsUsed = []; - for (var i = 0; i < object.resourceValueConfigsUsed.length; ++i) { - if (typeof object.resourceValueConfigsUsed[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v2.ValuedResource.resourceValueConfigsUsed: object expected"); - message.resourceValueConfigsUsed[i] = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.fromObject(object.resourceValueConfigsUsed[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ValuedResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {google.cloud.securitycenter.v2.ValuedResource} message ValuedResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValuedResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceValueConfigsUsed = []; - if (options.defaults) { - object.name = ""; - object.resource = ""; - object.resourceType = ""; - object.displayName = ""; - object.resourceValue = options.enums === String ? "RESOURCE_VALUE_UNSPECIFIED" : 0; - object.exposedScore = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.resourceValue != null && message.hasOwnProperty("resourceValue")) - object.resourceValue = options.enums === String ? $root.google.cloud.securitycenter.v2.ValuedResource.ResourceValue[message.resourceValue] === undefined ? message.resourceValue : $root.google.cloud.securitycenter.v2.ValuedResource.ResourceValue[message.resourceValue] : message.resourceValue; - if (message.exposedScore != null && message.hasOwnProperty("exposedScore")) - object.exposedScore = options.json && !isFinite(message.exposedScore) ? String(message.exposedScore) : message.exposedScore; - if (message.resourceValueConfigsUsed && message.resourceValueConfigsUsed.length) { - object.resourceValueConfigsUsed = []; - for (var j = 0; j < message.resourceValueConfigsUsed.length; ++j) - object.resourceValueConfigsUsed[j] = $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata.toObject(message.resourceValueConfigsUsed[j], options); - } - return object; - }; - - /** - * Converts this ValuedResource to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @instance - * @returns {Object.} JSON object - */ - ValuedResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValuedResource - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ValuedResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValuedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ValuedResource"; - }; - - /** - * ResourceValue enum. - * @name google.cloud.securitycenter.v2.ValuedResource.ResourceValue - * @enum {number} - * @property {number} RESOURCE_VALUE_UNSPECIFIED=0 RESOURCE_VALUE_UNSPECIFIED value - * @property {number} RESOURCE_VALUE_LOW=1 RESOURCE_VALUE_LOW value - * @property {number} RESOURCE_VALUE_MEDIUM=2 RESOURCE_VALUE_MEDIUM value - * @property {number} RESOURCE_VALUE_HIGH=3 RESOURCE_VALUE_HIGH value - */ - ValuedResource.ResourceValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_VALUE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE_VALUE_LOW"] = 1; - values[valuesById[2] = "RESOURCE_VALUE_MEDIUM"] = 2; - values[valuesById[3] = "RESOURCE_VALUE_HIGH"] = 3; - return values; - })(); - - return ValuedResource; - })(); - - v2.ResourceValueConfigMetadata = (function() { - - /** - * Properties of a ResourceValueConfigMetadata. - * @memberof google.cloud.securitycenter.v2 - * @interface IResourceValueConfigMetadata - * @property {string|null} [name] ResourceValueConfigMetadata name - */ - - /** - * Constructs a new ResourceValueConfigMetadata. - * @memberof google.cloud.securitycenter.v2 - * @classdesc Represents a ResourceValueConfigMetadata. - * @implements IResourceValueConfigMetadata - * @constructor - * @param {google.cloud.securitycenter.v2.IResourceValueConfigMetadata=} [properties] Properties to set - */ - function ResourceValueConfigMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceValueConfigMetadata name. - * @member {string} name - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @instance - */ - ResourceValueConfigMetadata.prototype.name = ""; - - /** - * Creates a new ResourceValueConfigMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {google.cloud.securitycenter.v2.IResourceValueConfigMetadata=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} ResourceValueConfigMetadata instance - */ - ResourceValueConfigMetadata.create = function create(properties) { - return new ResourceValueConfigMetadata(properties); - }; - - /** - * Encodes the specified ResourceValueConfigMetadata message. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {google.cloud.securitycenter.v2.IResourceValueConfigMetadata} message ResourceValueConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceValueConfigMetadata.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 ResourceValueConfigMetadata message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ResourceValueConfigMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {google.cloud.securitycenter.v2.IResourceValueConfigMetadata} message ResourceValueConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceValueConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} ResourceValueConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceValueConfigMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceValueConfigMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} ResourceValueConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceValueConfigMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceValueConfigMetadata message. - * @function verify - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceValueConfigMetadata.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 ResourceValueConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} ResourceValueConfigMetadata - */ - ResourceValueConfigMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata) - return object; - var message = new $root.google.cloud.securitycenter.v2.ResourceValueConfigMetadata(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a ResourceValueConfigMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {google.cloud.securitycenter.v2.ResourceValueConfigMetadata} message ResourceValueConfigMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceValueConfigMetadata.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 ResourceValueConfigMetadata to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @instance - * @returns {Object.} JSON object - */ - ResourceValueConfigMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceValueConfigMetadata - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.ResourceValueConfigMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceValueConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.securitycenter.v2.ResourceValueConfigMetadata"; - }; - - return ResourceValueConfigMetadata; - })(); - - v2.Source = (function() { - - /** - * Properties of a Source. - * @memberof google.cloud.securitycenter.v2 - * @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.v2 - * @classdesc Represents a Source. - * @implements ISource - * @constructor - * @param {google.cloud.securitycenter.v2.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.v2.Source - * @instance - */ - Source.prototype.name = ""; - - /** - * Source displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v2.Source - * @instance - */ - Source.prototype.displayName = ""; - - /** - * Source description. - * @member {string} description - * @memberof google.cloud.securitycenter.v2.Source - * @instance - */ - Source.prototype.description = ""; - - /** - * Source canonicalName. - * @member {string} canonicalName - * @memberof google.cloud.securitycenter.v2.Source - * @instance - */ - Source.prototype.canonicalName = ""; - - /** - * Creates a new Source instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v2.Source - * @static - * @param {google.cloud.securitycenter.v2.ISource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v2.Source} Source instance - */ - Source.create = function create(properties) { - return new Source(properties); - }; - - /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v2.Source.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v2.Source - * @static - * @param {google.cloud.securitycenter.v2.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 4, wireType 2 =*/34).string(message.canonicalName); - return writer; - }; - - /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.Source.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v2.Source - * @static - * @param {google.cloud.securitycenter.v2.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.v2.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.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.Source(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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.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.v2.Source - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v2.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.v2.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.v2.Source - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v2.Source} Source - */ - Source.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v2.Source) - return object; - var message = new $root.google.cloud.securitycenter.v2.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.v2.Source - * @static - * @param {google.cloud.securitycenter.v2.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.v2.Source - * @instance - * @returns {Object.} JSON object - */ - Source.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Source - * @function getTypeUrl - * @memberof google.cloud.securitycenter.v2.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.v2.Source"; - }; - - return Source; - })(); - - return v2; - })(); - - return securitycenter; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - 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 - * @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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - /** - * 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 - * @property {number} IDENTIFIER=8 IDENTIFIER 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; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), 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.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - 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.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), 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.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - 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.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - 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.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.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.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - api.RoutingRule = (function() { - - /** - * Properties of a RoutingRule. - * @memberof google.api - * @interface IRoutingRule - * @property {Array.|null} [routingParameters] RoutingRule routingParameters - */ - - /** - * Constructs a new RoutingRule. - * @memberof google.api - * @classdesc Represents a RoutingRule. - * @implements IRoutingRule - * @constructor - * @param {google.api.IRoutingRule=} [properties] Properties to set - */ - function RoutingRule(properties) { - this.routingParameters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingRule routingParameters. - * @member {Array.} routingParameters - * @memberof google.api.RoutingRule - * @instance - */ - RoutingRule.prototype.routingParameters = $util.emptyArray; - - /** - * Creates a new RoutingRule instance using the specified properties. - * @function create - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule=} [properties] Properties to set - * @returns {google.api.RoutingRule} RoutingRule instance - */ - RoutingRule.create = function create(properties) { - return new RoutingRule(properties); - }; - - /** - * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @function encode - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.routingParameters != null && message.routingParameters.length) - for (var i = 0; i < message.routingParameters.length; ++i) - $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.RoutingRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RoutingRule} RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.routingParameters && message.routingParameters.length)) - message.routingParameters = []; - message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RoutingRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RoutingRule} RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingRule message. - * @function verify - * @memberof google.api.RoutingRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { - if (!Array.isArray(message.routingParameters)) - return "routingParameters: array expected"; - for (var i = 0; i < message.routingParameters.length; ++i) { - var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i]); - if (error) - return "routingParameters." + error; - } - } - return null; - }; - - /** - * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RoutingRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.RoutingRule} RoutingRule - */ - RoutingRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RoutingRule) - return object; - var message = new $root.google.api.RoutingRule(); - if (object.routingParameters) { - if (!Array.isArray(object.routingParameters)) - throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); - message.routingParameters = []; - for (var i = 0; i < object.routingParameters.length; ++i) { - if (typeof object.routingParameters[i] !== "object") - throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); - message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RoutingRule - * @static - * @param {google.api.RoutingRule} message RoutingRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.routingParameters = []; - if (message.routingParameters && message.routingParameters.length) { - object.routingParameters = []; - for (var j = 0; j < message.routingParameters.length; ++j) - object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); - } - return object; - }; - - /** - * Converts this RoutingRule to JSON. - * @function toJSON - * @memberof google.api.RoutingRule - * @instance - * @returns {Object.} JSON object - */ - RoutingRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingRule - * @function getTypeUrl - * @memberof google.api.RoutingRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RoutingRule"; - }; - - return RoutingRule; - })(); - - api.RoutingParameter = (function() { - - /** - * Properties of a RoutingParameter. - * @memberof google.api - * @interface IRoutingParameter - * @property {string|null} [field] RoutingParameter field - * @property {string|null} [pathTemplate] RoutingParameter pathTemplate - */ - - /** - * Constructs a new RoutingParameter. - * @memberof google.api - * @classdesc Represents a RoutingParameter. - * @implements IRoutingParameter - * @constructor - * @param {google.api.IRoutingParameter=} [properties] Properties to set - */ - function RoutingParameter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingParameter field. - * @member {string} field - * @memberof google.api.RoutingParameter - * @instance - */ - RoutingParameter.prototype.field = ""; - - /** - * RoutingParameter pathTemplate. - * @member {string} pathTemplate - * @memberof google.api.RoutingParameter - * @instance - */ - RoutingParameter.prototype.pathTemplate = ""; - - /** - * Creates a new RoutingParameter instance using the specified properties. - * @function create - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter=} [properties] Properties to set - * @returns {google.api.RoutingParameter} RoutingParameter instance - */ - RoutingParameter.create = function create(properties) { - return new RoutingParameter(properties); - }; - - /** - * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @function encode - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingParameter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); - return writer; - }; - - /** - * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer. - * @function decode - * @memberof google.api.RoutingParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RoutingParameter} RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingParameter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.field = reader.string(); - break; - } - case 2: { - message.pathTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RoutingParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RoutingParameter} RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingParameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingParameter message. - * @function verify - * @memberof google.api.RoutingParameter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingParameter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) - if (!$util.isString(message.pathTemplate)) - return "pathTemplate: string expected"; - return null; - }; - - /** - * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RoutingParameter - * @static - * @param {Object.} object Plain object - * @returns {google.api.RoutingParameter} RoutingParameter - */ - RoutingParameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RoutingParameter) - return object; - var message = new $root.google.api.RoutingParameter(); - if (object.field != null) - message.field = String(object.field); - if (object.pathTemplate != null) - message.pathTemplate = String(object.pathTemplate); - return message; - }; - - /** - * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.RoutingParameter} message RoutingParameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingParameter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.field = ""; - object.pathTemplate = ""; - } - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) - object.pathTemplate = message.pathTemplate; - return object; - }; - - /** - * Converts this RoutingParameter to JSON. - * @function toJSON - * @memberof google.api.RoutingParameter - * @instance - * @returns {Object.} JSON object - */ - RoutingParameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingParameter - * @function getTypeUrl - * @memberof google.api.RoutingParameter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RoutingParameter"; - }; - - return RoutingParameter; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - 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); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * 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 = []; - this.declaration = []; - if (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; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * 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.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - 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, error) { - 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(); - if (tag === error) - break; - 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 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - 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; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - 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]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - 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.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - 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 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 50: { - message.features = $root.google.protobuf.FeatureSet.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; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - 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 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.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; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - */ - - /** - * 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.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $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; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - 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) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - 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(); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.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; - } - 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()); - break; - } - case 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.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"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { - var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); - if (error) - return ".google.api.fieldInfo." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.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"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); - } - 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.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - object[".google.api.fieldInfo"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.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; - } - } - 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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 (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @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 deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.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; - } - } - 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - 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; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @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 - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * 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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * 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"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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; - } - case 525000001: { - message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - 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.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @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 - * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing - */ - - /** - * 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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * 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; - - /** - * MethodOptions .google.api.routing. - * @member {google.api.IRoutingRule|null|undefined} .google.api.routing - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.routing"] = 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 && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - 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 && 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 && 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(); - if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) - $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.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; - } - 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 72295729: { - message[".google.api.routing"] = $root.google.api.RoutingRule.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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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; - } - if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { - var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); - if (error) - return ".google.api.routing." + 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) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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"]); - } - if (object[".google.api.routing"] != null) { - if (typeof object[".google.api.routing"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); - message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); - } - 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.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - object[".google.api.routing"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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); - if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) - object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - 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 && 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(); - } - 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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - 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(); - if (tag === error) - break; - 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; - } - } - message.fields[key] = value; - 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); - }; - - /** - * 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; - })(); - - 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|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * 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 && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - 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] === undefined ? message.nullValue : $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); - }; - - /** - * 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; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.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, error) { - 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(); - if (tag === error) - break; - 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() { - - /** - * 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 && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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 >= 0) - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - return protobuf; - })(); - - 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 && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - return type; - })(); - - 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 - * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask - */ - - /** - * 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; - - /** - * 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 - * @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 && Object.hasOwnProperty.call(message, "resource")) - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 3: { - message.updateMask = $root.google.protobuf.FieldMask.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; - } - 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 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); - } - 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; - }; - - /** - * 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; - 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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) - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 {Array.|null} [auditConfigs] Policy auditConfigs - * @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 = []; - this.auditConfigs = []; - if (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 auditConfigs. - * @member {Array.} auditConfigs - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.auditConfigs = $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 && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - 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) - $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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 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; - } - } - 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.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"; - 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.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 >= 0) - 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 = []; - object.auditConfigs = []; - } - 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); - } - 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; - }; - - /** - * 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); - }; - - /** - * 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; - })(); - - 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 && 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.logType === "number") { - message.logType = object.logType; - break; - } - break; - 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] === 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) - 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() { - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && 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.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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - 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] === 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")) - 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); - }; - - /** - * 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 - * @enum {number} - * @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 && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - 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] === 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")) - 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); - }; - - /** - * 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 - * @enum {number} - * @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.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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - 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 && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - 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); - if (message.name != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - 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; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - 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 && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - 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) - $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, error) { - 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(); - if (tag === error) - break; - 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); - }; - - /** - * 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; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/protos.json b/owl-bot-staging/google-cloud-securitycenter/protos/protos.json deleted file mode 100644 index b5bf0b8d7b0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/protos/protos.json +++ /dev/null @@ -1,17570 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "securitycenter": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.SecurityCenter.V1", - "go_package": "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb", - "java_multiple_files": true, - "java_outer_classname": "ValuedResourceProto", - "java_package": "com.google.cloud.securitycenter.v1", - "php_namespace": "Google\\Cloud\\SecurityCenter\\V1", - "ruby_package": "Google::Cloud::SecurityCenter::V1", - "(google.api.resource_definition).type": "securitycenter.googleapis.com/EventThreatDetectionSettings", - "(google.api.resource_definition).pattern": "projects/{project}/eventThreatDetectionSettings" - }, - "nested": { - "Access": { - "fields": { - "principalEmail": { - "type": "string", - "id": 1 - }, - "callerIp": { - "type": "string", - "id": 2 - }, - "callerIpGeo": { - "type": "Geolocation", - "id": 3 - }, - "userAgentFamily": { - "type": "string", - "id": 4 - }, - "userAgent": { - "type": "string", - "id": 12 - }, - "serviceName": { - "type": "string", - "id": 5 - }, - "methodName": { - "type": "string", - "id": 6 - }, - "principalSubject": { - "type": "string", - "id": 7 - }, - "serviceAccountKeyName": { - "type": "string", - "id": 8 - }, - "serviceAccountDelegationInfo": { - "rule": "repeated", - "type": "ServiceAccountDelegationInfo", - "id": 9 - }, - "userName": { - "type": "string", - "id": 11 - } - } - }, - "ServiceAccountDelegationInfo": { - "fields": { - "principalEmail": { - "type": "string", - "id": 1 - }, - "principalSubject": { - "type": "string", - "id": 2 - } - } - }, - "Geolocation": { - "fields": { - "regionCode": { - "type": "string", - "id": 1 - } - } - }, - "Application": { - "fields": { - "baseUri": { - "type": "string", - "id": 1 - }, - "fullUri": { - "type": "string", - "id": 2 - } - } - }, - "Asset": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Asset", - "(google.api.resource).pattern": "projects/{project}/assets/{asset}", - "(google.api.resource).plural": "assets", - "(google.api.resource).singular": "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 - }, - "canonicalName": { - "type": "string", - "id": 13 - } - }, - "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 - }, - "folders": { - "rule": "repeated", - "type": "Folder", - "id": 10 - } - } - }, - "IamPolicy": { - "fields": { - "policyBlob": { - "type": "string", - "id": 1 - } - } - } - } - }, - "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": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "marks": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "canonicalName": { - "type": "string", - "id": 3 - } - } - }, - "AttackExposure": { - "fields": { - "score": { - "type": "double", - "id": 1 - }, - "latestCalculationTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "attackExposureResult": { - "type": "string", - "id": 3 - }, - "state": { - "type": "State", - "id": 4 - }, - "exposedHighValueResourcesCount": { - "type": "int32", - "id": 5 - }, - "exposedMediumValueResourcesCount": { - "type": "int32", - "id": 6 - }, - "exposedLowValueResourcesCount": { - "type": "int32", - "id": 7 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CALCULATED": 1, - "NOT_CALCULATED": 2 - } - } - } - }, - "AttackPath": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/AttackPath", - "(google.api.resource).pattern": "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}", - "(google.api.resource).plural": "attackPaths", - "(google.api.resource).singular": "attackPath" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "pathNodes": { - "rule": "repeated", - "type": "AttackPathNode", - "id": 2 - }, - "edges": { - "rule": "repeated", - "type": "AttackPathEdge", - "id": 3 - } - }, - "nested": { - "AttackPathNode": { - "fields": { - "resource": { - "type": "string", - "id": 1 - }, - "resourceType": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - }, - "associatedFindings": { - "rule": "repeated", - "type": "PathNodeAssociatedFinding", - "id": 4 - }, - "uuid": { - "type": "string", - "id": 5 - }, - "attackSteps": { - "rule": "repeated", - "type": "AttackStepNode", - "id": 6 - } - }, - "nested": { - "PathNodeAssociatedFinding": { - "fields": { - "canonicalFinding": { - "type": "string", - "id": 1 - }, - "findingCategory": { - "type": "string", - "id": 2 - }, - "name": { - "type": "string", - "id": 3 - } - } - }, - "NodeType": { - "values": { - "NODE_TYPE_UNSPECIFIED": 0, - "NODE_TYPE_AND": 1, - "NODE_TYPE_OR": 2, - "NODE_TYPE_DEFENSE": 3, - "NODE_TYPE_ATTACKER": 4 - } - }, - "AttackStepNode": { - "fields": { - "uuid": { - "type": "string", - "id": 1 - }, - "type": { - "type": "NodeType", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4 - }, - "description": { - "type": "string", - "id": 5 - } - } - } - } - }, - "AttackPathEdge": { - "fields": { - "source": { - "type": "string", - "id": 1 - }, - "destination": { - "type": "string", - "id": 2 - } - } - } - } - }, - "BackupDisasterRecovery": { - "fields": { - "backupTemplate": { - "type": "string", - "id": 1 - }, - "policies": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "host": { - "type": "string", - "id": 3 - }, - "applications": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "storagePool": { - "type": "string", - "id": 5 - }, - "policyOptions": { - "rule": "repeated", - "type": "string", - "id": 6 - }, - "profile": { - "type": "string", - "id": 7 - }, - "appliance": { - "type": "string", - "id": 8 - }, - "backupType": { - "type": "string", - "id": 9 - }, - "backupCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - } - } - }, - "BigQueryExport": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/BigQueryExport", - "(google.api.resource).pattern": "projects/{project}/bigQueryExports/{export}", - "(google.api.resource).plural": "bigQueryExports", - "(google.api.resource).singular": "bigQueryExport" - }, - "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" - } - } - } - }, - "Chokepoint": { - "fields": { - "relatedFindings": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "CloudArmor": { - "fields": { - "securityPolicy": { - "type": "SecurityPolicy", - "id": 1 - }, - "requests": { - "type": "Requests", - "id": 2 - }, - "adaptiveProtection": { - "type": "AdaptiveProtection", - "id": 3 - }, - "attack": { - "type": "Attack", - "id": 4 - }, - "threatVector": { - "type": "string", - "id": 5 - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 6 - } - } - }, - "SecurityPolicy": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "preview": { - "type": "bool", - "id": 3 - } - } - }, - "Requests": { - "fields": { - "ratio": { - "type": "double", - "id": 1 - }, - "shortTermAllowed": { - "type": "int32", - "id": 2 - }, - "longTermAllowed": { - "type": "int32", - "id": 3 - }, - "longTermDenied": { - "type": "int32", - "id": 4 - } - } - }, - "AdaptiveProtection": { - "fields": { - "confidence": { - "type": "double", - "id": 1 - } - } - }, - "Attack": { - "fields": { - "volumePps": { - "type": "int32", - "id": 1 - }, - "volumeBps": { - "type": "int32", - "id": 2 - }, - "classification": { - "type": "string", - "id": 3 - } - } - }, - "CloudDlpDataProfile": { - "fields": { - "dataProfile": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "dlp.googleapis.com/TableDataProfile" - } - }, - "parentType": { - "type": "ParentType", - "id": 2 - }, - "infoTypes": { - "rule": "repeated", - "type": "InfoType", - "id": 3 - } - }, - "nested": { - "ParentType": { - "values": { - "PARENT_TYPE_UNSPECIFIED": 0, - "ORGANIZATION": 1, - "PROJECT": 2 - } - } - } - }, - "InfoType": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - }, - "sensitivityScore": { - "type": "SensitivityScore", - "id": 3 - } - } - }, - "SensitivityScore": { - "fields": { - "score": { - "type": "SensitivityScoreLevel", - "id": 1 - } - }, - "nested": { - "SensitivityScoreLevel": { - "values": { - "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED": 0, - "SENSITIVITY_LOW": 10, - "SENSITIVITY_UNKNOWN": 12, - "SENSITIVITY_MODERATE": 20, - "SENSITIVITY_HIGH": 30 - } - } - } - }, - "CloudDlpInspection": { - "fields": { - "inspectJob": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" - } - }, - "infoType": { - "type": "string", - "id": 2 - }, - "infoTypeCount": { - "type": "int64", - "id": 3 - }, - "fullScan": { - "type": "bool", - "id": 4 - } - } - }, - "Compliance": { - "fields": { - "standard": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - }, - "ids": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "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 - } - } - } - }, - "ContactDetails": { - "fields": { - "contacts": { - "rule": "repeated", - "type": "Contact", - "id": 1 - } - } - }, - "Contact": { - "fields": { - "email": { - "type": "string", - "id": 1 - } - } - }, - "Container": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "uri": { - "type": "string", - "id": 2 - }, - "imageId": { - "type": "string", - "id": 3 - }, - "labels": { - "rule": "repeated", - "type": "Label", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - } - } - }, - "Label": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "type": "string", - "id": 2 - } - } - }, - "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 - }, - "version": { - "type": "string", - "id": 6 - } - } - }, - "EffectiveEventThreatDetectionCustomModule": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule", - "(google.api.resource).pattern": "projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "config": { - "type": "google.protobuf.Struct", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "enablementState": { - "type": "EnablementState", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "EnablementState": { - "values": { - "ENABLEMENT_STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2 - } - } - } - }, - "EffectiveSecurityHealthAnalyticsCustomModule": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule", - "(google.api.resource).pattern": "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "customConfig": { - "type": "CustomConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "enablementState": { - "type": "EnablementState", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "EnablementState": { - "values": { - "ENABLEMENT_STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2 - } - } - } - }, - "CustomConfig": { - "fields": { - "predicate": { - "type": "google.type.Expr", - "id": 1 - }, - "customOutput": { - "type": "CustomOutputSpec", - "id": 2 - }, - "resourceSelector": { - "type": "ResourceSelector", - "id": 3 - }, - "severity": { - "type": "Severity", - "id": 4 - }, - "description": { - "type": "string", - "id": 5 - }, - "recommendation": { - "type": "string", - "id": 6 - } - }, - "nested": { - "CustomOutputSpec": { - "fields": { - "properties": { - "rule": "repeated", - "type": "Property", - "id": 1 - } - }, - "nested": { - "Property": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "valueExpression": { - "type": "google.type.Expr", - "id": 2 - } - } - } - } - }, - "ResourceSelector": { - "fields": { - "resourceTypes": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "CRITICAL": 1, - "HIGH": 2, - "MEDIUM": 3, - "LOW": 4 - } - } - } - }, - "EventThreatDetectionCustomModule": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule", - "(google.api.resource).pattern": "projects/{project}/eventThreatDetectionSettings/customModules/{module}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "config": { - "type": "google.protobuf.Struct", - "id": 2 - }, - "ancestorModule": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - }, - "enablementState": { - "type": "EnablementState", - "id": 4 - }, - "type": { - "type": "string", - "id": 5 - }, - "displayName": { - "type": "string", - "id": 6 - }, - "description": { - "type": "string", - "id": 7 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastEditor": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "EnablementState": { - "values": { - "ENABLEMENT_STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2, - "INHERITED": 3 - } - } - } - }, - "CustomModuleValidationErrors": { - "fields": { - "errors": { - "rule": "repeated", - "type": "CustomModuleValidationError", - "id": 1 - } - } - }, - "CustomModuleValidationError": { - "oneofs": { - "_start": { - "oneof": [ - "start" - ] - }, - "_end": { - "oneof": [ - "end" - ] - } - }, - "fields": { - "description": { - "type": "string", - "id": 1 - }, - "fieldPath": { - "type": "string", - "id": 2 - }, - "start": { - "type": "Position", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "end": { - "type": "Position", - "id": 4, - "options": { - "proto3_optional": true - } - } - } - }, - "Position": { - "fields": { - "lineNumber": { - "type": "int32", - "id": 1 - }, - "columnNumber": { - "type": "int32", - "id": 2 - } - } - }, - "Exfiltration": { - "fields": { - "sources": { - "rule": "repeated", - "type": "ExfilResource", - "id": 1 - }, - "targets": { - "rule": "repeated", - "type": "ExfilResource", - "id": 2 - }, - "totalExfiltratedBytes": { - "type": "int64", - "id": 3 - } - } - }, - "ExfilResource": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "components": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ExternalExposure": { - "fields": { - "privateIpAddress": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_info).format": "IPV4_OR_IPV6" - } - }, - "privatePort": { - "type": "string", - "id": 2 - }, - "exposedService": { - "type": "string", - "id": 3 - }, - "publicIpAddress": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "IPV4_OR_IPV6" - } - }, - "publicPort": { - "type": "string", - "id": 5 - }, - "exposedEndpoint": { - "type": "string", - "id": 6 - }, - "loadBalancerFirewallPolicy": { - "type": "string", - "id": 7 - }, - "serviceFirewallPolicy": { - "type": "string", - "id": 8 - }, - "forwardingRule": { - "type": "string", - "id": 9 - }, - "backendService": { - "type": "string", - "id": 10 - }, - "instanceGroup": { - "type": "string", - "id": 11 - }, - "networkEndpointGroup": { - "type": "string", - "id": 12 - } - } - }, - "ExternalSystem": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", - "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}", - "(google.api.resource).plural": "externalSystems", - "(google.api.resource).singular": "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 - }, - "caseUri": { - "type": "string", - "id": 6 - }, - "casePriority": { - "type": "string", - "id": 7 - }, - "caseSla": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "caseCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - }, - "caseCloseTime": { - "type": "google.protobuf.Timestamp", - "id": 11 - }, - "ticketInfo": { - "type": "TicketInfo", - "id": 8 - } - }, - "nested": { - "TicketInfo": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "assignee": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "uri": { - "type": "string", - "id": 4 - }, - "status": { - "type": "string", - "id": 5 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - } - } - } - } - }, - "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 - }, - "diskPath": { - "type": "DiskPath", - "id": 7 - } - }, - "nested": { - "DiskPath": { - "fields": { - "partitionUuid": { - "type": "string", - "id": 1 - }, - "relativePath": { - "type": "string", - "id": 2 - } - } - } - } - }, - "Finding": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Finding", - "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}", - "(google.api.resource).plural": "findings", - "(google.api.resource).singular": "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 - }, - "severity": { - "type": "Severity", - "id": 12 - }, - "canonicalName": { - "type": "string", - "id": 14 - }, - "mute": { - "type": "Mute", - "id": 15 - }, - "findingClass": { - "type": "FindingClass", - "id": 17 - }, - "indicator": { - "type": "Indicator", - "id": 18 - }, - "vulnerability": { - "type": "Vulnerability", - "id": 20 - }, - "muteUpdateTime": { - "type": "google.protobuf.Timestamp", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "externalSystems": { - "keyType": "string", - "type": "ExternalSystem", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "mitreAttack": { - "type": "MitreAttack", - "id": 25 - }, - "access": { - "type": "Access", - "id": 26 - }, - "connections": { - "rule": "repeated", - "type": "Connection", - "id": 31 - }, - "muteInitiator": { - "type": "string", - "id": 28 - }, - "muteInfo": { - "type": "MuteInfo", - "id": 61, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "processes": { - "rule": "repeated", - "type": "Process", - "id": 30 - }, - "contacts": { - "keyType": "string", - "type": "ContactDetails", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "compliances": { - "rule": "repeated", - "type": "Compliance", - "id": 34 - }, - "parentDisplayName": { - "type": "string", - "id": 36, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 37 - }, - "exfiltration": { - "type": "Exfiltration", - "id": 38 - }, - "iamBindings": { - "rule": "repeated", - "type": "IamBinding", - "id": 39 - }, - "nextSteps": { - "type": "string", - "id": 40 - }, - "moduleName": { - "type": "string", - "id": 41 - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 42 - }, - "kubernetes": { - "type": "Kubernetes", - "id": 43 - }, - "database": { - "type": "Database", - "id": 44 - }, - "attackExposure": { - "type": "AttackExposure", - "id": 45 - }, - "files": { - "rule": "repeated", - "type": "File", - "id": 46 - }, - "cloudDlpInspection": { - "type": "CloudDlpInspection", - "id": 48 - }, - "cloudDlpDataProfile": { - "type": "CloudDlpDataProfile", - "id": 49 - }, - "kernelRootkit": { - "type": "KernelRootkit", - "id": 50 - }, - "orgPolicies": { - "rule": "repeated", - "type": "OrgPolicy", - "id": 51 - }, - "application": { - "type": "Application", - "id": 53 - }, - "backupDisasterRecovery": { - "type": "BackupDisasterRecovery", - "id": 55 - }, - "securityPosture": { - "type": "SecurityPosture", - "id": 56 - }, - "logEntries": { - "rule": "repeated", - "type": "LogEntry", - "id": 57 - }, - "loadBalancers": { - "rule": "repeated", - "type": "LoadBalancer", - "id": 58 - }, - "cloudArmor": { - "type": "CloudArmor", - "id": 59 - }, - "notebook": { - "type": "Notebook", - "id": 63 - }, - "toxicCombination": { - "type": "ToxicCombination", - "id": 64 - }, - "groupMemberships": { - "rule": "repeated", - "type": "GroupMembership", - "id": 65 - }, - "chokepoint": { - "type": "Chokepoint", - "id": 77 - }, - "externalExposure": { - "type": "ExternalExposure", - "id": 84 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2 - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "CRITICAL": 1, - "HIGH": 2, - "MEDIUM": 3, - "LOW": 4 - } - }, - "Mute": { - "values": { - "MUTE_UNSPECIFIED": 0, - "MUTED": 1, - "UNMUTED": 2, - "UNDEFINED": 4 - } - }, - "FindingClass": { - "values": { - "FINDING_CLASS_UNSPECIFIED": 0, - "THREAT": 1, - "VULNERABILITY": 2, - "MISCONFIGURATION": 3, - "OBSERVATION": 4, - "SCC_ERROR": 5, - "POSTURE_VIOLATION": 6, - "TOXIC_COMBINATION": 7, - "SENSITIVE_DATA_RISK": 8, - "CHOKEPOINT": 9, - "EXTERNAL_EXPOSURE": 10 - } - }, - "MuteInfo": { - "fields": { - "staticMute": { - "type": "StaticMute", - "id": 1 - }, - "dynamicMuteRecords": { - "rule": "repeated", - "type": "DynamicMuteRecord", - "id": 2 - } - }, - "nested": { - "StaticMute": { - "fields": { - "state": { - "type": "Mute", - "id": 1 - }, - "applyTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "DynamicMuteRecord": { - "fields": { - "muteConfig": { - "type": "string", - "id": 1 - }, - "matchTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - } - } - }, - "GroupMembership": { - "fields": { - "groupType": { - "type": "GroupType", - "id": 1 - }, - "groupId": { - "type": "string", - "id": 2 - } - }, - "nested": { - "GroupType": { - "values": { - "GROUP_TYPE_UNSPECIFIED": 0, - "GROUP_TYPE_TOXIC_COMBINATION": 1, - "GROUP_TYPE_CHOKEPOINT": 3 - } - } - } - }, - "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": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "domains": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "signatures": { - "rule": "repeated", - "type": "ProcessSignature", - "id": 3 - }, - "uris": { - "rule": "repeated", - "type": "string", - "id": 4 - } - }, - "nested": { - "ProcessSignature": { - "oneofs": { - "signature": { - "oneof": [ - "memoryHashSignature", - "yaraRuleSignature" - ] - } - }, - "fields": { - "memoryHashSignature": { - "type": "MemoryHashSignature", - "id": 6 - }, - "yaraRuleSignature": { - "type": "YaraRuleSignature", - "id": 7 - }, - "signatureType": { - "type": "SignatureType", - "id": 8 - } - }, - "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 - } - } - }, - "SignatureType": { - "values": { - "SIGNATURE_TYPE_UNSPECIFIED": 0, - "SIGNATURE_TYPE_PROCESS": 1, - "SIGNATURE_TYPE_FILE": 2 - } - } - } - } - } - }, - "KernelRootkit": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "unexpectedCodeModification": { - "type": "bool", - "id": 2 - }, - "unexpectedReadOnlyDataModification": { - "type": "bool", - "id": 3 - }, - "unexpectedFtraceHandler": { - "type": "bool", - "id": 4 - }, - "unexpectedKprobeHandler": { - "type": "bool", - "id": 5 - }, - "unexpectedKernelCodePages": { - "type": "bool", - "id": 6 - }, - "unexpectedSystemCallHandler": { - "type": "bool", - "id": 7 - }, - "unexpectedInterruptHandler": { - "type": "bool", - "id": 8 - }, - "unexpectedProcessesInRunqueue": { - "type": "bool", - "id": 9 - } - } - }, - "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 - }, - "objects": { - "rule": "repeated", - "type": "Object", - "id": 7 - } - }, - "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 - } - } - }, - "Object": { - "fields": { - "group": { - "type": "string", - "id": 1 - }, - "kind": { - "type": "string", - "id": 2 - }, - "ns": { - "type": "string", - "id": 3 - }, - "name": { - "type": "string", - "id": 4 - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 5 - } - } - } - } - }, - "LoadBalancer": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "LogEntry": { - "oneofs": { - "logEntry": { - "oneof": [ - "cloudLoggingEntry" - ] - } - }, - "fields": { - "cloudLoggingEntry": { - "type": "CloudLoggingEntry", - "id": 1 - } - } - }, - "CloudLoggingEntry": { - "fields": { - "insertId": { - "type": "string", - "id": 1 - }, - "logId": { - "type": "string", - "id": 2 - }, - "resourceContainer": { - "type": "string", - "id": 3 - }, - "timestamp": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "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, - "MASQUERADING": 49, - "MATCH_LEGITIMATE_NAME_OR_LOCATION": 50, - "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": 37, - "STARTUP_ITEMS": 38, - "NETWORK_SERVICE_DISCOVERY": 32, - "PROCESS_DISCOVERY": 56, - "COMMAND_AND_SCRIPTING_INTERPRETER": 6, - "UNIX_SHELL": 7, - "PYTHON": 59, - "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": 63, - "PERMISSION_GROUPS_DISCOVERY": 18, - "CLOUD_GROUPS": 19, - "INDICATOR_REMOVAL_FILE_DELETION": 64, - "APPLICATION_LAYER_PROTOCOL": 45, - "DNS": 46, - "SOFTWARE_DEPLOYMENT_TOOLS": 47, - "VALID_ACCOUNTS": 14, - "DEFAULT_ACCOUNTS": 35, - "LOCAL_ACCOUNTS": 15, - "CLOUD_ACCOUNTS": 16, - "PROXY": 9, - "EXTERNAL_PROXY": 10, - "MULTI_HOP_PROXY": 11, - "ACCOUNT_MANIPULATION": 22, - "ADDITIONAL_CLOUD_CREDENTIALS": 40, - "SSH_AUTHORIZED_KEYS": 23, - "ADDITIONAL_CONTAINER_CLUSTER_ROLES": 58, - "INGRESS_TOOL_TRANSFER": 3, - "NATIVE_API": 4, - "BRUTE_FORCE": 44, - "SHARED_MODULES": 5, - "ACCESS_TOKEN_MANIPULATION": 33, - "TOKEN_IMPERSONATION_OR_THEFT": 39, - "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, - "DOMAIN_POLICY_MODIFICATION": 30, - "DATA_DESTRUCTION": 29, - "SERVICE_STOP": 52, - "INHIBIT_SYSTEM_RECOVERY": 36, - "RESOURCE_HIJACKING": 8, - "NETWORK_DENIAL_OF_SERVICE": 17, - "CLOUD_SERVICE_DISCOVERY": 48, - "STEAL_APPLICATION_ACCESS_TOKEN": 42, - "ACCOUNT_ACCESS_REMOVAL": 51, - "STEAL_WEB_SESSION_COOKIE": 25, - "CREATE_OR_MODIFY_SYSTEM_PROCESS": 24, - "ABUSE_ELEVATION_CONTROL_MECHANISM": 34, - "UNSECURED_CREDENTIALS": 13, - "MODIFY_AUTHENTICATION_PROCESS": 28, - "IMPAIR_DEFENSES": 31, - "DISABLE_OR_MODIFY_TOOLS": 55, - "EXFILTRATION_OVER_WEB_SERVICE": 20, - "EXFILTRATION_TO_CLOUD_STORAGE": 21, - "DYNAMIC_RESOLUTION": 12, - "LATERAL_TOOL_TRANSFER": 41, - "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": 26, - "CREATE_SNAPSHOT": 54, - "CLOUD_INFRASTRUCTURE_DISCOVERY": 53, - "OBTAIN_CAPABILITIES": 43, - "ACTIVE_SCANNING": 1, - "SCANNING_IP_BLOCKS": 2, - "CONTAINER_ADMINISTRATION_COMMAND": 60, - "ESCAPE_TO_HOST": 61, - "CONTAINER_AND_RESOURCE_DISCOVERY": 57, - "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": 62 - } - } - } - }, - "Notebook": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "lastAuthor": { - "type": "string", - "id": 3 - }, - "notebookUpdateTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "OrgPolicy": { - "options": { - "(google.api.resource).type": "orgpolicy.googleapis.com/Policy", - "(google.api.resource).pattern": "projects/{project}/policies/{constraint_name}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "Process": { - "fields": { - "name": { - "type": "string", - "id": 12 - }, - "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 - } - } - }, - "SecurityPosture": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "revisionId": { - "type": "string", - "id": 2 - }, - "postureDeploymentResource": { - "type": "string", - "id": 3 - }, - "postureDeployment": { - "type": "string", - "id": 4 - }, - "changedPolicy": { - "type": "string", - "id": 5 - }, - "policySet": { - "type": "string", - "id": 6 - }, - "policy": { - "type": "string", - "id": 7 - }, - "policyDriftDetails": { - "rule": "repeated", - "type": "PolicyDriftDetails", - "id": 8 - } - }, - "nested": { - "PolicyDriftDetails": { - "fields": { - "field": { - "type": "string", - "id": 1 - }, - "expectedValue": { - "type": "string", - "id": 2 - }, - "detectedValue": { - "type": "string", - "id": 3 - } - } - } - } - }, - "ToxicCombination": { - "fields": { - "attackExposureScore": { - "type": "double", - "id": 1 - }, - "relatedFindings": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "Vulnerability": { - "fields": { - "cve": { - "type": "Cve", - "id": 1 - }, - "offendingPackage": { - "type": "Package", - "id": 2 - }, - "fixedPackage": { - "type": "Package", - "id": 3 - }, - "securityBulletin": { - "type": "SecurityBulletin", - "id": 4 - } - } - }, - "Cve": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "references": { - "rule": "repeated", - "type": "Reference", - "id": 2 - }, - "cvssv3": { - "type": "Cvssv3", - "id": 3 - }, - "upstreamFixAvailable": { - "type": "bool", - "id": 4 - }, - "impact": { - "type": "RiskRating", - "id": 5 - }, - "exploitationActivity": { - "type": "ExploitationActivity", - "id": 6 - }, - "observedInTheWild": { - "type": "bool", - "id": 7 - }, - "zeroDay": { - "type": "bool", - "id": 8 - }, - "exploitReleaseDate": { - "type": "google.protobuf.Timestamp", - "id": 9 - } - }, - "nested": { - "RiskRating": { - "values": { - "RISK_RATING_UNSPECIFIED": 0, - "LOW": 1, - "MEDIUM": 2, - "HIGH": 3, - "CRITICAL": 4 - } - }, - "ExploitationActivity": { - "values": { - "EXPLOITATION_ACTIVITY_UNSPECIFIED": 0, - "WIDE": 1, - "CONFIRMED": 2, - "AVAILABLE": 3, - "ANTICIPATED": 4, - "NO_KNOWN": 5 - } - } - } - }, - "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 - } - } - } - }, - "Package": { - "fields": { - "packageName": { - "type": "string", - "id": 1 - }, - "cpeUri": { - "type": "string", - "id": 2 - }, - "packageType": { - "type": "string", - "id": 3 - }, - "packageVersion": { - "type": "string", - "id": 4 - } - } - }, - "SecurityBulletin": { - "fields": { - "bulletinId": { - "type": "string", - "id": 1 - }, - "submissionTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "suggestedUpgradeVersion": { - "type": "string", - "id": 3 - } - } - }, - "MuteConfig": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/MuteConfig", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/muteConfigs/{mute_config}", - "(google.api.resource).plural": "muteConfigs", - "(google.api.resource).singular": "muteConfig" - }, - "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" - } - }, - "type": { - "type": "MuteConfigType", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "expiryTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MuteConfigType": { - "values": { - "MUTE_CONFIG_TYPE_UNSPECIFIED": 0, - "STATIC": 1, - "DYNAMIC": 2 - } - } - } - }, - "NotificationConfig": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", - "(google.api.resource).pattern": "projects/{project}/notificationConfigs/{notification_config}", - "(google.api.resource).plural": "notificationConfigs", - "(google.api.resource).singular": "notificationConfig" - }, - "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 - }, - "resource": { - "type": "Resource", - "id": 3 - } - } - }, - "Resource": { - "oneofs": { - "cloudProviderMetadata": { - "oneof": [ - "awsMetadata", - "azureMetadata" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 8 - }, - "type": { - "type": "string", - "id": 6 - }, - "project": { - "type": "string", - "id": 2 - }, - "projectDisplayName": { - "type": "string", - "id": 3 - }, - "parent": { - "type": "string", - "id": 4 - }, - "parentDisplayName": { - "type": "string", - "id": 5 - }, - "folders": { - "rule": "repeated", - "type": "Folder", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudProvider": { - "type": "CloudProvider", - "id": 9 - }, - "organization": { - "type": "string", - "id": 10 - }, - "service": { - "type": "string", - "id": 11 - }, - "location": { - "type": "string", - "id": 12 - }, - "awsMetadata": { - "type": "AwsMetadata", - "id": 16 - }, - "azureMetadata": { - "type": "AzureMetadata", - "id": 17 - }, - "resourcePath": { - "type": "ResourcePath", - "id": 18 - }, - "resourcePathString": { - "type": "string", - "id": 19 - } - } - }, - "CloudProvider": { - "values": { - "CLOUD_PROVIDER_UNSPECIFIED": 0, - "GOOGLE_CLOUD_PLATFORM": 1, - "AMAZON_WEB_SERVICES": 2, - "MICROSOFT_AZURE": 3 - } - }, - "AwsMetadata": { - "fields": { - "organization": { - "type": "AwsOrganization", - "id": 2 - }, - "organizationalUnits": { - "rule": "repeated", - "type": "AwsOrganizationalUnit", - "id": 3 - }, - "account": { - "type": "AwsAccount", - "id": 4 - } - }, - "nested": { - "AwsOrganization": { - "fields": { - "id": { - "type": "string", - "id": 1 - } - } - }, - "AwsOrganizationalUnit": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "name": { - "type": "string", - "id": 2 - } - } - }, - "AwsAccount": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "name": { - "type": "string", - "id": 2 - } - } - } - } - }, - "AzureMetadata": { - "fields": { - "managementGroups": { - "rule": "repeated", - "type": "AzureManagementGroup", - "id": 4 - }, - "subscription": { - "type": "AzureSubscription", - "id": 5 - }, - "resourceGroup": { - "type": "AzureResourceGroup", - "id": 6 - } - }, - "nested": { - "AzureManagementGroup": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - } - } - }, - "AzureSubscription": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - } - } - }, - "AzureResourceGroup": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - } - } - }, - "ResourcePath": { - "fields": { - "nodes": { - "rule": "repeated", - "type": "ResourcePathNode", - "id": 1 - } - }, - "nested": { - "ResourcePathNodeType": { - "values": { - "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED": 0, - "GCP_ORGANIZATION": 1, - "GCP_FOLDER": 2, - "GCP_PROJECT": 3, - "AWS_ORGANIZATION": 4, - "AWS_ORGANIZATIONAL_UNIT": 5, - "AWS_ACCOUNT": 6, - "AZURE_MANAGEMENT_GROUP": 7, - "AZURE_SUBSCRIPTION": 8, - "AZURE_RESOURCE_GROUP": 9 - } - }, - "ResourcePathNode": { - "fields": { - "nodeType": { - "type": "ResourcePathNodeType", - "id": 1 - }, - "id": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - } - } - } - } - }, - "OrganizationSettings": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", - "(google.api.resource).pattern": "organizations/{organization}/organizationSettings", - "(google.api.resource).plural": "organizationSettings", - "(google.api.resource).singular": "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 - }, - "folderIds": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "InclusionMode": { - "values": { - "INCLUSION_MODE_UNSPECIFIED": 0, - "INCLUDE_ONLY": 1, - "EXCLUDE": 2 - } - } - } - } - } - }, - "ResourceValueConfig": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/ResourceValueConfig", - "(google.api.resource).pattern": "organizations/{organization}/resourceValueConfigs/{resource_value_config}", - "(google.api.resource).plural": "resourceValueConfigs", - "(google.api.resource).singular": "resourceValueConfig" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "resourceValue": { - "type": "ResourceValue", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "tagValues": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "resourceType": { - "type": "string", - "id": 4 - }, - "scope": { - "type": "string", - "id": 5 - }, - "resourceLabelsSelector": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "description": { - "type": "string", - "id": 7 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudProvider": { - "type": "CloudProvider", - "id": 10 - }, - "sensitiveDataProtectionMapping": { - "type": "SensitiveDataProtectionMapping", - "id": 11 - } - }, - "nested": { - "SensitiveDataProtectionMapping": { - "fields": { - "highSensitivityMapping": { - "type": "ResourceValue", - "id": 1 - }, - "mediumSensitivityMapping": { - "type": "ResourceValue", - "id": 2 - } - } - } - } - }, - "ResourceValue": { - "values": { - "RESOURCE_VALUE_UNSPECIFIED": 0, - "HIGH": 1, - "MEDIUM": 2, - "LOW": 3, - "NONE": 4 - } - }, - "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 - } - } - } - }, - "SecurityHealthAnalyticsCustomModule": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule", - "(google.api.resource).pattern": "projects/{project}/securityHealthAnalyticsSettings/customModules/{custom_module}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "enablementState": { - "type": "EnablementState", - "id": 4 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastEditor": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "ancestorModule": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - }, - "customConfig": { - "type": "CustomConfig", - "id": 8 - } - }, - "nested": { - "EnablementState": { - "values": { - "ENABLEMENT_STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2, - "INHERITED": 3 - } - } - } - }, - "SecurityCenter": { - "options": { - "(google.api.default_host)": "securitycenter.googleapis.com", - "(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" - } - } - ] - }, - "CreateSecurityHealthAnalyticsCustomModule": { - "requestType": "CreateSecurityHealthAnalyticsCustomModuleRequest", - "responseType": "SecurityHealthAnalyticsCustomModule", - "options": { - "(google.api.http).post": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules", - "(google.api.http).body": "security_health_analytics_custom_module", - "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules", - "(google.api.http).additional_bindings.body": "security_health_analytics_custom_module", - "(google.api.method_signature)": "parent,security_health_analytics_custom_module" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules", - "body": "security_health_analytics_custom_module", - "additional_bindings": [ - { - "post": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules", - "body": "security_health_analytics_custom_module" - }, - { - "post": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules", - "body": "security_health_analytics_custom_module" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,security_health_analytics_custom_module" - } - ] - }, - "CreateSource": { - "requestType": "CreateSourceRequest", - "responseType": "Source", - "options": { - "(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", - "responseType": "Finding", - "options": { - "(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" - } - ] - }, - "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/*/locations/*}/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=organizations/*/locations/*}/muteConfigs", - "body": "mute_config" - }, - { - "post": "/v1/{parent=folders/*}/muteConfigs", - "body": "mute_config" - }, - { - "post": "/v1/{parent=folders/*/locations/*}/muteConfigs", - "body": "mute_config" - }, - { - "post": "/v1/{parent=projects/*}/muteConfigs", - "body": "mute_config" - }, - { - "post": "/v1/{parent=projects/*/locations/*}/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", - "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", - "additional_bindings": [ - { - "post": "/v1/{parent=folders/*}/notificationConfigs", - "body": "notification_config" - }, - { - "post": "/v1/{parent=projects/*}/notificationConfigs", - "body": "notification_config" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,config_id,notification_config" - }, - { - "(google.api.method_signature)": "parent,notification_config" - } - ] - }, - "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/*/locations/*/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/*}" - }, - { - "delete": "/v1/{name=organizations/*/locations/*/muteConfigs/*}" - }, - { - "delete": "/v1/{name=folders/*/locations/*/muteConfigs/*}" - }, - { - "delete": "/v1/{name=projects/*/locations/*/muteConfigs/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteNotificationConfig": { - "requestType": "DeleteNotificationConfigRequest", - "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/*}", - "additional_bindings": [ - { - "delete": "/v1/{name=folders/*/notificationConfigs/*}" - }, - { - "delete": "/v1/{name=projects/*/notificationConfigs/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteSecurityHealthAnalyticsCustomModule": { - "requestType": "DeleteSecurityHealthAnalyticsCustomModuleRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", - "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", - "additional_bindings": [ - { - "delete": "/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}" - }, - { - "delete": "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetSimulation": { - "requestType": "GetSimulationRequest", - "responseType": "Simulation", - "options": { - "(google.api.http).get": "/v1/{name=organizations/*/simulations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=organizations/*/simulations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetValuedResource": { - "requestType": "GetValuedResourceRequest", - "responseType": "ValuedResource", - "options": { - "(google.api.http).get": "/v1/{name=organizations/*/simulations/*/valuedResources/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=organizations/*/simulations/*/valuedResources/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "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", - "options": { - "(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" - } - ] - }, - "GetMuteConfig": { - "requestType": "GetMuteConfigRequest", - "responseType": "MuteConfig", - "options": { - "(google.api.http).get": "/v1/{name=organizations/*/muteConfigs/*}", - "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/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/*}" - }, - { - "get": "/v1/{name=organizations/*/locations/*/muteConfigs/*}" - }, - { - "get": "/v1/{name=folders/*/locations/*/muteConfigs/*}" - }, - { - "get": "/v1/{name=projects/*/locations/*/muteConfigs/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetNotificationConfig": { - "requestType": "GetNotificationConfigRequest", - "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/*}", - "additional_bindings": [ - { - "get": "/v1/{name=folders/*/notificationConfigs/*}" - }, - { - "get": "/v1/{name=projects/*/notificationConfigs/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetOrganizationSettings": { - "requestType": "GetOrganizationSettingsRequest", - "responseType": "OrganizationSettings", - "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" - } - ] - }, - "GetEffectiveSecurityHealthAnalyticsCustomModule": { - "requestType": "GetEffectiveSecurityHealthAnalyticsCustomModuleRequest", - "responseType": "EffectiveSecurityHealthAnalyticsCustomModule", - "options": { - "(google.api.http).get": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}", - "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}", - "additional_bindings": [ - { - "get": "/v1/{name=folders/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" - }, - { - "get": "/v1/{name=projects/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetSecurityHealthAnalyticsCustomModule": { - "requestType": "GetSecurityHealthAnalyticsCustomModuleRequest", - "responseType": "SecurityHealthAnalyticsCustomModule", - "options": { - "(google.api.http).get": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", - "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", - "additional_bindings": [ - { - "get": "/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}" - }, - { - "get": "/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetSource": { - "requestType": "GetSourceRequest", - "responseType": "Source", - "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", - "responseType": "GroupAssetsResponse", - "options": { - "deprecated": true, - "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/assets:group", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "deprecated": true - }, - { - "(google.api.http)": { - "post": "/v1/{parent=organizations/*}/assets:group", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{parent=folders/*}/assets:group", - "body": "*" - }, - { - "post": "/v1/{parent=projects/*}/assets:group", - "body": "*" - } - ] - } - } - ] - }, - "GroupFindings": { - "requestType": "GroupFindingsRequest", - "responseType": "GroupFindingsResponse", - "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": "*", - "additional_bindings": [ - { - "post": "/v1/{parent=folders/*/sources/*}/findings:group", - "body": "*" - }, - { - "post": "/v1/{parent=projects/*/sources/*}/findings:group", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,group_by" - } - ] - }, - "ListAssets": { - "requestType": "ListAssetsRequest", - "responseType": "ListAssetsResponse", - "options": { - "deprecated": true, - "(google.api.http).get": "/v1/{parent=organizations/*}/assets", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/assets" - }, - "parsedOptions": [ - { - "deprecated": true - }, - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*}/assets", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*}/assets" - }, - { - "get": "/v1/{parent=projects/*}/assets" - } - ] - } - } - ] - }, - "ListDescendantSecurityHealthAnalyticsCustomModules": { - "requestType": "ListDescendantSecurityHealthAnalyticsCustomModulesRequest", - "responseType": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:listDescendant", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:listDescendant", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:listDescendant", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:listDescendant" - }, - { - "get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:listDescendant" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListFindings": { - "requestType": "ListFindingsRequest", - "responseType": "ListFindingsResponse", - "options": { - "(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", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*/sources/*}/findings" - }, - { - "get": "/v1/{parent=projects/*/sources/*}/findings" - } - ] - } - } - ] - }, - "ListMuteConfigs": { - "requestType": "ListMuteConfigsRequest", - "responseType": "ListMuteConfigsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*}/muteConfigs", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*/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" - }, - { - "get": "/v1/{parent=organizations/*/locations/*/muteConfigs}" - }, - { - "get": "/v1/{parent=folders/*/locations/*/muteConfigs}" - }, - { - "get": "/v1/{parent=projects/*/locations/*/muteConfigs}" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListNotificationConfigs": { - "requestType": "ListNotificationConfigsRequest", - "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", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*}/notificationConfigs" - }, - { - "get": "/v1/{parent=projects/*}/notificationConfigs" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListEffectiveSecurityHealthAnalyticsCustomModules": { - "requestType": "ListEffectiveSecurityHealthAnalyticsCustomModulesRequest", - "responseType": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/effectiveCustomModules", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/effectiveCustomModules", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/effectiveCustomModules", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/effectiveCustomModules" - }, - { - "get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/effectiveCustomModules" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListSecurityHealthAnalyticsCustomModules": { - "requestType": "ListSecurityHealthAnalyticsCustomModulesRequest", - "responseType": "ListSecurityHealthAnalyticsCustomModulesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules" - }, - { - "get": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListSources": { - "requestType": "ListSourcesRequest", - "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", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*}/sources" - }, - { - "get": "/v1/{parent=projects/*}/sources" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "RunAssetDiscovery": { - "requestType": "RunAssetDiscoveryRequest", - "responseType": "google.longrunning.Operation", - "options": { - "deprecated": true, - "(google.api.http).post": "/v1/{parent=organizations/*}/assets:runDiscovery", - "(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" - }, - "parsedOptions": [ - { - "deprecated": true - }, - { - "(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", - "responseType": "Finding", - "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": "*", - "additional_bindings": [ - { - "post": "/v1/{name=folders/*/sources/*/findings/*}:setState", - "body": "*" - }, - { - "post": "/v1/{name=projects/*/sources/*/findings/*}:setState", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "name,state,start_time" - } - ] - }, - "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", - "options": { - "(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", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(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" - } - ] - }, - "SimulateSecurityHealthAnalyticsCustomModule": { - "requestType": "SimulateSecurityHealthAnalyticsCustomModuleRequest", - "responseType": "SimulateSecurityHealthAnalyticsCustomModuleResponse", - "options": { - "(google.api.http).post": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:simulate", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:simulate", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,custom_config,resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:simulate", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:simulate", - "body": "*" - }, - { - "post": "/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:simulate", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,custom_config,resource" - } - ] - }, - "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", - "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", - "additional_bindings": [ - { - "patch": "/v1/{finding.name=folders/*/sources/*/findings/*}", - "body": "finding" - }, - { - "patch": "/v1/{finding.name=projects/*/sources/*/findings/*}", - "body": "finding" - } - ] - } - }, - { - "(google.api.method_signature)": "finding" - } - ] - }, - "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/*/locations/*/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" - }, - { - "patch": "/v1/{mute_config.name=organizations/*/locations/*/muteConfigs/*}", - "body": "mute_config" - }, - { - "patch": "/v1/{mute_config.name=folders/*/locations/*/muteConfigs/*}", - "body": "mute_config" - }, - { - "patch": "/v1/{mute_config.name=projects/*/locations/*/muteConfigs/*}", - "body": "mute_config" - } - ] - } - }, - { - "(google.api.method_signature)": "mute_config,update_mask" - } - ] - }, - "UpdateNotificationConfig": { - "requestType": "UpdateNotificationConfigRequest", - "responseType": "NotificationConfig", - "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", - "additional_bindings": [ - { - "patch": "/v1/{notification_config.name=folders/*/notificationConfigs/*}", - "body": "notification_config" - }, - { - "patch": "/v1/{notification_config.name=projects/*/notificationConfigs/*}", - "body": "notification_config" - } - ] - } - }, - { - "(google.api.method_signature)": "notification_config" - }, - { - "(google.api.method_signature)": "notification_config,update_mask" - } - ] - }, - "UpdateOrganizationSettings": { - "requestType": "UpdateOrganizationSettingsRequest", - "responseType": "OrganizationSettings", - "options": { - "(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" - } - ] - }, - "UpdateSecurityHealthAnalyticsCustomModule": { - "requestType": "UpdateSecurityHealthAnalyticsCustomModuleRequest", - "responseType": "SecurityHealthAnalyticsCustomModule", - "options": { - "(google.api.http).patch": "/v1/{security_health_analytics_custom_module.name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", - "(google.api.http).body": "security_health_analytics_custom_module", - "(google.api.http).additional_bindings.patch": "/v1/{security_health_analytics_custom_module.name=projects/*/securityHealthAnalyticsSettings/customModules/*}", - "(google.api.http).additional_bindings.body": "security_health_analytics_custom_module", - "(google.api.method_signature)": "security_health_analytics_custom_module,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{security_health_analytics_custom_module.name=organizations/*/securityHealthAnalyticsSettings/customModules/*}", - "body": "security_health_analytics_custom_module", - "additional_bindings": [ - { - "patch": "/v1/{security_health_analytics_custom_module.name=folders/*/securityHealthAnalyticsSettings/customModules/*}", - "body": "security_health_analytics_custom_module" - }, - { - "patch": "/v1/{security_health_analytics_custom_module.name=projects/*/securityHealthAnalyticsSettings/customModules/*}", - "body": "security_health_analytics_custom_module" - } - ] - } - }, - { - "(google.api.method_signature)": "security_health_analytics_custom_module,update_mask" - } - ] - }, - "UpdateSource": { - "requestType": "UpdateSourceRequest", - "responseType": "Source", - "options": { - "(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", - "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=projects/*/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=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" - } - ] - } - }, - { - "(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" - } - ] - }, - "CreateEventThreatDetectionCustomModule": { - "requestType": "CreateEventThreatDetectionCustomModuleRequest", - "responseType": "EventThreatDetectionCustomModule", - "options": { - "(google.api.http).post": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules", - "(google.api.http).body": "event_threat_detection_custom_module", - "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules", - "(google.api.http).additional_bindings.body": "event_threat_detection_custom_module", - "(google.api.method_signature)": "parent,event_threat_detection_custom_module" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules", - "body": "event_threat_detection_custom_module", - "additional_bindings": [ - { - "post": "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules", - "body": "event_threat_detection_custom_module" - }, - { - "post": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules", - "body": "event_threat_detection_custom_module" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,event_threat_detection_custom_module" - } - ] - }, - "DeleteEventThreatDetectionCustomModule": { - "requestType": "DeleteEventThreatDetectionCustomModuleRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}", - "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}", - "additional_bindings": [ - { - "delete": "/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}" - }, - { - "delete": "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetEventThreatDetectionCustomModule": { - "requestType": "GetEventThreatDetectionCustomModuleRequest", - "responseType": "EventThreatDetectionCustomModule", - "options": { - "(google.api.http).get": "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}", - "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}", - "additional_bindings": [ - { - "get": "/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}" - }, - { - "get": "/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDescendantEventThreatDetectionCustomModules": { - "requestType": "ListDescendantEventThreatDetectionCustomModulesRequest", - "responseType": "ListDescendantEventThreatDetectionCustomModulesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:listDescendant", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:listDescendant", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:listDescendant", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules:listDescendant" - }, - { - "get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:listDescendant" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListEventThreatDetectionCustomModules": { - "requestType": "ListEventThreatDetectionCustomModulesRequest", - "responseType": "ListEventThreatDetectionCustomModulesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules" - }, - { - "get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateEventThreatDetectionCustomModule": { - "requestType": "UpdateEventThreatDetectionCustomModuleRequest", - "responseType": "EventThreatDetectionCustomModule", - "options": { - "(google.api.http).patch": "/v1/{event_threat_detection_custom_module.name=organizations/*/eventThreatDetectionSettings/customModules/*}", - "(google.api.http).body": "event_threat_detection_custom_module", - "(google.api.http).additional_bindings.patch": "/v1/{event_threat_detection_custom_module.name=projects/*/eventThreatDetectionSettings/customModules/*}", - "(google.api.http).additional_bindings.body": "event_threat_detection_custom_module", - "(google.api.method_signature)": "event_threat_detection_custom_module,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{event_threat_detection_custom_module.name=organizations/*/eventThreatDetectionSettings/customModules/*}", - "body": "event_threat_detection_custom_module", - "additional_bindings": [ - { - "patch": "/v1/{event_threat_detection_custom_module.name=folders/*/eventThreatDetectionSettings/customModules/*}", - "body": "event_threat_detection_custom_module" - }, - { - "patch": "/v1/{event_threat_detection_custom_module.name=projects/*/eventThreatDetectionSettings/customModules/*}", - "body": "event_threat_detection_custom_module" - } - ] - } - }, - { - "(google.api.method_signature)": "event_threat_detection_custom_module,update_mask" - } - ] - }, - "ValidateEventThreatDetectionCustomModule": { - "requestType": "ValidateEventThreatDetectionCustomModuleRequest", - "responseType": "ValidateEventThreatDetectionCustomModuleResponse", - "options": { - "(google.api.http).post": "/v1/{parent=organizations/*/eventThreatDetectionSettings}:validateCustomModule", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/eventThreatDetectionSettings}:validateCustomModule", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=organizations/*/eventThreatDetectionSettings}:validateCustomModule", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{parent=folders/*/eventThreatDetectionSettings}:validateCustomModule", - "body": "*" - }, - { - "post": "/v1/{parent=projects/*/eventThreatDetectionSettings}:validateCustomModule", - "body": "*" - } - ] - } - } - ] - }, - "GetEffectiveEventThreatDetectionCustomModule": { - "requestType": "GetEffectiveEventThreatDetectionCustomModuleRequest", - "responseType": "EffectiveEventThreatDetectionCustomModule", - "options": { - "(google.api.http).get": "/v1/{name=organizations/*/eventThreatDetectionSettings/effectiveCustomModules/*}", - "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/eventThreatDetectionSettings/effectiveCustomModules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=organizations/*/eventThreatDetectionSettings/effectiveCustomModules/*}", - "additional_bindings": [ - { - "get": "/v1/{name=folders/*/eventThreatDetectionSettings/effectiveCustomModules/*}" - }, - { - "get": "/v1/{name=projects/*/eventThreatDetectionSettings/effectiveCustomModules/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListEffectiveEventThreatDetectionCustomModules": { - "requestType": "ListEffectiveEventThreatDetectionCustomModulesRequest", - "responseType": "ListEffectiveEventThreatDetectionCustomModulesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/effectiveCustomModules", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/effectiveCustomModules", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*/eventThreatDetectionSettings}/effectiveCustomModules", - "additional_bindings": [ - { - "get": "/v1/{parent=folders/*/eventThreatDetectionSettings}/effectiveCustomModules" - }, - { - "get": "/v1/{parent=projects/*/eventThreatDetectionSettings}/effectiveCustomModules" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "BatchCreateResourceValueConfigs": { - "requestType": "BatchCreateResourceValueConfigsRequest", - "responseType": "BatchCreateResourceValueConfigsResponse", - "options": { - "(google.api.http).post": "/v1/{parent=organizations/*}/resourceValueConfigs:batchCreate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,requests" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=organizations/*}/resourceValueConfigs:batchCreate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,requests" - } - ] - }, - "DeleteResourceValueConfig": { - "requestType": "DeleteResourceValueConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=organizations/*/resourceValueConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=organizations/*/resourceValueConfigs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetResourceValueConfig": { - "requestType": "GetResourceValueConfigRequest", - "responseType": "ResourceValueConfig", - "options": { - "(google.api.http).get": "/v1/{name=organizations/*/resourceValueConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=organizations/*/resourceValueConfigs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListResourceValueConfigs": { - "requestType": "ListResourceValueConfigsRequest", - "responseType": "ListResourceValueConfigsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*}/resourceValueConfigs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*}/resourceValueConfigs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateResourceValueConfig": { - "requestType": "UpdateResourceValueConfigRequest", - "responseType": "ResourceValueConfig", - "options": { - "(google.api.http).patch": "/v1/{resource_value_config.name=organizations/*/resourceValueConfigs/*}", - "(google.api.http).body": "resource_value_config", - "(google.api.method_signature)": "resource_value_config,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{resource_value_config.name=organizations/*/resourceValueConfigs/*}", - "body": "resource_value_config" - } - }, - { - "(google.api.method_signature)": "resource_value_config,update_mask" - } - ] - }, - "ListValuedResources": { - "requestType": "ListValuedResourcesRequest", - "responseType": "ListValuedResourcesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/simulations/*}/valuedResources", - "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*/simulations/*}/valuedResources", - "additional_bindings": { - "get": "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListAttackPaths": { - "requestType": "ListAttackPathsRequest", - "responseType": "ListAttackPathsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/simulations/*}/attackPaths", - "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=organizations/*/simulations/*}/attackPaths", - "additional_bindings": [ - { - "get": "/v1/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" - }, - { - "get": "/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "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 - } - }, - "muteState": { - "type": "MuteState", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MuteState": { - "values": { - "MUTE_STATE_UNSPECIFIED": 0, - "MUTED": 1, - "UNDEFINED": 2 - } - } - } - }, - "BulkMuteFindingsResponse": { - "fields": {} - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "CreateResourceValueConfigRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" - } - }, - "resourceValueConfig": { - "type": "ResourceValueConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateResourceValueConfigsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" - } - }, - "requests": { - "rule": "repeated", - "type": "CreateResourceValueConfigRequest", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateResourceValueConfigsResponse": { - "fields": { - "resourceValueConfigs": { - "rule": "repeated", - "type": "ResourceValueConfig", - "id": 1 - } - } - }, - "DeleteResourceValueConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/ResourceValueConfig" - } - } - } - }, - "GetResourceValueConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/ResourceValueConfig" - } - } - } - }, - "ListResourceValueConfigsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListResourceValueConfigsResponse": { - "fields": { - "resourceValueConfigs": { - "rule": "repeated", - "type": "ResourceValueConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "UpdateResourceValueConfigRequest": { - "fields": { - "resourceValueConfig": { - "type": "ResourceValueConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "CreateNotificationConfigRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" - } - }, - "configId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "notificationConfig": { - "type": "NotificationConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "CreateSecurityHealthAnalyticsCustomModuleRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - }, - "securityHealthAnalyticsCustomModule": { - "type": "SecurityHealthAnalyticsCustomModule", - "id": 2, - "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" - } - } - } - }, - "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": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" - } - } - } - }, - "DeleteSecurityHealthAnalyticsCustomModuleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - } - } - }, - "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": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" - } - } - } - }, - "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" - } - } - } - }, - "GetEffectiveSecurityHealthAnalyticsCustomModuleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule" - } - } - } - }, - "GetSecurityHealthAnalyticsCustomModuleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - } - } - }, - "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).child_type": "securitycenter.googleapis.com/Asset" - } - }, - "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 - }, - "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 - }, - "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 - } - } - }, - "ListDescendantSecurityHealthAnalyticsCustomModulesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListDescendantSecurityHealthAnalyticsCustomModulesResponse": { - "fields": { - "securityHealthAnalyticsCustomModules": { - "rule": "repeated", - "type": "SecurityHealthAnalyticsCustomModule", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListValuedResourcesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ValuedResource" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListValuedResourcesResponse": { - "fields": { - "valuedResources": { - "rule": "repeated", - "type": "ValuedResource", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListAttackPathsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/AttackPath" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - } - } - }, - "ListAttackPathsResponse": { - "fields": { - "attackPaths": { - "rule": "repeated", - "type": "AttackPath", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetSimulationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/Simulation" - } - } - } - }, - "GetValuedResourceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/ValuedResource" - } - } - } - }, - "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": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" - } - }, - "pageToken": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListNotificationConfigsResponse": { - "fields": { - "notificationConfigs": { - "rule": "repeated", - "type": "NotificationConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListEffectiveSecurityHealthAnalyticsCustomModulesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse": { - "fields": { - "effectiveSecurityHealthAnalyticsCustomModules": { - "rule": "repeated", - "type": "EffectiveSecurityHealthAnalyticsCustomModule", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListSecurityHealthAnalyticsCustomModulesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListSecurityHealthAnalyticsCustomModulesResponse": { - "fields": { - "securityHealthAnalyticsCustomModules": { - "rule": "repeated", - "type": "SecurityHealthAnalyticsCustomModule", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListSourcesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" - } - }, - "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).child_type": "securitycenter.googleapis.com/Asset" - } - }, - "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 - } - } - }, - "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 - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 7 - }, - "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, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "StateChange": { - "values": { - "UNUSED": 0, - "CHANGED": 1, - "UNCHANGED": 2, - "ADDED": 3, - "REMOVED": 4 - } - }, - "Resource": { - "oneofs": { - "cloudProviderMetadata": { - "oneof": [ - "awsMetadata", - "azureMetadata" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 8 - }, - "type": { - "type": "string", - "id": 6 - }, - "projectName": { - "type": "string", - "id": 2 - }, - "projectDisplayName": { - "type": "string", - "id": 3 - }, - "parentName": { - "type": "string", - "id": 4 - }, - "parentDisplayName": { - "type": "string", - "id": 5 - }, - "folders": { - "rule": "repeated", - "type": "Folder", - "id": 7 - }, - "cloudProvider": { - "type": "CloudProvider", - "id": 9 - }, - "organization": { - "type": "string", - "id": 10 - }, - "service": { - "type": "string", - "id": 11 - }, - "location": { - "type": "string", - "id": 12 - }, - "awsMetadata": { - "type": "AwsMetadata", - "id": 16 - }, - "azureMetadata": { - "type": "AzureMetadata", - "id": 17 - }, - "resourcePath": { - "type": "ResourcePath", - "id": 18 - }, - "resourcePathString": { - "type": "string", - "id": 19 - } - } - } - } - } - } - }, - "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" - } - } - } - }, - "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": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" - } - } - } - }, - "SimulateSecurityHealthAnalyticsCustomModuleRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "customConfig": { - "type": "CustomConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "resource": { - "type": "SimulatedResource", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "SimulatedResource": { - "fields": { - "resourceType": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "resourceData": { - "type": "google.protobuf.Struct", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "iamPolicyData": { - "type": "google.iam.v1.Policy", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "SimulateSecurityHealthAnalyticsCustomModuleResponse": { - "fields": { - "result": { - "type": "SimulatedResult", - "id": 1 - } - }, - "nested": { - "SimulatedResult": { - "oneofs": { - "result": { - "oneof": [ - "finding", - "noViolation", - "error" - ] - } - }, - "fields": { - "finding": { - "type": "Finding", - "id": 1 - }, - "noViolation": { - "type": "google.protobuf.Empty", - "id": 2 - }, - "error": { - "type": "google.rpc.Status", - "id": 3 - } - } - } - } - }, - "UpdateExternalSystemRequest": { - "fields": { - "externalSystem": { - "type": "ExternalSystem", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "UpdateFindingRequest": { - "fields": { - "finding": { - "type": "Finding", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "UpdateMuteConfigRequest": { - "fields": { - "muteConfig": { - "type": "MuteConfig", - "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 - } - } - }, - "UpdateSecurityHealthAnalyticsCustomModuleRequest": { - "fields": { - "securityHealthAnalyticsCustomModule": { - "type": "SecurityHealthAnalyticsCustomModule", - "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 - } - } - }, - "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" - } - } - } - }, - "CreateEventThreatDetectionCustomModuleRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - }, - "eventThreatDetectionCustomModule": { - "type": "EventThreatDetectionCustomModule", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ValidateEventThreatDetectionCustomModuleRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - }, - "rawText": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "type": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ValidateEventThreatDetectionCustomModuleResponse": { - "fields": { - "errors": { - "type": "CustomModuleValidationErrors", - "id": 2 - } - } - }, - "DeleteEventThreatDetectionCustomModuleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - } - } - }, - "GetEventThreatDetectionCustomModuleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - } - } - }, - "ListDescendantEventThreatDetectionCustomModulesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - }, - "pageToken": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListDescendantEventThreatDetectionCustomModulesResponse": { - "fields": { - "eventThreatDetectionCustomModules": { - "rule": "repeated", - "type": "EventThreatDetectionCustomModule", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListEventThreatDetectionCustomModulesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EventThreatDetectionCustomModule" - } - }, - "pageToken": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListEventThreatDetectionCustomModulesResponse": { - "fields": { - "eventThreatDetectionCustomModules": { - "rule": "repeated", - "type": "EventThreatDetectionCustomModule", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "UpdateEventThreatDetectionCustomModuleRequest": { - "fields": { - "eventThreatDetectionCustomModule": { - "type": "EventThreatDetectionCustomModule", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "GetEffectiveEventThreatDetectionCustomModuleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" - } - } - } - }, - "ListEffectiveEventThreatDetectionCustomModulesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule" - } - }, - "pageToken": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListEffectiveEventThreatDetectionCustomModulesResponse": { - "fields": { - "effectiveEventThreatDetectionCustomModules": { - "rule": "repeated", - "type": "EffectiveEventThreatDetectionCustomModule", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Simulation": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Simulation", - "(google.api.resource).pattern": "organizations/{organization}/simulations/{simulation}", - "(google.api.resource).plural": "simulations", - "(google.api.resource).singular": "simulation" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resourceValueConfigsMetadata": { - "rule": "repeated", - "type": "ResourceValueConfigMetadata", - "id": 3 - }, - "cloudProvider": { - "type": "CloudProvider", - "id": 4 - } - } - }, - "ValuedResource": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/ValuedResource", - "(google.api.resource).pattern": "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}", - "(google.api.resource).plural": "valuedResources", - "(google.api.resource).singular": "valuedResource" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "resource": { - "type": "string", - "id": 2 - }, - "resourceType": { - "type": "string", - "id": 3 - }, - "displayName": { - "type": "string", - "id": 4 - }, - "resourceValue": { - "type": "ResourceValue", - "id": 5 - }, - "exposedScore": { - "type": "double", - "id": 6 - }, - "resourceValueConfigsUsed": { - "rule": "repeated", - "type": "ResourceValueConfigMetadata", - "id": 7 - } - }, - "nested": { - "ResourceValue": { - "values": { - "RESOURCE_VALUE_UNSPECIFIED": 0, - "RESOURCE_VALUE_LOW": 1, - "RESOURCE_VALUE_MEDIUM": 2, - "RESOURCE_VALUE_HIGH": 3 - } - } - } - }, - "ResourceValueConfigMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "Source": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Source", - "(google.api.resource).pattern": "projects/{project}/sources/{source}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "canonicalName": { - "type": "string", - "id": 14 - } - } - } - } - }, - "v1beta1": { - "options": { - "go_package": "cloud.google.com/go/securitycenter/apiv1beta1/securitycenterpb;securitycenterpb", - "java_multiple_files": true, - "java_package": "com.google.cloud.securitycenter.v1beta1" - }, - "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 - } - }, - "nested": { - "SecurityCenterProperties": { - "fields": { - "resourceName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "resourceType": { - "type": "string", - "id": 2 - }, - "resourceParent": { - "type": "string", - "id": 3 - }, - "resourceProject": { - "type": "string", - "id": 4 - }, - "resourceOwners": { - "rule": "repeated", - "type": "string", - "id": 5 - } - } - } - } - }, - "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, - "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 - } - } - } - }, - "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": "/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", - "responseType": "Finding", - "options": { - "(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", - "responseType": "google.iam.v1.Policy", - "options": { - "(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", - "responseType": "OrganizationSettings", - "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", - "responseType": "Source", - "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", - "responseType": "GroupAssetsResponse", - "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", - "responseType": "GroupFindingsResponse", - "options": { - "(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", - "responseType": "ListSourcesResponse", - "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", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{parent=organizations/*}/assets:runDiscovery", - "(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" - }, - "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", - "responseType": "Finding", - "options": { - "(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", - "responseType": "google.iam.v1.Policy", - "options": { - "(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", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(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", - "responseType": "Finding", - "options": { - "(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", - "responseType": "OrganizationSettings", - "options": { - "(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", - "responseType": "Source", - "options": { - "(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", - "responseType": "SecurityMarks", - "options": { - "(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.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" - } - ] - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "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 - }, - "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 - } - } - }, - "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 - }, - "pageToken": { - "type": "string", - "id": 5 - }, - "pageSize": { - "type": "int32", - "id": 6 - } - } - }, - "GroupFindingsResponse": { - "fields": { - "groupByResults": { - "rule": "repeated", - "type": "GroupResult", - "id": 1 - }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "nextPageToken": { - "type": "string", - "id": 3 - } - } - }, - "GroupResult": { - "fields": { - "properties": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 1 - }, - "count": { - "type": "int64", - "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 - }, - "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 - }, - "state": { - "type": "State", - "id": 2 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "UNUSED": 1, - "ADDED": 2, - "REMOVED": 3, - "ACTIVE": 4 - } - } - } - } - } - }, - "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 - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 6 - }, - "pageSize": { - "type": "int32", - "id": 7 - } - } - }, - "ListFindingsResponse": { - "fields": { - "findings": { - "rule": "repeated", - "type": "Finding", - "id": 1 - }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "nextPageToken": { - "type": "string", - "id": 3 - }, - "totalSize": { - "type": "int32", - "id": 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 - } - } - }, - "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 - } - } - } - } - }, - "v1p1beta1": { - "options": { - "csharp_namespace": "Google.Cloud.SecurityCenter.V1P1Beta1", - "go_package": "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb", - "java_multiple_files": true, - "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}" - }, - "nested": { - "Asset": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Asset", - "(google.api.resource).pattern": "projects/{project}/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 - }, - "canonicalName": { - "type": "string", - "id": 13 - } - }, - "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 - }, - "folders": { - "rule": "repeated", - "type": "Folder", - "id": 10 - } - } - }, - "IamPolicy": { - "fields": { - "policyBlob": { - "type": "string", - "id": 1 - } - } - } - } - }, - "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": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "marks": { - "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": "projects/{project}/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 - }, - "severity": { - "type": "Severity", - "id": 13 - }, - "canonicalName": { - "type": "string", - "id": 14 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2 - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "CRITICAL": 1, - "HIGH": 2, - "MEDIUM": 3, - "LOW": 4 - } - } - } - }, - "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 - }, - "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 - }, - "folders": { - "rule": "repeated", - "type": "Folder", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "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 - }, - "folderIds": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "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" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1p1beta1/{parent=organizations/*}/sources", - "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" - }, - "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", - "responseType": "NotificationConfig", - "options": { - "(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", - "responseType": "google.protobuf.Empty", - "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", - "responseType": "google.iam.v1.Policy", - "options": { - "(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", - "responseType": "NotificationConfig", - "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", - "responseType": "OrganizationSettings", - "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", - "responseType": "Source", - "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", - "responseType": "GroupAssetsResponse", - "options": { - "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/assets:group", - "(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": "*", - "additional_bindings": [ - { - "post": "/v1p1beta1/{parent=folders/*}/assets:group", - "body": "*" - }, - { - "post": "/v1p1beta1/{parent=projects/*}/assets:group", - "body": "*" - } - ] - } - } - ] - }, - "GroupFindings": { - "requestType": "GroupFindingsRequest", - "responseType": "GroupFindingsResponse", - "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": "*", - "additional_bindings": [ - { - "post": "/v1p1beta1/{parent=folders/*/sources/*}/findings:group", - "body": "*" - }, - { - "post": "/v1p1beta1/{parent=projects/*/sources/*}/findings:group", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,group_by" - } - ] - }, - "ListAssets": { - "requestType": "ListAssetsRequest", - "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", - "additional_bindings": [ - { - "get": "/v1p1beta1/{parent=folders/*}/assets" - }, - { - "get": "/v1p1beta1/{parent=projects/*}/assets" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListFindings": { - "requestType": "ListFindingsRequest", - "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", - "additional_bindings": [ - { - "get": "/v1p1beta1/{parent=folders/*/sources/*}/findings" - }, - { - "get": "/v1p1beta1/{parent=projects/*/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" - }, - "parsedOptions": [ - { - "(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.http).additional_bindings.get": "/v1p1beta1/{parent=projects/*}/sources", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1p1beta1/{parent=organizations/*}/sources", - "additional_bindings": [ - { - "get": "/v1p1beta1/{parent=folders/*}/sources" - }, - { - "get": "/v1p1beta1/{parent=projects/*}/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" - }, - "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", - "responseType": "Finding", - "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": "*", - "additional_bindings": [ - { - "post": "/v1p1beta1/{name=folders/*/sources/*/findings/*}:setState", - "body": "*" - }, - { - "post": "/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState", - "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" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy", - "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" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions", - "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.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", - "additional_bindings": [ - { - "patch": "/v1p1beta1/{finding.name=folders/*/sources/*/findings/*}", - "body": "finding" - }, - { - "patch": "/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}", - "body": "finding" - } - ] - } - }, - { - "(google.api.method_signature)": "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" - }, - "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", - "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" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}", - "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" - }, - "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", - "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=projects/*/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=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" - } - ] - } - }, - { - "(google.api.method_signature)": "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).child_type": "securitycenter.googleapis.com/Asset" - } - }, - "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 - }, - "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 - }, - "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).child_type": "securitycenter.googleapis.com/Source" - } - }, - "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).child_type": "securitycenter.googleapis.com/Asset" - } - }, - "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 - } - } - }, - "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 - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 7 - }, - "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, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "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 - }, - "folders": { - "rule": "repeated", - "type": "Folder", - "id": 10 - } - } - }, - "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": "projects/{project}/sources/{source}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "canonicalName": { - "type": "string", - "id": 14 - } - } - } - } - }, - "v2": { - "options": { - "csharp_namespace": "Google.Cloud.SecurityCenter.V2", - "go_package": "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb", - "java_multiple_files": true, - "java_outer_classname": "SourceProto", - "java_package": "com.google.cloud.securitycenter.v2", - "php_namespace": "Google\\Cloud\\SecurityCenter\\V2", - "ruby_package": "Google::Cloud::SecurityCenter::V2", - "(google.api.resource_definition).type": "securitycenter.googleapis.com/OrganizationValuedResource", - "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}" - }, - "nested": { - "Access": { - "fields": { - "principalEmail": { - "type": "string", - "id": 1 - }, - "callerIp": { - "type": "string", - "id": 2 - }, - "callerIpGeo": { - "type": "Geolocation", - "id": 3 - }, - "userAgentFamily": { - "type": "string", - "id": 4 - }, - "userAgent": { - "type": "string", - "id": 5 - }, - "serviceName": { - "type": "string", - "id": 6 - }, - "methodName": { - "type": "string", - "id": 7 - }, - "principalSubject": { - "type": "string", - "id": 8 - }, - "serviceAccountKeyName": { - "type": "string", - "id": 9 - }, - "serviceAccountDelegationInfo": { - "rule": "repeated", - "type": "ServiceAccountDelegationInfo", - "id": 10 - }, - "userName": { - "type": "string", - "id": 11 - } - } - }, - "ServiceAccountDelegationInfo": { - "fields": { - "principalEmail": { - "type": "string", - "id": 1 - }, - "principalSubject": { - "type": "string", - "id": 2 - } - } - }, - "Geolocation": { - "fields": { - "regionCode": { - "type": "string", - "id": 1 - } - } - }, - "AffectedResources": { - "fields": { - "count": { - "type": "int64", - "id": 1 - } - } - }, - "AiModel": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "domain": { - "type": "string", - "id": 2 - }, - "library": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - }, - "publisher": { - "type": "string", - "id": 5 - }, - "deploymentPlatform": { - "type": "DeploymentPlatform", - "id": 6 - }, - "displayName": { - "type": "string", - "id": 7 - } - }, - "nested": { - "DeploymentPlatform": { - "values": { - "DEPLOYMENT_PLATFORM_UNSPECIFIED": 0, - "VERTEX_AI": 1, - "GKE": 2, - "GCE": 3, - "FINE_TUNED_MODEL": 4 - } - } - } - }, - "Application": { - "fields": { - "baseUri": { - "type": "string", - "id": 1 - }, - "fullUri": { - "type": "string", - "id": 2 - } - } - }, - "AttackExposure": { - "fields": { - "score": { - "type": "double", - "id": 1 - }, - "latestCalculationTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "attackExposureResult": { - "type": "string", - "id": 3 - }, - "state": { - "type": "State", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "exposedHighValueResourcesCount": { - "type": "int32", - "id": 5 - }, - "exposedMediumValueResourcesCount": { - "type": "int32", - "id": 6 - }, - "exposedLowValueResourcesCount": { - "type": "int32", - "id": 7 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CALCULATED": 1, - "NOT_CALCULATED": 2 - } - } - } - }, - "AttackPath": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/AttackPath", - "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}", - "(google.api.resource).plural": "attackPaths", - "(google.api.resource).singular": "attackPath" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "pathNodes": { - "rule": "repeated", - "type": "AttackPathNode", - "id": 2 - }, - "edges": { - "rule": "repeated", - "type": "AttackPathEdge", - "id": 3 - } - }, - "nested": { - "AttackPathNode": { - "fields": { - "resource": { - "type": "string", - "id": 1 - }, - "resourceType": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - }, - "associatedFindings": { - "rule": "repeated", - "type": "PathNodeAssociatedFinding", - "id": 4 - }, - "uuid": { - "type": "string", - "id": 5 - }, - "attackSteps": { - "rule": "repeated", - "type": "AttackStepNode", - "id": 6 - } - }, - "nested": { - "PathNodeAssociatedFinding": { - "fields": { - "canonicalFinding": { - "type": "string", - "id": 1 - }, - "findingCategory": { - "type": "string", - "id": 2 - }, - "name": { - "type": "string", - "id": 3 - } - } - }, - "NodeType": { - "values": { - "NODE_TYPE_UNSPECIFIED": 0, - "NODE_TYPE_AND": 1, - "NODE_TYPE_OR": 2, - "NODE_TYPE_DEFENSE": 3, - "NODE_TYPE_ATTACKER": 4 - } - }, - "AttackStepNode": { - "fields": { - "uuid": { - "type": "string", - "id": 1 - }, - "type": { - "type": "NodeType", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4 - }, - "description": { - "type": "string", - "id": 5 - } - } - } - } - }, - "AttackPathEdge": { - "fields": { - "source": { - "type": "string", - "id": 1 - }, - "destination": { - "type": "string", - "id": 2 - } - } - } - } - }, - "BackupDisasterRecovery": { - "fields": { - "backupTemplate": { - "type": "string", - "id": 1 - }, - "policies": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "host": { - "type": "string", - "id": 3 - }, - "applications": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "storagePool": { - "type": "string", - "id": 5 - }, - "policyOptions": { - "rule": "repeated", - "type": "string", - "id": 6 - }, - "profile": { - "type": "string", - "id": 7 - }, - "appliance": { - "type": "string", - "id": 8 - }, - "backupType": { - "type": "string", - "id": 9 - }, - "backupCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - } - } - }, - "BigQueryExport": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/BigQueryExport", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/bigQueryExports/{export}", - "(google.api.resource).plural": "bigQueryExports", - "(google.api.resource).singular": "bigQueryExport" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "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" - } - } - } - }, - "Chokepoint": { - "fields": { - "relatedFindings": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "CloudArmor": { - "fields": { - "securityPolicy": { - "type": "SecurityPolicy", - "id": 1 - }, - "requests": { - "type": "Requests", - "id": 2 - }, - "adaptiveProtection": { - "type": "AdaptiveProtection", - "id": 3 - }, - "attack": { - "type": "Attack", - "id": 4 - }, - "threatVector": { - "type": "string", - "id": 5 - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 6 - } - } - }, - "SecurityPolicy": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "preview": { - "type": "bool", - "id": 3 - } - } - }, - "Requests": { - "fields": { - "ratio": { - "type": "double", - "id": 1 - }, - "shortTermAllowed": { - "type": "int32", - "id": 2 - }, - "longTermAllowed": { - "type": "int32", - "id": 3 - }, - "longTermDenied": { - "type": "int32", - "id": 4 - } - } - }, - "AdaptiveProtection": { - "fields": { - "confidence": { - "type": "double", - "id": 1 - } - } - }, - "Attack": { - "fields": { - "volumePpsLong": { - "type": "int64", - "id": 4 - }, - "volumeBpsLong": { - "type": "int64", - "id": 5 - }, - "classification": { - "type": "string", - "id": 3 - }, - "volumePps": { - "type": "int32", - "id": 1, - "options": { - "deprecated": true - } - }, - "volumeBps": { - "type": "int32", - "id": 2, - "options": { - "deprecated": true - } - } - } - }, - "CloudDlpDataProfile": { - "fields": { - "dataProfile": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "dlp.googleapis.com/TableDataProfile" - } - }, - "parentType": { - "type": "ParentType", - "id": 2 - } - }, - "nested": { - "ParentType": { - "values": { - "PARENT_TYPE_UNSPECIFIED": 0, - "ORGANIZATION": 1, - "PROJECT": 2 - } - } - } - }, - "CloudDlpInspection": { - "fields": { - "inspectJob": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" - } - }, - "infoType": { - "type": "string", - "id": 2 - }, - "infoTypeCount": { - "type": "int64", - "id": 3 - }, - "fullScan": { - "type": "bool", - "id": 4 - } - } - }, - "Compliance": { - "fields": { - "standard": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - }, - "ids": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "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 - } - } - } - }, - "ContactDetails": { - "fields": { - "contacts": { - "rule": "repeated", - "type": "Contact", - "id": 1 - } - } - }, - "Contact": { - "fields": { - "email": { - "type": "string", - "id": 1 - } - } - }, - "Container": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "uri": { - "type": "string", - "id": 2 - }, - "imageId": { - "type": "string", - "id": 3 - }, - "labels": { - "rule": "repeated", - "type": "Label", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - } - } - }, - "Label": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "type": "string", - "id": 2 - } - } - }, - "DataAccessEvent": { - "fields": { - "eventId": { - "type": "string", - "id": 1 - }, - "principalEmail": { - "type": "string", - "id": 2 - }, - "operation": { - "type": "Operation", - "id": 3 - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - }, - "nested": { - "Operation": { - "values": { - "OPERATION_UNSPECIFIED": 0, - "READ": 1, - "MOVE": 2, - "COPY": 3 - } - } - } - }, - "DataFlowEvent": { - "fields": { - "eventId": { - "type": "string", - "id": 1 - }, - "principalEmail": { - "type": "string", - "id": 2 - }, - "operation": { - "type": "Operation", - "id": 3 - }, - "violatedLocation": { - "type": "string", - "id": 4 - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - } - }, - "nested": { - "Operation": { - "values": { - "OPERATION_UNSPECIFIED": 0, - "READ": 1, - "MOVE": 2, - "COPY": 3 - } - } - } - }, - "DataRetentionDeletionEvent": { - "fields": { - "eventDetectionTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "dataObjectCount": { - "type": "int64", - "id": 3 - }, - "maxRetentionAllowed": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "eventType": { - "type": "EventType", - "id": 5 - } - }, - "nested": { - "EventType": { - "values": { - "EVENT_TYPE_UNSPECIFIED": 0, - "EVENT_TYPE_MAX_TTL_EXCEEDED": 1 - } - } - } - }, - "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 - }, - "version": { - "type": "string", - "id": 6 - } - } - }, - "Disk": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "Exfiltration": { - "fields": { - "sources": { - "rule": "repeated", - "type": "ExfilResource", - "id": 1 - }, - "targets": { - "rule": "repeated", - "type": "ExfilResource", - "id": 2 - }, - "totalExfiltratedBytes": { - "type": "int64", - "id": 3 - } - } - }, - "ExfilResource": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "components": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ExternalSystem": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", - "(google.api.resource).pattern": "projects/{project}/sources/{source}/locations/{location}/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 - }, - "caseUri": { - "type": "string", - "id": 6 - }, - "casePriority": { - "type": "string", - "id": 7 - }, - "caseSla": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "caseCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - }, - "caseCloseTime": { - "type": "google.protobuf.Timestamp", - "id": 11 - }, - "ticketInfo": { - "type": "TicketInfo", - "id": 8 - } - }, - "nested": { - "TicketInfo": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "assignee": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "uri": { - "type": "string", - "id": 4 - }, - "status": { - "type": "string", - "id": 5 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - } - } - } - } - }, - "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 - }, - "diskPath": { - "type": "DiskPath", - "id": 7 - }, - "operations": { - "rule": "repeated", - "type": "FileOperation", - "id": 8 - } - }, - "nested": { - "DiskPath": { - "fields": { - "partitionUuid": { - "type": "string", - "id": 1 - }, - "relativePath": { - "type": "string", - "id": 2 - } - } - }, - "FileOperation": { - "fields": { - "type": { - "type": "OperationType", - "id": 1 - } - }, - "nested": { - "OperationType": { - "values": { - "OPERATION_TYPE_UNSPECIFIED": 0, - "OPEN": 1, - "READ": 2, - "RENAME": 3, - "WRITE": 4, - "EXECUTE": 5 - } - } - } - } - } - }, - "Finding": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Finding", - "(google.api.resource).pattern": "projects/{project}/sources/{source}/locations/{location}/findings/{finding}", - "(google.api.resource).plural": "findings", - "(google.api.resource).singular": "finding" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "canonicalName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "parent": { - "type": "string", - "id": 3 - }, - "resourceName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "category": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "externalUri": { - "type": "string", - "id": 8 - }, - "sourceProperties": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 9 - }, - "securityMarks": { - "type": "SecurityMarks", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 11 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "severity": { - "type": "Severity", - "id": 14 - }, - "mute": { - "type": "Mute", - "id": 15 - }, - "muteInfo": { - "type": "MuteInfo", - "id": 53, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "findingClass": { - "type": "FindingClass", - "id": 16 - }, - "indicator": { - "type": "Indicator", - "id": 17 - }, - "vulnerability": { - "type": "Vulnerability", - "id": 18 - }, - "muteUpdateTime": { - "type": "google.protobuf.Timestamp", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "externalSystems": { - "keyType": "string", - "type": "ExternalSystem", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "mitreAttack": { - "type": "MitreAttack", - "id": 21 - }, - "access": { - "type": "Access", - "id": 22 - }, - "connections": { - "rule": "repeated", - "type": "Connection", - "id": 23 - }, - "muteInitiator": { - "type": "string", - "id": 24 - }, - "processes": { - "rule": "repeated", - "type": "Process", - "id": 25 - }, - "contacts": { - "keyType": "string", - "type": "ContactDetails", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "compliances": { - "rule": "repeated", - "type": "Compliance", - "id": 27 - }, - "parentDisplayName": { - "type": "string", - "id": 29, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 30 - }, - "exfiltration": { - "type": "Exfiltration", - "id": 31 - }, - "iamBindings": { - "rule": "repeated", - "type": "IamBinding", - "id": 32 - }, - "nextSteps": { - "type": "string", - "id": 33 - }, - "moduleName": { - "type": "string", - "id": 34 - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 35 - }, - "kubernetes": { - "type": "Kubernetes", - "id": 36 - }, - "database": { - "type": "Database", - "id": 37 - }, - "attackExposure": { - "type": "AttackExposure", - "id": 38 - }, - "files": { - "rule": "repeated", - "type": "File", - "id": 39 - }, - "cloudDlpInspection": { - "type": "CloudDlpInspection", - "id": 40 - }, - "cloudDlpDataProfile": { - "type": "CloudDlpDataProfile", - "id": 41 - }, - "kernelRootkit": { - "type": "KernelRootkit", - "id": 42 - }, - "orgPolicies": { - "rule": "repeated", - "type": "OrgPolicy", - "id": 43 - }, - "job": { - "type": "Job", - "id": 44 - }, - "application": { - "type": "Application", - "id": 45 - }, - "ipRules": { - "type": "IpRules", - "id": 46 - }, - "backupDisasterRecovery": { - "type": "BackupDisasterRecovery", - "id": 47 - }, - "securityPosture": { - "type": "SecurityPosture", - "id": 48 - }, - "logEntries": { - "rule": "repeated", - "type": "LogEntry", - "id": 49 - }, - "loadBalancers": { - "rule": "repeated", - "type": "LoadBalancer", - "id": 50 - }, - "cloudArmor": { - "type": "CloudArmor", - "id": 51 - }, - "notebook": { - "type": "Notebook", - "id": 55 - }, - "toxicCombination": { - "type": "ToxicCombination", - "id": 56 - }, - "groupMemberships": { - "rule": "repeated", - "type": "GroupMembership", - "id": 57 - }, - "disk": { - "type": "Disk", - "id": 58 - }, - "dataAccessEvents": { - "rule": "repeated", - "type": "DataAccessEvent", - "id": 61 - }, - "dataFlowEvents": { - "rule": "repeated", - "type": "DataFlowEvent", - "id": 62 - }, - "networks": { - "rule": "repeated", - "type": "Network", - "id": 63 - }, - "dataRetentionDeletionEvents": { - "rule": "repeated", - "type": "DataRetentionDeletionEvent", - "id": 64 - }, - "affectedResources": { - "type": "AffectedResources", - "id": 65 - }, - "aiModel": { - "type": "AiModel", - "id": 66 - }, - "chokepoint": { - "type": "Chokepoint", - "id": 69 - }, - "vertexAi": { - "type": "VertexAi", - "id": 72 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2 - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "CRITICAL": 1, - "HIGH": 2, - "MEDIUM": 3, - "LOW": 4 - } - }, - "Mute": { - "values": { - "MUTE_UNSPECIFIED": 0, - "MUTED": 1, - "UNMUTED": 2, - "UNDEFINED": 3 - } - }, - "MuteInfo": { - "fields": { - "staticMute": { - "type": "StaticMute", - "id": 1 - }, - "dynamicMuteRecords": { - "rule": "repeated", - "type": "DynamicMuteRecord", - "id": 2 - } - }, - "nested": { - "StaticMute": { - "fields": { - "state": { - "type": "Mute", - "id": 1 - }, - "applyTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "DynamicMuteRecord": { - "fields": { - "muteConfig": { - "type": "string", - "id": 1 - }, - "matchTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - }, - "FindingClass": { - "values": { - "FINDING_CLASS_UNSPECIFIED": 0, - "THREAT": 1, - "VULNERABILITY": 2, - "MISCONFIGURATION": 3, - "OBSERVATION": 4, - "SCC_ERROR": 5, - "POSTURE_VIOLATION": 6, - "TOXIC_COMBINATION": 7, - "SENSITIVE_DATA_RISK": 8, - "CHOKEPOINT": 9 - } - } - } - }, - "GroupMembership": { - "fields": { - "groupType": { - "type": "GroupType", - "id": 1 - }, - "groupId": { - "type": "string", - "id": 2 - } - }, - "nested": { - "GroupType": { - "values": { - "GROUP_TYPE_UNSPECIFIED": 0, - "GROUP_TYPE_TOXIC_COMBINATION": 1, - "GROUP_TYPE_CHOKEPOINT": 3 - } - } - } - }, - "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": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "domains": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "signatures": { - "rule": "repeated", - "type": "ProcessSignature", - "id": 3 - }, - "uris": { - "rule": "repeated", - "type": "string", - "id": 4 - } - }, - "nested": { - "ProcessSignature": { - "oneofs": { - "signature": { - "oneof": [ - "memoryHashSignature", - "yaraRuleSignature" - ] - } - }, - "fields": { - "memoryHashSignature": { - "type": "MemoryHashSignature", - "id": 6 - }, - "yaraRuleSignature": { - "type": "YaraRuleSignature", - "id": 7 - }, - "signatureType": { - "type": "SignatureType", - "id": 8 - } - }, - "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 - } - } - }, - "SignatureType": { - "values": { - "SIGNATURE_TYPE_UNSPECIFIED": 0, - "SIGNATURE_TYPE_PROCESS": 1, - "SIGNATURE_TYPE_FILE": 2 - } - } - } - } - } - }, - "IpRules": { - "oneofs": { - "rules": { - "oneof": [ - "allowed", - "denied" - ] - } - }, - "fields": { - "direction": { - "type": "Direction", - "id": 1 - }, - "allowed": { - "type": "Allowed", - "id": 2 - }, - "denied": { - "type": "Denied", - "id": 3 - }, - "sourceIpRanges": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "destinationIpRanges": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "exposedServices": { - "rule": "repeated", - "type": "string", - "id": 6 - } - }, - "nested": { - "Direction": { - "values": { - "DIRECTION_UNSPECIFIED": 0, - "INGRESS": 1, - "EGRESS": 2 - } - } - } - }, - "IpRule": { - "fields": { - "protocol": { - "type": "string", - "id": 1 - }, - "portRanges": { - "rule": "repeated", - "type": "PortRange", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PortRange": { - "fields": { - "min": { - "type": "int64", - "id": 1 - }, - "max": { - "type": "int64", - "id": 2 - } - } - } - } - }, - "Allowed": { - "fields": { - "ipRules": { - "rule": "repeated", - "type": "IpRule", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Denied": { - "fields": { - "ipRules": { - "rule": "repeated", - "type": "IpRule", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Job": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "state": { - "type": "JobState", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorCode": { - "type": "int32", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - }, - "JobState": { - "values": { - "JOB_STATE_UNSPECIFIED": 0, - "PENDING": 1, - "RUNNING": 2, - "SUCCEEDED": 3, - "FAILED": 4 - } - }, - "KernelRootkit": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "unexpectedCodeModification": { - "type": "bool", - "id": 2 - }, - "unexpectedReadOnlyDataModification": { - "type": "bool", - "id": 3 - }, - "unexpectedFtraceHandler": { - "type": "bool", - "id": 4 - }, - "unexpectedKprobeHandler": { - "type": "bool", - "id": 5 - }, - "unexpectedKernelCodePages": { - "type": "bool", - "id": 6 - }, - "unexpectedSystemCallHandler": { - "type": "bool", - "id": 7 - }, - "unexpectedInterruptHandler": { - "type": "bool", - "id": 8 - }, - "unexpectedProcessesInRunqueue": { - "type": "bool", - "id": 9 - } - } - }, - "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 - }, - "objects": { - "rule": "repeated", - "type": "Object", - "id": 7 - } - }, - "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 - } - } - }, - "Object": { - "fields": { - "group": { - "type": "string", - "id": 1 - }, - "kind": { - "type": "string", - "id": 2 - }, - "ns": { - "type": "string", - "id": 3 - }, - "name": { - "type": "string", - "id": 4 - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 5 - } - } - } - } - }, - "LoadBalancer": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "LogEntry": { - "oneofs": { - "logEntry": { - "oneof": [ - "cloudLoggingEntry" - ] - } - }, - "fields": { - "cloudLoggingEntry": { - "type": "CloudLoggingEntry", - "id": 1 - } - } - }, - "CloudLoggingEntry": { - "fields": { - "insertId": { - "type": "string", - "id": 1 - }, - "logId": { - "type": "string", - "id": 2 - }, - "resourceContainer": { - "type": "string", - "id": 3 - }, - "timestamp": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "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, - "DATA_OBFUSCATION": 70, - "DATA_OBFUSCATION_STEGANOGRAPHY": 71, - "OS_CREDENTIAL_DUMPING": 114, - "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM": 115, - "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW": 122, - "DATA_FROM_LOCAL_SYSTEM": 117, - "AUTOMATED_EXFILTRATION": 68, - "OBFUSCATED_FILES_OR_INFO": 72, - "STEGANOGRAPHY": 73, - "COMPILE_AFTER_DELIVERY": 74, - "COMMAND_OBFUSCATION": 75, - "SCHEDULED_TRANSFER": 120, - "SYSTEM_OWNER_USER_DISCOVERY": 118, - "MASQUERADING": 49, - "MATCH_LEGITIMATE_NAME_OR_LOCATION": 50, - "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS": 37, - "STARTUP_ITEMS": 38, - "NETWORK_SERVICE_DISCOVERY": 32, - "SCHEDULED_TASK_JOB": 89, - "SCHEDULED_TASK_JOB_CRON": 119, - "CONTAINER_ORCHESTRATION_JOB": 90, - "PROCESS_INJECTION": 93, - "INPUT_CAPTURE": 103, - "INPUT_CAPTURE_KEYLOGGING": 104, - "PROCESS_DISCOVERY": 56, - "COMMAND_AND_SCRIPTING_INTERPRETER": 6, - "UNIX_SHELL": 7, - "PYTHON": 59, - "EXPLOITATION_FOR_PRIVILEGE_ESCALATION": 63, - "PERMISSION_GROUPS_DISCOVERY": 18, - "CLOUD_GROUPS": 19, - "INDICATOR_REMOVAL": 123, - "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS": 124, - "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY": 125, - "INDICATOR_REMOVAL_FILE_DELETION": 64, - "INDICATOR_REMOVAL_TIMESTOMP": 128, - "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA": 126, - "APPLICATION_LAYER_PROTOCOL": 45, - "DNS": 46, - "SOFTWARE_DEPLOYMENT_TOOLS": 47, - "VALID_ACCOUNTS": 14, - "DEFAULT_ACCOUNTS": 35, - "LOCAL_ACCOUNTS": 15, - "CLOUD_ACCOUNTS": 16, - "FILE_AND_DIRECTORY_DISCOVERY": 121, - "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT": 116, - "PROXY": 9, - "EXTERNAL_PROXY": 10, - "MULTI_HOP_PROXY": 11, - "ACCOUNT_MANIPULATION": 22, - "ADDITIONAL_CLOUD_CREDENTIALS": 40, - "ADDITIONAL_CLOUD_ROLES": 67, - "SSH_AUTHORIZED_KEYS": 23, - "ADDITIONAL_CONTAINER_CLUSTER_ROLES": 58, - "MULTI_STAGE_CHANNELS": 76, - "INGRESS_TOOL_TRANSFER": 3, - "NATIVE_API": 4, - "BRUTE_FORCE": 44, - "AUTOMATED_COLLECTION": 94, - "SHARED_MODULES": 5, - "DATA_ENCODING": 77, - "STANDARD_ENCODING": 78, - "ACCESS_TOKEN_MANIPULATION": 33, - "TOKEN_IMPERSONATION_OR_THEFT": 39, - "CREATE_ACCOUNT": 79, - "LOCAL_ACCOUNT": 80, - "DEOBFUSCATE_DECODE_FILES_OR_INFO": 95, - "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, - "SUPPLY_CHAIN_COMPROMISE": 129, - "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS": 130, - "EXPLOITATION_FOR_CLIENT_EXECUTION": 134, - "USER_EXECUTION": 69, - "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION": 135, - "DOMAIN_POLICY_MODIFICATION": 30, - "DATA_DESTRUCTION": 29, - "DATA_ENCRYPTED_FOR_IMPACT": 132, - "SERVICE_STOP": 52, - "INHIBIT_SYSTEM_RECOVERY": 36, - "FIRMWARE_CORRUPTION": 81, - "RESOURCE_HIJACKING": 8, - "NETWORK_DENIAL_OF_SERVICE": 17, - "CLOUD_SERVICE_DISCOVERY": 48, - "STEAL_APPLICATION_ACCESS_TOKEN": 42, - "ACCOUNT_ACCESS_REMOVAL": 51, - "TRANSFER_DATA_TO_CLOUD_ACCOUNT": 91, - "STEAL_WEB_SESSION_COOKIE": 25, - "CREATE_OR_MODIFY_SYSTEM_PROCESS": 24, - "EVENT_TRIGGERED_EXECUTION": 65, - "BOOT_OR_LOGON_AUTOSTART_EXECUTION": 82, - "KERNEL_MODULES_AND_EXTENSIONS": 83, - "SHORTCUT_MODIFICATION": 127, - "ABUSE_ELEVATION_CONTROL_MECHANISM": 34, - "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID": 136, - "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING": 109, - "UNSECURED_CREDENTIALS": 13, - "CREDENTIALS_IN_FILES": 105, - "BASH_HISTORY": 96, - "PRIVATE_KEYS": 97, - "SUBVERT_TRUST_CONTROL": 106, - "INSTALL_ROOT_CERTIFICATE": 107, - "COMPROMISE_HOST_SOFTWARE_BINARY": 84, - "CREDENTIALS_FROM_PASSWORD_STORES": 98, - "MODIFY_AUTHENTICATION_PROCESS": 28, - "PLUGGABLE_AUTHENTICATION_MODULES": 108, - "MULTI_FACTOR_AUTHENTICATION": 137, - "IMPAIR_DEFENSES": 31, - "DISABLE_OR_MODIFY_TOOLS": 55, - "INDICATOR_BLOCKING": 110, - "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM": 111, - "HIDE_ARTIFACTS": 85, - "HIDDEN_FILES_AND_DIRECTORIES": 86, - "HIDDEN_USERS": 87, - "EXFILTRATION_OVER_WEB_SERVICE": 20, - "EXFILTRATION_TO_CLOUD_STORAGE": 21, - "DYNAMIC_RESOLUTION": 12, - "LATERAL_TOOL_TRANSFER": 41, - "HIJACK_EXECUTION_FLOW": 112, - "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING": 113, - "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": 26, - "CREATE_SNAPSHOT": 54, - "CLOUD_INFRASTRUCTURE_DISCOVERY": 53, - "DEVELOP_CAPABILITIES": 99, - "DEVELOP_CAPABILITIES_MALWARE": 100, - "OBTAIN_CAPABILITIES": 43, - "OBTAIN_CAPABILITIES_MALWARE": 101, - "OBTAIN_CAPABILITIES_VULNERABILITIES": 133, - "ACTIVE_SCANNING": 1, - "SCANNING_IP_BLOCKS": 2, - "STAGE_CAPABILITIES": 88, - "UPLOAD_MALWARE": 102, - "CONTAINER_ADMINISTRATION_COMMAND": 60, - "DEPLOY_CONTAINER": 66, - "ESCAPE_TO_HOST": 61, - "CONTAINER_AND_RESOURCE_DISCOVERY": 57, - "REFLECTIVE_CODE_LOADING": 92, - "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES": 62, - "FINANCIAL_THEFT": 131 - } - } - } - }, - "Network": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "Notebook": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "lastAuthor": { - "type": "string", - "id": 3 - }, - "notebookUpdateTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "OrgPolicy": { - "options": { - "(google.api.resource).type": "orgpolicy.googleapis.com/Policy", - "(google.api.resource).pattern": "projects/{project}/policies/{constraint_name}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - } - } - }, - "Process": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "binary": { - "type": "File", - "id": 2 - }, - "libraries": { - "rule": "repeated", - "type": "File", - "id": 3 - }, - "script": { - "type": "File", - "id": 4 - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "argumentsTruncated": { - "type": "bool", - "id": 6 - }, - "envVariables": { - "rule": "repeated", - "type": "EnvironmentVariable", - "id": 7 - }, - "envVariablesTruncated": { - "type": "bool", - "id": 8 - }, - "pid": { - "type": "int64", - "id": 9 - }, - "parentPid": { - "type": "int64", - "id": 10 - }, - "userId": { - "type": "int64", - "id": 11 - } - } - }, - "EnvironmentVariable": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "val": { - "type": "string", - "id": 2 - } - } - }, - "SecurityMarks": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", - "(google.api.resource).pattern": "projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "marks": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "canonicalName": { - "type": "string", - "id": 3 - } - } - }, - "SecurityPosture": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "revisionId": { - "type": "string", - "id": 2 - }, - "postureDeploymentResource": { - "type": "string", - "id": 3 - }, - "postureDeployment": { - "type": "string", - "id": 4 - }, - "changedPolicy": { - "type": "string", - "id": 5 - }, - "policySet": { - "type": "string", - "id": 6 - }, - "policy": { - "type": "string", - "id": 7 - }, - "policyDriftDetails": { - "rule": "repeated", - "type": "PolicyDriftDetails", - "id": 8 - } - }, - "nested": { - "PolicyDriftDetails": { - "fields": { - "field": { - "type": "string", - "id": 1 - }, - "expectedValue": { - "type": "string", - "id": 2 - }, - "detectedValue": { - "type": "string", - "id": 3 - } - } - } - } - }, - "ToxicCombination": { - "fields": { - "attackExposureScore": { - "type": "double", - "id": 1 - }, - "relatedFindings": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "VertexAi": { - "fields": { - "datasets": { - "rule": "repeated", - "type": "Dataset", - "id": 1 - }, - "pipelines": { - "rule": "repeated", - "type": "Pipeline", - "id": 2 - } - }, - "nested": { - "Dataset": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "source": { - "type": "string", - "id": 3 - } - } - }, - "Pipeline": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - } - } - } - } - }, - "Vulnerability": { - "fields": { - "cve": { - "type": "Cve", - "id": 1 - }, - "offendingPackage": { - "type": "Package", - "id": 2 - }, - "fixedPackage": { - "type": "Package", - "id": 3 - }, - "securityBulletin": { - "type": "SecurityBulletin", - "id": 4 - }, - "providerRiskScore": { - "type": "int64", - "id": 5 - }, - "reachable": { - "type": "bool", - "id": 6 - }, - "cwes": { - "rule": "repeated", - "type": "Cwe", - "id": 7 - } - } - }, - "Cve": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "references": { - "rule": "repeated", - "type": "Reference", - "id": 2 - }, - "cvssv3": { - "type": "Cvssv3", - "id": 3 - }, - "upstreamFixAvailable": { - "type": "bool", - "id": 4 - }, - "impact": { - "type": "RiskRating", - "id": 5 - }, - "exploitationActivity": { - "type": "ExploitationActivity", - "id": 6 - }, - "observedInTheWild": { - "type": "bool", - "id": 7 - }, - "zeroDay": { - "type": "bool", - "id": 8 - }, - "exploitReleaseDate": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "firstExploitationDate": { - "type": "google.protobuf.Timestamp", - "id": 10 - } - }, - "nested": { - "RiskRating": { - "values": { - "RISK_RATING_UNSPECIFIED": 0, - "LOW": 1, - "MEDIUM": 2, - "HIGH": 3, - "CRITICAL": 4 - } - }, - "ExploitationActivity": { - "values": { - "EXPLOITATION_ACTIVITY_UNSPECIFIED": 0, - "WIDE": 1, - "CONFIRMED": 2, - "AVAILABLE": 3, - "ANTICIPATED": 4, - "NO_KNOWN": 5 - } - } - } - }, - "Reference": { - "fields": { - "source": { - "type": "string", - "id": 1 - }, - "uri": { - "type": "string", - "id": 2 - } - } - }, - "Cvssv3": { - "fields": { - "baseScore": { - "type": "double", - "id": 1 - }, - "attackVector": { - "type": "AttackVector", - "id": 2 - }, - "attackComplexity": { - "type": "AttackComplexity", - "id": 3 - }, - "privilegesRequired": { - "type": "PrivilegesRequired", - "id": 4 - }, - "userInteraction": { - "type": "UserInteraction", - "id": 5 - }, - "scope": { - "type": "Scope", - "id": 6 - }, - "confidentialityImpact": { - "type": "Impact", - "id": 7 - }, - "integrityImpact": { - "type": "Impact", - "id": 8 - }, - "availabilityImpact": { - "type": "Impact", - "id": 9 - } - }, - "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 - } - } - } - }, - "Package": { - "fields": { - "packageName": { - "type": "string", - "id": 1 - }, - "cpeUri": { - "type": "string", - "id": 2 - }, - "packageType": { - "type": "string", - "id": 3 - }, - "packageVersion": { - "type": "string", - "id": 4 - } - } - }, - "SecurityBulletin": { - "fields": { - "bulletinId": { - "type": "string", - "id": 1 - }, - "submissionTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "suggestedUpgradeVersion": { - "type": "string", - "id": 3 - } - } - }, - "Cwe": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "references": { - "rule": "repeated", - "type": "Reference", - "id": 2 - } - } - }, - "Folder": { - "fields": { - "resourceFolder": { - "type": "string", - "id": 1 - }, - "resourceFolderDisplayName": { - "type": "string", - "id": 2 - } - } - }, - "MuteConfig": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/MuteConfig", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/muteConfigs/{mute_config}", - "(google.api.resource).plural": "muteConfigs", - "(google.api.resource).singular": "muteConfig" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "description": { - "type": "string", - "id": 2 - }, - "filter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "mostRecentEditor": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "MuteConfigType", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "expiryTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MuteConfigType": { - "values": { - "MUTE_CONFIG_TYPE_UNSPECIFIED": 0, - "STATIC": 1, - "DYNAMIC": 2 - } - } - } - }, - "NotificationConfig": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/notificationConfigs/{notification_config}", - "(google.api.resource).plural": "notificationConfigs", - "(google.api.resource).singular": "notificationConfig" - }, - "oneofs": { - "notifyConfig": { - "oneof": [ - "streamingConfig" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "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 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "StreamingConfig": { - "fields": { - "filter": { - "type": "string", - "id": 1 - } - } - } - } - }, - "NotificationMessage": { - "oneofs": { - "event": { - "oneof": [ - "finding" - ] - } - }, - "fields": { - "notificationConfigName": { - "type": "string", - "id": 1 - }, - "finding": { - "type": "Finding", - "id": 2 - }, - "resource": { - "type": "Resource", - "id": 3 - } - } - }, - "Resource": { - "oneofs": { - "cloudProviderMetadata": { - "oneof": [ - "gcpMetadata", - "awsMetadata", - "azureMetadata" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "cloudProvider": { - "type": "CloudProvider", - "id": 4 - }, - "service": { - "type": "string", - "id": 5 - }, - "location": { - "type": "string", - "id": 6 - }, - "gcpMetadata": { - "type": "GcpMetadata", - "id": 7 - }, - "awsMetadata": { - "type": "AwsMetadata", - "id": 8 - }, - "azureMetadata": { - "type": "AzureMetadata", - "id": 9 - }, - "resourcePath": { - "type": "ResourcePath", - "id": 10 - }, - "resourcePathString": { - "type": "string", - "id": 11 - } - } - }, - "CloudProvider": { - "values": { - "CLOUD_PROVIDER_UNSPECIFIED": 0, - "GOOGLE_CLOUD_PLATFORM": 1, - "AMAZON_WEB_SERVICES": 2, - "MICROSOFT_AZURE": 3 - } - }, - "GcpMetadata": { - "fields": { - "project": { - "type": "string", - "id": 1 - }, - "projectDisplayName": { - "type": "string", - "id": 2 - }, - "parent": { - "type": "string", - "id": 3 - }, - "parentDisplayName": { - "type": "string", - "id": 4 - }, - "folders": { - "rule": "repeated", - "type": "Folder", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "organization": { - "type": "string", - "id": 6 - } - } - }, - "AwsMetadata": { - "fields": { - "organization": { - "type": "AwsOrganization", - "id": 1 - }, - "organizationalUnits": { - "rule": "repeated", - "type": "AwsOrganizationalUnit", - "id": 2 - }, - "account": { - "type": "AwsAccount", - "id": 3 - } - }, - "nested": { - "AwsOrganization": { - "fields": { - "id": { - "type": "string", - "id": 1 - } - } - }, - "AwsOrganizationalUnit": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "name": { - "type": "string", - "id": 2 - } - } - }, - "AwsAccount": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "name": { - "type": "string", - "id": 2 - } - } - } - } - }, - "AzureMetadata": { - "fields": { - "managementGroups": { - "rule": "repeated", - "type": "AzureManagementGroup", - "id": 1 - }, - "subscription": { - "type": "AzureSubscription", - "id": 2 - }, - "resourceGroup": { - "type": "AzureResourceGroup", - "id": 3 - }, - "tenant": { - "type": "AzureTenant", - "id": 7 - } - }, - "nested": { - "AzureManagementGroup": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - } - } - }, - "AzureSubscription": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - } - } - }, - "AzureResourceGroup": { - "fields": { - "id": { - "type": "string", - "id": 2 - }, - "name": { - "type": "string", - "id": 1 - } - } - }, - "AzureTenant": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - } - } - } - } - }, - "ResourcePath": { - "fields": { - "nodes": { - "rule": "repeated", - "type": "ResourcePathNode", - "id": 1 - } - }, - "nested": { - "ResourcePathNodeType": { - "values": { - "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED": 0, - "GCP_ORGANIZATION": 1, - "GCP_FOLDER": 2, - "GCP_PROJECT": 3, - "AWS_ORGANIZATION": 4, - "AWS_ORGANIZATIONAL_UNIT": 5, - "AWS_ACCOUNT": 6, - "AZURE_MANAGEMENT_GROUP": 7, - "AZURE_SUBSCRIPTION": 8, - "AZURE_RESOURCE_GROUP": 9 - } - }, - "ResourcePathNode": { - "fields": { - "nodeType": { - "type": "ResourcePathNodeType", - "id": 1 - }, - "id": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - } - } - } - } - }, - "ResourceValueConfig": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/ResourceValueConfig", - "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}", - "(google.api.resource).plural": "resourceValueConfigs", - "(google.api.resource).singular": "resourceValueConfig" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "resourceValue": { - "type": "ResourceValue", - "id": 2 - }, - "tagValues": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "resourceType": { - "type": "string", - "id": 4 - }, - "scope": { - "type": "string", - "id": 5 - }, - "resourceLabelsSelector": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "description": { - "type": "string", - "id": 7 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudProvider": { - "type": "CloudProvider", - "id": 10 - }, - "sensitiveDataProtectionMapping": { - "type": "SensitiveDataProtectionMapping", - "id": 11 - } - }, - "nested": { - "SensitiveDataProtectionMapping": { - "fields": { - "highSensitivityMapping": { - "type": "ResourceValue", - "id": 1 - }, - "mediumSensitivityMapping": { - "type": "ResourceValue", - "id": 2 - } - } - } - } - }, - "ResourceValue": { - "values": { - "RESOURCE_VALUE_UNSPECIFIED": 0, - "HIGH": 1, - "MEDIUM": 2, - "LOW": 3, - "NONE": 4 - } - }, - "SecurityCenter": { - "options": { - "(google.api.default_host)": "securitycenter.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "BatchCreateResourceValueConfigs": { - "requestType": "BatchCreateResourceValueConfigsRequest", - "responseType": "BatchCreateResourceValueConfigsResponse", - "options": { - "(google.api.http).post": "/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,requests" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate", - "body": "*", - "additional_bindings": { - "post": "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "parent,requests" - } - ] - }, - "BulkMuteFindings": { - "requestType": "BulkMuteFindingsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=organizations/*}/findings:bulkMute", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/findings:bulkMute", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent", - "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v2.BulkMuteFindingsResponse", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=organizations/*}/findings:bulkMute", - "body": "*", - "additional_bindings": [ - { - "post": "/v2/{parent=organizations/*/locations/*}/findings:bulkMute", - "body": "*" - }, - { - "post": "/v2/{parent=folders/*}/findings:bulkMute", - "body": "*" - }, - { - "post": "/v2/{parent=folders/*/locations/*}/findings:bulkMute", - "body": "*" - }, - { - "post": "/v2/{parent=projects/*}/findings:bulkMute", - "body": "*" - }, - { - "post": "/v2/{parent=projects/*/locations/*}/findings:bulkMute", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.securitycenter.v2.BulkMuteFindingsResponse", - "metadata_type": "google.protobuf.Empty" - } - } - ] - }, - "CreateBigQueryExport": { - "requestType": "CreateBigQueryExportRequest", - "responseType": "BigQueryExport", - "options": { - "(google.api.http).post": "/v2/{parent=organizations/*/locations/*}/bigQueryExports", - "(google.api.http).body": "big_query_export", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/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": "/v2/{parent=organizations/*/locations/*}/bigQueryExports", - "body": "big_query_export", - "additional_bindings": [ - { - "post": "/v2/{parent=folders/*/locations/*}/bigQueryExports", - "body": "big_query_export" - }, - { - "post": "/v2/{parent=projects/*/locations/*}/bigQueryExports", - "body": "big_query_export" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,big_query_export,big_query_export_id" - } - ] - }, - "CreateFinding": { - "requestType": "CreateFindingRequest", - "responseType": "Finding", - "options": { - "(google.api.http).post": "/v2/{parent=organizations/*/sources/*/locations/*}/findings", - "(google.api.http).body": "finding", - "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/sources/*}/findings", - "(google.api.http).additional_bindings.body": "finding", - "(google.api.method_signature)": "parent,finding,finding_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=organizations/*/sources/*/locations/*}/findings", - "body": "finding", - "additional_bindings": { - "post": "/v2/{parent=organizations/*/sources/*}/findings", - "body": "finding" - } - } - }, - { - "(google.api.method_signature)": "parent,finding,finding_id" - } - ] - }, - "CreateMuteConfig": { - "requestType": "CreateMuteConfigRequest", - "responseType": "MuteConfig", - "options": { - "(google.api.http).post": "/v2/{parent=organizations/*/locations/*}/muteConfigs", - "(google.api.http).body": "mute_config", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*}/muteConfigs", - "(google.api.http).additional_bindings.body": "mute_config", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}", - "(google.api.method_signature)": "parent,mute_config,mute_config_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=organizations/*/locations/*}/muteConfigs", - "body": "mute_config", - "additional_bindings": [ - { - "post": "/v2/{parent=folders/*/locations/*}/muteConfigs", - "body": "mute_config" - }, - { - "post": "/v2/{parent=projects/*/locations/*}/muteConfigs", - "body": "mute_config" - }, - { - "post": "/v2/{parent=organizations/*}/muteConfigs", - "body": "mute_config" - }, - { - "post": "/v2/{parent=folders/*}/muteConfigs", - "body": "mute_config" - }, - { - "post": "/v2/{parent=projects/*}/muteConfigs", - "body": "mute_config" - } - ] - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - }, - { - "field": "parent", - "path_template": "organizations/*/locations/{location=*}" - }, - { - "field": "parent", - "path_template": "folders/*/locations/{location=*}" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,mute_config,mute_config_id" - } - ] - }, - "CreateNotificationConfig": { - "requestType": "CreateNotificationConfigRequest", - "responseType": "NotificationConfig", - "options": { - "(google.api.http).post": "/v2/{parent=organizations/*/locations/*}/notificationConfigs", - "(google.api.http).body": "notification_config", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/notificationConfigs", - "(google.api.http).additional_bindings.body": "notification_config", - "(google.api.method_signature)": "parent,notification_config,config_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=organizations/*/locations/*}/notificationConfigs", - "body": "notification_config", - "additional_bindings": [ - { - "post": "/v2/{parent=folders/*/locations/*}/notificationConfigs", - "body": "notification_config" - }, - { - "post": "/v2/{parent=projects/*/locations/*}/notificationConfigs", - "body": "notification_config" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,notification_config,config_id" - } - ] - }, - "CreateSource": { - "requestType": "CreateSourceRequest", - "responseType": "Source", - "options": { - "(google.api.http).post": "/v2/{parent=organizations/*}/sources", - "(google.api.http).body": "source", - "(google.api.method_signature)": "parent,source" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=organizations/*}/sources", - "body": "source" - } - }, - { - "(google.api.method_signature)": "parent,source" - } - ] - }, - "DeleteBigQueryExport": { - "requestType": "DeleteBigQueryExportRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2/{name=organizations/*/locations/*/bigQueryExports/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/bigQueryExports/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=organizations/*/locations/*/bigQueryExports/*}", - "additional_bindings": [ - { - "delete": "/v2/{name=folders/*/locations/*/bigQueryExports/*}" - }, - { - "delete": "/v2/{name=projects/*/locations/*/bigQueryExports/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteMuteConfig": { - "requestType": "DeleteMuteConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2/{name=organizations/*/muteConfigs/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/muteConfigs/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}/muteConfigs/*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=organizations/*/muteConfigs/*}", - "additional_bindings": [ - { - "delete": "/v2/{name=organizations/*/locations/*/muteConfigs/*}" - }, - { - "delete": "/v2/{name=folders/*/muteConfigs/*}" - }, - { - "delete": "/v2/{name=folders/*/locations/*/muteConfigs/*}" - }, - { - "delete": "/v2/{name=projects/*/muteConfigs/*}" - }, - { - "delete": "/v2/{name=projects/*/locations/*/muteConfigs/*}" - } - ] - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "name", - "path_template": "projects/*/locations/{location=*}/muteConfigs/*" - }, - { - "field": "name", - "path_template": "organizations/*/locations/{location=*}/muteConfigs/*" - }, - { - "field": "name", - "path_template": "folders/*/locations/{location=*}/muteConfigs/*" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteNotificationConfig": { - "requestType": "DeleteNotificationConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2/{name=organizations/*/locations/*/notificationConfigs/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/notificationConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=organizations/*/locations/*/notificationConfigs/*}", - "additional_bindings": [ - { - "delete": "/v2/{name=folders/*/locations/*/notificationConfigs/*}" - }, - { - "delete": "/v2/{name=projects/*/locations/*/notificationConfigs/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteResourceValueConfig": { - "requestType": "DeleteResourceValueConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2/{name=organizations/*/resourceValueConfigs/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=organizations/*/resourceValueConfigs/*}", - "additional_bindings": { - "delete": "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetBigQueryExport": { - "requestType": "GetBigQueryExportRequest", - "responseType": "BigQueryExport", - "options": { - "(google.api.http).get": "/v2/{name=organizations/*/locations/*/bigQueryExports/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/bigQueryExports/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=organizations/*/locations/*/bigQueryExports/*}", - "additional_bindings": [ - { - "get": "/v2/{name=folders/*/locations/*/bigQueryExports/*}" - }, - { - "get": "/v2/{name=projects/*/locations/*/bigQueryExports/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetSimulation": { - "requestType": "GetSimulationRequest", - "responseType": "Simulation", - "options": { - "(google.api.http).get": "/v2/{name=organizations/*/simulations/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/locations/*/simulations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=organizations/*/simulations/*}", - "additional_bindings": { - "get": "/v2/{name=organizations/*/locations/*/simulations/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetValuedResource": { - "requestType": "GetValuedResourceRequest", - "responseType": "ValuedResource", - "options": { - "(google.api.http).get": "/v2/{name=organizations/*/simulations/*/valuedResources/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/locations/*/simulations/*/valuedResources/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=organizations/*/simulations/*/valuedResources/*}", - "additional_bindings": { - "get": "/v2/{name=organizations/*/locations/*/simulations/*/valuedResources/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=organizations/*/sources/*}:getIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=organizations/*/sources/*}:getIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "GetMuteConfig": { - "requestType": "GetMuteConfigRequest", - "responseType": "MuteConfig", - "options": { - "(google.api.http).get": "/v2/{name=organizations/*/muteConfigs/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/muteConfigs/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}/muteConfigs/*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=organizations/*/muteConfigs/*}", - "additional_bindings": [ - { - "get": "/v2/{name=organizations/*/locations/*/muteConfigs/*}" - }, - { - "get": "/v2/{name=folders/*/muteConfigs/*}" - }, - { - "get": "/v2/{name=folders/*/locations/*/muteConfigs/*}" - }, - { - "get": "/v2/{name=projects/*/muteConfigs/*}" - }, - { - "get": "/v2/{name=projects/*/locations/*/muteConfigs/*}" - } - ] - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "name", - "path_template": "projects/*/locations/{location=*}/muteConfigs/*" - }, - { - "field": "name", - "path_template": "organizations/*/locations/{location=*}/muteConfigs/*" - }, - { - "field": "name", - "path_template": "folders/*/locations/{location=*}/muteConfigs/*" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetNotificationConfig": { - "requestType": "GetNotificationConfigRequest", - "responseType": "NotificationConfig", - "options": { - "(google.api.http).get": "/v2/{name=organizations/*/locations/*/notificationConfigs/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/notificationConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=organizations/*/locations/*/notificationConfigs/*}", - "additional_bindings": [ - { - "get": "/v2/{name=folders/*/locations/*/notificationConfigs/*}" - }, - { - "get": "/v2/{name=projects/*/locations/*/notificationConfigs/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetResourceValueConfig": { - "requestType": "GetResourceValueConfigRequest", - "responseType": "ResourceValueConfig", - "options": { - "(google.api.http).get": "/v2/{name=organizations/*/resourceValueConfigs/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=organizations/*/resourceValueConfigs/*}", - "additional_bindings": { - "get": "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetSource": { - "requestType": "GetSourceRequest", - "responseType": "Source", - "options": { - "(google.api.http).get": "/v2/{name=organizations/*/sources/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=organizations/*/sources/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GroupFindings": { - "requestType": "GroupFindingsRequest", - "responseType": "GroupFindingsResponse", - "options": { - "(google.api.http).post": "/v2/{parent=organizations/*/sources/*}/findings:group", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/sources/*/locations/*}/findings:group", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,group_by" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=organizations/*/sources/*}/findings:group", - "body": "*", - "additional_bindings": [ - { - "post": "/v2/{parent=organizations/*/sources/*/locations/*}/findings:group", - "body": "*" - }, - { - "post": "/v2/{parent=folders/*/sources/*}/findings:group", - "body": "*" - }, - { - "post": "/v2/{parent=folders/*/sources/*/locations/*}/findings:group", - "body": "*" - }, - { - "post": "/v2/{parent=projects/*/sources/*}/findings:group", - "body": "*" - }, - { - "post": "/v2/{parent=projects/*/sources/*/locations/*}/findings:group", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "parent,group_by" - } - ] - }, - "ListAttackPaths": { - "requestType": "ListAttackPathsRequest", - "responseType": "ListAttackPathsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=organizations/*/simulations/*}/attackPaths", - "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/locations/*/simulations/*/attackExposureResults/*}/attackPaths", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=organizations/*/simulations/*}/attackPaths", - "additional_bindings": [ - { - "get": "/v2/{parent=organizations/*}/attackPaths" - }, - { - "get": "/v2/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" - }, - { - "get": "/v2/{parent=organizations/*/locations/*/simulations/*/valuedResources/*}/attackPaths" - }, - { - "get": "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" - }, - { - "get": "/v2/{parent=organizations/*/locations/*/simulations/*/attackExposureResults/*}/attackPaths" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListBigQueryExports": { - "requestType": "ListBigQueryExportsRequest", - "responseType": "ListBigQueryExportsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=organizations/*/locations/*}/bigQueryExports", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/bigQueryExports", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=organizations/*/locations/*}/bigQueryExports", - "additional_bindings": [ - { - "get": "/v2/{parent=folders/*/locations/*}/bigQueryExports" - }, - { - "get": "/v2/{parent=projects/*/locations/*}/bigQueryExports" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListFindings": { - "requestType": "ListFindingsRequest", - "responseType": "ListFindingsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=organizations/*/sources/*}/findings", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/sources/*/locations/*}/findings", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=organizations/*/sources/*}/findings", - "additional_bindings": [ - { - "get": "/v2/{parent=organizations/*/sources/*/locations/*}/findings" - }, - { - "get": "/v2/{parent=folders/*/sources/*}/findings" - }, - { - "get": "/v2/{parent=folders/*/sources/*/locations/*}/findings" - }, - { - "get": "/v2/{parent=projects/*/sources/*}/findings" - }, - { - "get": "/v2/{parent=projects/*/sources/*/locations/*}/findings" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListMuteConfigs": { - "requestType": "ListMuteConfigsRequest", - "responseType": "ListMuteConfigsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=organizations/*}/muteConfigs", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/muteConfigs", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}/muteConfigs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=organizations/*}/muteConfigs", - "additional_bindings": [ - { - "get": "/v2/{parent=organizations/*/locations/*}/muteConfigs" - }, - { - "get": "/v2/{parent=folders/*}/muteConfigs" - }, - { - "get": "/v2/{parent=folders/*/locations/*}/muteConfigs" - }, - { - "get": "/v2/{parent=projects/*}/muteConfigs" - }, - { - "get": "/v2/{parent=projects/*/locations/*}/muteConfigs" - } - ] - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "parent", - "path_template": "projects/*/locations/{location=*}/muteConfigs" - }, - { - "field": "parent", - "path_template": "organizations/*/locations/{location=*}/muteConfigs" - }, - { - "field": "parent", - "path_template": "folders/*/locations/{location=*}/muteConfigs" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListNotificationConfigs": { - "requestType": "ListNotificationConfigsRequest", - "responseType": "ListNotificationConfigsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=organizations/*/locations/*}/notificationConfigs", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/notificationConfigs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=organizations/*/locations/*}/notificationConfigs", - "additional_bindings": [ - { - "get": "/v2/{parent=folders/*/locations/*}/notificationConfigs" - }, - { - "get": "/v2/{parent=projects/*/locations/*}/notificationConfigs" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListResourceValueConfigs": { - "requestType": "ListResourceValueConfigsRequest", - "responseType": "ListResourceValueConfigsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=organizations/*}/resourceValueConfigs", - "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=organizations/*}/resourceValueConfigs", - "additional_bindings": { - "get": "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListSources": { - "requestType": "ListSourcesRequest", - "responseType": "ListSourcesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=organizations/*}/sources", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*}/sources", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=organizations/*}/sources", - "additional_bindings": [ - { - "get": "/v2/{parent=folders/*}/sources" - }, - { - "get": "/v2/{parent=projects/*}/sources" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListValuedResources": { - "requestType": "ListValuedResourcesRequest", - "responseType": "ListValuedResourcesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=organizations/*/simulations/*}/valuedResources", - "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/valuedResources", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=organizations/*/simulations/*}/valuedResources", - "additional_bindings": [ - { - "get": "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources" - }, - { - "get": "/v2/{parent=organizations/*}/valuedResources" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "SetFindingState": { - "requestType": "SetFindingStateRequest", - "responseType": "Finding", - "options": { - "(google.api.http).post": "/v2/{name=organizations/*/sources/*/findings/*}:setState", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setState", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name,state" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=organizations/*/sources/*/findings/*}:setState", - "body": "*", - "additional_bindings": [ - { - "post": "/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setState", - "body": "*" - }, - { - "post": "/v2/{name=folders/*/sources/*/findings/*}:setState", - "body": "*" - }, - { - "post": "/v2/{name=folders/*/sources/*/locations/*/findings/*}:setState", - "body": "*" - }, - { - "post": "/v2/{name=projects/*/sources/*/findings/*}:setState", - "body": "*" - }, - { - "post": "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setState", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "name,state" - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=organizations/*/sources/*}:setIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=organizations/*/sources/*}:setIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - }, - "SetMute": { - "requestType": "SetMuteRequest", - "responseType": "Finding", - "options": { - "(google.api.http).post": "/v2/{name=organizations/*/sources/*/findings/*}:setMute", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setMute", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name,mute" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=organizations/*/sources/*/findings/*}:setMute", - "body": "*", - "additional_bindings": [ - { - "post": "/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setMute", - "body": "*" - }, - { - "post": "/v2/{name=folders/*/sources/*/findings/*}:setMute", - "body": "*" - }, - { - "post": "/v2/{name=folders/*/sources/*/locations/*/findings/*}:setMute", - "body": "*" - }, - { - "post": "/v2/{name=projects/*/sources/*/findings/*}:setMute", - "body": "*" - }, - { - "post": "/v2/{name=projects/*/sources/*/locations/*/findings/*}:setMute", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "name,mute" - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2/{resource=organizations/*/sources/*}:testIamPermissions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,permissions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=organizations/*/sources/*}:testIamPermissions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,permissions" - } - ] - }, - "UpdateBigQueryExport": { - "requestType": "UpdateBigQueryExportRequest", - "responseType": "BigQueryExport", - "options": { - "(google.api.http).patch": "/v2/{big_query_export.name=organizations/*/locations/*/bigQueryExports/*}", - "(google.api.http).body": "big_query_export", - "(google.api.http).additional_bindings.patch": "/v2/{big_query_export.name=projects/*/locations/*/bigQueryExports/*}", - "(google.api.http).additional_bindings.body": "big_query_export", - "(google.api.method_signature)": "big_query_export,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{big_query_export.name=organizations/*/locations/*/bigQueryExports/*}", - "body": "big_query_export", - "additional_bindings": [ - { - "patch": "/v2/{big_query_export.name=folders/*/locations/*/bigQueryExports/*}", - "body": "big_query_export" - }, - { - "patch": "/v2/{big_query_export.name=projects/*/locations/*/bigQueryExports/*}", - "body": "big_query_export" - } - ] - } - }, - { - "(google.api.method_signature)": "big_query_export,update_mask" - } - ] - }, - "UpdateExternalSystem": { - "requestType": "UpdateExternalSystemRequest", - "responseType": "ExternalSystem", - "options": { - "(google.api.http).patch": "/v2/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}", - "(google.api.http).body": "external_system", - "(google.api.http).additional_bindings.patch": "/v2/{external_system.name=projects/*/sources/*/locations/*/findings/*/externalSystems/*}", - "(google.api.http).additional_bindings.body": "external_system", - "(google.api.method_signature)": "external_system,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}", - "body": "external_system", - "additional_bindings": [ - { - "patch": "/v2/{external_system.name=organizations/*/sources/*/locations/*/findings/*/externalSystems/*}", - "body": "external_system" - }, - { - "patch": "/v2/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}", - "body": "external_system" - }, - { - "patch": "/v2/{external_system.name=folders/*/sources/*/locations/*/findings/*/externalSystems/*}", - "body": "external_system" - }, - { - "patch": "/v2/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}", - "body": "external_system" - }, - { - "patch": "/v2/{external_system.name=projects/*/sources/*/locations/*/findings/*/externalSystems/*}", - "body": "external_system" - } - ] - } - }, - { - "(google.api.method_signature)": "external_system,update_mask" - } - ] - }, - "UpdateFinding": { - "requestType": "UpdateFindingRequest", - "responseType": "Finding", - "options": { - "(google.api.http).patch": "/v2/{finding.name=organizations/*/sources/*/findings/*}", - "(google.api.http).body": "finding", - "(google.api.http).additional_bindings.patch": "/v2/{finding.name=projects/*/sources/*/locations/*/findings/*}", - "(google.api.http).additional_bindings.body": "finding", - "(google.api.method_signature)": "finding,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{finding.name=organizations/*/sources/*/findings/*}", - "body": "finding", - "additional_bindings": [ - { - "patch": "/v2/{finding.name=organizations/*/sources/*/locations/*/findings/*}", - "body": "finding" - }, - { - "patch": "/v2/{finding.name=folders/*/sources/*/findings/*}", - "body": "finding" - }, - { - "patch": "/v2/{finding.name=folders/*/sources/*/locations/*/findings/*}", - "body": "finding" - }, - { - "patch": "/v2/{finding.name=projects/*/sources/*/findings/*}", - "body": "finding" - }, - { - "patch": "/v2/{finding.name=projects/*/sources/*/locations/*/findings/*}", - "body": "finding" - } - ] - } - }, - { - "(google.api.method_signature)": "finding,update_mask" - } - ] - }, - "UpdateMuteConfig": { - "requestType": "UpdateMuteConfigRequest", - "responseType": "MuteConfig", - "options": { - "(google.api.http).patch": "/v2/{mute_config.name=organizations/*/muteConfigs/*}", - "(google.api.http).body": "mute_config", - "(google.api.http).additional_bindings.patch": "/v2/{mute_config.name=projects/*/locations/*/muteConfigs/*}", - "(google.api.http).additional_bindings.body": "mute_config", - "(google.api.routing).routing_parameters.field": "mute_config.name", - "(google.api.routing).routing_parameters.path_template": "folders/*/locations/{location=*}/muteConfigs/*", - "(google.api.method_signature)": "mute_config,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{mute_config.name=organizations/*/muteConfigs/*}", - "body": "mute_config", - "additional_bindings": [ - { - "patch": "/v2/{mute_config.name=organizations/*/locations/*/muteConfigs/*}", - "body": "mute_config" - }, - { - "patch": "/v2/{mute_config.name=folders/*/muteConfigs/*}", - "body": "mute_config" - }, - { - "patch": "/v2/{mute_config.name=folders/*/locations/*/muteConfigs/*}", - "body": "mute_config" - }, - { - "patch": "/v2/{mute_config.name=projects/*/muteConfigs/*}", - "body": "mute_config" - }, - { - "patch": "/v2/{mute_config.name=projects/*/locations/*/muteConfigs/*}", - "body": "mute_config" - } - ] - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "mute_config.name", - "path_template": "projects/*/locations/{location=*}/muteConfigs/*" - }, - { - "field": "mute_config.name", - "path_template": "organizations/*/locations/{location=*}/muteConfigs/*" - }, - { - "field": "mute_config.name", - "path_template": "folders/*/locations/{location=*}/muteConfigs/*" - } - ] - } - }, - { - "(google.api.method_signature)": "mute_config,update_mask" - } - ] - }, - "UpdateNotificationConfig": { - "requestType": "UpdateNotificationConfigRequest", - "responseType": "NotificationConfig", - "options": { - "(google.api.http).patch": "/v2/{notification_config.name=organizations/*/locations/*/notificationConfigs/*}", - "(google.api.http).body": "notification_config", - "(google.api.http).additional_bindings.patch": "/v2/{notification_config.name=projects/*/locations/*/notificationConfigs/*}", - "(google.api.http).additional_bindings.body": "notification_config", - "(google.api.method_signature)": "notification_config,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{notification_config.name=organizations/*/locations/*/notificationConfigs/*}", - "body": "notification_config", - "additional_bindings": [ - { - "patch": "/v2/{notification_config.name=folders/*/locations/*/notificationConfigs/*}", - "body": "notification_config" - }, - { - "patch": "/v2/{notification_config.name=projects/*/locations/*/notificationConfigs/*}", - "body": "notification_config" - } - ] - } - }, - { - "(google.api.method_signature)": "notification_config,update_mask" - } - ] - }, - "UpdateResourceValueConfig": { - "requestType": "UpdateResourceValueConfigRequest", - "responseType": "ResourceValueConfig", - "options": { - "(google.api.http).patch": "/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}", - "(google.api.http).body": "resource_value_config", - "(google.api.http).additional_bindings.patch": "/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}", - "(google.api.http).additional_bindings.body": "resource_value_config", - "(google.api.method_signature)": "resource_value_config,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}", - "body": "resource_value_config", - "additional_bindings": { - "patch": "/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}", - "body": "resource_value_config" - } - } - }, - { - "(google.api.method_signature)": "resource_value_config,update_mask" - } - ] - }, - "UpdateSecurityMarks": { - "requestType": "UpdateSecurityMarksRequest", - "responseType": "SecurityMarks", - "options": { - "(google.api.http).patch": "/v2/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", - "(google.api.http).body": "security_marks", - "(google.api.http).additional_bindings.patch": "/v2/{security_marks.name=projects/*/sources/*/locations/*/findings/*/securityMarks}", - "(google.api.http).additional_bindings.body": "security_marks", - "(google.api.method_signature)": "security_marks,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", - "body": "security_marks", - "additional_bindings": [ - { - "patch": "/v2/{security_marks.name=organizations/*/assets/*/securityMarks}", - "body": "security_marks" - }, - { - "patch": "/v2/{security_marks.name=organizations/*/sources/*/locations/*/findings/*/securityMarks}", - "body": "security_marks" - }, - { - "patch": "/v2/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}", - "body": "security_marks" - }, - { - "patch": "/v2/{security_marks.name=folders/*/assets/*/securityMarks}", - "body": "security_marks" - }, - { - "patch": "/v2/{security_marks.name=folders/*/sources/*/locations/*/findings/*/securityMarks}", - "body": "security_marks" - }, - { - "patch": "/v2/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", - "body": "security_marks" - }, - { - "patch": "/v2/{security_marks.name=projects/*/assets/*/securityMarks}", - "body": "security_marks" - }, - { - "patch": "/v2/{security_marks.name=projects/*/sources/*/locations/*/findings/*/securityMarks}", - "body": "security_marks" - } - ] - } - }, - { - "(google.api.method_signature)": "security_marks,update_mask" - } - ] - }, - "UpdateSource": { - "requestType": "UpdateSourceRequest", - "responseType": "Source", - "options": { - "(google.api.http).patch": "/v2/{source.name=organizations/*/sources/*}", - "(google.api.http).body": "source", - "(google.api.method_signature)": "source,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{source.name=organizations/*/sources/*}", - "body": "source" - } - }, - { - "(google.api.method_signature)": "source,update_mask" - } - ] - } - } - }, - "BatchCreateResourceValueConfigsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" - } - }, - "requests": { - "rule": "repeated", - "type": "CreateResourceValueConfigRequest", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateResourceValueConfigsResponse": { - "fields": { - "resourceValueConfigs": { - "rule": "repeated", - "type": "ResourceValueConfig", - "id": 1 - } - } - }, - "BulkMuteFindingsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "muteState": { - "type": "MuteState", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MuteState": { - "values": { - "MUTE_STATE_UNSPECIFIED": 0, - "MUTED": 1, - "UNDEFINED": 2 - } - } - } - }, - "BulkMuteFindingsResponse": { - "fields": {} - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "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": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" - } - }, - "configId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "notificationConfig": { - "type": "NotificationConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "CreateResourceValueConfigRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" - } - }, - "resourceValueConfig": { - "type": "ResourceValueConfig", - "id": 2, - "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" - } - } - } - }, - "DeleteBigQueryExportRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/BigQueryExport" - } - } - } - }, - "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": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" - } - } - } - }, - "DeleteResourceValueConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/ResourceValueConfig" - } - } - } - }, - "BigQueryDestination": { - "fields": { - "dataset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ExportFindingsMetadata": { - "oneofs": { - "destination": { - "oneof": [ - "bigQueryDestination" - ] - } - }, - "fields": { - "exportStartTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bigQueryDestination": { - "type": "BigQueryDestination", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ExportFindingsResponse": { - "fields": {} - }, - "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": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" - } - } - } - }, - "GetNotificationConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" - } - } - } - }, - "GetResourceValueConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/ResourceValueConfig" - } - } - } - }, - "GetSourceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" - } - } - } - }, - "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" - } - }, - "pageToken": { - "type": "string", - "id": 7 - }, - "pageSize": { - "type": "int32", - "id": 8 - } - } - }, - "GroupFindingsResponse": { - "fields": { - "groupByResults": { - "rule": "repeated", - "type": "GroupResult", - "id": 1 - }, - "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 - } - } - }, - "ListAttackPathsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/AttackPath" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - } - } - }, - "ListAttackPathsResponse": { - "fields": { - "attackPaths": { - "rule": "repeated", - "type": "AttackPath", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetSimulationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/Simulation" - } - } - } - }, - "GetValuedResourceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "securitycenter.googleapis.com/ValuedResource" - } - } - } - }, - "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 - } - } - }, - "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 - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 7 - }, - "pageToken": { - "type": "string", - "id": 8 - }, - "pageSize": { - "type": "int32", - "id": 9 - } - } - }, - "ListFindingsResponse": { - "fields": { - "listFindingsResults": { - "rule": "repeated", - "type": "ListFindingsResult", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 3 - }, - "totalSize": { - "type": "int32", - "id": 4 - } - }, - "nested": { - "ListFindingsResult": { - "fields": { - "finding": { - "type": "Finding", - "id": 1 - }, - "resource": { - "type": "Resource", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Resource": { - "oneofs": { - "cloudProviderMetadata": { - "oneof": [ - "gcpMetadata", - "awsMetadata", - "azureMetadata" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "cloudProvider": { - "type": "CloudProvider", - "id": 4 - }, - "service": { - "type": "string", - "id": 5 - }, - "location": { - "type": "string", - "id": 6 - }, - "gcpMetadata": { - "type": "GcpMetadata", - "id": 7 - }, - "awsMetadata": { - "type": "AwsMetadata", - "id": 8 - }, - "azureMetadata": { - "type": "AzureMetadata", - "id": 9 - }, - "resourcePath": { - "type": "ResourcePath", - "id": 10 - }, - "resourcePathString": { - "type": "string", - "id": 11 - } - } - } - } - } - } - }, - "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": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" - } - }, - "pageToken": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListNotificationConfigsResponse": { - "fields": { - "notificationConfigs": { - "rule": "repeated", - "type": "NotificationConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListResourceValueConfigsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ResourceValueConfig" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListResourceValueConfigsResponse": { - "fields": { - "resourceValueConfigs": { - "rule": "repeated", - "type": "ResourceValueConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListSourcesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" - } - }, - "pageToken": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 7 - } - } - }, - "ListSourcesResponse": { - "fields": { - "sources": { - "rule": "repeated", - "type": "Source", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListValuedResourcesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/ValuedResource" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListValuedResourcesResponse": { - "fields": { - "valuedResources": { - "rule": "repeated", - "type": "ValuedResource", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "UpdateBigQueryExportRequest": { - "fields": { - "bigQueryExport": { - "type": "BigQueryExport", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "UpdateExternalSystemRequest": { - "fields": { - "externalSystem": { - "type": "ExternalSystem", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "UpdateFindingRequest": { - "fields": { - "finding": { - "type": "Finding", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "UpdateMuteConfigRequest": { - "fields": { - "muteConfig": { - "type": "MuteConfig", - "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 - } - } - }, - "UpdateResourceValueConfigRequest": { - "fields": { - "resourceValueConfig": { - "type": "ResourceValueConfig", - "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 - } - } - }, - "UpdateSourceRequest": { - "fields": { - "source": { - "type": "Source", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "Simulation": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Simulation", - "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/simulations/{simluation}", - "(google.api.resource).plural": "simulations", - "(google.api.resource).singular": "simulation" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resourceValueConfigsMetadata": { - "rule": "repeated", - "type": "ResourceValueConfigMetadata", - "id": 3 - }, - "cloudProvider": { - "type": "CloudProvider", - "id": 4 - } - } - }, - "ValuedResource": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/ValuedResource", - "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}", - "(google.api.resource).plural": "valuedResources", - "(google.api.resource).singular": "valuedResource" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "resource": { - "type": "string", - "id": 2 - }, - "resourceType": { - "type": "string", - "id": 3 - }, - "displayName": { - "type": "string", - "id": 4 - }, - "resourceValue": { - "type": "ResourceValue", - "id": 5 - }, - "exposedScore": { - "type": "double", - "id": 6 - }, - "resourceValueConfigsUsed": { - "rule": "repeated", - "type": "ResourceValueConfigMetadata", - "id": 7 - } - }, - "nested": { - "ResourceValue": { - "values": { - "RESOURCE_VALUE_UNSPECIFIED": 0, - "RESOURCE_VALUE_LOW": 1, - "RESOURCE_VALUE_MEDIUM": 2, - "RESOURCE_VALUE_HIGH": 3 - } - } - } - }, - "ResourceValueConfigMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "Source": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Source", - "(google.api.resource).pattern": "projects/{project}/sources/{source}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "canonicalName": { - "type": "string", - "id": 4 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "RoutingProto", - "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 - }, - "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", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "routing": { - "type": "google.api.RoutingRule", - "id": 72295729, - "extend": "google.protobuf.MethodOptions" - }, - "RoutingRule": { - "fields": { - "routingParameters": { - "rule": "repeated", - "type": "RoutingParameter", - "id": 2 - } - } - }, - "RoutingParameter": { - "fields": { - "field": { - "type": "string", - "id": 1 - }, - "pathTemplate": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "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 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "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": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "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": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "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": { - "edition": "proto2", - "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 - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "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 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "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 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "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 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - } - } - }, - "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 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "options": { - "(google.api.default_host)": "iam-meta-api.googleapis.com" - }, - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:setIamPolicy", - "body": "*" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:getIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "SetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "policy": { - "type": "Policy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3 - } - } - }, - "GetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "options": { - "type": "GetPolicyOptions", - "id": 2 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TestIamPermissionsResponse": { - "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "GetPolicyOptions": { - "fields": { - "requestedPolicyVersion": { - "type": "int32", - "id": 1 - } - } - }, - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "auditConfigs": { - "rule": "repeated", - "type": "AuditConfig", - "id": 6 - }, - "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 - } - } - }, - "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": { - "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 - } - } - } - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "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": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "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", - "responseType": "Operation", - "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", - "responseType": "google.protobuf.Empty", - "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", - "responseType": "google.protobuf.Empty", - "options": { - "(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", - "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": { - "cc_enable_arenas": true, - "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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js deleted file mode 100644 index 06a231a2f15..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.batch_create_resource_value_configs.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, requests) { - // [START securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the new ResourceValueConfig's parent. - * The parent field in the CreateResourceValueConfigRequest - * messages must either be empty or match this field. - */ - // const parent = 'abc123' - /** - * Required. The resource value configs to be created. - */ - // const requests = [1,2,3,4] - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callBatchCreateResourceValueConfigs() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const response = await securitycenterClient.batchCreateResourceValueConfigs(request); - console.log(response); - } - - callBatchCreateResourceValueConfigs(); - // [END securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js deleted file mode 100644 index 0400b80d9e5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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' - /** - * Optional. All findings matching the given filter will have their mute state - * set to this value. The default value is `MUTED`. Setting this to - * `UNDEFINED` will clear the mute state on all matching findings. - */ - // const muteState = {} - - // 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js deleted file mode 100644 index 56d7f9ae426..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource of the new BigQuery export. Its - * format is `organizations/[organization_id]`, `folders/[folder_id]`, or - * `projects/[project_id]`. - */ - // const parent = 'abc123' - /** - * Required. The BigQuery export being created. - */ - // const bigQueryExport = {} - /** - * Required. Unique identifier provided by the client within the parent scope. - * It must consist of only lowercase letters, numbers, and hyphens, must start - * with a letter, must end with either a letter or a number, and must be 63 - * characters or less. - */ - // 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js deleted file mode 100644 index a8683573ab4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_event_threat_detection_custom_module.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, eventThreatDetectionCustomModule) { - // [START securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The new custom module's parent. - * Its format is: - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - */ - // const parent = 'abc123' - /** - * Required. The module to create. The - * event_threat_detection_custom_module.name will be ignored and server - * generated. - */ - // const eventThreatDetectionCustomModule = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callCreateEventThreatDetectionCustomModule() { - // Construct request - const request = { - parent, - eventThreatDetectionCustomModule, - }; - - // Run request - const response = await securitycenterClient.createEventThreatDetectionCustomModule(request); - console.log(response); - } - - callCreateEventThreatDetectionCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js deleted file mode 100644 index 9305355c90e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callCreateFinding() { - // Construct request - const request = { - parent, - findingId, - finding, - }; - - // Run request - const response = await securitycenterClient.createFinding(request); - console.log(response); - } - - callCreateFinding(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js deleted file mode 100644 index 9c2ab116ef7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 only lowercase letters, numbers, and hyphens, must start - * with a letter, must end with either a letter or a number, and must be 63 - * characters or less. - */ - // 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js deleted file mode 100644 index 66b6a01eede..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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' - /** - * Required. - * Unique identifier provided by the client within the parent scope. - * It must be between 1 and 128 characters and contain 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 callCreateNotificationConfig() { - // Construct request - const request = { - parent, - configId, - notificationConfig, - }; - - // Run request - const response = await securitycenterClient.createNotificationConfig(request); - console.log(response); - } - - callCreateNotificationConfig(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js deleted file mode 100644 index f46ecd8ca06..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, securityHealthAnalyticsCustomModule) { - // [START securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the new custom module's parent. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - */ - // const parent = 'abc123' - /** - * Required. SecurityHealthAnalytics custom module to create. The provided - * name is ignored and reset with provided parent information and - * server-generated ID. - */ - // const securityHealthAnalyticsCustomModule = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callCreateSecurityHealthAnalyticsCustomModule() { - // Construct request - const request = { - parent, - securityHealthAnalyticsCustomModule, - }; - - // Run request - const response = await securitycenterClient.createSecurityHealthAnalyticsCustomModule(request); - console.log(response); - } - - callCreateSecurityHealthAnalyticsCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js deleted file mode 100644 index 7a02f2d7226..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callCreateSource() { - // Construct request - const request = { - parent, - source, - }; - - // Run request - const response = await securitycenterClient.createSource(request); - console.log(response); - } - - callCreateSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js deleted file mode 100644 index cd35a8fc98d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the BigQuery 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js deleted file mode 100644 index e650f60daf7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_DeleteEventThreatDetectionCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the custom module to delete. - * Its format is: - * * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - * * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - * * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callDeleteEventThreatDetectionCustomModule() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.deleteEventThreatDetectionCustomModule(request); - console.log(response); - } - - callDeleteEventThreatDetectionCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js deleted file mode 100644 index 78b10cb40f6..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * Required. Name of the mute config to delete. Its format is - * `organizations/{organization}/muteConfigs/{config_id}`, - * `folders/{folder}/muteConfigs/{config_id}`, - * `projects/{project}/muteConfigs/{config_id}`, - * `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - * `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - * `projects/{project}/locations/global/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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js deleted file mode 100644 index c74f24446b9..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * Required. Name of the notification config to delete. Its format is - * `organizations/[organization_id]/notificationConfigs/[config_id]`, - * `folders/[folder_id]/notificationConfigs/[config_id]`, - * or `projects/[project_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 callDeleteNotificationConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.deleteNotificationConfig(request); - console.log(response); - } - - callDeleteNotificationConfig(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js deleted file mode 100644 index dc702af70cb..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_resource_value_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_DeleteResourceValueConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the ResourceValueConfig to delete - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callDeleteResourceValueConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.deleteResourceValueConfig(request); - console.log(response); - } - - callDeleteResourceValueConfig(); - // [END securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js deleted file mode 100644 index af762489928..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_DeleteSecurityHealthAnalyticsCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the custom module to delete. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - * `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - * or - * `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callDeleteSecurityHealthAnalyticsCustomModule() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.deleteSecurityHealthAnalyticsCustomModule(request); - console.log(response); - } - - callDeleteSecurityHealthAnalyticsCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js deleted file mode 100644 index 03dd812a700..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the BigQuery 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js deleted file mode 100644 index 9bf9dc06979..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_GetEffectiveEventThreatDetectionCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the effective Event Threat Detection custom - * module. - * Its format is: - * * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - * * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - * * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetEffectiveEventThreatDetectionCustomModule() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getEffectiveEventThreatDetectionCustomModule(request); - console.log(response); - } - - callGetEffectiveEventThreatDetectionCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js deleted file mode 100644 index 496318a1c18..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_GetEffectiveSecurityHealthAnalyticsCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the effective custom module to get. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - * `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - * or - * `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetEffectiveSecurityHealthAnalyticsCustomModule() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getEffectiveSecurityHealthAnalyticsCustomModule(request); - console.log(response); - } - - callGetEffectiveSecurityHealthAnalyticsCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js deleted file mode 100644 index 71edf4f4e5b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_event_threat_detection_custom_module.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_GetEventThreatDetectionCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the custom module to get. - * Its format is: - * * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - * * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - * * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetEventThreatDetectionCustomModule() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getEventThreatDetectionCustomModule(request); - console.log(response); - } - - callGetEventThreatDetectionCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js deleted file mode 100644 index 5b8dbed8756..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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`. - */ - // const options = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await securitycenterClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js deleted file mode 100644 index b0d8f7c980b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * Required. Name of the mute config to retrieve. Its format is - * `organizations/{organization}/muteConfigs/{config_id}`, - * `folders/{folder}/muteConfigs/{config_id}`, - * `projects/{project}/muteConfigs/{config_id}`, - * `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - * `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - * `projects/{project}/locations/global/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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js deleted file mode 100644 index 5bef0250fbe..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * Required. Name of the notification config to get. Its format is - * `organizations/[organization_id]/notificationConfigs/[config_id]`, - * `folders/[folder_id]/notificationConfigs/[config_id]`, - * or `projects/[project_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 callGetNotificationConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getNotificationConfig(request); - console.log(response); - } - - callGetNotificationConfig(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js deleted file mode 100644 index 700b089c742..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callGetOrganizationSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getOrganizationSettings(request); - console.log(response); - } - - callGetOrganizationSettings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js deleted file mode 100644 index bb016f906a2..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_resource_value_config.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_GetResourceValueConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource value config to retrieve. Its format is - * `organizations/{organization}/resourceValueConfigs/{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 callGetResourceValueConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getResourceValueConfig(request); - console.log(response); - } - - callGetResourceValueConfig(); - // [END securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js deleted file mode 100644 index aa97b45f74d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_GetSecurityHealthAnalyticsCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the custom module to get. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - * `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - * or - * `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetSecurityHealthAnalyticsCustomModule() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getSecurityHealthAnalyticsCustomModule(request); - console.log(response); - } - - callGetSecurityHealthAnalyticsCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js deleted file mode 100644 index 71c77686e1e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_simulation.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_GetSimulation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The organization name or simulation name of this simulation - * Valid format: - * `organizations/{organization}/simulations/latest` - * `organizations/{organization}/simulations/{simulation}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetSimulation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getSimulation(request); - console.log(response); - } - - callGetSimulation(); - // [END securitycenter_v1_generated_SecurityCenter_GetSimulation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js deleted file mode 100644 index 08903fee4c8..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callGetSource() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getSource(request); - console.log(response); - } - - callGetSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js deleted file mode 100644 index 1941c52a2d4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.get_valued_resource.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_GetValuedResource_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of this valued resource - * Valid format: - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetValuedResource() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getValuedResource(request); - console.log(response); - } - - callGetValuedResource(); - // [END securitycenter_v1_generated_SecurityCenter_GetValuedResource_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js deleted file mode 100644 index 007a3c85b29..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * Required. The name of the parent to group the assets by. 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 callGroupAssets() { - // Construct request - const request = { - parent, - groupBy, - }; - - // Run request - const iterable = securitycenterClient.groupAssetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callGroupAssets(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js deleted file mode 100644 index b7f4e2b4fa3..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 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 callGroupFindings() { - // Construct request - const request = { - parent, - groupBy, - }; - - // Run request - const iterable = securitycenterClient.groupFindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callGroupFindings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js deleted file mode 100644 index 6ab4b8cb6c7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * Required. The name of the parent resource that contains the assets. The - * value that you can specify on parent depends on the method in which you - * specify parent. You can specify one of the following values: - * `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 callListAssets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listAssetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAssets(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js deleted file mode 100644 index 382492e7094..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_attack_paths.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListAttackPaths_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of parent to list attack paths. - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - */ - // const parent = 'abc123' - /** - * The filter expression that filters the attack path in the response. - * Supported fields: - * * `valued_resources` supports = - */ - // const filter = 'abc123' - /** - * The value returned by the last `ListAttackPathsResponse`; indicates - * that this is a continuation of a prior `ListAttackPaths` 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 callListAttackPaths() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listAttackPathsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAttackPaths(); - // [END securitycenter_v1_generated_SecurityCenter_ListAttackPaths_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js deleted file mode 100644 index 7a5312cf641..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, 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 = 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js deleted file mode 100644 index 1364d1650a2..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListDescendantEventThreatDetectionCustomModules_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the parent to list custom modules under. - * Its format is: - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - */ - // const parent = 'abc123' - /** - * A page token, received from a previous - * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to - * retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListDescendantEventThreatDetectionCustomModules` must match the call that - * provided the page token. - */ - // const pageToken = 'abc123' - /** - * The maximum number of modules 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 - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListDescendantEventThreatDetectionCustomModules() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listDescendantEventThreatDetectionCustomModulesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDescendantEventThreatDetectionCustomModules(); - // [END securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js deleted file mode 100644 index c6d003b6963..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListDescendantSecurityHealthAnalyticsCustomModules_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of parent to list descendant custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - */ - // const parent = 'abc123' - /** - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - */ - // const pageSize = 1234 - /** - * The value returned by the last call indicating a continuation - */ - // const pageToken = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListDescendantSecurityHealthAnalyticsCustomModules() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listDescendantSecurityHealthAnalyticsCustomModulesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDescendantSecurityHealthAnalyticsCustomModules(); - // [END securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js deleted file mode 100644 index 92688688bdd..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListEffectiveEventThreatDetectionCustomModules_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the parent to list custom modules for. - * Its format is: - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - */ - // const parent = 'abc123' - /** - * A page token, received from a previous - * `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to - * retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListEffectiveEventThreatDetectionCustomModules` must match the call that - * provided the page token. - */ - // const pageToken = 'abc123' - /** - * The maximum number of modules 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 - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListEffectiveEventThreatDetectionCustomModules() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listEffectiveEventThreatDetectionCustomModulesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListEffectiveEventThreatDetectionCustomModules(); - // [END securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js deleted file mode 100644 index 85716da998d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListEffectiveSecurityHealthAnalyticsCustomModules_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of parent to list effective custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - */ - // const parent = 'abc123' - /** - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - */ - // const pageSize = 1234 - /** - * The value returned by the last call indicating a continuation - */ - // const pageToken = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListEffectiveSecurityHealthAnalyticsCustomModules() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listEffectiveSecurityHealthAnalyticsCustomModulesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListEffectiveSecurityHealthAnalyticsCustomModules(); - // [END securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js deleted file mode 100644 index c58fa6d1824..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListEventThreatDetectionCustomModules_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the parent to list custom modules under. - * Its format is: - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - */ - // const parent = 'abc123' - /** - * A page token, received from a previous - * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - * subsequent page. - * When paginating, all other parameters provided to - * `ListEventThreatDetectionCustomModules` must match the call that provided - * the page token. - */ - // const pageToken = 'abc123' - /** - * The maximum number of modules 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 - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListEventThreatDetectionCustomModules() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listEventThreatDetectionCustomModulesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListEventThreatDetectionCustomModules(); - // [END securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js deleted file mode 100644 index 37bf56b92f5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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: `=`, `:` - * * resource.display_name: `=`, `:` - */ - // 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 callListFindings() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listFindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListFindings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js deleted file mode 100644 index 4b585435bb5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 = 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js deleted file mode 100644 index 5e8d74e6cc0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * Required. The name of the parent in which to list the notification - * configurations. Its format is "organizations/[organization_id]", - * "folders/[folder_id]", or "projects/[project_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 callListNotificationConfigs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listNotificationConfigsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListNotificationConfigs(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js deleted file mode 100644 index 5e66edcbb1c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_resource_value_configs.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListResourceValueConfigs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns the collection of resource value configs. - * Its format is - * `organizations/[organization_id]` - */ - // const parent = 'abc123' - /** - * The number of results 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 `ListResourceValueConfigs` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListResourceValueConfigs` must match the call that provided the - * page token. - * page_size can be specified, and the new page_size will be used. - */ - // const pageToken = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListResourceValueConfigs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listResourceValueConfigsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListResourceValueConfigs(); - // [END securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js deleted file mode 100644 index beb9d8b0b34..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListSecurityHealthAnalyticsCustomModules_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - */ - // const parent = 'abc123' - /** - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - */ - // const pageSize = 1234 - /** - * The value returned by the last call indicating a continuation - */ - // const pageToken = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListSecurityHealthAnalyticsCustomModules() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listSecurityHealthAnalyticsCustomModulesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSecurityHealthAnalyticsCustomModules(); - // [END securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js deleted file mode 100644 index f9c0b7b73ce..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callListSources() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listSourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSources(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js deleted file mode 100644 index 83d3c39a4f1..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.list_valued_resources.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_ListValuedResources_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of parent to list valued resources. - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - */ - // const parent = 'abc123' - /** - * The filter expression that filters the valued resources in the response. - * Supported fields: - * * `resource_value` supports = - * * `resource_type` supports = - */ - // const filter = 'abc123' - /** - * The value returned by the last `ListValuedResourcesResponse`; indicates - * that this is a continuation of a prior `ListValuedResources` 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 - /** - * Optional. The fields by which to order the valued resources response. - * Supported fields: - * * `exposed_score` - * * `resource_value` - * * `resource_type` - * * `resource` - * * `display_name` - * Values should be a comma separated list of fields. For example: - * `exposed_score,resource_value`. - * The default sorting order is descending. To specify ascending or descending - * order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for - * example: `exposed_score DESC`. - */ - // const orderBy = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListValuedResources() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listValuedResourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListValuedResources(); - // [END securitycenter_v1_generated_SecurityCenter_ListValuedResources_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js deleted file mode 100644 index 98e0fc29ccc..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callRunAssetDiscovery() { - // Construct request - const request = { - parent, - }; - - // Run request - const [operation] = await securitycenterClient.runAssetDiscovery(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRunAssetDiscovery(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js deleted file mode 100644 index a4116d648fd..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * Required. The relative resource - * name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * of the finding. Example: - * `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' - /** - * 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 callSetFindingState() { - // Construct request - const request = { - name, - state, - startTime, - }; - - // Run request - const response = await securitycenterClient.setFindingState(request); - console.log(response); - } - - callSetFindingState(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js deleted file mode 100644 index 911aea07b23..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 = {} - /** - * 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; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await securitycenterClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js deleted file mode 100644 index e18ebbe96ef..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * Required. The relative resource - * name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * of the finding. Example: - * `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' - /** - * 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js deleted file mode 100644 index 83feb2dfb03..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, customConfig, resource) { - // [START securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The relative resource name of the organization, project, or - * folder. For more information about relative resource names, see Relative - * Resource - * Name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * Example: `organizations/{organization_id}` - */ - // const parent = 'abc123' - /** - * Required. The custom configuration that you need to test. - */ - // const customConfig = {} - /** - * Required. Resource data to simulate custom module against. - */ - // const resource = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callSimulateSecurityHealthAnalyticsCustomModule() { - // Construct request - const request = { - parent, - customConfig, - resource, - }; - - // Run request - const response = await securitycenterClient.simulateSecurityHealthAnalyticsCustomModule(request); - console.log(response); - } - - callSimulateSecurityHealthAnalyticsCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js deleted file mode 100644 index 3d7813598f1..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 = ['abc','def'] - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await securitycenterClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js deleted file mode 100644 index fe0995786d9..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js deleted file mode 100644 index f4093f8d97a..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_event_threat_detection_custom_module.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(eventThreatDetectionCustomModule) { - // [START securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The module being updated. - */ - // const eventThreatDetectionCustomModule = {} - /** - * 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 callUpdateEventThreatDetectionCustomModule() { - // Construct request - const request = { - eventThreatDetectionCustomModule, - }; - - // Run request - const response = await securitycenterClient.updateEventThreatDetectionCustomModule(request); - console.log(response); - } - - callUpdateEventThreatDetectionCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js deleted file mode 100644 index 5b699615e78..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js deleted file mode 100644 index 5cf4f892b62..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateFinding() { - // Construct request - const request = { - finding, - }; - - // Run request - const response = await securitycenterClient.updateFinding(request); - console.log(response); - } - - callUpdateFinding(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js deleted file mode 100644 index e9907f5228d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js deleted file mode 100644 index 4eb3622cfee..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateNotificationConfig() { - // Construct request - const request = { - notificationConfig, - }; - - // Run request - const response = await securitycenterClient.updateNotificationConfig(request); - console.log(response); - } - - callUpdateNotificationConfig(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js deleted file mode 100644 index 09351d96c89..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateOrganizationSettings() { - // Construct request - const request = { - organizationSettings, - }; - - // Run request - const response = await securitycenterClient.updateOrganizationSettings(request); - console.log(response); - } - - callUpdateOrganizationSettings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js deleted file mode 100644 index 138ff41f9a7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_resource_value_config.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resourceValueConfig) { - // [START securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource value config being updated. - */ - // const resourceValueConfig = {} - /** - * 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 callUpdateResourceValueConfig() { - // Construct request - const request = { - resourceValueConfig, - }; - - // Run request - const response = await securitycenterClient.updateResourceValueConfig(request); - console.log(response); - } - - callUpdateResourceValueConfig(); - // [END securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js deleted file mode 100644 index d230134932e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(securityHealthAnalyticsCustomModule) { - // [START securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The SecurityHealthAnalytics custom module to update. - */ - // const securityHealthAnalyticsCustomModule = {} - /** - * The list of fields to be updated. The only fields that can be updated are - * `enablement_state` and `custom_config`. If empty or set to the wildcard - * value `*`, both `enablement_state` and `custom_config` are updated. - */ - // const updateMask = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callUpdateSecurityHealthAnalyticsCustomModule() { - // Construct request - const request = { - securityHealthAnalyticsCustomModule, - }; - - // Run request - const response = await securitycenterClient.updateSecurityHealthAnalyticsCustomModule(request); - console.log(response); - } - - callUpdateSecurityHealthAnalyticsCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js deleted file mode 100644 index 2493a54c831..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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. Must be - * earlier or equal to the server time. - */ - // const startTime = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callUpdateSecurityMarks() { - // Construct request - const request = { - securityMarks, - }; - - // Run request - const response = await securitycenterClient.updateSecurityMarks(request); - console.log(response); - } - - callUpdateSecurityMarks(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js deleted file mode 100644 index a9fe907a312..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateSource() { - // Construct request - const request = { - source, - }; - - // Run request - const response = await securitycenterClient.updateSource(request); - console.log(response); - } - - callUpdateSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js deleted file mode 100644 index 4764401ddae..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, rawText, type) { - // [START securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the parent to validate the Custom Module under. - * Its format is: - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - */ - // const parent = 'abc123' - /** - * Required. The raw text of the module's contents. Used to generate error - * messages. - */ - // const rawText = 'abc123' - /** - * Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). - */ - // const type = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callValidateEventThreatDetectionCustomModule() { - // Construct request - const request = { - parent, - rawText, - type, - }; - - // Run request - const response = await securitycenterClient.validateEventThreatDetectionCustomModule(request); - console.log(response); - } - - callValidateEventThreatDetectionCustomModule(); - // [END securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json deleted file mode 100644 index 96f2d664554..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json +++ /dev/null @@ -1,2907 +0,0 @@ -{ - "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": 85, - "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" - }, - { - "name": "mute_state", - "type": ".google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState" - } - ], - "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_CreateSecurityHealthAnalyticsCustomModule_async", - "title": "SecurityCenter createSecurityHealthAnalyticsCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", - "canonical": true, - "file": "security_center.create_security_health_analytics_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModule", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "security_health_analytics_custom_module", - "type": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule" - } - ], - "resultType": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "CreateSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModule", - "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": 60, - "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": 67, - "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": 68, - "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": 70, - "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": 59, - "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": 56, - "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_DeleteSecurityHealthAnalyticsCustomModule_async", - "title": "SecurityCenter deleteSecurityHealthAnalyticsCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", - "canonical": true, - "file": "security_center.delete_security_health_analytics_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModule", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "DeleteSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModule", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetSimulation_async", - "title": "SecurityCenter getSimulation Sample", - "origin": "API_DEFINITION", - "description": " Get the simulation by name or the latest simulation for the given organization.", - "canonical": true, - "file": "security_center.get_simulation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSimulation", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSimulation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.Simulation", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "GetSimulation", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSimulation", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetValuedResource_async", - "title": "SecurityCenter getValuedResource Sample", - "origin": "API_DEFINITION", - "description": " Get the valued resource by name", - "canonical": true, - "file": "security_center.get_valued_resource.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetValuedResource", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetValuedResource", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ValuedResource", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "GetValuedResource", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetValuedResource", - "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 BigQuery export.", - "canonical": true, - "file": "security_center.get_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "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", - "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": 59, - "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": 59, - "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": 56, - "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": 54, - "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_GetEffectiveSecurityHealthAnalyticsCustomModule_async", - "title": "SecurityCenter getEffectiveSecurityHealthAnalyticsCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", - "canonical": true, - "file": "security_center.get_effective_security_health_analytics_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEffectiveSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModule", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "GetEffectiveSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModule", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_async", - "title": "SecurityCenter getSecurityHealthAnalyticsCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a SecurityHealthAnalyticsCustomModule.", - "canonical": true, - "file": "security_center.get_security_health_analytics_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModule", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "GetSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModule", - "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": 54, - "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": 168, - "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": 166, - "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": 179, - "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_ListDescendantSecurityHealthAnalyticsCustomModules_async", - "title": "SecurityCenter listDescendantSecurityHealthAnalyticsCustomModules Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", - "canonical": true, - "file": "security_center.list_descendant_security_health_analytics_custom_modules.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDescendantSecurityHealthAnalyticsCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModules", - "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.ListDescendantSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListDescendantSecurityHealthAnalyticsCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModules", - "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": 183, - "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": 71, - "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": 68, - "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_ListEffectiveSecurityHealthAnalyticsCustomModules_async", - "title": "SecurityCenter listEffectiveSecurityHealthAnalyticsCustomModules Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - "canonical": true, - "file": "security_center.list_effective_security_health_analytics_custom_modules.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListEffectiveSecurityHealthAnalyticsCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModules", - "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.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListEffectiveSecurityHealthAnalyticsCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModules", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_async", - "title": "SecurityCenter listSecurityHealthAnalyticsCustomModules Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - "canonical": true, - "file": "security_center.list_security_health_analytics_custom_modules.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSecurityHealthAnalyticsCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModules", - "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.ListSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListSecurityHealthAnalyticsCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModules", - "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": 68, - "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": 55, - "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": 68, - "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": 63, - "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": 69, - "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" - } - } - } - }, - { - "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": 62, - "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_SimulateSecurityHealthAnalyticsCustomModule_async", - "title": "SecurityCenter simulateSecurityHealthAnalyticsCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", - "canonical": true, - "file": "security_center.simulate_security_health_analytics_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SimulateSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModule", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "custom_config", - "type": ".google.cloud.securitycenter.v1.CustomConfig" - }, - { - "name": "resource", - "type": ".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource" - } - ], - "resultType": ".google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "SimulateSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModule", - "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": 58, - "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": 66, - "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": 58, - "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": 58, - "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": 58, - "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_UpdateSecurityHealthAnalyticsCustomModule_async", - "title": "SecurityCenter updateSecurityHealthAnalyticsCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", - "canonical": true, - "file": "security_center.update_security_health_analytics_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModule", - "async": true, - "parameters": [ - { - "name": "security_health_analytics_custom_module", - "type": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateSecurityHealthAnalyticsCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModule", - "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": 58, - "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": 67, - "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" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async", - "title": "SecurityCenter createBigQueryExport Sample", - "origin": "API_DEFINITION", - "description": " Creates a BigQuery export.", - "canonical": true, - "file": "security_center.create_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "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 BigQuery export.", - "canonical": true, - "file": "security_center.delete_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "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": 58, - "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": 71, - "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" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_async", - "title": "SecurityCenter createEventThreatDetectionCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", - "canonical": true, - "file": "security_center.create_event_threat_detection_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModule", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "event_threat_detection_custom_module", - "type": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule" - } - ], - "resultType": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "CreateEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModule", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_async", - "title": "SecurityCenter deleteEventThreatDetectionCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", - "canonical": true, - "file": "security_center.delete_event_threat_detection_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModule", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "DeleteEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModule", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_async", - "title": "SecurityCenter getEventThreatDetectionCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Gets an Event Threat Detection custom module.", - "canonical": true, - "file": "security_center.get_event_threat_detection_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModule", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "GetEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModule", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_async", - "title": "SecurityCenter listDescendantEventThreatDetectionCustomModules Sample", - "origin": "API_DEFINITION", - "description": " Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", - "canonical": true, - "file": "security_center.list_descendant_event_threat_detection_custom_modules.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDescendantEventThreatDetectionCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModules", - "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.ListDescendantEventThreatDetectionCustomModulesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListDescendantEventThreatDetectionCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModules", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_async", - "title": "SecurityCenter listEventThreatDetectionCustomModules Sample", - "origin": "API_DEFINITION", - "description": " Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", - "canonical": true, - "file": "security_center.list_event_threat_detection_custom_modules.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListEventThreatDetectionCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModules", - "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.ListEventThreatDetectionCustomModulesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListEventThreatDetectionCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModules", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_async", - "title": "SecurityCenter updateEventThreatDetectionCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.", - "canonical": true, - "file": "security_center.update_event_threat_detection_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModule", - "async": true, - "parameters": [ - { - "name": "event_threat_detection_custom_module", - "type": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.EventThreatDetectionCustomModule", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModule", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_async", - "title": "SecurityCenter validateEventThreatDetectionCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Validates the given Event Threat Detection custom module.", - "canonical": true, - "file": "security_center.validate_event_threat_detection_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ValidateEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModule", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "raw_text", - "type": "TYPE_STRING" - }, - { - "name": "type", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ValidateEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModule", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_async", - "title": "SecurityCenter getEffectiveEventThreatDetectionCustomModule Sample", - "origin": "API_DEFINITION", - "description": " Gets an effective Event Threat Detection custom module at the given level.", - "canonical": true, - "file": "security_center.get_effective_event_threat_detection_custom_module.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEffectiveEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModule", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "GetEffectiveEventThreatDetectionCustomModule", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModule", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_async", - "title": "SecurityCenter listEffectiveEventThreatDetectionCustomModules Sample", - "origin": "API_DEFINITION", - "description": " Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.", - "canonical": true, - "file": "security_center.list_effective_event_threat_detection_custom_modules.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListEffectiveEventThreatDetectionCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModules", - "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.ListEffectiveEventThreatDetectionCustomModulesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListEffectiveEventThreatDetectionCustomModules", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModules", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_async", - "title": "SecurityCenter batchCreateResourceValueConfigs Sample", - "origin": "API_DEFINITION", - "description": " Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.", - "canonical": true, - "file": "security_center.batch_create_resource_value_configs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateResourceValueConfigs", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "BatchCreateResourceValueConfigs", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_async", - "title": "SecurityCenter deleteResourceValueConfig Sample", - "origin": "API_DEFINITION", - "description": " Deletes a ResourceValueConfig.", - "canonical": true, - "file": "security_center.delete_resource_value_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteResourceValueConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "DeleteResourceValueConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_async", - "title": "SecurityCenter getResourceValueConfig Sample", - "origin": "API_DEFINITION", - "description": " Gets a ResourceValueConfig.", - "canonical": true, - "file": "security_center.get_resource_value_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetResourceValueConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ResourceValueConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "GetResourceValueConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_async", - "title": "SecurityCenter listResourceValueConfigs Sample", - "origin": "API_DEFINITION", - "description": " Lists all ResourceValueConfigs.", - "canonical": true, - "file": "security_center.list_resource_value_configs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListResourceValueConfigs", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigs", - "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.ListResourceValueConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListResourceValueConfigs", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_async", - "title": "SecurityCenter updateResourceValueConfig Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing ResourceValueConfigs with new rules.", - "canonical": true, - "file": "security_center.update_resource_value_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateResourceValueConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfig", - "async": true, - "parameters": [ - { - "name": "resource_value_config", - "type": ".google.cloud.securitycenter.v1.ResourceValueConfig" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ResourceValueConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateResourceValueConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListValuedResources_async", - "title": "SecurityCenter listValuedResources Sample", - "origin": "API_DEFINITION", - "description": " Lists the valued resources for a set of simulation results and filter.", - "canonical": true, - "file": "security_center.list_valued_resources.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListValuedResources", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListValuedResources", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ListValuedResourcesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListValuedResources", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListValuedResources", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListAttackPaths_async", - "title": "SecurityCenter listAttackPaths Sample", - "origin": "API_DEFINITION", - "description": " Lists the attack paths for a set of simulation results or valued resources and filter.", - "canonical": true, - "file": "security_center.list_attack_paths.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAttackPaths", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAttackPaths", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ListAttackPathsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "ListAttackPaths", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAttackPaths", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js deleted file mode 100644 index bfb25900b23..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callCreateFinding() { - // Construct request - const request = { - parent, - findingId, - finding, - }; - - // Run request - const response = await securitycenterClient.createFinding(request); - console.log(response); - } - - callCreateFinding(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js deleted file mode 100644 index 7c886bd0783..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callCreateSource() { - // Construct request - const request = { - parent, - source, - }; - - // Run request - const response = await securitycenterClient.createSource(request); - console.log(response); - } - - callCreateSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js deleted file mode 100644 index 0d291a776ba..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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`. - */ - // const options = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await securitycenterClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js deleted file mode 100644 index fe5cff18804..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callGetOrganizationSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getOrganizationSettings(request); - console.log(response); - } - - callGetOrganizationSettings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js deleted file mode 100644 index 3e2feb62385..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callGetSource() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getSource(request); - console.log(response); - } - - callGetSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js deleted file mode 100644 index 74aa4670b37..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callGroupAssets() { - // Construct request - const request = { - parent, - groupBy, - }; - - // Run request - const iterable = securitycenterClient.groupAssetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callGroupAssets(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js deleted file mode 100644 index 9f68d14b7f0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callGroupFindings() { - // Construct request - const request = { - parent, - groupBy, - }; - - // Run request - const iterable = securitycenterClient.groupFindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callGroupFindings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js deleted file mode 100644 index f7a78250c53..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callListAssets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listAssetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAssets(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js deleted file mode 100644 index 4c9da681eff..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callListFindings() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listFindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListFindings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js deleted file mode 100644 index b371c9da77c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callListSources() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listSourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSources(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js deleted file mode 100644 index 136a5390702..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callRunAssetDiscovery() { - // Construct request - const request = { - parent, - }; - - // Run request - const [operation] = await securitycenterClient.runAssetDiscovery(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRunAssetDiscovery(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js deleted file mode 100644 index 1d71876924d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callSetFindingState() { - // Construct request - const request = { - name, - state, - startTime, - }; - - // Run request - const response = await securitycenterClient.setFindingState(request); - console.log(response); - } - - callSetFindingState(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js deleted file mode 100644 index ce159b9a0ac..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 = {} - /** - * 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; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await securitycenterClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js deleted file mode 100644 index adb7a14d19f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 = ['abc','def'] - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await securitycenterClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js deleted file mode 100644 index c98245c8be0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateFinding() { - // Construct request - const request = { - finding, - }; - - // Run request - const response = await securitycenterClient.updateFinding(request); - console.log(response); - } - - callUpdateFinding(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js deleted file mode 100644 index e2ef636e325..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateOrganizationSettings() { - // Construct request - const request = { - organizationSettings, - }; - - // Run request - const response = await securitycenterClient.updateOrganizationSettings(request); - console.log(response); - } - - callUpdateOrganizationSettings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js deleted file mode 100644 index bfe3b0385a9..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateSecurityMarks() { - // Construct request - const request = { - securityMarks, - }; - - // Run request - const response = await securitycenterClient.updateSecurityMarks(request); - console.log(response); - } - - callUpdateSecurityMarks(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js deleted file mode 100644 index 3f3f3a9c564..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateSource() { - // Construct request - const request = { - source, - }; - - // Run request - const response = await securitycenterClient.updateSource(request); - console.log(response); - } - - callUpdateSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json deleted file mode 100644 index e41fe5b440c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "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": 60, - "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": 67, - "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": 59, - "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": 54, - "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": 54, - "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": 131, - "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": 110, - "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": 136, - "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": 113, - "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": 67, - "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": 55, - "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": 66, - "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": 69, - "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" - } - } - } - }, - { - "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": 62, - "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": 62, - "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": 57, - "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": 57, - "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": 61, - "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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js deleted file mode 100644 index 076d4024764..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callCreateFinding() { - // Construct request - const request = { - parent, - findingId, - finding, - }; - - // Run request - const response = await securitycenterClient.createFinding(request); - console.log(response); - } - - callCreateFinding(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js deleted file mode 100644 index 640abc85120..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callCreateNotificationConfig() { - // Construct request - const request = { - parent, - configId, - notificationConfig, - }; - - // Run request - const response = await securitycenterClient.createNotificationConfig(request); - console.log(response); - } - - callCreateNotificationConfig(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js deleted file mode 100644 index 823ddc36aec..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callCreateSource() { - // Construct request - const request = { - parent, - source, - }; - - // Run request - const response = await securitycenterClient.createSource(request); - console.log(response); - } - - callCreateSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js deleted file mode 100644 index 8d98467bd3a..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callDeleteNotificationConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.deleteNotificationConfig(request); - console.log(response); - } - - callDeleteNotificationConfig(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js deleted file mode 100644 index df279ca8777..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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`. - */ - // const options = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await securitycenterClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js deleted file mode 100644 index c75edfc98f3..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callGetNotificationConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getNotificationConfig(request); - console.log(response); - } - - callGetNotificationConfig(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js deleted file mode 100644 index 8311292782e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callGetOrganizationSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getOrganizationSettings(request); - console.log(response); - } - - callGetOrganizationSettings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js deleted file mode 100644 index b2cc9ac8361..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callGetSource() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getSource(request); - console.log(response); - } - - callGetSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js deleted file mode 100644 index 3b187f63469..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callGroupAssets() { - // Construct request - const request = { - parent, - groupBy, - }; - - // Run request - const iterable = securitycenterClient.groupAssetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callGroupAssets(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js deleted file mode 100644 index 9143e0a95e2..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callGroupFindings() { - // Construct request - const request = { - parent, - groupBy, - }; - - // Run request - const iterable = securitycenterClient.groupFindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callGroupFindings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js deleted file mode 100644 index 6351f41a531..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callListAssets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listAssetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAssets(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js deleted file mode 100644 index 85deac67bed..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callListFindings() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listFindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListFindings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js deleted file mode 100644 index b2fa4fbc780..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callListNotificationConfigs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listNotificationConfigsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListNotificationConfigs(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js deleted file mode 100644 index 444040d32b4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callListSources() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listSourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSources(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js deleted file mode 100644 index 341171e330f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_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. - */ - /** - * 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 callRunAssetDiscovery() { - // Construct request - const request = { - parent, - }; - - // Run request - const [operation] = await securitycenterClient.runAssetDiscovery(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRunAssetDiscovery(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js deleted file mode 100644 index c45f132d97c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, 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. - */ - /** - * 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 callSetFindingState() { - // Construct request - const request = { - name, - state, - startTime, - }; - - // Run request - const response = await securitycenterClient.setFindingState(request); - console.log(response); - } - - callSetFindingState(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js deleted file mode 100644 index ad06a6ada6d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 = {} - /** - * 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; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await securitycenterClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js deleted file mode 100644 index be4756d9f27..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 = ['abc','def'] - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await securitycenterClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js deleted file mode 100644 index 541476a06a2..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateFinding() { - // Construct request - const request = { - finding, - }; - - // Run request - const response = await securitycenterClient.updateFinding(request); - console.log(response); - } - - callUpdateFinding(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js deleted file mode 100644 index 358882fe53d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateNotificationConfig() { - // Construct request - const request = { - notificationConfig, - }; - - // Run request - const response = await securitycenterClient.updateNotificationConfig(request); - console.log(response); - } - - callUpdateNotificationConfig(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js deleted file mode 100644 index 2124db502a0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateOrganizationSettings() { - // Construct request - const request = { - organizationSettings, - }; - - // Run request - const response = await securitycenterClient.updateOrganizationSettings(request); - console.log(response); - } - - callUpdateOrganizationSettings(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js deleted file mode 100644 index d8655bcd440..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateSecurityMarks() { - // Construct request - const request = { - securityMarks, - }; - - // Run request - const response = await securitycenterClient.updateSecurityMarks(request); - console.log(response); - } - - callUpdateSecurityMarks(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js deleted file mode 100644 index 3d4a7dddfef..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -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. - */ - /** - * 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 callUpdateSource() { - // Construct request - const request = { - source, - }; - - // Run request - const response = await securitycenterClient.updateSource(request); - console.log(response); - } - - callUpdateSource(); - // [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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json deleted file mode 100644 index 73ceda373e3..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json +++ /dev/null @@ -1,1123 +0,0 @@ -{ - "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": 60, - "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": 65, - "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": 67, - "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": 54, - "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": 59, - "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": 54, - "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": 54, - "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": 54, - "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": 168, - "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": 164, - "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": 177, - "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": 173, - "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": 67, - "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": 68, - "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": 55, - "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": 66, - "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": 69, - "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" - } - } - } - }, - { - "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": 62, - "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": 66, - "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": 58, - "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": 58, - "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": 58, - "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": 66, - "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/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js deleted file mode 100644 index 6cf6f770cf3..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.batch_create_resource_value_configs.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, requests) { - // [START securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Resource name of the new ResourceValueConfig's parent. - * The parent field in the CreateResourceValueConfigRequest - * messages must either be empty or match this field. - */ - // const parent = 'abc123' - /** - * Required. The resource value configs to be created. - */ - // const requests = [1,2,3,4] - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callBatchCreateResourceValueConfigs() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const response = await securitycenterClient.batchCreateResourceValueConfigs(request); - console.log(response); - } - - callBatchCreateResourceValueConfigs(); - // [END securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js deleted file mode 100644 index d0d95d3b9f1..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.bulk_mute_findings.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. The parent, at which bulk action needs to be applied. If no - * location is specified, findings are updated in global. The following list - * shows some examples: - * + `organizations/[organization_id]` - * + `organizations/[organization_id]/locations/[location_id]` - * + `folders/[folder_id]` - * + `folders/[folder_id]/locations/[location_id]` - * + `projects/[project_id]` - * + `projects/[project_id]/locations/[location_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' - /** - * Optional. All findings matching the given filter will have their mute state - * set to this value. The default value is `MUTED`. Setting this to - * `UNDEFINED` will clear the mute state on all matching findings. - */ - // const muteState = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_BulkMuteFindings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js deleted file mode 100644 index 3ec09a4c9ca..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_big_query_export.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. The name of the parent resource of the new BigQuery export. Its - * format is `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_id]`. - */ - // const parent = 'abc123' - /** - * Required. The BigQuery export being created. - */ - // const bigQueryExport = {} - /** - * Required. Unique identifier provided by the client within the parent scope. - * It must consist of only lowercase letters, numbers, and hyphens, must start - * with a letter, must end with either a letter or a number, and must be 63 - * characters or less. - */ - // const bigQueryExportId = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_CreateBigQueryExport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js deleted file mode 100644 index 3af8374d077..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_finding.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, findingId, finding) { - // [START securitycenter_v2_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. - */ - /** - * Required. Resource name of the new finding's parent. The following list - * shows some examples of the format: - * + - * `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callCreateFinding() { - // Construct request - const request = { - parent, - findingId, - finding, - }; - - // Run request - const response = await securitycenterClient.createFinding(request); - console.log(response); - } - - callCreateFinding(); - // [END securitycenter_v2_generated_SecurityCenter_CreateFinding_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js deleted file mode 100644 index 5e0fccbadeb..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_mute_config.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, muteConfig, muteConfigId) { - // [START securitycenter_v2_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. - */ - /** - * Required. Resource name of the new mute configs's parent. Its format is - * `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_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 only lowercase letters, numbers, and hyphens, must start - * with a letter, must end with either a letter or a number, and must be 63 - * characters or less. - */ - // const muteConfigId = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_CreateMuteConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js deleted file mode 100644 index 31b796f4b33..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_notification_config.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, configId, notificationConfig) { - // [START securitycenter_v2_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. - */ - /** - * Required. Resource name of the new notification config's parent. Its format - * is `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_id]`. - */ - // const parent = 'abc123' - /** - * Required. - * Unique identifier provided by the client within the parent scope. - * It must be between 1 and 128 characters and contain 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callCreateNotificationConfig() { - // Construct request - const request = { - parent, - configId, - notificationConfig, - }; - - // Run request - const response = await securitycenterClient.createNotificationConfig(request); - console.log(response); - } - - callCreateNotificationConfig(); - // [END securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js deleted file mode 100644 index 7c60ffa8db5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.create_source.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, source) { - // [START securitycenter_v2_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. - */ - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callCreateSource() { - // Construct request - const request = { - parent, - source, - }; - - // Run request - const response = await securitycenterClient.createSource(request); - console.log(response); - } - - callCreateSource(); - // [END securitycenter_v2_generated_SecurityCenter_CreateSource_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js deleted file mode 100644 index b9bccdda6c5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_big_query_export.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. The name of the BigQuery export to delete. The following list - * shows some examples of the format: - * + - * `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - * + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - * + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_DeleteBigQueryExport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js deleted file mode 100644 index 97f11c9ee2c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_mute_config.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. Name of the mute config to delete. The following list shows some - * examples of the format: - * + `organizations/{organization}/muteConfigs/{config_id}` - * + - * `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - * + `folders/{folder}/muteConfigs/{config_id}` - * + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - * + `projects/{project}/muteConfigs/{config_id}` - * + `projects/{project}/locations/{location}/muteConfigs/{config_id}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_DeleteMuteConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js deleted file mode 100644 index 7d80dbadcc4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_notification_config.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. Name of the notification config to delete. The following list - * shows some examples of the format: - * + - * `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - * + - * `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` - * + - * `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callDeleteNotificationConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.deleteNotificationConfig(request); - console.log(response); - } - - callDeleteNotificationConfig(); - // [END securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js deleted file mode 100644 index 1ed949da608..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.delete_resource_value_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_generated_SecurityCenter_DeleteResourceValueConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the ResourceValueConfig to delete - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callDeleteResourceValueConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.deleteResourceValueConfig(request); - console.log(response); - } - - callDeleteResourceValueConfig(); - // [END securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js deleted file mode 100644 index 317cde2e26c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_big_query_export.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. Name of the BigQuery export to retrieve. The following list shows - * some examples of the format: - * + - * `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - * + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - * + `projects/{project}locations/{location}//bigQueryExports/{export_id}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_GetBigQueryExport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js deleted file mode 100644 index bdee3a80881..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource) { - // [START securitycenter_v2_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. - */ - /** - * 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`. - */ - // const options = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await securitycenterClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END securitycenter_v2_generated_SecurityCenter_GetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js deleted file mode 100644 index 47b0b08601c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_mute_config.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. Name of the mute config to retrieve. The following list shows - * some examples of the format: - * + `organizations/{organization}/muteConfigs/{config_id}` - * + - * `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - * + `folders/{folder}/muteConfigs/{config_id}` - * + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - * + `projects/{project}/muteConfigs/{config_id}` - * + `projects/{project}/locations/{location}/muteConfigs/{config_id}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_GetMuteConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js deleted file mode 100644 index fcf405cecde..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_notification_config.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. Name of the notification config to get. The following list shows - * some examples of the format: - * + - * `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - * + - * `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` - * + - * `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetNotificationConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getNotificationConfig(request); - console.log(response); - } - - callGetNotificationConfig(); - // [END securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js deleted file mode 100644 index 023825c41a8..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_resource_value_config.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_generated_SecurityCenter_GetResourceValueConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource value config to retrieve. Its format is - * organizations/{organization}/resourceValueConfigs/{config_id}. - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetResourceValueConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getResourceValueConfig(request); - console.log(response); - } - - callGetResourceValueConfig(); - // [END securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js deleted file mode 100644 index acfea02f280..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_simulation.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_generated_SecurityCenter_GetSimulation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The organization name or simulation name of this simulation - * Valid format: - * `organizations/{organization}/simulations/latest` - * `organizations/{organization}/simulations/{simulation}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetSimulation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getSimulation(request); - console.log(response); - } - - callGetSimulation(); - // [END securitycenter_v2_generated_SecurityCenter_GetSimulation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js deleted file mode 100644 index 41203efec24..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_source.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetSource() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getSource(request); - console.log(response); - } - - callGetSource(); - // [END securitycenter_v2_generated_SecurityCenter_GetSource_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js deleted file mode 100644 index 5c06609490c..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.get_valued_resource.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_generated_SecurityCenter_GetValuedResource_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of this valued resource - * Valid format: - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - */ - // const name = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGetValuedResource() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await securitycenterClient.getValuedResource(request); - console.log(response); - } - - callGetValuedResource(); - // [END securitycenter_v2_generated_SecurityCenter_GetValuedResource_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js deleted file mode 100644 index b95183c426b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.group_findings.js +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, groupBy) { - // [START securitycenter_v2_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. - */ - /** - * Required. Name of the source to groupBy. If no location is specified, - * finding is assumed to be in global. - * The following list shows some examples: - * + `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - * + `folders/[folder_id]/sources/[source_id]` - * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - * + `projects/[project_id]/sources/[source_id]` - * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - * To groupBy across all sources provide a source_id of `-`. The following - * list shows some examples: - * + `organizations/{organization_id}/sources/-` - * + `organizations/{organization_id}/sources/-/locations/[location_id]` - * + `folders/{folder_id}/sources/-` - * + `folders/{folder_id}/sources/-/locations/[location_id]` - * + `projects/{project_id}/sources/-` - * + `projects/{project_id}/sources/-/locations/[location_id]` - */ - // 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 - * * 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: `=`, `:` - * * security_marks.marks: `=`, `:` - * * 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. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: "parent,resource_name". - */ - // const groupBy = 'abc123' - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callGroupFindings() { - // Construct request - const request = { - parent, - groupBy, - }; - - // Run request - const iterable = securitycenterClient.groupFindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callGroupFindings(); - // [END securitycenter_v2_generated_SecurityCenter_GroupFindings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js deleted file mode 100644 index fd7ebda4f62..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_attack_paths.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_generated_SecurityCenter_ListAttackPaths_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of parent to list attack paths. - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - */ - // const parent = 'abc123' - /** - * The filter expression that filters the attack path in the response. - * Supported fields: - * * `valued_resources` supports = - */ - // const filter = 'abc123' - /** - * The value returned by the last `ListAttackPathsResponse`; indicates - * that this is a continuation of a prior `ListAttackPaths` 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListAttackPaths() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listAttackPathsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAttackPaths(); - // [END securitycenter_v2_generated_SecurityCenter_ListAttackPaths_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js deleted file mode 100644 index a61a2417283..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_big_query_exports.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. The parent, which owns the collection of BigQuery exports. Its - * format is `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListBigQueryExports() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listBigQueryExportsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBigQueryExports(); - // [END securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js deleted file mode 100644 index 481b1cd1c23..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_findings.js +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. Name of the source the findings belong to. If no location is - * specified, the default is global. The following list shows some examples: - * + `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - * + `folders/[folder_id]/sources/[source_id]` - * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - * + `projects/[project_id]/sources/[source_id]` - * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - * To list across all sources provide a source_id of `-`. The following - * list shows some examples: - * + `organizations/{organization_id}/sources/-` - * + `organizations/{organization_id}/sources/-/locations/{location_id}` - * + `folders/{folder_id}/sources/-` - * + `folders/{folder_id}/sources/-locations/{location_id}` - * + `projects/{projects_id}/sources/-` - * + `projects/{projects_id}/sources/-/locations/{location_id}` - */ - // 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 - * * 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: `=`, `:` - * * security_marks.marks: `=`, `:` - * * resource: - * * resource.name: `=`, `:` - * * resource.parent_name: `=`, `:` - * * resource.parent_display_name: `=`, `:` - * * resource.project_name: `=`, `:` - * * resource.project_display_name: `=`, `:` - * * resource.type: `=`, `:` - * * resource.folders.resource_folder: `=`, `:` - * * resource.display_name: `=`, `:` - */ - // 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,parent". 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,parent". Redundant space characters in the - * syntax are insignificant. "name desc,parent" and " - * name desc , parent " are equivalent. - * The following fields are supported: - * name - * parent - * state - * category - * resource_name - * event_time - * security_marks.marks - */ - // const orderBy = 'abc123' - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListFindings() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listFindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListFindings(); - // [END securitycenter_v2_generated_SecurityCenter_ListFindings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js deleted file mode 100644 index 4c3cadf5ed5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_mute_configs.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. The parent, which owns the collection of mute configs. Its format - * is `organizations/[organization_id]", "folders/[folder_id]`, - * `projects/[project_id]`, - * `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, - * `projects/[project_id]/locations/[location_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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListMuteConfigs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listMuteConfigsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListMuteConfigs(); - // [END securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js deleted file mode 100644 index 7e477d62385..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_notification_configs.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * Required. The name of the parent in which to list the notification - * configurations. Its format is - * "organizations/[organization_id]/locations/[location_id]", - * "folders/[folder_id]/locations/[location_id]", or - * "projects/[project_id]/locations/[location_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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListNotificationConfigs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listNotificationConfigsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListNotificationConfigs(); - // [END securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js deleted file mode 100644 index 62d9cca0815..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_resource_value_configs.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_generated_SecurityCenter_ListResourceValueConfigs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns the collection of resource value configs. - * Its format is - * `organizations/[organization_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 `ListResourceValueConfigs` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListResourceValueConfigs` must match the call that provided the - * page token. - * page_size can be specified, and the new page_size will be used. - */ - // const pageToken = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListResourceValueConfigs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listResourceValueConfigsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListResourceValueConfigs(); - // [END securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js deleted file mode 100644 index faa02e7df5f..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_sources.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListSources() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listSourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSources(); - // [END securitycenter_v2_generated_SecurityCenter_ListSources_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js deleted file mode 100644 index d85336ee89e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.list_valued_resources.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_generated_SecurityCenter_ListValuedResources_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of parent to list exposed resources. - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - */ - // const parent = 'abc123' - /** - * The filter expression that filters the valued resources in the response. - * Supported fields: - * * `resource_value` supports = - * * `resource_type` supports = - */ - // const filter = 'abc123' - /** - * The value returned by the last `ListValuedResourcesResponse`; indicates - * that this is a continuation of a prior `ListValuedResources` 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 - /** - * Optional. The fields by which to order the valued resources response. - * Supported fields: - * * `exposed_score` - * * `resource_value` - * * `resource_type` - * Values should be a comma separated list of fields. For example: - * `exposed_score,resource_value`. - * The default sorting order is descending. To specify ascending or descending - * order for a field, append a " ASC" or a " DESC" suffix, respectively; for - * example: `exposed_score DESC`. - */ - // const orderBy = 'abc123' - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callListValuedResources() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = securitycenterClient.listValuedResourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListValuedResources(); - // [END securitycenter_v2_generated_SecurityCenter_ListValuedResources_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js deleted file mode 100644 index f2134f465e7..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_finding_state.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, state) { - // [START securitycenter_v2_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. - */ - /** - * Required. The relative resource - * name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * of the finding. If no location is specified, finding is assumed to be in - * global. The following list shows some examples: - * + - * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - * + - * `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - * + - * `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - * + - * `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - */ - // const name = 'abc123' - /** - * Required. The desired State of the finding. - */ - // const state = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callSetFindingState() { - // Construct request - const request = { - name, - state, - }; - - // Run request - const response = await securitycenterClient.setFindingState(request); - console.log(response); - } - - callSetFindingState(); - // [END securitycenter_v2_generated_SecurityCenter_SetFindingState_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js deleted file mode 100644 index b1eff3f2bc9..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, policy) { - // [START securitycenter_v2_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. - */ - /** - * 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 = {} - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await securitycenterClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END securitycenter_v2_generated_SecurityCenter_SetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js deleted file mode 100644 index 1d00d726d5d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.set_mute.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, mute) { - // [START securitycenter_v2_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. - */ - /** - * Required. The relative resource - * name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * of the finding. If no location is specified, finding is assumed to be in - * global. The following list shows some examples: - * + - * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - * + - * `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - * + - * `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - * + - * `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - */ - // const name = 'abc123' - /** - * Required. The desired state of the Mute. - */ - // const mute = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_SetMute_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js deleted file mode 100644 index cbeb24944e5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, permissions) { - // [START securitycenter_v2_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. - */ - /** - * 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 = ['abc','def'] - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await securitycenterClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END securitycenter_v2_generated_SecurityCenter_TestIamPermissions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js deleted file mode 100644 index 7ed0fd29fcf..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_big_query_export.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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_v2_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. - */ - /** - * 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/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_UpdateBigQueryExport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js deleted file mode 100644 index 98bd94a4053..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_external_system.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(externalSystem) { - // [START securitycenter_v2_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. - */ - /** - * 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/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_UpdateExternalSystem_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js deleted file mode 100644 index e1061b07c24..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_finding.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(finding) { - // [START securitycenter_v2_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. - */ - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callUpdateFinding() { - // Construct request - const request = { - finding, - }; - - // Run request - const response = await securitycenterClient.updateFinding(request); - console.log(response); - } - - callUpdateFinding(); - // [END securitycenter_v2_generated_SecurityCenter_UpdateFinding_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js deleted file mode 100644 index 25bd6ab2541..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_mute_config.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(muteConfig) { - // [START securitycenter_v2_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. - */ - /** - * 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/securitycenter').v2; - - // 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_v2_generated_SecurityCenter_UpdateMuteConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js deleted file mode 100644 index f3e87f0e710..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_notification_config.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(notificationConfig) { - // [START securitycenter_v2_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. - */ - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callUpdateNotificationConfig() { - // Construct request - const request = { - notificationConfig, - }; - - // Run request - const response = await securitycenterClient.updateNotificationConfig(request); - console.log(response); - } - - callUpdateNotificationConfig(); - // [END securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js deleted file mode 100644 index 4fad0d3fe9e..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_resource_value_config.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resourceValueConfig) { - // [START securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource value config being updated. - */ - // const resourceValueConfig = {} - /** - * The list of fields to be updated. - * If empty all mutable fields will be updated. - * To update nested fields, include the top level field in the mask - * For example, to update gcp_metadata.resource_type, include the - * "gcp_metadata" field mask - */ - // const updateMask = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callUpdateResourceValueConfig() { - // Construct request - const request = { - resourceValueConfig, - }; - - // Run request - const response = await securitycenterClient.updateResourceValueConfig(request); - console.log(response); - } - - callUpdateResourceValueConfig(); - // [END securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js deleted file mode 100644 index 25b9591bbdf..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_security_marks.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(securityMarks) { - // [START securitycenter_v2_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. - */ - /** - * 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 = {} - - // Imports the Securitycenter library - const {SecurityCenterClient} = require('@google-cloud/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callUpdateSecurityMarks() { - // Construct request - const request = { - securityMarks, - }; - - // Run request - const response = await securitycenterClient.updateSecurityMarks(request); - console.log(response); - } - - callUpdateSecurityMarks(); - // [END securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js deleted file mode 100644 index 1f44431bfb5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/security_center.update_source.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(source) { - // [START securitycenter_v2_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. - */ - /** - * 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/securitycenter').v2; - - // Instantiates a client - const securitycenterClient = new SecurityCenterClient(); - - async function callUpdateSource() { - // Construct request - const request = { - source, - }; - - // Run request - const response = await securitycenterClient.updateSource(request); - console.log(response); - } - - callUpdateSource(); - // [END securitycenter_v2_generated_SecurityCenter_UpdateSource_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json b/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json deleted file mode 100644 index c59a76de87b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json +++ /dev/null @@ -1,1823 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-securitycenter", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.securitycenter.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_async", - "title": "SecurityCenter batchCreateResourceValueConfigs Sample", - "origin": "API_DEFINITION", - "description": " Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.", - "canonical": true, - "file": "security_center.batch_create_resource_value_configs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateResourceValueConfigs", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "BatchCreateResourceValueConfigs", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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. If no location is specified, findings are muted in global. 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": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BulkMuteFindings", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.BulkMuteFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "mute_state", - "type": ".google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "BulkMuteFindings", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.BulkMuteFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_async", - "title": "SecurityCenter createBigQueryExport Sample", - "origin": "API_DEFINITION", - "description": " Creates a BigQuery export.", - "canonical": true, - "file": "security_center.create_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBigQueryExport", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateBigQueryExport", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "big_query_export", - "type": ".google.cloud.securitycenter.v2.BigQueryExport" - }, - { - "name": "big_query_export_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.BigQueryExport", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "CreateBigQueryExport", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateBigQueryExport", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_CreateFinding_async", - "title": "SecurityCenter createFinding Sample", - "origin": "API_DEFINITION", - "description": " Creates a finding in a location. The corresponding source must exist for finding creation to succeed.", - "canonical": true, - "file": "security_center.create_finding.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateFinding", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateFinding", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "finding_id", - "type": "TYPE_STRING" - }, - { - "name": "finding", - "type": ".google.cloud.securitycenter.v2.Finding" - } - ], - "resultType": ".google.cloud.securitycenter.v2.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "CreateFinding", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateFinding", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateMuteConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateMuteConfig", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "mute_config", - "type": ".google.cloud.securitycenter.v2.MuteConfig" - }, - { - "name": "mute_config_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.MuteConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "CreateMuteConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateMuteConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNotificationConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateNotificationConfig", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "config_id", - "type": "TYPE_STRING" - }, - { - "name": "notification_config", - "type": ".google.cloud.securitycenter.v2.NotificationConfig" - } - ], - "resultType": ".google.cloud.securitycenter.v2.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "CreateNotificationConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSource", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateSource", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source", - "type": ".google.cloud.securitycenter.v2.Source" - } - ], - "resultType": ".google.cloud.securitycenter.v2.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "CreateSource", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.CreateSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_async", - "title": "SecurityCenter deleteBigQueryExport Sample", - "origin": "API_DEFINITION", - "description": " Deletes an existing BigQuery export.", - "canonical": true, - "file": "security_center.delete_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBigQueryExport", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteBigQueryExport", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "DeleteBigQueryExport", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteBigQueryExport", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_async", - "title": "SecurityCenter deleteMuteConfig Sample", - "origin": "API_DEFINITION", - "description": " Deletes an existing mute config. If no location is specified, default is global.", - "canonical": true, - "file": "security_center.delete_mute_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteMuteConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteMuteConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "DeleteMuteConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteMuteConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteNotificationConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteNotificationConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "DeleteNotificationConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_async", - "title": "SecurityCenter deleteResourceValueConfig Sample", - "origin": "API_DEFINITION", - "description": " Deletes a ResourceValueConfig.", - "canonical": true, - "file": "security_center.delete_resource_value_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteResourceValueConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "DeleteResourceValueConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_async", - "title": "SecurityCenter getBigQueryExport Sample", - "origin": "API_DEFINITION", - "description": " Gets a BigQuery export.", - "canonical": true, - "file": "security_center.get_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBigQueryExport", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetBigQueryExport", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.BigQueryExport", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GetBigQueryExport", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetBigQueryExport", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_GetSimulation_async", - "title": "SecurityCenter getSimulation Sample", - "origin": "API_DEFINITION", - "description": " Get the simulation by name or the latest simulation for the given organization.", - "canonical": true, - "file": "security_center.get_simulation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSimulation", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetSimulation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.Simulation", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GetSimulation", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetSimulation", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_GetValuedResource_async", - "title": "SecurityCenter getValuedResource Sample", - "origin": "API_DEFINITION", - "description": " Get the valued resource by name", - "canonical": true, - "file": "security_center.get_valued_resource.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetValuedResource", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetValuedResource", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.ValuedResource", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GetValuedResource", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetValuedResource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.securitycenter.v2.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.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetIamPolicy", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_GetMuteConfig_async", - "title": "SecurityCenter getMuteConfig Sample", - "origin": "API_DEFINITION", - "description": " Gets a mute config. If no location is specified, default is global.", - "canonical": true, - "file": "security_center.get_mute_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetMuteConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetMuteConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.MuteConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GetMuteConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetMuteConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNotificationConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetNotificationConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GetNotificationConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_async", - "title": "SecurityCenter getResourceValueConfig Sample", - "origin": "API_DEFINITION", - "description": " Gets a ResourceValueConfig.", - "canonical": true, - "file": "security_center.get_resource_value_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetResourceValueConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.ResourceValueConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GetResourceValueConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSource", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetSource", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GetSource", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GetSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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 in a location. If no location is specified, findings are assumed to be in global To group across all sources provide a `-` as the source id. The following list shows some examples: + `/v2/organizations/{organization_id}/sources/-/findings` + `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + `/v2/folders/{folder_id}/sources/-/findings` + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` + `/v2/projects/{project_id}/sources/-/findings` + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings`", - "canonical": true, - "file": "security_center.group_findings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 130, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GroupFindings", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GroupFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "group_by", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v2.GroupFindingsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "GroupFindings", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.GroupFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_ListAttackPaths_async", - "title": "SecurityCenter listAttackPaths Sample", - "origin": "API_DEFINITION", - "description": " Lists the attack paths for a set of simulation results or valued resources and filter.", - "canonical": true, - "file": "security_center.list_attack_paths.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAttackPaths", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListAttackPaths", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v2.ListAttackPathsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "ListAttackPaths", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListAttackPaths", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBigQueryExports", - "fullName": "google.cloud.securitycenter.v2.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.v2.ListBigQueryExportsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "ListBigQueryExports", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListBigQueryExports", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_ListFindings_async", - "title": "SecurityCenter listFindings Sample", - "origin": "API_DEFINITION", - "description": " Lists an organization or source's findings. To list across all sources for a given location provide a `-` as the source id. If no location is specified, finding are assumed to be in global. The following list shows some examples: + `/v2/organizations/{organization_id}/sources/-/findings` + `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings`", - "canonical": true, - "file": "security_center.list_findings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 148, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListFindings", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v2.ListFindingsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "ListFindings", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_async", - "title": "SecurityCenter listMuteConfigs Sample", - "origin": "API_DEFINITION", - "description": " Lists mute configs. If no location is specified, default is global.", - "canonical": true, - "file": "security_center.list_mute_configs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListMuteConfigs", - "fullName": "google.cloud.securitycenter.v2.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.v2.ListMuteConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "ListMuteConfigs", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListMuteConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNotificationConfigs", - "fullName": "google.cloud.securitycenter.v2.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.v2.ListNotificationConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "ListNotificationConfigs", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListNotificationConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_async", - "title": "SecurityCenter listResourceValueConfigs Sample", - "origin": "API_DEFINITION", - "description": " Lists all ResourceValueConfigs.", - "canonical": true, - "file": "security_center.list_resource_value_configs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListResourceValueConfigs", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.ListResourceValueConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "ListResourceValueConfigs", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSources", - "fullName": "google.cloud.securitycenter.v2.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.v2.ListSourcesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "ListSources", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListSources", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_ListValuedResources_async", - "title": "SecurityCenter listValuedResources Sample", - "origin": "API_DEFINITION", - "description": " Lists the valued resources for a set of simulation results and filter.", - "canonical": true, - "file": "security_center.list_valued_resources.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 90, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListValuedResources", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListValuedResources", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v2.ListValuedResourcesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "ListValuedResources", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.ListValuedResources", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_SetFindingState_async", - "title": "SecurityCenter setFindingState Sample", - "origin": "API_DEFINITION", - "description": " Updates the state of a finding. If no location is specified, finding is assumed to be in global", - "canonical": true, - "file": "security_center.set_finding_state.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetFindingState", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetFindingState", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "state", - "type": ".google.cloud.securitycenter.v2.Finding.State" - } - ], - "resultType": ".google.cloud.securitycenter.v2.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "SetFindingState", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetFindingState", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.securitycenter.v2.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.v2.SecurityCenterClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetIamPolicy", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_SetMute_async", - "title": "SecurityCenter setMute Sample", - "origin": "API_DEFINITION", - "description": " Updates the mute state of a finding. If no location is specified, finding is assumed to be in global", - "canonical": true, - "file": "security_center.set_mute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMute", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetMute", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "mute", - "type": ".google.cloud.securitycenter.v2.Finding.Mute" - } - ], - "resultType": ".google.cloud.securitycenter.v2.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "SetMute", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.SetMute", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.securitycenter.v2.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.v2.SecurityCenterClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.TestIamPermissions", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBigQueryExport", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateBigQueryExport", - "async": true, - "parameters": [ - { - "name": "big_query_export", - "type": ".google.cloud.securitycenter.v2.BigQueryExport" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v2.BigQueryExport", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateBigQueryExport", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateBigQueryExport", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_async", - "title": "SecurityCenter updateExternalSystem Sample", - "origin": "API_DEFINITION", - "description": " Updates external system. This is for a given finding. If no location is specified, finding is assumed to be in global", - "canonical": true, - "file": "security_center.update_external_system.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateExternalSystem", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateExternalSystem", - "async": true, - "parameters": [ - { - "name": "external_system", - "type": ".google.cloud.securitycenter.v2.ExternalSystem" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v2.ExternalSystem", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateExternalSystem", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateExternalSystem", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateFinding_async", - "title": "SecurityCenter updateFinding Sample", - "origin": "API_DEFINITION", - "description": " Creates or updates a finding. If no location is specified, finding is assumed to be in global. 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": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateFinding", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateFinding", - "async": true, - "parameters": [ - { - "name": "finding", - "type": ".google.cloud.securitycenter.v2.Finding" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v2.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateFinding", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateFinding", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_async", - "title": "SecurityCenter updateMuteConfig Sample", - "origin": "API_DEFINITION", - "description": " Updates a mute config. If no location is specified, default is global.", - "canonical": true, - "file": "security_center.update_mute_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMuteConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateMuteConfig", - "async": true, - "parameters": [ - { - "name": "mute_config", - "type": ".google.cloud.securitycenter.v2.MuteConfig" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v2.MuteConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateMuteConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateMuteConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateNotificationConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateNotificationConfig", - "async": true, - "parameters": [ - { - "name": "notification_config", - "type": ".google.cloud.securitycenter.v2.NotificationConfig" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v2.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateNotificationConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_async", - "title": "SecurityCenter updateResourceValueConfig Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing ResourceValueConfigs with new rules.", - "canonical": true, - "file": "security_center.update_resource_value_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateResourceValueConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfig", - "async": true, - "parameters": [ - { - "name": "resource_value_config", - "type": ".google.cloud.securitycenter.v2.ResourceValueConfig" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v2.ResourceValueConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateResourceValueConfig", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_async", - "title": "SecurityCenter updateSecurityMarks Sample", - "origin": "API_DEFINITION", - "description": " Updates security marks. For Finding Security marks, if no location is specified, finding is assumed to be in global. Assets Security Marks can only be accessed through global endpoint.", - "canonical": true, - "file": "security_center.update_security_marks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSecurityMarks", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSecurityMarks", - "async": true, - "parameters": [ - { - "name": "security_marks", - "type": ".google.cloud.securitycenter.v2.SecurityMarks" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v2.SecurityMarks", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateSecurityMarks", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSecurityMarks", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v2_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": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSource", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSource", - "async": true, - "parameters": [ - { - "name": "source", - "type": ".google.cloud.securitycenter.v2.Source" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v2.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v2.SecurityCenterClient" - }, - "method": { - "shortName": "UpdateSource", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/index.ts deleted file mode 100644 index d0cf15cbb55..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by synthtool. ** -// ** https://github.com/googleapis/synthtool ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -import * as v1beta1 from './v1beta1'; -import * as v1p1beta1 from './v1p1beta1'; -import * as v2 from './v2'; - -const SecurityCenterClient = v1.SecurityCenterClient; -type SecurityCenterClient = v1.SecurityCenterClient; - -export {v1, v1beta1, v1p1beta1, v2, SecurityCenterClient}; -export default {v1, v1beta1, v1p1beta1, v2, SecurityCenterClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-securitycenter/src/v1/gapic_metadata.json deleted file mode 100644 index bf53b41973b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1/gapic_metadata.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "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": { - "CreateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "createSecurityHealthAnalyticsCustomModule" - ] - }, - "CreateSource": { - "methods": [ - "createSource" - ] - }, - "CreateFinding": { - "methods": [ - "createFinding" - ] - }, - "CreateMuteConfig": { - "methods": [ - "createMuteConfig" - ] - }, - "CreateNotificationConfig": { - "methods": [ - "createNotificationConfig" - ] - }, - "DeleteMuteConfig": { - "methods": [ - "deleteMuteConfig" - ] - }, - "DeleteNotificationConfig": { - "methods": [ - "deleteNotificationConfig" - ] - }, - "DeleteSecurityHealthAnalyticsCustomModule": { - "methods": [ - "deleteSecurityHealthAnalyticsCustomModule" - ] - }, - "GetSimulation": { - "methods": [ - "getSimulation" - ] - }, - "GetValuedResource": { - "methods": [ - "getValuedResource" - ] - }, - "GetBigQueryExport": { - "methods": [ - "getBigQueryExport" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetMuteConfig": { - "methods": [ - "getMuteConfig" - ] - }, - "GetNotificationConfig": { - "methods": [ - "getNotificationConfig" - ] - }, - "GetOrganizationSettings": { - "methods": [ - "getOrganizationSettings" - ] - }, - "GetEffectiveSecurityHealthAnalyticsCustomModule": { - "methods": [ - "getEffectiveSecurityHealthAnalyticsCustomModule" - ] - }, - "GetSecurityHealthAnalyticsCustomModule": { - "methods": [ - "getSecurityHealthAnalyticsCustomModule" - ] - }, - "GetSource": { - "methods": [ - "getSource" - ] - }, - "SetFindingState": { - "methods": [ - "setFindingState" - ] - }, - "SetMute": { - "methods": [ - "setMute" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "SimulateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "simulateSecurityHealthAnalyticsCustomModule" - ] - }, - "UpdateExternalSystem": { - "methods": [ - "updateExternalSystem" - ] - }, - "UpdateFinding": { - "methods": [ - "updateFinding" - ] - }, - "UpdateMuteConfig": { - "methods": [ - "updateMuteConfig" - ] - }, - "UpdateNotificationConfig": { - "methods": [ - "updateNotificationConfig" - ] - }, - "UpdateOrganizationSettings": { - "methods": [ - "updateOrganizationSettings" - ] - }, - "UpdateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "updateSecurityHealthAnalyticsCustomModule" - ] - }, - "UpdateSource": { - "methods": [ - "updateSource" - ] - }, - "UpdateSecurityMarks": { - "methods": [ - "updateSecurityMarks" - ] - }, - "CreateBigQueryExport": { - "methods": [ - "createBigQueryExport" - ] - }, - "DeleteBigQueryExport": { - "methods": [ - "deleteBigQueryExport" - ] - }, - "UpdateBigQueryExport": { - "methods": [ - "updateBigQueryExport" - ] - }, - "CreateEventThreatDetectionCustomModule": { - "methods": [ - "createEventThreatDetectionCustomModule" - ] - }, - "DeleteEventThreatDetectionCustomModule": { - "methods": [ - "deleteEventThreatDetectionCustomModule" - ] - }, - "GetEventThreatDetectionCustomModule": { - "methods": [ - "getEventThreatDetectionCustomModule" - ] - }, - "UpdateEventThreatDetectionCustomModule": { - "methods": [ - "updateEventThreatDetectionCustomModule" - ] - }, - "ValidateEventThreatDetectionCustomModule": { - "methods": [ - "validateEventThreatDetectionCustomModule" - ] - }, - "GetEffectiveEventThreatDetectionCustomModule": { - "methods": [ - "getEffectiveEventThreatDetectionCustomModule" - ] - }, - "BatchCreateResourceValueConfigs": { - "methods": [ - "batchCreateResourceValueConfigs" - ] - }, - "DeleteResourceValueConfig": { - "methods": [ - "deleteResourceValueConfig" - ] - }, - "GetResourceValueConfig": { - "methods": [ - "getResourceValueConfig" - ] - }, - "UpdateResourceValueConfig": { - "methods": [ - "updateResourceValueConfig" - ] - }, - "BulkMuteFindings": { - "methods": [ - "bulkMuteFindings" - ] - }, - "RunAssetDiscovery": { - "methods": [ - "runAssetDiscovery" - ] - }, - "GroupAssets": { - "methods": [ - "groupAssets", - "groupAssetsStream", - "groupAssetsAsync" - ] - }, - "GroupFindings": { - "methods": [ - "groupFindings", - "groupFindingsStream", - "groupFindingsAsync" - ] - }, - "ListAssets": { - "methods": [ - "listAssets", - "listAssetsStream", - "listAssetsAsync" - ] - }, - "ListDescendantSecurityHealthAnalyticsCustomModules": { - "methods": [ - "listDescendantSecurityHealthAnalyticsCustomModules", - "listDescendantSecurityHealthAnalyticsCustomModulesStream", - "listDescendantSecurityHealthAnalyticsCustomModulesAsync" - ] - }, - "ListFindings": { - "methods": [ - "listFindings", - "listFindingsStream", - "listFindingsAsync" - ] - }, - "ListMuteConfigs": { - "methods": [ - "listMuteConfigs", - "listMuteConfigsStream", - "listMuteConfigsAsync" - ] - }, - "ListNotificationConfigs": { - "methods": [ - "listNotificationConfigs", - "listNotificationConfigsStream", - "listNotificationConfigsAsync" - ] - }, - "ListEffectiveSecurityHealthAnalyticsCustomModules": { - "methods": [ - "listEffectiveSecurityHealthAnalyticsCustomModules", - "listEffectiveSecurityHealthAnalyticsCustomModulesStream", - "listEffectiveSecurityHealthAnalyticsCustomModulesAsync" - ] - }, - "ListSecurityHealthAnalyticsCustomModules": { - "methods": [ - "listSecurityHealthAnalyticsCustomModules", - "listSecurityHealthAnalyticsCustomModulesStream", - "listSecurityHealthAnalyticsCustomModulesAsync" - ] - }, - "ListSources": { - "methods": [ - "listSources", - "listSourcesStream", - "listSourcesAsync" - ] - }, - "ListBigQueryExports": { - "methods": [ - "listBigQueryExports", - "listBigQueryExportsStream", - "listBigQueryExportsAsync" - ] - }, - "ListDescendantEventThreatDetectionCustomModules": { - "methods": [ - "listDescendantEventThreatDetectionCustomModules", - "listDescendantEventThreatDetectionCustomModulesStream", - "listDescendantEventThreatDetectionCustomModulesAsync" - ] - }, - "ListEventThreatDetectionCustomModules": { - "methods": [ - "listEventThreatDetectionCustomModules", - "listEventThreatDetectionCustomModulesStream", - "listEventThreatDetectionCustomModulesAsync" - ] - }, - "ListEffectiveEventThreatDetectionCustomModules": { - "methods": [ - "listEffectiveEventThreatDetectionCustomModules", - "listEffectiveEventThreatDetectionCustomModulesStream", - "listEffectiveEventThreatDetectionCustomModulesAsync" - ] - }, - "ListResourceValueConfigs": { - "methods": [ - "listResourceValueConfigs", - "listResourceValueConfigsStream", - "listResourceValueConfigsAsync" - ] - }, - "ListValuedResources": { - "methods": [ - "listValuedResources", - "listValuedResourcesStream", - "listValuedResourcesAsync" - ] - }, - "ListAttackPaths": { - "methods": [ - "listAttackPaths", - "listAttackPathsStream", - "listAttackPathsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SecurityCenterClient", - "rpcs": { - "CreateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "createSecurityHealthAnalyticsCustomModule" - ] - }, - "CreateSource": { - "methods": [ - "createSource" - ] - }, - "CreateFinding": { - "methods": [ - "createFinding" - ] - }, - "CreateMuteConfig": { - "methods": [ - "createMuteConfig" - ] - }, - "CreateNotificationConfig": { - "methods": [ - "createNotificationConfig" - ] - }, - "DeleteMuteConfig": { - "methods": [ - "deleteMuteConfig" - ] - }, - "DeleteNotificationConfig": { - "methods": [ - "deleteNotificationConfig" - ] - }, - "DeleteSecurityHealthAnalyticsCustomModule": { - "methods": [ - "deleteSecurityHealthAnalyticsCustomModule" - ] - }, - "GetSimulation": { - "methods": [ - "getSimulation" - ] - }, - "GetValuedResource": { - "methods": [ - "getValuedResource" - ] - }, - "GetBigQueryExport": { - "methods": [ - "getBigQueryExport" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetMuteConfig": { - "methods": [ - "getMuteConfig" - ] - }, - "GetNotificationConfig": { - "methods": [ - "getNotificationConfig" - ] - }, - "GetOrganizationSettings": { - "methods": [ - "getOrganizationSettings" - ] - }, - "GetEffectiveSecurityHealthAnalyticsCustomModule": { - "methods": [ - "getEffectiveSecurityHealthAnalyticsCustomModule" - ] - }, - "GetSecurityHealthAnalyticsCustomModule": { - "methods": [ - "getSecurityHealthAnalyticsCustomModule" - ] - }, - "GetSource": { - "methods": [ - "getSource" - ] - }, - "SetFindingState": { - "methods": [ - "setFindingState" - ] - }, - "SetMute": { - "methods": [ - "setMute" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "SimulateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "simulateSecurityHealthAnalyticsCustomModule" - ] - }, - "UpdateExternalSystem": { - "methods": [ - "updateExternalSystem" - ] - }, - "UpdateFinding": { - "methods": [ - "updateFinding" - ] - }, - "UpdateMuteConfig": { - "methods": [ - "updateMuteConfig" - ] - }, - "UpdateNotificationConfig": { - "methods": [ - "updateNotificationConfig" - ] - }, - "UpdateOrganizationSettings": { - "methods": [ - "updateOrganizationSettings" - ] - }, - "UpdateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "updateSecurityHealthAnalyticsCustomModule" - ] - }, - "UpdateSource": { - "methods": [ - "updateSource" - ] - }, - "UpdateSecurityMarks": { - "methods": [ - "updateSecurityMarks" - ] - }, - "CreateBigQueryExport": { - "methods": [ - "createBigQueryExport" - ] - }, - "DeleteBigQueryExport": { - "methods": [ - "deleteBigQueryExport" - ] - }, - "UpdateBigQueryExport": { - "methods": [ - "updateBigQueryExport" - ] - }, - "CreateEventThreatDetectionCustomModule": { - "methods": [ - "createEventThreatDetectionCustomModule" - ] - }, - "DeleteEventThreatDetectionCustomModule": { - "methods": [ - "deleteEventThreatDetectionCustomModule" - ] - }, - "GetEventThreatDetectionCustomModule": { - "methods": [ - "getEventThreatDetectionCustomModule" - ] - }, - "UpdateEventThreatDetectionCustomModule": { - "methods": [ - "updateEventThreatDetectionCustomModule" - ] - }, - "ValidateEventThreatDetectionCustomModule": { - "methods": [ - "validateEventThreatDetectionCustomModule" - ] - }, - "GetEffectiveEventThreatDetectionCustomModule": { - "methods": [ - "getEffectiveEventThreatDetectionCustomModule" - ] - }, - "BatchCreateResourceValueConfigs": { - "methods": [ - "batchCreateResourceValueConfigs" - ] - }, - "DeleteResourceValueConfig": { - "methods": [ - "deleteResourceValueConfig" - ] - }, - "GetResourceValueConfig": { - "methods": [ - "getResourceValueConfig" - ] - }, - "UpdateResourceValueConfig": { - "methods": [ - "updateResourceValueConfig" - ] - }, - "BulkMuteFindings": { - "methods": [ - "bulkMuteFindings" - ] - }, - "RunAssetDiscovery": { - "methods": [ - "runAssetDiscovery" - ] - }, - "GroupAssets": { - "methods": [ - "groupAssets", - "groupAssetsStream", - "groupAssetsAsync" - ] - }, - "GroupFindings": { - "methods": [ - "groupFindings", - "groupFindingsStream", - "groupFindingsAsync" - ] - }, - "ListAssets": { - "methods": [ - "listAssets", - "listAssetsStream", - "listAssetsAsync" - ] - }, - "ListDescendantSecurityHealthAnalyticsCustomModules": { - "methods": [ - "listDescendantSecurityHealthAnalyticsCustomModules", - "listDescendantSecurityHealthAnalyticsCustomModulesStream", - "listDescendantSecurityHealthAnalyticsCustomModulesAsync" - ] - }, - "ListFindings": { - "methods": [ - "listFindings", - "listFindingsStream", - "listFindingsAsync" - ] - }, - "ListMuteConfigs": { - "methods": [ - "listMuteConfigs", - "listMuteConfigsStream", - "listMuteConfigsAsync" - ] - }, - "ListNotificationConfigs": { - "methods": [ - "listNotificationConfigs", - "listNotificationConfigsStream", - "listNotificationConfigsAsync" - ] - }, - "ListEffectiveSecurityHealthAnalyticsCustomModules": { - "methods": [ - "listEffectiveSecurityHealthAnalyticsCustomModules", - "listEffectiveSecurityHealthAnalyticsCustomModulesStream", - "listEffectiveSecurityHealthAnalyticsCustomModulesAsync" - ] - }, - "ListSecurityHealthAnalyticsCustomModules": { - "methods": [ - "listSecurityHealthAnalyticsCustomModules", - "listSecurityHealthAnalyticsCustomModulesStream", - "listSecurityHealthAnalyticsCustomModulesAsync" - ] - }, - "ListSources": { - "methods": [ - "listSources", - "listSourcesStream", - "listSourcesAsync" - ] - }, - "ListBigQueryExports": { - "methods": [ - "listBigQueryExports", - "listBigQueryExportsStream", - "listBigQueryExportsAsync" - ] - }, - "ListDescendantEventThreatDetectionCustomModules": { - "methods": [ - "listDescendantEventThreatDetectionCustomModules", - "listDescendantEventThreatDetectionCustomModulesStream", - "listDescendantEventThreatDetectionCustomModulesAsync" - ] - }, - "ListEventThreatDetectionCustomModules": { - "methods": [ - "listEventThreatDetectionCustomModules", - "listEventThreatDetectionCustomModulesStream", - "listEventThreatDetectionCustomModulesAsync" - ] - }, - "ListEffectiveEventThreatDetectionCustomModules": { - "methods": [ - "listEffectiveEventThreatDetectionCustomModules", - "listEffectiveEventThreatDetectionCustomModulesStream", - "listEffectiveEventThreatDetectionCustomModulesAsync" - ] - }, - "ListResourceValueConfigs": { - "methods": [ - "listResourceValueConfigs", - "listResourceValueConfigsStream", - "listResourceValueConfigsAsync" - ] - }, - "ListValuedResources": { - "methods": [ - "listValuedResources", - "listValuedResourcesStream", - "listValuedResourcesAsync" - ] - }, - "ListAttackPaths": { - "methods": [ - "listAttackPaths", - "listAttackPathsStream", - "listAttackPathsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1/index.ts deleted file mode 100644 index 750912594f5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {SecurityCenterClient} from './security_center_client'; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client.ts deleted file mode 100644 index 5952c112138..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client.ts +++ /dev/null @@ -1,12666 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * 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'; -const version = require('../../../package.json').version; - -/** - * V1 APIs for Security Center service. - * @class - * @memberof v1 - */ -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: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('security-center'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - securityCenterStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of 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/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * 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: true}, 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; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'securitycenter.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - attackPathPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}' - ), - folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/assets/{asset}/securityMarks' - ), - folderAssetsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/assets/{asset}' - ), - folderBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/bigQueryExports/{export}' - ), - folderConstraintNamePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/policies/{constraint_name}' - ), - folderEventThreatDetectionSettingsModulePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}' - ), - folderLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/locations/{location}/muteConfigs/{mute_config}' - ), - folderMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/muteConfigs/{mute_config}' - ), - folderNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/notificationConfigs/{notification_config}' - ), - folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/securityHealthAnalyticsSettings/customModules/{custom_module}' - ), - folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}' - ), - folderSourcePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}' - ), - folderSourceFindingExternalSystemsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' - ), - folderSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' - ), - folderSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}/findings/{finding}' - ), - organizationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}' - ), - organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), - organizationAssetsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}' - ), - organizationBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/bigQueryExports/{export}' - ), - organizationConstraintNamePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/policies/{constraint_name}' - ), - organizationEventThreatDetectionSettingsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/eventThreatDetectionSettings' - ), - organizationEventThreatDetectionSettingsModulePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}' - ), - organizationLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/muteConfigs/{mute_config}' - ), - organizationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/muteConfigs/{mute_config}' - ), - organizationNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationConfigs/{notification_config}' - ), - organizationSecurityHealthAnalyticsSettingsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/securityHealthAnalyticsSettings' - ), - organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/securityHealthAnalyticsSettings/customModules/{custom_module}' - ), - organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}' - ), - organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/organizationSettings' - ), - organizationSimulationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/simulations/{simulation}' - ), - organizationSourcePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' - ), - organizationSourceFindingExternalSystemsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' - ), - organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' - ), - organizationSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' - ), - projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/assets/{asset}/securityMarks' - ), - projectAssetsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/assets/{asset}' - ), - projectBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/bigQueryExports/{export}' - ), - projectConstraintNamePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/policies/{constraint_name}' - ), - projectEventThreatDetectionSettingsModulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}' - ), - projectLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/muteConfigs/{mute_config}' - ), - projectMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/muteConfigs/{mute_config}' - ), - projectNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/notificationConfigs/{notification_config}' - ), - projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/securityHealthAnalyticsSettings/customModules/{custom_module}' - ), - projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}' - ), - projectSourcePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}' - ), - projectSourceFindingExternalSystemsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' - ), - projectSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}/findings/{finding}/securityMarks' - ), - projectSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}/findings/{finding}' - ), - resourceValueConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/resourceValueConfigs/{resource_value_config}' - ), - simulationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/simulations/{simulation}' - ), - valuedResourcePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}' - ), - }; - - // 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 this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), - groupFindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), - listAssets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listAssetsResults'), - listDescendantSecurityHealthAnalyticsCustomModules: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'securityHealthAnalyticsCustomModules'), - listFindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listFindingsResults'), - listMuteConfigs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'muteConfigs'), - listNotificationConfigs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'notificationConfigs'), - listEffectiveSecurityHealthAnalyticsCustomModules: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'effectiveSecurityHealthAnalyticsCustomModules'), - listSecurityHealthAnalyticsCustomModules: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'securityHealthAnalyticsCustomModules'), - listSources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sources'), - listBigQueryExports: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'bigQueryExports'), - listDescendantEventThreatDetectionCustomModules: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'eventThreatDetectionCustomModules'), - listEventThreatDetectionCustomModules: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'eventThreatDetectionCustomModules'), - listEffectiveEventThreatDetectionCustomModules: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'effectiveEventThreatDetectionCustomModules'), - listResourceValueConfigs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceValueConfigs'), - listValuedResources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'valuedResources'), - listAttackPaths: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attackPaths') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { - 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(lroOptions).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; - const runAssetDiscoveryMetadata = protoFilesRoot.lookup( - '.google.protobuf.Empty') 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), - runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.securitycenter.v1.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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.securityCenterStub) { - return this.securityCenterStub; - } - - // Put together the "service stub" for - // google.cloud.securitycenter.v1.SecurityCenter. - this.securityCenterStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.securitycenter.v1.SecurityCenter') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.securitycenter.v1.SecurityCenter, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const securityCenterStubMethods = - ['bulkMuteFindings', 'createSecurityHealthAnalyticsCustomModule', 'createSource', 'createFinding', 'createMuteConfig', 'createNotificationConfig', 'deleteMuteConfig', 'deleteNotificationConfig', 'deleteSecurityHealthAnalyticsCustomModule', 'getSimulation', 'getValuedResource', 'getBigQueryExport', 'getIamPolicy', 'getMuteConfig', 'getNotificationConfig', 'getOrganizationSettings', 'getEffectiveSecurityHealthAnalyticsCustomModule', 'getSecurityHealthAnalyticsCustomModule', 'getSource', 'groupAssets', 'groupFindings', 'listAssets', 'listDescendantSecurityHealthAnalyticsCustomModules', 'listFindings', 'listMuteConfigs', 'listNotificationConfigs', 'listEffectiveSecurityHealthAnalyticsCustomModules', 'listSecurityHealthAnalyticsCustomModules', 'listSources', 'runAssetDiscovery', 'setFindingState', 'setMute', 'setIamPolicy', 'testIamPermissions', 'simulateSecurityHealthAnalyticsCustomModule', 'updateExternalSystem', 'updateFinding', 'updateMuteConfig', 'updateNotificationConfig', 'updateOrganizationSettings', 'updateSecurityHealthAnalyticsCustomModule', 'updateSource', 'updateSecurityMarks', 'createBigQueryExport', 'deleteBigQueryExport', 'updateBigQueryExport', 'listBigQueryExports', 'createEventThreatDetectionCustomModule', 'deleteEventThreatDetectionCustomModule', 'getEventThreatDetectionCustomModule', 'listDescendantEventThreatDetectionCustomModules', 'listEventThreatDetectionCustomModules', 'updateEventThreatDetectionCustomModule', 'validateEventThreatDetectionCustomModule', 'getEffectiveEventThreatDetectionCustomModule', 'listEffectiveEventThreatDetectionCustomModules', 'batchCreateResourceValueConfigs', 'deleteResourceValueConfig', 'getResourceValueConfig', 'listResourceValueConfigs', 'updateResourceValueConfig', 'listValuedResources', 'listAttackPaths']; - 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); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.securityCenterStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the - * given CRM parent, and also creates inherited - * SecurityHealthAnalyticsCustomModules for all CRM descendants of the given - * parent. These modules are enabled by default. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new custom module's parent. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} request.securityHealthAnalyticsCustomModule - * Required. SecurityHealthAnalytics custom module to create. The provided - * name is ignored and reset with provided parent information and - * server-generated 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 {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.create_security_health_analytics_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async - */ - createSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>; - createSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - createSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - createSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createSecurityHealthAnalyticsCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createSecurityHealthAnalyticsCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.ICreateSecurityHealthAnalyticsCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('createSecurityHealthAnalyticsCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.ICreateSourceRequest|undefined, {}|undefined - ]>; - createSource( - request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.ICreateSourceRequest|null|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; - createSource( - request?: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.ICreateSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.ICreateSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.ICreateSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.ICreateSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.ICreateSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('createSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ICreateFindingRequest|undefined, {}|undefined - ]>; - createFinding( - request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ICreateFindingRequest|null|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; - createFinding( - request?: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ICreateFindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ICreateFindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ICreateFindingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createFinding request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ICreateFindingRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createFinding response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createFinding(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ICreateFindingRequest|undefined, - {}|undefined - ]) => { - this._log.info('createFinding response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 only lowercase letters, numbers, and hyphens, must start - * with a letter, must end with either a letter or a number, and must be 63 - * characters or less. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.MuteConfig|MuteConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createMuteConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IMuteConfig, - protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createMuteConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createMuteConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IMuteConfig, - protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('createMuteConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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]`, `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 contain 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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|undefined, {}|undefined - ]>; - createNotificationConfig( - request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|null|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; - createNotificationConfig( - request?: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('createNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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}`, - * `projects/{project}/muteConfigs/{config_id}`, - * `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - * `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - * `projects/{project}/locations/global/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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteMuteConfig request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteMuteConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteMuteConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteMuteConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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]`, - * `folders/[folder_id]/notificationConfigs/[config_id]`, - * or `projects/[project_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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|undefined, {}|undefined - ]>; - deleteNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|null|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; - deleteNotificationConfig( - request?: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified SecurityHealthAnalyticsCustomModule and all of its - * descendants in the CRM hierarchy. This method is only supported for - * resident custom modules. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the custom module to delete. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - * `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - * or - * `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_async - */ - deleteSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>; - deleteSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - deleteSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - deleteSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteSecurityHealthAnalyticsCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteSecurityHealthAnalyticsCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteSecurityHealthAnalyticsCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteSecurityHealthAnalyticsCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Get the simulation by name or the latest simulation for the given - * organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The organization name or simulation name of this simulation - * - * Valid format: - * `organizations/{organization}/simulations/latest` - * `organizations/{organization}/simulations/{simulation}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.Simulation|Simulation}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.get_simulation.js - * region_tag:securitycenter_v1_generated_SecurityCenter_GetSimulation_async - */ - getSimulation( - request?: protos.google.cloud.securitycenter.v1.IGetSimulationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.ISimulation, - protos.google.cloud.securitycenter.v1.IGetSimulationRequest|undefined, {}|undefined - ]>; - getSimulation( - request: protos.google.cloud.securitycenter.v1.IGetSimulationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISimulation, - protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, - {}|null|undefined>): void; - getSimulation( - request: protos.google.cloud.securitycenter.v1.IGetSimulationRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISimulation, - protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, - {}|null|undefined>): void; - getSimulation( - request?: protos.google.cloud.securitycenter.v1.IGetSimulationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.ISimulation, - protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.ISimulation, - protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISimulation, - protos.google.cloud.securitycenter.v1.IGetSimulationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSimulation request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISimulation, - protos.google.cloud.securitycenter.v1.IGetSimulationRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSimulation response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSimulation(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISimulation, - protos.google.cloud.securitycenter.v1.IGetSimulationRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSimulation response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Get the valued resource by name - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of this valued resource - * - * Valid format: - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_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 {@link protos.google.cloud.securitycenter.v1.ValuedResource|ValuedResource}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.get_valued_resource.js - * region_tag:securitycenter_v1_generated_SecurityCenter_GetValuedResource_async - */ - getValuedResource( - request?: protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IValuedResource, - protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|undefined, {}|undefined - ]>; - getValuedResource( - request: protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IValuedResource, - protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>): void; - getValuedResource( - request: protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IValuedResource, - protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>): void; - getValuedResource( - request?: protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IValuedResource, - protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IValuedResource, - protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IValuedResource, - protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getValuedResource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IValuedResource, - protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getValuedResource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getValuedResource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IValuedResource, - protos.google.cloud.securitycenter.v1.IGetValuedResourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getValuedResource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a BigQuery export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the BigQuery 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 {@link protos.google.cloud.securitycenter.v1.BigQueryExport|BigQueryExport}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getBigQueryExport request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBigQueryExport response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBigQueryExport(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBigQueryExport response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - 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; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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}`, - * `projects/{project}/muteConfigs/{config_id}`, - * `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - * `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - * `projects/{project}/locations/global/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 {@link protos.google.cloud.securitycenter.v1.MuteConfig|MuteConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getMuteConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IMuteConfig, - protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getMuteConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getMuteConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IMuteConfig, - protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('getMuteConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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]`, - * `folders/[folder_id]/notificationConfigs/[config_id]`, - * or `projects/[project_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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|undefined, {}|undefined - ]>; - getNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|null|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; - getNotificationConfig( - request?: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('getNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.OrganizationSettings|OrganizationSettings}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|undefined, {}|undefined - ]>; - getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|null|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; - getOrganizationSettings( - request?: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getOrganizationSettings request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getOrganizationSettings response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getOrganizationSettings(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest|undefined, - {}|undefined - ]) => { - this._log.info('getOrganizationSettings response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the effective custom module to get. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - * `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - * or - * `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_async - */ - getEffectiveSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>; - getEffectiveSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - getEffectiveSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - getEffectiveSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getEffectiveSecurityHealthAnalyticsCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getEffectiveSecurityHealthAnalyticsCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveSecurityHealthAnalyticsCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('getEffectiveSecurityHealthAnalyticsCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Retrieves a SecurityHealthAnalyticsCustomModule. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the custom module to get. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - * `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - * or - * `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.get_security_health_analytics_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_async - */ - getSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>; - getSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - getSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - getSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSecurityHealthAnalyticsCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSecurityHealthAnalyticsCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IGetSecurityHealthAnalyticsCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSecurityHealthAnalyticsCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IGetSourceRequest|undefined, {}|undefined - ]>; - getSource( - request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, - options: CallOptions, - callback: Callback< - 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; - getSource( - request?: protos.google.cloud.securitycenter.v1.IGetSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IGetSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IGetSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IGetSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IGetSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IGetSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * of the finding. Example: - * `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.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 {@link protos.google.cloud.securitycenter.v1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|undefined, {}|undefined - ]>; - setFindingState( - request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|null|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; - setFindingState( - request?: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setFindingState request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setFindingState response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setFindingState(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetFindingStateRequest|undefined, - {}|undefined - ]) => { - this._log.info('setFindingState response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * of the finding. Example: - * `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] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setMute request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetMuteRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setMute response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setMute(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.ISetMuteRequest|undefined, - {}|undefined - ]) => { - this._log.info('setMute response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {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. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - 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; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - 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; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Simulates a given SecurityHealthAnalyticsCustomModule and Resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative resource name of the organization, project, or - * folder. For more information about relative resource names, see [Relative - * Resource - * Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * Example: `organizations/{organization_id}` - * @param {google.cloud.securitycenter.v1.CustomConfig} request.customConfig - * Required. The custom configuration that you need to test. - * @param {google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} request.resource - * Required. Resource data to simulate custom module against. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse|SimulateSecurityHealthAnalyticsCustomModuleResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.simulate_security_health_analytics_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_async - */ - simulateSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>; - simulateSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - simulateSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - simulateSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('simulateSecurityHealthAnalyticsCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('simulateSecurityHealthAnalyticsCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse, - protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('simulateSecurityHealthAnalyticsCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.ExternalSystem|ExternalSystem}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'external_system.name': request.externalSystem!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateExternalSystem request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IExternalSystem, - protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateExternalSystem response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateExternalSystem(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IExternalSystem, - protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateExternalSystem response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|undefined, {}|undefined - ]>; - updateFinding( - request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|null|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; - updateFinding( - request?: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'finding.name': request.finding!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateFinding request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateFinding response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateFinding(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IFinding, - protos.google.cloud.securitycenter.v1.IUpdateFindingRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateFinding response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.MuteConfig|MuteConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'mute_config.name': request.muteConfig!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateMuteConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IMuteConfig, - protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateMuteConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateMuteConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IMuteConfig, - protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateMuteConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * - * 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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|undefined, {}|undefined - ]>; - updateNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|null|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; - updateNotificationConfig( - request?: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'notification_config.name': request.notificationConfig!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.INotificationConfig, - protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.OrganizationSettings|OrganizationSettings}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined - ]>; - updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, - options: CallOptions, - 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, - 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|Callback< - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateOrganizationSettings request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateOrganizationSettings response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateOrganizationSettings(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateOrganizationSettings response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the SecurityHealthAnalyticsCustomModule under the given name based - * on the given update mask. Updating the enablement state is supported on - * both resident and inherited modules (though resident modules cannot have an - * enablement state of "inherited"). Updating the display name and custom - * config of a module is supported on resident modules only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule} request.securityHealthAnalyticsCustomModule - * Required. The SecurityHealthAnalytics custom module to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. The only fields that can be updated are - * `enablement_state` and `custom_config`. If empty or set to the wildcard - * value `*`, both `enablement_state` and `custom_config` are updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.update_security_health_analytics_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_async - */ - updateSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>; - updateSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - updateSecurityHealthAnalyticsCustomModule( - request: protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - updateSecurityHealthAnalyticsCustomModule( - request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'security_health_analytics_custom_module.name': request.securityHealthAnalyticsCustomModule!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSecurityHealthAnalyticsCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSecurityHealthAnalyticsCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSecurityHealthAnalyticsCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateSecurityHealthAnalyticsCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSecurityHealthAnalyticsCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|undefined, {}|undefined - ]>; - updateSource( - request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|null|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; - updateSource( - request?: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'source.name': request.source!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISource, - protos.google.cloud.securitycenter.v1.IUpdateSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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. Must be - * 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. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.SecurityMarks|SecurityMarks}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSecurityMarks request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSecurityMarks response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSecurityMarks(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.ISecurityMarks, - protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSecurityMarks response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a BigQuery export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource of the new BigQuery export. Its - * format is `organizations/[organization_id]`, `folders/[folder_id]`, or - * `projects/[project_id]`. - * @param {google.cloud.securitycenter.v1.BigQueryExport} request.bigQueryExport - * Required. The BigQuery export being created. - * @param {string} request.bigQueryExportId - * Required. Unique identifier provided by the client within the parent scope. - * It must consist of only lowercase letters, numbers, and hyphens, must start - * with a letter, must end with either a letter or a number, and must be 63 - * characters or less. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.BigQueryExport|BigQueryExport}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createBigQueryExport request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createBigQueryExport response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createBigQueryExport(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest|undefined, - {}|undefined - ]) => { - this._log.info('createBigQueryExport response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes an existing BigQuery export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BigQuery 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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteBigQueryExport request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteBigQueryExport response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteBigQueryExport(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteBigQueryExport response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 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 {@link protos.google.cloud.securitycenter.v1.BigQueryExport|BigQueryExport}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.update_big_query_export.js - * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async - */ - updateBigQueryExport( - request?: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|undefined, {}|undefined - ]>; - updateBigQueryExport( - request: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - updateBigQueryExport( - request: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - updateBigQueryExport( - request?: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'big_query_export.name': request.bigQueryExport!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateBigQueryExport request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateBigQueryExport response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateBigQueryExport(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IBigQueryExport, - protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateBigQueryExport response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a resident Event Threat Detection custom module at the scope of the - * given Resource Manager parent, and also creates inherited custom modules - * for all descendants of the given parent. These modules are enabled by - * default. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The new custom module's parent. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} request.eventThreatDetectionCustomModule - * Required. The module to create. The - * event_threat_detection_custom_module.name will be ignored and server - * generated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.create_event_threat_detection_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_async - */ - createEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>; - createEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - createEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - createEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createEventThreatDetectionCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createEventThreatDetectionCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createEventThreatDetectionCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.ICreateEventThreatDetectionCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('createEventThreatDetectionCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified Event Threat Detection custom module and all of its - * descendants in the Resource Manager hierarchy. This method is only - * supported for resident custom modules. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the custom module to delete. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - * * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - * * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.delete_event_threat_detection_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_async - */ - deleteEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>; - deleteEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - deleteEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - deleteEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteEventThreatDetectionCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteEventThreatDetectionCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteEventThreatDetectionCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteEventThreatDetectionCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteEventThreatDetectionCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets an Event Threat Detection custom module. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the custom module to get. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - * * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - * * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.get_event_threat_detection_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_async - */ - getEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>; - getEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - getEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - getEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getEventThreatDetectionCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getEventThreatDetectionCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getEventThreatDetectionCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEventThreatDetectionCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('getEventThreatDetectionCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the Event Threat Detection custom module with the given name based - * on the given update mask. Updating the enablement state is supported for - * both resident and inherited modules (though resident modules cannot have an - * enablement state of "inherited"). Updating the display name or - * configuration of a module is supported for resident modules only. The type - * of a module cannot be changed. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.EventThreatDetectionCustomModule} request.eventThreatDetectionCustomModule - * Required. The module 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 {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.update_event_threat_detection_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_async - */ - updateEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>; - updateEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - updateEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - updateEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'event_threat_detection_custom_module.name': request.eventThreatDetectionCustomModule!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateEventThreatDetectionCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateEventThreatDetectionCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateEventThreatDetectionCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IUpdateEventThreatDetectionCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateEventThreatDetectionCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Validates the given Event Threat Detection custom module. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent to validate the Custom Module under. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.rawText - * Required. The raw text of the module's contents. Used to generate error - * messages. - * @param {string} request.type - * Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse|ValidateEventThreatDetectionCustomModuleResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.validate_event_threat_detection_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_async - */ - validateEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>; - validateEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - validateEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - validateEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('validateEventThreatDetectionCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('validateEventThreatDetectionCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.validateEventThreatDetectionCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse, - protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('validateEventThreatDetectionCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets an effective Event Threat Detection custom module at the given level. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the effective Event Threat Detection custom - * module. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - * * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - * * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.get_effective_event_threat_detection_custom_module.js - * region_tag:securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_async - */ - getEffectiveEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>; - getEffectiveEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - getEffectiveEventThreatDetectionCustomModule( - request: protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): void; - getEffectiveEventThreatDetectionCustomModule( - request?: protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getEffectiveEventThreatDetectionCustomModule request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getEffectiveEventThreatDetectionCustomModule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getEffectiveEventThreatDetectionCustomModule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule, - protos.google.cloud.securitycenter.v1.IGetEffectiveEventThreatDetectionCustomModuleRequest|undefined, - {}|undefined - ]) => { - this._log.info('getEffectiveEventThreatDetectionCustomModule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a ResourceValueConfig for an organization. Maps user's tags to - * difference resource values for use by the attack path simulation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new ResourceValueConfig's parent. - * The parent field in the CreateResourceValueConfigRequest - * messages must either be empty or match this field. - * @param {number[]} request.requests - * Required. The resource value configs to be created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse|BatchCreateResourceValueConfigsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.batch_create_resource_value_configs.js - * region_tag:securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_async - */ - batchCreateResourceValueConfigs( - request?: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|undefined, {}|undefined - ]>; - batchCreateResourceValueConfigs( - request: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateResourceValueConfigs( - request: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateResourceValueConfigs( - request?: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('batchCreateResourceValueConfigs request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('batchCreateResourceValueConfigs response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.batchCreateResourceValueConfigs(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsRequest|undefined, - {}|undefined - ]) => { - this._log.info('batchCreateResourceValueConfigs response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a ResourceValueConfig. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the ResourceValueConfig to delete - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.delete_resource_value_config.js - * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_async - */ - deleteResourceValueConfig( - request?: protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|undefined, {}|undefined - ]>; - deleteResourceValueConfig( - request: protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteResourceValueConfig( - request: protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteResourceValueConfig( - request?: protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteResourceValueConfig request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteResourceValueConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteResourceValueConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1.IDeleteResourceValueConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteResourceValueConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a ResourceValueConfig. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource value config to retrieve. Its format is - * `organizations/{organization}/resourceValueConfigs/{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 {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.get_resource_value_config.js - * region_tag:securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_async - */ - getResourceValueConfig( - request?: protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|undefined, {}|undefined - ]>; - getResourceValueConfig( - request: protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - getResourceValueConfig( - request: protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - getResourceValueConfig( - request?: protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getResourceValueConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getResourceValueConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getResourceValueConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IGetResourceValueConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('getResourceValueConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates an existing ResourceValueConfigs with new rules. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.ResourceValueConfig} request.resourceValueConfig - * Required. The resource value 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 {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.update_resource_value_config.js - * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_async - */ - updateResourceValueConfig( - request?: protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|undefined, {}|undefined - ]>; - updateResourceValueConfig( - request: protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - updateResourceValueConfig( - request: protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - updateResourceValueConfig( - request?: protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource_value_config.name': request.resourceValueConfig!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateResourceValueConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateResourceValueConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateResourceValueConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1.IResourceValueConfig, - protos.google.cloud.securitycenter.v1.IUpdateResourceValueConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateResourceValueConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * 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 {google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState} [request.muteState] - * Optional. All findings matching the given filter will have their mute state - * set to this value. The default value is `MUTED`. Setting this to - * `UNDEFINED` will clear the mute state on all matching findings. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - bulkMuteFindings( - request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - bulkMuteFindings( - request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - bulkMuteFindings( - request?: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('bulkMuteFindings response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('bulkMuteFindings request %j', request); - return this.innerApiCalls.bulkMuteFindings(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('bulkMuteFindings response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * 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>{ - this._log.info('bulkMuteFindings long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.bulkMuteFindings, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.run_asset_discovery.js - * region_tag:securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async - * @deprecated RunAssetDiscovery is deprecated and may be removed in a future version. - */ - runAssetDiscovery( - request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runAssetDiscovery( - request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this.warn('DEP$SecurityCenter-$RunAssetDiscovery','RunAssetDiscovery is deprecated and may be removed in a future version.', 'DeprecationWarning'); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('runAssetDiscovery response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('runAssetDiscovery request %j', request); - return this.innerApiCalls.runAssetDiscovery(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('runAssetDiscovery response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * 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. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.run_asset_discovery.js - * region_tag:securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async - * @deprecated RunAssetDiscovery is deprecated and may be removed in a future version. - */ - async checkRunAssetDiscoveryProgress(name: string): Promise>{ - this.warn('DEP$SecurityCenter-$checkRunAssetDiscoveryProgress','checkRunAssetDiscoveryProgress is deprecated and may be removed in a future version.', 'DeprecationWarning'); - this._log.info('runAssetDiscovery long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * 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. The name of the parent to group the assets by. Its format is - * `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 - * 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 : ""` - * @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.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 {@link protos.google.cloud.securitycenter.v1.GroupResult|GroupResult}. - * 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 `groupAssetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @deprecated GroupAssets is deprecated and may be removed in a future version. - */ - 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IGroupResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IGroupResult>): - Promise<[ - protos.google.cloud.securitycenter.v1.IGroupResult[], - protos.google.cloud.securitycenter.v1.IGroupAssetsRequest|null, - protos.google.cloud.securitycenter.v1.IGroupAssetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this.warn('DEP$SecurityCenter-$GroupAssets','GroupAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IGroupResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('groupAssets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('groupAssets request %j', request); - return this.innerApiCalls - .groupAssets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IGroupResult[], - protos.google.cloud.securitycenter.v1.IGroupAssetsRequest|null, - protos.google.cloud.securitycenter.v1.IGroupAssetsResponse - ]) => { - this._log.info('groupAssets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `groupAssets`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent to group the assets by. Its format is - * `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 - * 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 : ""` - * @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.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 {@link protos.google.cloud.securitycenter.v1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @deprecated GroupAssets is deprecated and may be removed in a future version. - */ - groupAssetsStream( - request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this.warn('DEP$SecurityCenter-$GroupAssets','GroupAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); - this._log.info('groupAssets stream %j', request); - return this.descriptors.page.groupAssets.createStream( - this.innerApiCalls.groupAssets as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * Required. The name of the parent to group the assets by. Its format is - * `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 - * 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 : ""` - * @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.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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.group_assets.js - * region_tag:securitycenter_v1_generated_SecurityCenter_GroupAssets_async - * @deprecated GroupAssets is deprecated and may be removed in a future version. - */ - groupAssetsAsync( - request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this.warn('DEP$SecurityCenter-$GroupAssets','GroupAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); - this._log.info('groupAssets iterate %j', request); - return this.descriptors.page.groupAssets.asyncIterate( - this.innerApiCalls['groupAssets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * 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 - * - * @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]`, - * `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 - * 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: `=`, `:` - * @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 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 {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.GroupResult|GroupResult}. - * 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 `groupFindingsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IGroupResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IGroupResult>): - Promise<[ - protos.google.cloud.securitycenter.v1.IGroupResult[], - protos.google.cloud.securitycenter.v1.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v1.IGroupFindingsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IGroupResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('groupFindings values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('groupFindings request %j', request); - return this.innerApiCalls - .groupFindings(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IGroupResult[], - protos.google.cloud.securitycenter.v1.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v1.IGroupFindingsResponse - ]) => { - this._log.info('groupFindings values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `groupFindings`, but returns a NodeJS Stream object. - * @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]`, - * `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 - * 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: `=`, `:` - * @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 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 {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - groupFindingsStream( - request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupFindings stream %j', request); - return this.descriptors.page.groupFindings.createStream( - this.innerApiCalls.groupFindings as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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/-` - * @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` - * - * * 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: `=`, `:` - * @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 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupFindings iterate %j', request); - return this.descriptors.page.groupFindings.asyncIterate( - this.innerApiCalls['groupFindings'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists an organization's assets. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource that contains the assets. The - * value that you can specify on parent depends on the method in which you - * specify parent. You can specify one of the following values: - * `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 - * 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 : ""` - * @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 - * 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 {@link protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult|ListAssetsResult}. - * 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 `listAssetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @deprecated ListAssets is deprecated and may be removed in a future version. - */ - 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult>): - Promise<[ - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1.IListAssetsRequest|null, - protos.google.cloud.securitycenter.v1.IListAssetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this.warn('DEP$SecurityCenter-$ListAssets','ListAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAssets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAssets request %j', request); - return this.innerApiCalls - .listAssets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1.IListAssetsRequest|null, - protos.google.cloud.securitycenter.v1.IListAssetsResponse - ]) => { - this._log.info('listAssets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAssets`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource that contains the assets. The - * value that you can specify on parent depends on the method in which you - * specify parent. You can specify one of the following values: - * `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 - * 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 : ""` - * @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 - * 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 {@link protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @deprecated ListAssets is deprecated and may be removed in a future version. - */ - listAssetsStream( - request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this.warn('DEP$SecurityCenter-$ListAssets','ListAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); - this._log.info('listAssets stream %j', request); - return this.descriptors.page.listAssets.createStream( - this.innerApiCalls.listAssets as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * Required. The name of the parent resource that contains the assets. The - * value that you can specify on parent depends on the method in which you - * specify parent. You can specify one of the following values: - * `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 - * 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 : ""` - * @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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_assets.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListAssets_async - * @deprecated ListAssets is deprecated and may be removed in a future version. - */ - listAssetsAsync( - request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this.warn('DEP$SecurityCenter-$ListAssets','ListAssets is deprecated and may be removed in a future version.', 'DeprecationWarning'); - this._log.info('listAssets iterate %j', request); - return this.descriptors.page.listAssets.asyncIterate( - this.innerApiCalls['listAssets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns a list of all resident SecurityHealthAnalyticsCustomModules under - * the given CRM parent and all of the parent’s CRM descendants. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list descendant custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. - * 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 `listDescendantSecurityHealthAnalyticsCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDescendantSecurityHealthAnalyticsCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse - ]>; - listDescendantSecurityHealthAnalyticsCustomModules( - request: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): void; - listDescendantSecurityHealthAnalyticsCustomModules( - request: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): void; - listDescendantSecurityHealthAnalyticsCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDescendantSecurityHealthAnalyticsCustomModules values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDescendantSecurityHealthAnalyticsCustomModules request %j', request); - return this.innerApiCalls - .listDescendantSecurityHealthAnalyticsCustomModules(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesResponse - ]) => { - this._log.info('listDescendantSecurityHealthAnalyticsCustomModules values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDescendantSecurityHealthAnalyticsCustomModules`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list descendant custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} 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 `listDescendantSecurityHealthAnalyticsCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDescendantSecurityHealthAnalyticsCustomModulesStream( - request?: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDescendantSecurityHealthAnalyticsCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDescendantSecurityHealthAnalyticsCustomModules stream %j', request); - return this.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream( - this.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDescendantSecurityHealthAnalyticsCustomModules`, 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. Name of parent to list descendant custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_async - */ - listDescendantSecurityHealthAnalyticsCustomModulesAsync( - request?: protos.google.cloud.securitycenter.v1.IListDescendantSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDescendantSecurityHealthAnalyticsCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDescendantSecurityHealthAnalyticsCustomModules iterate %j', request); - return this.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate( - this.innerApiCalls['listDescendantSecurityHealthAnalyticsCustomModules'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * 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]`, - * `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 - * 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: `=`, `:` - * * 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 - * 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 - * 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 {@link protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult|ListFindingsResult}. - * 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 `listFindingsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult>): - Promise<[ - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v1.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v1.IListFindingsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listFindings values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listFindings request %j', request); - return this.innerApiCalls - .listFindings(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v1.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v1.IListFindingsResponse - ]) => { - this._log.info('listFindings values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listFindings`, but returns a NodeJS Stream object. - * @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]`, - * `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 - * 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: `=`, `:` - * * 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 - * 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 - * 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 {@link protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listFindingsStream( - request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listFindings stream %j', request); - return this.descriptors.page.listFindings.createStream( - this.innerApiCalls.listFindings as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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/-` - * @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` - * - * * 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: `=`, `:` - * * 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 - * 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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listFindings iterate %j', request); - return this.descriptors.page.listFindings.asyncIterate( - this.innerApiCalls['listFindings'] as GaxCall, - request as {}, - 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 {@link protos.google.cloud.securitycenter.v1.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, - protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IMuteConfig>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listMuteConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listMuteConfigs request %j', request); - return this.innerApiCalls - .listMuteConfigs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IMuteConfig[], - protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest|null, - protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse - ]) => { - this._log.info('listMuteConfigs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listMuteConfigs`, 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 {@link protos.google.cloud.securitycenter.v1.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listMuteConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listMuteConfigs stream %j', request); - return this.descriptors.page.listMuteConfigs.createStream( - this.innerApiCalls.listMuteConfigs as 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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listMuteConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listMuteConfigs iterate %j', request); - return this.descriptors.page.listMuteConfigs.asyncIterate( - this.innerApiCalls['listMuteConfigs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists notification configs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent in which to list the notification - * configurations. 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 - * 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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listNotificationConfigs( - request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.INotificationConfig[], - protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse - ]>; - listNotificationConfigs( - request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - options: CallOptions, - 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; - listNotificationConfigs( - request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.INotificationConfig>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.INotificationConfig>): - Promise<[ - protos.google.cloud.securitycenter.v1.INotificationConfig[], - protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.INotificationConfig>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listNotificationConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listNotificationConfigs request %j', request); - return this.innerApiCalls - .listNotificationConfigs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.INotificationConfig[], - protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse - ]) => { - this._log.info('listNotificationConfigs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listNotificationConfigs`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent in which to list the notification - * configurations. 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 - * 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 {@link protos.google.cloud.securitycenter.v1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listNotificationConfigsStream( - request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listNotificationConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listNotificationConfigs stream %j', request); - return this.descriptors.page.listNotificationConfigs.createStream( - this.innerApiCalls.listNotificationConfigs as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * Required. The name of the parent in which to list the notification - * configurations. 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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listNotificationConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listNotificationConfigs iterate %j', request); - return this.descriptors.page.listNotificationConfigs.asyncIterate( - this.innerApiCalls['listNotificationConfigs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the - * given parent. This includes resident modules defined at the scope of the - * parent, and inherited modules, inherited from CRM ancestors. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list effective custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule}. - * 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 `listEffectiveSecurityHealthAnalyticsCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listEffectiveSecurityHealthAnalyticsCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse - ]>; - listEffectiveSecurityHealthAnalyticsCustomModules( - request: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>): void; - listEffectiveSecurityHealthAnalyticsCustomModules( - request: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>): void; - listEffectiveSecurityHealthAnalyticsCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules request %j', request); - return this.innerApiCalls - .listEffectiveSecurityHealthAnalyticsCustomModules(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesResponse - ]) => { - this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listEffectiveSecurityHealthAnalyticsCustomModules`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list effective custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule} 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 `listEffectiveSecurityHealthAnalyticsCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listEffectiveSecurityHealthAnalyticsCustomModulesStream( - request?: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEffectiveSecurityHealthAnalyticsCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules stream %j', request); - return this.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream( - this.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEffectiveSecurityHealthAnalyticsCustomModules`, 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. Name of parent to list effective custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_async - */ - listEffectiveSecurityHealthAnalyticsCustomModulesAsync( - request?: protos.google.cloud.securitycenter.v1.IListEffectiveSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEffectiveSecurityHealthAnalyticsCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEffectiveSecurityHealthAnalyticsCustomModules iterate %j', request); - return this.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate( - this.innerApiCalls['listEffectiveSecurityHealthAnalyticsCustomModules'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns a list of all SecurityHealthAnalyticsCustomModules for the given - * parent. This includes resident modules defined at the scope of the parent, - * and inherited modules, inherited from CRM ancestors. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. - * 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 `listSecurityHealthAnalyticsCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSecurityHealthAnalyticsCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse - ]>; - listSecurityHealthAnalyticsCustomModules( - request: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): void; - listSecurityHealthAnalyticsCustomModules( - request: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): void; - listSecurityHealthAnalyticsCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSecurityHealthAnalyticsCustomModules values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSecurityHealthAnalyticsCustomModules request %j', request); - return this.innerApiCalls - .listSecurityHealthAnalyticsCustomModules(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[], - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesResponse - ]) => { - this._log.info('listSecurityHealthAnalyticsCustomModules values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSecurityHealthAnalyticsCustomModules`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} 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 `listSecurityHealthAnalyticsCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSecurityHealthAnalyticsCustomModulesStream( - request?: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSecurityHealthAnalyticsCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSecurityHealthAnalyticsCustomModules stream %j', request); - return this.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream( - this.innerApiCalls.listSecurityHealthAnalyticsCustomModules as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSecurityHealthAnalyticsCustomModules`, 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. Name of parent to list custom modules. Its format is - * `organizations/{organization}/securityHealthAnalyticsSettings`, - * `folders/{folder}/securityHealthAnalyticsSettings`, or - * `projects/{project}/securityHealthAnalyticsSettings` - * @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 {string} request.pageToken - * The value returned by the last call indicating a continuation - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_async - */ - listSecurityHealthAnalyticsCustomModulesAsync( - request?: protos.google.cloud.securitycenter.v1.IListSecurityHealthAnalyticsCustomModulesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSecurityHealthAnalyticsCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSecurityHealthAnalyticsCustomModules iterate %j', request); - return this.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate( - this.innerApiCalls['listSecurityHealthAnalyticsCustomModules'] as GaxCall, - request as {}, - 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 {@link protos.google.cloud.securitycenter.v1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSources( - request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.ISource[], - protos.google.cloud.securitycenter.v1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1.IListSourcesResponse - ]>; - listSources( - request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, - options: CallOptions, - 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; - listSources( - request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISource>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISource>): - Promise<[ - protos.google.cloud.securitycenter.v1.ISource[], - protos.google.cloud.securitycenter.v1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1.IListSourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.ISource>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSources values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSources request %j', request); - return this.innerApiCalls - .listSources(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.ISource[], - protos.google.cloud.securitycenter.v1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1.IListSourcesResponse - ]) => { - this._log.info('listSources values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSources`, but returns a NodeJS Stream object. - * @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 {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSourcesStream( - request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSources stream %j', request); - return this.descriptors.page.listSources.createStream( - this.innerApiCalls.listSources as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSources iterate %j', request); - return this.descriptors.page.listSources.asyncIterate( - this.innerApiCalls['listSources'] as GaxCall, - request as {}, - 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 {@link protos.google.cloud.securitycenter.v1.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, - protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IBigQueryExport>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBigQueryExports values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBigQueryExports request %j', request); - return this.innerApiCalls - .listBigQueryExports(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IBigQueryExport[], - protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest|null, - protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse - ]) => { - this._log.info('listBigQueryExports values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBigQueryExports`, 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 {@link protos.google.cloud.securitycenter.v1.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBigQueryExports']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBigQueryExports stream %j', request); - return this.descriptors.page.listBigQueryExports.createStream( - this.innerApiCalls.listBigQueryExports as 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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBigQueryExports']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBigQueryExports iterate %j', request); - return this.descriptors.page.listBigQueryExports.asyncIterate( - this.innerApiCalls['listBigQueryExports'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all resident Event Threat Detection custom modules under the - * given Resource Manager parent and its descendants. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the parent to list custom modules under. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to - * retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDescendantEventThreatDetectionCustomModules` must match the call that - * provided the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. - * 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 `listDescendantEventThreatDetectionCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDescendantEventThreatDetectionCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse - ]>; - listDescendantEventThreatDetectionCustomModules( - request: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): void; - listDescendantEventThreatDetectionCustomModules( - request: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): void; - listDescendantEventThreatDetectionCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDescendantEventThreatDetectionCustomModules values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDescendantEventThreatDetectionCustomModules request %j', request); - return this.innerApiCalls - .listDescendantEventThreatDetectionCustomModules(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesResponse - ]) => { - this._log.info('listDescendantEventThreatDetectionCustomModules values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDescendantEventThreatDetectionCustomModules`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the parent to list custom modules under. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to - * retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDescendantEventThreatDetectionCustomModules` must match the call that - * provided the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule} 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 `listDescendantEventThreatDetectionCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDescendantEventThreatDetectionCustomModulesStream( - request?: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDescendantEventThreatDetectionCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDescendantEventThreatDetectionCustomModules stream %j', request); - return this.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream( - this.innerApiCalls.listDescendantEventThreatDetectionCustomModules as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDescendantEventThreatDetectionCustomModules`, 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. Name of the parent to list custom modules under. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListDescendantEventThreatDetectionCustomModules` call. Provide this to - * retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDescendantEventThreatDetectionCustomModules` must match the call that - * provided the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_descendant_event_threat_detection_custom_modules.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_async - */ - listDescendantEventThreatDetectionCustomModulesAsync( - request?: protos.google.cloud.securitycenter.v1.IListDescendantEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDescendantEventThreatDetectionCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDescendantEventThreatDetectionCustomModules iterate %j', request); - return this.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate( - this.innerApiCalls['listDescendantEventThreatDetectionCustomModules'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all Event Threat Detection custom modules for the given - * Resource Manager parent. This includes resident modules defined at the - * scope of the parent along with modules inherited from ancestors. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the parent to list custom modules under. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters provided to - * `ListEventThreatDetectionCustomModules` must match the call that provided - * the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. - * 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 `listEventThreatDetectionCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listEventThreatDetectionCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse - ]>; - listEventThreatDetectionCustomModules( - request: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): void; - listEventThreatDetectionCustomModules( - request: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): void; - listEventThreatDetectionCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listEventThreatDetectionCustomModules values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listEventThreatDetectionCustomModules request %j', request); - return this.innerApiCalls - .listEventThreatDetectionCustomModules(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesResponse - ]) => { - this._log.info('listEventThreatDetectionCustomModules values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listEventThreatDetectionCustomModules`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the parent to list custom modules under. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters provided to - * `ListEventThreatDetectionCustomModules` must match the call that provided - * the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule} 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 `listEventThreatDetectionCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listEventThreatDetectionCustomModulesStream( - request?: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEventThreatDetectionCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEventThreatDetectionCustomModules stream %j', request); - return this.descriptors.page.listEventThreatDetectionCustomModules.createStream( - this.innerApiCalls.listEventThreatDetectionCustomModules as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEventThreatDetectionCustomModules`, 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. Name of the parent to list custom modules under. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters provided to - * `ListEventThreatDetectionCustomModules` must match the call that provided - * the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_event_threat_detection_custom_modules.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_async - */ - listEventThreatDetectionCustomModulesAsync( - request?: protos.google.cloud.securitycenter.v1.IListEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEventThreatDetectionCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEventThreatDetectionCustomModules iterate %j', request); - return this.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate( - this.innerApiCalls['listEventThreatDetectionCustomModules'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all effective Event Threat Detection custom modules for the - * given parent. This includes resident modules defined at the scope of the - * parent along with modules inherited from its ancestors. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the parent to list custom modules for. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to - * retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListEffectiveEventThreatDetectionCustomModules` must match the call that - * provided the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule}. - * 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 `listEffectiveEventThreatDetectionCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listEffectiveEventThreatDetectionCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse - ]>; - listEffectiveEventThreatDetectionCustomModules( - request: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>): void; - listEffectiveEventThreatDetectionCustomModules( - request: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>): void; - listEffectiveEventThreatDetectionCustomModules( - request?: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>): - Promise<[ - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listEffectiveEventThreatDetectionCustomModules values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listEffectiveEventThreatDetectionCustomModules request %j', request); - return this.innerApiCalls - .listEffectiveEventThreatDetectionCustomModules(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[], - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest|null, - protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesResponse - ]) => { - this._log.info('listEffectiveEventThreatDetectionCustomModules values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listEffectiveEventThreatDetectionCustomModules`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the parent to list custom modules for. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to - * retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListEffectiveEventThreatDetectionCustomModules` must match the call that - * provided the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule} 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 `listEffectiveEventThreatDetectionCustomModulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listEffectiveEventThreatDetectionCustomModulesStream( - request?: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEffectiveEventThreatDetectionCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEffectiveEventThreatDetectionCustomModules stream %j', request); - return this.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream( - this.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEffectiveEventThreatDetectionCustomModules`, 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. Name of the parent to list custom modules for. - * - * Its format is: - * - * * `organizations/{organization}/eventThreatDetectionSettings`. - * * `folders/{folder}/eventThreatDetectionSettings`. - * * `projects/{project}/eventThreatDetectionSettings`. - * @param {string} request.pageToken - * A page token, received from a previous - * `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to - * retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListEffectiveEventThreatDetectionCustomModules` must match the call that - * provided the page token. - * @param {number} request.pageSize - * The maximum number of modules 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 {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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_effective_event_threat_detection_custom_modules.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_async - */ - listEffectiveEventThreatDetectionCustomModulesAsync( - request?: protos.google.cloud.securitycenter.v1.IListEffectiveEventThreatDetectionCustomModulesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEffectiveEventThreatDetectionCustomModules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEffectiveEventThreatDetectionCustomModules iterate %j', request); - return this.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate( - this.innerApiCalls['listEffectiveEventThreatDetectionCustomModules'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all ResourceValueConfigs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns the collection of resource value configs. - * Its format is - * `organizations/[organization_id]` - * @param {number} request.pageSize - * The number of results 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 `ListResourceValueConfigs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListResourceValueConfigs` must match the call that provided the - * page token. - * - * page_size can be specified, and the new page_size will be used. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig}. - * 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 `listResourceValueConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listResourceValueConfigs( - request?: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IResourceValueConfig[], - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest|null, - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse - ]>; - listResourceValueConfigs( - request: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IResourceValueConfig>): void; - listResourceValueConfigs( - request: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IResourceValueConfig>): void; - listResourceValueConfigs( - request?: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IResourceValueConfig>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IResourceValueConfig>): - Promise<[ - protos.google.cloud.securitycenter.v1.IResourceValueConfig[], - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest|null, - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IResourceValueConfig>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listResourceValueConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listResourceValueConfigs request %j', request); - return this.innerApiCalls - .listResourceValueConfigs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IResourceValueConfig[], - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest|null, - protos.google.cloud.securitycenter.v1.IListResourceValueConfigsResponse - ]) => { - this._log.info('listResourceValueConfigs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listResourceValueConfigs`, 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 resource value configs. - * Its format is - * `organizations/[organization_id]` - * @param {number} request.pageSize - * The number of results 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 `ListResourceValueConfigs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListResourceValueConfigs` must match the call that provided the - * page token. - * - * page_size can be specified, and the new page_size will be used. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig} 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 `listResourceValueConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listResourceValueConfigsStream( - request?: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listResourceValueConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listResourceValueConfigs stream %j', request); - return this.descriptors.page.listResourceValueConfigs.createStream( - this.innerApiCalls.listResourceValueConfigs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listResourceValueConfigs`, 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 resource value configs. - * Its format is - * `organizations/[organization_id]` - * @param {number} request.pageSize - * The number of results 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 `ListResourceValueConfigs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListResourceValueConfigs` must match the call that provided the - * page token. - * - * page_size can be specified, and the new page_size will be used. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.ResourceValueConfig|ResourceValueConfig}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_resource_value_configs.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_async - */ - listResourceValueConfigsAsync( - request?: protos.google.cloud.securitycenter.v1.IListResourceValueConfigsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listResourceValueConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listResourceValueConfigs iterate %j', request); - return this.descriptors.page.listResourceValueConfigs.asyncIterate( - this.innerApiCalls['listResourceValueConfigs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the valued resources for a set of simulation results and filter. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list valued resources. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * @param {string} request.filter - * The filter expression that filters the valued resources in the response. - * Supported fields: - * - * * `resource_value` supports = - * * `resource_type` supports = - * @param {string} request.pageToken - * The value returned by the last `ListValuedResourcesResponse`; indicates - * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] - * Optional. The fields by which to order the valued resources response. - * - * Supported fields: - * - * * `exposed_score` - * - * * `resource_value` - * - * * `resource_type` - * - * * `resource` - * - * * `display_name` - * - * Values should be a comma separated list of fields. For example: - * `exposed_score,resource_value`. - * - * The default sorting order is descending. To specify ascending or descending - * order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for - * example: `exposed_score DESC`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1.ValuedResource|ValuedResource}. - * 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 `listValuedResourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listValuedResources( - request?: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IValuedResource[], - protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest|null, - protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse - ]>; - listValuedResources( - request: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IValuedResource>): void; - listValuedResources( - request: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IValuedResource>): void; - listValuedResources( - request?: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IValuedResource>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IValuedResource>): - Promise<[ - protos.google.cloud.securitycenter.v1.IValuedResource[], - protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest|null, - protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IValuedResource>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listValuedResources values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listValuedResources request %j', request); - return this.innerApiCalls - .listValuedResources(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IValuedResource[], - protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest|null, - protos.google.cloud.securitycenter.v1.IListValuedResourcesResponse - ]) => { - this._log.info('listValuedResources values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listValuedResources`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list valued resources. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * @param {string} request.filter - * The filter expression that filters the valued resources in the response. - * Supported fields: - * - * * `resource_value` supports = - * * `resource_type` supports = - * @param {string} request.pageToken - * The value returned by the last `ListValuedResourcesResponse`; indicates - * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] - * Optional. The fields by which to order the valued resources response. - * - * Supported fields: - * - * * `exposed_score` - * - * * `resource_value` - * - * * `resource_type` - * - * * `resource` - * - * * `display_name` - * - * Values should be a comma separated list of fields. For example: - * `exposed_score,resource_value`. - * - * The default sorting order is descending. To specify ascending or descending - * order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for - * example: `exposed_score DESC`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1.ValuedResource|ValuedResource} 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 `listValuedResourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listValuedResourcesStream( - request?: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listValuedResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listValuedResources stream %j', request); - return this.descriptors.page.listValuedResources.createStream( - this.innerApiCalls.listValuedResources as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listValuedResources`, 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. Name of parent to list valued resources. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * @param {string} request.filter - * The filter expression that filters the valued resources in the response. - * Supported fields: - * - * * `resource_value` supports = - * * `resource_type` supports = - * @param {string} request.pageToken - * The value returned by the last `ListValuedResourcesResponse`; indicates - * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] - * Optional. The fields by which to order the valued resources response. - * - * Supported fields: - * - * * `exposed_score` - * - * * `resource_value` - * - * * `resource_type` - * - * * `resource` - * - * * `display_name` - * - * Values should be a comma separated list of fields. For example: - * `exposed_score,resource_value`. - * - * The default sorting order is descending. To specify ascending or descending - * order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for - * example: `exposed_score DESC`. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.ValuedResource|ValuedResource}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_valued_resources.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListValuedResources_async - */ - listValuedResourcesAsync( - request?: protos.google.cloud.securitycenter.v1.IListValuedResourcesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listValuedResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listValuedResources iterate %j', request); - return this.descriptors.page.listValuedResources.asyncIterate( - this.innerApiCalls['listValuedResources'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the attack paths for a set of simulation results or valued resources - * and filter. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list attack paths. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - * @param {string} request.filter - * The filter expression that filters the attack path in the response. - * Supported fields: - * - * * `valued_resources` supports = - * @param {string} request.pageToken - * The value returned by the last `ListAttackPathsResponse`; indicates - * that this is a continuation of a prior `ListAttackPaths` 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 {@link protos.google.cloud.securitycenter.v1.AttackPath|AttackPath}. - * 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 `listAttackPathsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAttackPaths( - request?: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1.IAttackPath[], - protos.google.cloud.securitycenter.v1.IListAttackPathsRequest|null, - protos.google.cloud.securitycenter.v1.IListAttackPathsResponse - ]>; - listAttackPaths( - request: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IAttackPath>): void; - listAttackPaths( - request: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IAttackPath>): void; - listAttackPaths( - request?: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IAttackPath>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IAttackPath>): - Promise<[ - protos.google.cloud.securitycenter.v1.IAttackPath[], - protos.google.cloud.securitycenter.v1.IListAttackPathsRequest|null, - protos.google.cloud.securitycenter.v1.IListAttackPathsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v1.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v1.IAttackPath>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAttackPaths values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAttackPaths request %j', request); - return this.innerApiCalls - .listAttackPaths(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1.IAttackPath[], - protos.google.cloud.securitycenter.v1.IListAttackPathsRequest|null, - protos.google.cloud.securitycenter.v1.IListAttackPathsResponse - ]) => { - this._log.info('listAttackPaths values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAttackPaths`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list attack paths. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - * @param {string} request.filter - * The filter expression that filters the attack path in the response. - * Supported fields: - * - * * `valued_resources` supports = - * @param {string} request.pageToken - * The value returned by the last `ListAttackPathsResponse`; indicates - * that this is a continuation of a prior `ListAttackPaths` 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 {@link protos.google.cloud.securitycenter.v1.AttackPath|AttackPath} 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 `listAttackPathsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAttackPathsStream( - request?: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAttackPaths']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAttackPaths stream %j', request); - return this.descriptors.page.listAttackPaths.createStream( - this.innerApiCalls.listAttackPaths as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAttackPaths`, 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. Name of parent to list attack paths. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - * @param {string} request.filter - * The filter expression that filters the attack path in the response. - * Supported fields: - * - * * `valued_resources` supports = - * @param {string} request.pageToken - * The value returned by the last `ListAttackPathsResponse`; indicates - * that this is a continuation of a prior `ListAttackPaths` 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1.AttackPath|AttackPath}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/security_center.list_attack_paths.js - * region_tag:securitycenter_v1_generated_SecurityCenter_ListAttackPaths_async - */ - listAttackPathsAsync( - request?: protos.google.cloud.securitycenter.v1.IListAttackPathsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAttackPaths']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAttackPaths iterate %j', request); - return this.descriptors.page.listAttackPaths.asyncIterate( - this.innerApiCalls['listAttackPaths'] as GaxCall, - request as {}, - 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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, - optionsOrCallback?: - | 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]> { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, - optionsOrCallback?: - | 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 { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified attackPath resource name string. - * - * @param {string} organization - * @param {string} simulation - * @param {string} valued_resource - * @param {string} attack_path - * @returns {string} Resource name string. - */ - attackPathPath(organization:string,simulation:string,valuedResource:string,attackPath:string) { - return this.pathTemplates.attackPathPathTemplate.render({ - organization: organization, - simulation: simulation, - valued_resource: valuedResource, - attack_path: attackPath, - }); - } - - /** - * Parse the organization from AttackPath resource. - * - * @param {string} attackPathName - * A fully-qualified path representing AttackPath resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromAttackPathName(attackPathName: string) { - return this.pathTemplates.attackPathPathTemplate.match(attackPathName).organization; - } - - /** - * Parse the simulation from AttackPath resource. - * - * @param {string} attackPathName - * A fully-qualified path representing AttackPath resource. - * @returns {string} A string representing the simulation. - */ - matchSimulationFromAttackPathName(attackPathName: string) { - return this.pathTemplates.attackPathPathTemplate.match(attackPathName).simulation; - } - - /** - * Parse the valued_resource from AttackPath resource. - * - * @param {string} attackPathName - * A fully-qualified path representing AttackPath resource. - * @returns {string} A string representing the valued_resource. - */ - matchValuedResourceFromAttackPathName(attackPathName: string) { - return this.pathTemplates.attackPathPathTemplate.match(attackPathName).valued_resource; - } - - /** - * Parse the attack_path from AttackPath resource. - * - * @param {string} attackPathName - * A fully-qualified path representing AttackPath resource. - * @returns {string} A string representing the attack_path. - */ - matchAttackPathFromAttackPathName(attackPathName: string) { - return this.pathTemplates.attackPathPathTemplate.match(attackPathName).attack_path; - } - - /** - * Return a fully-qualified folderAssetSecurityMarks resource name string. - * - * @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 folderAssets resource name string. - * - * @param {string} folder - * @param {string} asset - * @returns {string} Resource name string. - */ - folderAssetsPath(folder:string,asset:string) { - return this.pathTemplates.folderAssetsPathTemplate.render({ - folder: folder, - asset: asset, - }); - } - - /** - * Parse the folder from FolderAssets resource. - * - * @param {string} folderAssetsName - * A fully-qualified path representing folder_assets resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderAssetsName(folderAssetsName: string) { - return this.pathTemplates.folderAssetsPathTemplate.match(folderAssetsName).folder; - } - - /** - * Parse the asset from FolderAssets resource. - * - * @param {string} folderAssetsName - * A fully-qualified path representing folder_assets resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromFolderAssetsName(folderAssetsName: string) { - return this.pathTemplates.folderAssetsPathTemplate.match(folderAssetsName).asset; - } - - /** - * Return a fully-qualified folderBigQueryExports resource name string. - * - * @param {string} folder - * @param {string} exportParam - * @returns {string} Resource name string. - */ - folderBigQueryExportsPath(folder:string,exportParam:string) { - return this.pathTemplates.folderBigQueryExportsPathTemplate.render({ - folder: folder, - export: exportParam, - }); - } - - /** - * Parse the folder from FolderBigQueryExports resource. - * - * @param {string} folderBigQueryExportsName - * A fully-qualified path representing folder_bigQueryExports resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderBigQueryExportsName(folderBigQueryExportsName: string) { - return this.pathTemplates.folderBigQueryExportsPathTemplate.match(folderBigQueryExportsName).folder; - } - - /** - * Parse the export from FolderBigQueryExports resource. - * - * @param {string} folderBigQueryExportsName - * A fully-qualified path representing folder_bigQueryExports resource. - * @returns {string} A string representing the export. - */ - matchExportFromFolderBigQueryExportsName(folderBigQueryExportsName: string) { - return this.pathTemplates.folderBigQueryExportsPathTemplate.match(folderBigQueryExportsName).export; - } - - /** - * Return a fully-qualified folderConstraintName resource name string. - * - * @param {string} folder - * @param {string} constraint_name - * @returns {string} Resource name string. - */ - folderConstraintNamePath(folder:string,constraintName:string) { - return this.pathTemplates.folderConstraintNamePathTemplate.render({ - folder: folder, - constraint_name: constraintName, - }); - } - - /** - * Parse the folder from FolderConstraintName resource. - * - * @param {string} folderConstraintNameName - * A fully-qualified path representing folder_constraint_name resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderConstraintNameName(folderConstraintNameName: string) { - return this.pathTemplates.folderConstraintNamePathTemplate.match(folderConstraintNameName).folder; - } - - /** - * Parse the constraint_name from FolderConstraintName resource. - * - * @param {string} folderConstraintNameName - * A fully-qualified path representing folder_constraint_name resource. - * @returns {string} A string representing the constraint_name. - */ - matchConstraintNameFromFolderConstraintNameName(folderConstraintNameName: string) { - return this.pathTemplates.folderConstraintNamePathTemplate.match(folderConstraintNameName).constraint_name; - } - - /** - * Return a fully-qualified folderEventThreatDetectionSettingsModule resource name string. - * - * @param {string} folder - * @param {string} module - * @returns {string} Resource name string. - */ - folderEventThreatDetectionSettingsModulePath(folder:string,module:string) { - return this.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.render({ - folder: folder, - module: module, - }); - } - - /** - * Parse the folder from FolderEventThreatDetectionSettingsModule resource. - * - * @param {string} folderEventThreatDetectionSettingsModuleName - * A fully-qualified path representing folder_eventThreatDetectionSettings_module resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderEventThreatDetectionSettingsModuleName(folderEventThreatDetectionSettingsModuleName: string) { - return this.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match(folderEventThreatDetectionSettingsModuleName).folder; - } - - /** - * Parse the module from FolderEventThreatDetectionSettingsModule resource. - * - * @param {string} folderEventThreatDetectionSettingsModuleName - * A fully-qualified path representing folder_eventThreatDetectionSettings_module resource. - * @returns {string} A string representing the module. - */ - matchModuleFromFolderEventThreatDetectionSettingsModuleName(folderEventThreatDetectionSettingsModuleName: string) { - return this.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match(folderEventThreatDetectionSettingsModuleName).module; - } - - /** - * Return a fully-qualified folderLocationMuteConfigs resource name string. - * - * @param {string} folder - * @param {string} location - * @param {string} mute_config - * @returns {string} Resource name string. - */ - folderLocationMuteConfigsPath(folder:string,location:string,muteConfig:string) { - return this.pathTemplates.folderLocationMuteConfigsPathTemplate.render({ - folder: folder, - location: location, - mute_config: muteConfig, - }); - } - - /** - * Parse the folder from FolderLocationMuteConfigs resource. - * - * @param {string} folderLocationMuteConfigsName - * A fully-qualified path representing folder_location_muteConfigs resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { - return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).folder; - } - - /** - * Parse the location from FolderLocationMuteConfigs resource. - * - * @param {string} folderLocationMuteConfigsName - * A fully-qualified path representing folder_location_muteConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { - return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).location; - } - - /** - * Parse the mute_config from FolderLocationMuteConfigs resource. - * - * @param {string} folderLocationMuteConfigsName - * A fully-qualified path representing folder_location_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { - return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified folderMuteConfigs resource name string. - * - * @param {string} folder - * @param {string} mute_config - * @returns {string} Resource name string. - */ - folderMuteConfigsPath(folder:string,muteConfig:string) { - return this.pathTemplates.folderMuteConfigsPathTemplate.render({ - folder: folder, - mute_config: muteConfig, - }); - } - - /** - * Parse the folder from FolderMuteConfigs resource. - * - * @param {string} folderMuteConfigsName - * A fully-qualified path representing folder_muteConfigs resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMuteConfigsName(folderMuteConfigsName: string) { - return this.pathTemplates.folderMuteConfigsPathTemplate.match(folderMuteConfigsName).folder; - } - - /** - * Parse the mute_config from FolderMuteConfigs resource. - * - * @param {string} folderMuteConfigsName - * A fully-qualified path representing folder_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromFolderMuteConfigsName(folderMuteConfigsName: string) { - return this.pathTemplates.folderMuteConfigsPathTemplate.match(folderMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified folderNotificationConfigs resource name string. - * - * @param {string} folder - * @param {string} notification_config - * @returns {string} Resource name string. - */ - folderNotificationConfigsPath(folder:string,notificationConfig:string) { - return this.pathTemplates.folderNotificationConfigsPathTemplate.render({ - folder: folder, - notification_config: notificationConfig, - }); - } - - /** - * Parse the folder from FolderNotificationConfigs resource. - * - * @param {string} folderNotificationConfigsName - * A fully-qualified path representing folder_notificationConfigs resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderNotificationConfigsName(folderNotificationConfigsName: string) { - return this.pathTemplates.folderNotificationConfigsPathTemplate.match(folderNotificationConfigsName).folder; - } - - /** - * Parse the notification_config from FolderNotificationConfigs resource. - * - * @param {string} folderNotificationConfigsName - * A fully-qualified path representing folder_notificationConfigs resource. - * @returns {string} A string representing the notification_config. - */ - matchNotificationConfigFromFolderNotificationConfigsName(folderNotificationConfigsName: string) { - return this.pathTemplates.folderNotificationConfigsPathTemplate.match(folderNotificationConfigsName).notification_config; - } - - /** - * Return a fully-qualified folderSecurityHealthAnalyticsSettingsCustomModule resource name string. - * - * @param {string} folder - * @param {string} custom_module - * @returns {string} Resource name string. - */ - folderSecurityHealthAnalyticsSettingsCustomModulePath(folder:string,customModule:string) { - return this.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render({ - folder: folder, - custom_module: customModule, - }); - } - - /** - * Parse the folder from FolderSecurityHealthAnalyticsSettingsCustomModule resource. - * - * @param {string} folderSecurityHealthAnalyticsSettingsCustomModuleName - * A fully-qualified path representing folder_securityHealthAnalyticsSettings_custom_module resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderSecurityHealthAnalyticsSettingsCustomModuleName(folderSecurityHealthAnalyticsSettingsCustomModuleName: string) { - return this.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(folderSecurityHealthAnalyticsSettingsCustomModuleName).folder; - } - - /** - * Parse the custom_module from FolderSecurityHealthAnalyticsSettingsCustomModule resource. - * - * @param {string} folderSecurityHealthAnalyticsSettingsCustomModuleName - * A fully-qualified path representing folder_securityHealthAnalyticsSettings_custom_module resource. - * @returns {string} A string representing the custom_module. - */ - matchCustomModuleFromFolderSecurityHealthAnalyticsSettingsCustomModuleName(folderSecurityHealthAnalyticsSettingsCustomModuleName: string) { - return this.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(folderSecurityHealthAnalyticsSettingsCustomModuleName).custom_module; - } - - /** - * Return a fully-qualified folderSecurityHealthAnalyticsSettingsEffectiveCustomModule resource name string. - * - * @param {string} folder - * @param {string} effective_custom_module - * @returns {string} Resource name string. - */ - folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePath(folder:string,effectiveCustomModule:string) { - return this.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render({ - folder: folder, - effective_custom_module: effectiveCustomModule, - }); - } - - /** - * Parse the folder from FolderSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. - * - * @param {string} folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName - * A fully-qualified path representing folder_securityHealthAnalyticsSettings_effective_custom_module resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { - return this.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).folder; - } - - /** - * Parse the effective_custom_module from FolderSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. - * - * @param {string} folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName - * A fully-qualified path representing folder_securityHealthAnalyticsSettings_effective_custom_module resource. - * @returns {string} A string representing the effective_custom_module. - */ - matchEffectiveCustomModuleFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { - return this.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(folderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).effective_custom_module; - } - - /** - * 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 folderSourceFindingExternalSystems resource name string. - * - * @param {string} folder - * @param {string} source - * @param {string} finding - * @param {string} externalsystem - * @returns {string} Resource name string. - */ - folderSourceFindingExternalSystemsPath(folder:string,source:string,finding:string,externalsystem:string) { - return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.render({ - folder: folder, - source: source, - finding: finding, - externalsystem: externalsystem, - }); - } - - /** - * Parse the folder from FolderSourceFindingExternalSystems resource. - * - * @param {string} folderSourceFindingExternalSystemsName - * A fully-qualified path representing folder_source_finding_externalSystems resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderSourceFindingExternalSystemsName(folderSourceFindingExternalSystemsName: string) { - return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match(folderSourceFindingExternalSystemsName).folder; - } - - /** - * Parse the source from FolderSourceFindingExternalSystems resource. - * - * @param {string} folderSourceFindingExternalSystemsName - * A fully-qualified path representing folder_source_finding_externalSystems resource. - * @returns {string} A string representing the source. - */ - matchSourceFromFolderSourceFindingExternalSystemsName(folderSourceFindingExternalSystemsName: string) { - return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match(folderSourceFindingExternalSystemsName).source; - } - - /** - * Parse the finding from FolderSourceFindingExternalSystems resource. - * - * @param {string} folderSourceFindingExternalSystemsName - * A fully-qualified path representing folder_source_finding_externalSystems resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromFolderSourceFindingExternalSystemsName(folderSourceFindingExternalSystemsName: string) { - return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match(folderSourceFindingExternalSystemsName).finding; - } - - /** - * Parse the externalsystem from FolderSourceFindingExternalSystems resource. - * - * @param {string} folderSourceFindingExternalSystemsName - * A fully-qualified path representing folder_source_finding_externalSystems resource. - * @returns {string} A string representing the externalsystem. - */ - matchExternalsystemFromFolderSourceFindingExternalSystemsName(folderSourceFindingExternalSystemsName: string) { - return this.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match(folderSourceFindingExternalSystemsName).externalsystem; - } - - /** - * 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; - } - - /** - * Return a fully-qualified folderSourceFindings resource name string. - * - * @param {string} folder - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - folderSourceFindingsPath(folder:string,source:string,finding:string) { - return this.pathTemplates.folderSourceFindingsPathTemplate.render({ - folder: folder, - source: source, - finding: finding, - }); - } - - /** - * Parse the folder from FolderSourceFindings resource. - * - * @param {string} folderSourceFindingsName - * A fully-qualified path representing folder_source_findings resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderSourceFindingsName(folderSourceFindingsName: string) { - return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).folder; - } - - /** - * Parse the source from FolderSourceFindings resource. - * - * @param {string} folderSourceFindingsName - * A fully-qualified path representing folder_source_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromFolderSourceFindingsName(folderSourceFindingsName: string) { - return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).source; - } - - /** - * Parse the finding from FolderSourceFindings resource. - * - * @param {string} folderSourceFindingsName - * A fully-qualified path representing folder_source_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromFolderSourceFindingsName(folderSourceFindingsName: string) { - return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).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: 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 organizationAssetSecurityMarks resource name string. - * - * @param {string} organization - * @param {string} asset - * @returns {string} Resource name string. - */ - organizationAssetSecurityMarksPath(organization:string,asset:string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render({ - organization: organization, - asset: asset, - }); - } - - /** - * Parse the organization from OrganizationAssetSecurityMarks resource. - * - * @param {string} organizationAssetSecurityMarksName - * A fully-qualified path representing organization_asset_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).organization; - } - - /** - * Parse the asset from OrganizationAssetSecurityMarks resource. - * - * @param {string} organizationAssetSecurityMarksName - * A fully-qualified path representing organization_asset_securityMarks resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).asset; - } - - /** - * Return a fully-qualified organizationAssets resource name string. - * - * @param {string} organization - * @param {string} asset - * @returns {string} Resource name string. - */ - organizationAssetsPath(organization:string,asset:string) { - return this.pathTemplates.organizationAssetsPathTemplate.render({ - organization: organization, - asset: asset, - }); - } - - /** - * Parse the organization from OrganizationAssets resource. - * - * @param {string} organizationAssetsName - * A fully-qualified path representing organization_assets resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationAssetsName(organizationAssetsName: string) { - return this.pathTemplates.organizationAssetsPathTemplate.match(organizationAssetsName).organization; - } - - /** - * Parse the asset from OrganizationAssets resource. - * - * @param {string} organizationAssetsName - * A fully-qualified path representing organization_assets resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromOrganizationAssetsName(organizationAssetsName: string) { - return this.pathTemplates.organizationAssetsPathTemplate.match(organizationAssetsName).asset; - } - - /** - * Return a fully-qualified organizationBigQueryExports resource name string. - * - * @param {string} organization - * @param {string} exportParam - * @returns {string} Resource name string. - */ - organizationBigQueryExportsPath(organization:string,exportParam:string) { - return this.pathTemplates.organizationBigQueryExportsPathTemplate.render({ - organization: organization, - export: exportParam, - }); - } - - /** - * Parse the organization from OrganizationBigQueryExports resource. - * - * @param {string} organizationBigQueryExportsName - * A fully-qualified path representing organization_bigQueryExports resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationBigQueryExportsName(organizationBigQueryExportsName: string) { - return this.pathTemplates.organizationBigQueryExportsPathTemplate.match(organizationBigQueryExportsName).organization; - } - - /** - * Parse the export from OrganizationBigQueryExports resource. - * - * @param {string} organizationBigQueryExportsName - * A fully-qualified path representing organization_bigQueryExports resource. - * @returns {string} A string representing the export. - */ - matchExportFromOrganizationBigQueryExportsName(organizationBigQueryExportsName: string) { - return this.pathTemplates.organizationBigQueryExportsPathTemplate.match(organizationBigQueryExportsName).export; - } - - /** - * Return a fully-qualified organizationConstraintName resource name string. - * - * @param {string} organization - * @param {string} constraint_name - * @returns {string} Resource name string. - */ - organizationConstraintNamePath(organization:string,constraintName:string) { - return this.pathTemplates.organizationConstraintNamePathTemplate.render({ - organization: organization, - constraint_name: constraintName, - }); - } - - /** - * Parse the organization from OrganizationConstraintName resource. - * - * @param {string} organizationConstraintNameName - * A fully-qualified path representing organization_constraint_name resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationConstraintNameName(organizationConstraintNameName: string) { - return this.pathTemplates.organizationConstraintNamePathTemplate.match(organizationConstraintNameName).organization; - } - - /** - * Parse the constraint_name from OrganizationConstraintName resource. - * - * @param {string} organizationConstraintNameName - * A fully-qualified path representing organization_constraint_name resource. - * @returns {string} A string representing the constraint_name. - */ - matchConstraintNameFromOrganizationConstraintNameName(organizationConstraintNameName: string) { - return this.pathTemplates.organizationConstraintNamePathTemplate.match(organizationConstraintNameName).constraint_name; - } - - /** - * Return a fully-qualified organizationEventThreatDetectionSettings resource name string. - * - * @param {string} organization - * @returns {string} Resource name string. - */ - organizationEventThreatDetectionSettingsPath(organization:string) { - return this.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.render({ - organization: organization, - }); - } - - /** - * Parse the organization from OrganizationEventThreatDetectionSettings resource. - * - * @param {string} organizationEventThreatDetectionSettingsName - * A fully-qualified path representing organization_eventThreatDetectionSettings resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationEventThreatDetectionSettingsName(organizationEventThreatDetectionSettingsName: string) { - return this.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.match(organizationEventThreatDetectionSettingsName).organization; - } - - /** - * Return a fully-qualified organizationEventThreatDetectionSettingsModule resource name string. - * - * @param {string} organization - * @param {string} module - * @returns {string} Resource name string. - */ - organizationEventThreatDetectionSettingsModulePath(organization:string,module:string) { - return this.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.render({ - organization: organization, - module: module, - }); - } - - /** - * Parse the organization from OrganizationEventThreatDetectionSettingsModule resource. - * - * @param {string} organizationEventThreatDetectionSettingsModuleName - * A fully-qualified path representing organization_eventThreatDetectionSettings_module resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationEventThreatDetectionSettingsModuleName(organizationEventThreatDetectionSettingsModuleName: string) { - return this.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match(organizationEventThreatDetectionSettingsModuleName).organization; - } - - /** - * Parse the module from OrganizationEventThreatDetectionSettingsModule resource. - * - * @param {string} organizationEventThreatDetectionSettingsModuleName - * A fully-qualified path representing organization_eventThreatDetectionSettings_module resource. - * @returns {string} A string representing the module. - */ - matchModuleFromOrganizationEventThreatDetectionSettingsModuleName(organizationEventThreatDetectionSettingsModuleName: string) { - return this.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match(organizationEventThreatDetectionSettingsModuleName).module; - } - - /** - * Return a fully-qualified organizationLocationMuteConfigs resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} mute_config - * @returns {string} Resource name string. - */ - organizationLocationMuteConfigsPath(organization:string,location:string,muteConfig:string) { - return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.render({ - organization: organization, - location: location, - mute_config: muteConfig, - }); - } - - /** - * Parse the organization from OrganizationLocationMuteConfigs resource. - * - * @param {string} organizationLocationMuteConfigsName - * A fully-qualified path representing organization_location_muteConfigs resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { - return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).organization; - } - - /** - * Parse the location from OrganizationLocationMuteConfigs resource. - * - * @param {string} organizationLocationMuteConfigsName - * A fully-qualified path representing organization_location_muteConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { - return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).location; - } - - /** - * Parse the mute_config from OrganizationLocationMuteConfigs resource. - * - * @param {string} organizationLocationMuteConfigsName - * A fully-qualified path representing organization_location_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { - return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified organizationMuteConfigs resource name string. - * - * @param {string} organization - * @param {string} mute_config - * @returns {string} Resource name string. - */ - organizationMuteConfigsPath(organization:string,muteConfig:string) { - return this.pathTemplates.organizationMuteConfigsPathTemplate.render({ - organization: organization, - mute_config: muteConfig, - }); - } - - /** - * Parse the organization from OrganizationMuteConfigs resource. - * - * @param {string} organizationMuteConfigsName - * A fully-qualified path representing organization_muteConfigs resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMuteConfigsName(organizationMuteConfigsName: string) { - return this.pathTemplates.organizationMuteConfigsPathTemplate.match(organizationMuteConfigsName).organization; - } - - /** - * Parse the mute_config from OrganizationMuteConfigs resource. - * - * @param {string} organizationMuteConfigsName - * A fully-qualified path representing organization_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromOrganizationMuteConfigsName(organizationMuteConfigsName: string) { - return this.pathTemplates.organizationMuteConfigsPathTemplate.match(organizationMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified organizationNotificationConfigs resource name string. - * - * @param {string} organization - * @param {string} notification_config - * @returns {string} Resource name string. - */ - organizationNotificationConfigsPath(organization:string,notificationConfig:string) { - return this.pathTemplates.organizationNotificationConfigsPathTemplate.render({ - organization: organization, - notification_config: notificationConfig, - }); - } - - /** - * Parse the organization from OrganizationNotificationConfigs resource. - * - * @param {string} organizationNotificationConfigsName - * A fully-qualified path representing organization_notificationConfigs resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationNotificationConfigsName(organizationNotificationConfigsName: string) { - return this.pathTemplates.organizationNotificationConfigsPathTemplate.match(organizationNotificationConfigsName).organization; - } - - /** - * Parse the notification_config from OrganizationNotificationConfigs resource. - * - * @param {string} organizationNotificationConfigsName - * A fully-qualified path representing organization_notificationConfigs resource. - * @returns {string} A string representing the notification_config. - */ - matchNotificationConfigFromOrganizationNotificationConfigsName(organizationNotificationConfigsName: string) { - return this.pathTemplates.organizationNotificationConfigsPathTemplate.match(organizationNotificationConfigsName).notification_config; - } - - /** - * Return a fully-qualified organizationSecurityHealthAnalyticsSettings resource name string. - * - * @param {string} organization - * @returns {string} Resource name string. - */ - organizationSecurityHealthAnalyticsSettingsPath(organization:string) { - return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.render({ - organization: organization, - }); - } - - /** - * Parse the organization from OrganizationSecurityHealthAnalyticsSettings resource. - * - * @param {string} organizationSecurityHealthAnalyticsSettingsName - * A fully-qualified path representing organization_securityHealthAnalyticsSettings resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsName(organizationSecurityHealthAnalyticsSettingsName: string) { - return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.match(organizationSecurityHealthAnalyticsSettingsName).organization; - } - - /** - * Return a fully-qualified organizationSecurityHealthAnalyticsSettingsCustomModule resource name string. - * - * @param {string} organization - * @param {string} custom_module - * @returns {string} Resource name string. - */ - organizationSecurityHealthAnalyticsSettingsCustomModulePath(organization:string,customModule:string) { - return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render({ - organization: organization, - custom_module: customModule, - }); - } - - /** - * Parse the organization from OrganizationSecurityHealthAnalyticsSettingsCustomModule resource. - * - * @param {string} organizationSecurityHealthAnalyticsSettingsCustomModuleName - * A fully-qualified path representing organization_securityHealthAnalyticsSettings_custom_module resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName(organizationSecurityHealthAnalyticsSettingsCustomModuleName: string) { - return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(organizationSecurityHealthAnalyticsSettingsCustomModuleName).organization; - } - - /** - * Parse the custom_module from OrganizationSecurityHealthAnalyticsSettingsCustomModule resource. - * - * @param {string} organizationSecurityHealthAnalyticsSettingsCustomModuleName - * A fully-qualified path representing organization_securityHealthAnalyticsSettings_custom_module resource. - * @returns {string} A string representing the custom_module. - */ - matchCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName(organizationSecurityHealthAnalyticsSettingsCustomModuleName: string) { - return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(organizationSecurityHealthAnalyticsSettingsCustomModuleName).custom_module; - } - - /** - * Return a fully-qualified organizationSecurityHealthAnalyticsSettingsEffectiveCustomModule resource name string. - * - * @param {string} organization - * @param {string} effective_custom_module - * @returns {string} Resource name string. - */ - organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePath(organization:string,effectiveCustomModule:string) { - return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render({ - organization: organization, - effective_custom_module: effectiveCustomModule, - }); - } - - /** - * Parse the organization from OrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. - * - * @param {string} organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName - * A fully-qualified path representing organization_securityHealthAnalyticsSettings_effective_custom_module resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { - return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).organization; - } - - /** - * Parse the effective_custom_module from OrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. - * - * @param {string} organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName - * A fully-qualified path representing organization_securityHealthAnalyticsSettings_effective_custom_module resource. - * @returns {string} A string representing the effective_custom_module. - */ - matchEffectiveCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { - return this.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(organizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).effective_custom_module; - } - - /** - * 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: 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 organizationSimulation resource name string. - * - * @param {string} organization - * @param {string} simulation - * @returns {string} Resource name string. - */ - organizationSimulationPath(organization:string,simulation:string) { - return this.pathTemplates.organizationSimulationPathTemplate.render({ - organization: organization, - simulation: simulation, - }); - } - - /** - * Parse the organization from OrganizationSimulation resource. - * - * @param {string} organizationSimulationName - * A fully-qualified path representing OrganizationSimulation resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSimulationName(organizationSimulationName: string) { - return this.pathTemplates.organizationSimulationPathTemplate.match(organizationSimulationName).organization; - } - - /** - * Parse the simulation from OrganizationSimulation resource. - * - * @param {string} organizationSimulationName - * A fully-qualified path representing OrganizationSimulation resource. - * @returns {string} A string representing the simulation. - */ - matchSimulationFromOrganizationSimulationName(organizationSimulationName: string) { - return this.pathTemplates.organizationSimulationPathTemplate.match(organizationSimulationName).simulation; - } - - /** - * 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 organizationSourceFindingExternalSystems resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @param {string} externalsystem - * @returns {string} Resource name string. - */ - organizationSourceFindingExternalSystemsPath(organization:string,source:string,finding:string,externalsystem:string) { - return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - externalsystem: externalsystem, - }); - } - - /** - * Parse the organization from OrganizationSourceFindingExternalSystems resource. - * - * @param {string} organizationSourceFindingExternalSystemsName - * A fully-qualified path representing organization_source_finding_externalSystems resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingExternalSystemsName(organizationSourceFindingExternalSystemsName: string) { - return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match(organizationSourceFindingExternalSystemsName).organization; - } - - /** - * Parse the source from OrganizationSourceFindingExternalSystems resource. - * - * @param {string} organizationSourceFindingExternalSystemsName - * A fully-qualified path representing organization_source_finding_externalSystems resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingExternalSystemsName(organizationSourceFindingExternalSystemsName: string) { - return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match(organizationSourceFindingExternalSystemsName).source; - } - - /** - * Parse the finding from OrganizationSourceFindingExternalSystems resource. - * - * @param {string} organizationSourceFindingExternalSystemsName - * A fully-qualified path representing organization_source_finding_externalSystems resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingExternalSystemsName(organizationSourceFindingExternalSystemsName: string) { - return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match(organizationSourceFindingExternalSystemsName).finding; - } - - /** - * Parse the externalsystem from OrganizationSourceFindingExternalSystems resource. - * - * @param {string} organizationSourceFindingExternalSystemsName - * A fully-qualified path representing organization_source_finding_externalSystems resource. - * @returns {string} A string representing the externalsystem. - */ - matchExternalsystemFromOrganizationSourceFindingExternalSystemsName(organizationSourceFindingExternalSystemsName: string) { - return this.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match(organizationSourceFindingExternalSystemsName).externalsystem; - } - - /** - * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceFindingSecurityMarksPath(organization:string,source:string,finding:string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); - } - - /** - * Parse the organization from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).organization; - } - - /** - * Parse the source from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).source; - } - - /** - * Parse the finding from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).finding; - } - - /** - * Return a fully-qualified organizationSourceFindings resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceFindingsPath(organization:string,source:string,finding:string) { - return this.pathTemplates.organizationSourceFindingsPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); - } - - /** - * Parse the organization from OrganizationSourceFindings resource. - * - * @param {string} organizationSourceFindingsName - * A fully-qualified path representing organization_source_findings resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { - return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).organization; - } - - /** - * Parse the source from OrganizationSourceFindings resource. - * - * @param {string} organizationSourceFindingsName - * A fully-qualified path representing organization_source_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { - return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).source; - } - - /** - * Parse the finding from OrganizationSourceFindings resource. - * - * @param {string} organizationSourceFindingsName - * A fully-qualified path representing organization_source_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { - return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).finding; - } - - /** - * 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 projectAssets resource name string. - * - * @param {string} project - * @param {string} asset - * @returns {string} Resource name string. - */ - projectAssetsPath(project:string,asset:string) { - return this.pathTemplates.projectAssetsPathTemplate.render({ - project: project, - asset: asset, - }); - } - - /** - * Parse the project from ProjectAssets resource. - * - * @param {string} projectAssetsName - * A fully-qualified path representing project_assets resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectAssetsName(projectAssetsName: string) { - return this.pathTemplates.projectAssetsPathTemplate.match(projectAssetsName).project; - } - - /** - * Parse the asset from ProjectAssets resource. - * - * @param {string} projectAssetsName - * A fully-qualified path representing project_assets resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromProjectAssetsName(projectAssetsName: string) { - return this.pathTemplates.projectAssetsPathTemplate.match(projectAssetsName).asset; - } - - /** - * Return a fully-qualified projectBigQueryExports resource name string. - * - * @param {string} project - * @param {string} exportParam - * @returns {string} Resource name string. - */ - projectBigQueryExportsPath(project:string,exportParam:string) { - return this.pathTemplates.projectBigQueryExportsPathTemplate.render({ - project: project, - export: exportParam, - }); - } - - /** - * Parse the project from ProjectBigQueryExports resource. - * - * @param {string} projectBigQueryExportsName - * A fully-qualified path representing project_bigQueryExports resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectBigQueryExportsName(projectBigQueryExportsName: string) { - return this.pathTemplates.projectBigQueryExportsPathTemplate.match(projectBigQueryExportsName).project; - } - - /** - * Parse the export from ProjectBigQueryExports resource. - * - * @param {string} projectBigQueryExportsName - * A fully-qualified path representing project_bigQueryExports resource. - * @returns {string} A string representing the export. - */ - matchExportFromProjectBigQueryExportsName(projectBigQueryExportsName: string) { - return this.pathTemplates.projectBigQueryExportsPathTemplate.match(projectBigQueryExportsName).export; - } - - /** - * Return a fully-qualified projectConstraintName resource name string. - * - * @param {string} project - * @param {string} constraint_name - * @returns {string} Resource name string. - */ - projectConstraintNamePath(project:string,constraintName:string) { - return this.pathTemplates.projectConstraintNamePathTemplate.render({ - project: project, - constraint_name: constraintName, - }); - } - - /** - * Parse the project from ProjectConstraintName resource. - * - * @param {string} projectConstraintNameName - * A fully-qualified path representing project_constraint_name resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectConstraintNameName(projectConstraintNameName: string) { - return this.pathTemplates.projectConstraintNamePathTemplate.match(projectConstraintNameName).project; - } - - /** - * Parse the constraint_name from ProjectConstraintName resource. - * - * @param {string} projectConstraintNameName - * A fully-qualified path representing project_constraint_name resource. - * @returns {string} A string representing the constraint_name. - */ - matchConstraintNameFromProjectConstraintNameName(projectConstraintNameName: string) { - return this.pathTemplates.projectConstraintNamePathTemplate.match(projectConstraintNameName).constraint_name; - } - - /** - * Return a fully-qualified projectEventThreatDetectionSettingsModule resource name string. - * - * @param {string} project - * @param {string} module - * @returns {string} Resource name string. - */ - projectEventThreatDetectionSettingsModulePath(project:string,module:string) { - return this.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.render({ - project: project, - module: module, - }); - } - - /** - * Parse the project from ProjectEventThreatDetectionSettingsModule resource. - * - * @param {string} projectEventThreatDetectionSettingsModuleName - * A fully-qualified path representing project_eventThreatDetectionSettings_module resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectEventThreatDetectionSettingsModuleName(projectEventThreatDetectionSettingsModuleName: string) { - return this.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match(projectEventThreatDetectionSettingsModuleName).project; - } - - /** - * Parse the module from ProjectEventThreatDetectionSettingsModule resource. - * - * @param {string} projectEventThreatDetectionSettingsModuleName - * A fully-qualified path representing project_eventThreatDetectionSettings_module resource. - * @returns {string} A string representing the module. - */ - matchModuleFromProjectEventThreatDetectionSettingsModuleName(projectEventThreatDetectionSettingsModuleName: string) { - return this.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match(projectEventThreatDetectionSettingsModuleName).module; - } - - /** - * Return a fully-qualified projectLocationMuteConfigs resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} mute_config - * @returns {string} Resource name string. - */ - projectLocationMuteConfigsPath(project:string,location:string,muteConfig:string) { - return this.pathTemplates.projectLocationMuteConfigsPathTemplate.render({ - project: project, - location: location, - mute_config: muteConfig, - }); - } - - /** - * Parse the project from ProjectLocationMuteConfigs resource. - * - * @param {string} projectLocationMuteConfigsName - * A fully-qualified path representing project_location_muteConfigs resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { - return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).project; - } - - /** - * Parse the location from ProjectLocationMuteConfigs resource. - * - * @param {string} projectLocationMuteConfigsName - * A fully-qualified path representing project_location_muteConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { - return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).location; - } - - /** - * Parse the mute_config from ProjectLocationMuteConfigs resource. - * - * @param {string} projectLocationMuteConfigsName - * A fully-qualified path representing project_location_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { - return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified projectMuteConfigs resource name string. - * - * @param {string} project - * @param {string} mute_config - * @returns {string} Resource name string. - */ - projectMuteConfigsPath(project:string,muteConfig:string) { - return this.pathTemplates.projectMuteConfigsPathTemplate.render({ - project: project, - mute_config: muteConfig, - }); - } - - /** - * Parse the project from ProjectMuteConfigs resource. - * - * @param {string} projectMuteConfigsName - * A fully-qualified path representing project_muteConfigs resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMuteConfigsName(projectMuteConfigsName: string) { - return this.pathTemplates.projectMuteConfigsPathTemplate.match(projectMuteConfigsName).project; - } - - /** - * Parse the mute_config from ProjectMuteConfigs resource. - * - * @param {string} projectMuteConfigsName - * A fully-qualified path representing project_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromProjectMuteConfigsName(projectMuteConfigsName: string) { - return this.pathTemplates.projectMuteConfigsPathTemplate.match(projectMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified projectNotificationConfigs resource name string. - * - * @param {string} project - * @param {string} notification_config - * @returns {string} Resource name string. - */ - projectNotificationConfigsPath(project:string,notificationConfig:string) { - return this.pathTemplates.projectNotificationConfigsPathTemplate.render({ - project: project, - notification_config: notificationConfig, - }); - } - - /** - * Parse the project from ProjectNotificationConfigs resource. - * - * @param {string} projectNotificationConfigsName - * A fully-qualified path representing project_notificationConfigs resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectNotificationConfigsName(projectNotificationConfigsName: string) { - return this.pathTemplates.projectNotificationConfigsPathTemplate.match(projectNotificationConfigsName).project; - } - - /** - * Parse the notification_config from ProjectNotificationConfigs resource. - * - * @param {string} projectNotificationConfigsName - * A fully-qualified path representing project_notificationConfigs resource. - * @returns {string} A string representing the notification_config. - */ - matchNotificationConfigFromProjectNotificationConfigsName(projectNotificationConfigsName: string) { - return this.pathTemplates.projectNotificationConfigsPathTemplate.match(projectNotificationConfigsName).notification_config; - } - - /** - * Return a fully-qualified projectSecurityHealthAnalyticsSettingsCustomModule resource name string. - * - * @param {string} project - * @param {string} custom_module - * @returns {string} Resource name string. - */ - projectSecurityHealthAnalyticsSettingsCustomModulePath(project:string,customModule:string) { - return this.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render({ - project: project, - custom_module: customModule, - }); - } - - /** - * Parse the project from ProjectSecurityHealthAnalyticsSettingsCustomModule resource. - * - * @param {string} projectSecurityHealthAnalyticsSettingsCustomModuleName - * A fully-qualified path representing project_securityHealthAnalyticsSettings_custom_module resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectSecurityHealthAnalyticsSettingsCustomModuleName(projectSecurityHealthAnalyticsSettingsCustomModuleName: string) { - return this.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(projectSecurityHealthAnalyticsSettingsCustomModuleName).project; - } - - /** - * Parse the custom_module from ProjectSecurityHealthAnalyticsSettingsCustomModule resource. - * - * @param {string} projectSecurityHealthAnalyticsSettingsCustomModuleName - * A fully-qualified path representing project_securityHealthAnalyticsSettings_custom_module resource. - * @returns {string} A string representing the custom_module. - */ - matchCustomModuleFromProjectSecurityHealthAnalyticsSettingsCustomModuleName(projectSecurityHealthAnalyticsSettingsCustomModuleName: string) { - return this.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match(projectSecurityHealthAnalyticsSettingsCustomModuleName).custom_module; - } - - /** - * Return a fully-qualified projectSecurityHealthAnalyticsSettingsEffectiveCustomModule resource name string. - * - * @param {string} project - * @param {string} effective_custom_module - * @returns {string} Resource name string. - */ - projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePath(project:string,effectiveCustomModule:string) { - return this.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render({ - project: project, - effective_custom_module: effectiveCustomModule, - }); - } - - /** - * Parse the project from ProjectSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. - * - * @param {string} projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName - * A fully-qualified path representing project_securityHealthAnalyticsSettings_effective_custom_module resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { - return this.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).project; - } - - /** - * Parse the effective_custom_module from ProjectSecurityHealthAnalyticsSettingsEffectiveCustomModule resource. - * - * @param {string} projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName - * A fully-qualified path representing project_securityHealthAnalyticsSettings_effective_custom_module resource. - * @returns {string} A string representing the effective_custom_module. - */ - matchEffectiveCustomModuleFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName: string) { - return this.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match(projectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName).effective_custom_module; - } - - /** - * Return a fully-qualified projectSource resource name string. - * - * @param {string} project - * @param {string} source - * @returns {string} Resource name string. - */ - projectSourcePath(project:string,source:string) { - return this.pathTemplates.projectSourcePathTemplate.render({ - project: project, - source: source, - }); - } - - /** - * Parse the project from ProjectSource resource. - * - * @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 projectSourceFindingExternalSystems resource name string. - * - * @param {string} project - * @param {string} source - * @param {string} finding - * @param {string} externalsystem - * @returns {string} Resource name string. - */ - projectSourceFindingExternalSystemsPath(project:string,source:string,finding:string,externalsystem:string) { - return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.render({ - project: project, - source: source, - finding: finding, - externalsystem: externalsystem, - }); - } - - /** - * Parse the project from ProjectSourceFindingExternalSystems resource. - * - * @param {string} projectSourceFindingExternalSystemsName - * A fully-qualified path representing project_source_finding_externalSystems resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectSourceFindingExternalSystemsName(projectSourceFindingExternalSystemsName: string) { - return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match(projectSourceFindingExternalSystemsName).project; - } - - /** - * Parse the source from ProjectSourceFindingExternalSystems resource. - * - * @param {string} projectSourceFindingExternalSystemsName - * A fully-qualified path representing project_source_finding_externalSystems resource. - * @returns {string} A string representing the source. - */ - matchSourceFromProjectSourceFindingExternalSystemsName(projectSourceFindingExternalSystemsName: string) { - return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match(projectSourceFindingExternalSystemsName).source; - } - - /** - * Parse the finding from ProjectSourceFindingExternalSystems resource. - * - * @param {string} projectSourceFindingExternalSystemsName - * A fully-qualified path representing project_source_finding_externalSystems resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromProjectSourceFindingExternalSystemsName(projectSourceFindingExternalSystemsName: string) { - return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match(projectSourceFindingExternalSystemsName).finding; - } - - /** - * Parse the externalsystem from ProjectSourceFindingExternalSystems resource. - * - * @param {string} projectSourceFindingExternalSystemsName - * A fully-qualified path representing project_source_finding_externalSystems resource. - * @returns {string} A string representing the externalsystem. - */ - matchExternalsystemFromProjectSourceFindingExternalSystemsName(projectSourceFindingExternalSystemsName: string) { - return this.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match(projectSourceFindingExternalSystemsName).externalsystem; - } - - /** - * 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 ProjectSourceFindingSecurityMarks resource. - * - * @param {string} projectSourceFindingSecurityMarksName - * A fully-qualified path representing project_source_finding_securityMarks resource. - * @returns {string} A string representing the 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; - } - - /** - * Return a fully-qualified projectSourceFindings resource name string. - * - * @param {string} project - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - projectSourceFindingsPath(project:string,source:string,finding:string) { - return this.pathTemplates.projectSourceFindingsPathTemplate.render({ - project: project, - source: source, - finding: finding, - }); - } - - /** - * Parse the project from ProjectSourceFindings resource. - * - * @param {string} projectSourceFindingsName - * A fully-qualified path representing project_source_findings resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectSourceFindingsName(projectSourceFindingsName: string) { - return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).project; - } - - /** - * Parse the source from ProjectSourceFindings resource. - * - * @param {string} projectSourceFindingsName - * A fully-qualified path representing project_source_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromProjectSourceFindingsName(projectSourceFindingsName: string) { - return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).source; - } - - /** - * Parse the finding from ProjectSourceFindings resource. - * - * @param {string} projectSourceFindingsName - * A fully-qualified path representing project_source_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromProjectSourceFindingsName(projectSourceFindingsName: string) { - return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).finding; - } - - /** - * Return a fully-qualified resourceValueConfig resource name string. - * - * @param {string} organization - * @param {string} resource_value_config - * @returns {string} Resource name string. - */ - resourceValueConfigPath(organization:string,resourceValueConfig:string) { - return this.pathTemplates.resourceValueConfigPathTemplate.render({ - organization: organization, - resource_value_config: resourceValueConfig, - }); - } - - /** - * Parse the organization from ResourceValueConfig resource. - * - * @param {string} resourceValueConfigName - * A fully-qualified path representing ResourceValueConfig resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromResourceValueConfigName(resourceValueConfigName: string) { - return this.pathTemplates.resourceValueConfigPathTemplate.match(resourceValueConfigName).organization; - } - - /** - * Parse the resource_value_config from ResourceValueConfig resource. - * - * @param {string} resourceValueConfigName - * A fully-qualified path representing ResourceValueConfig resource. - * @returns {string} A string representing the resource_value_config. - */ - matchResourceValueConfigFromResourceValueConfigName(resourceValueConfigName: string) { - return this.pathTemplates.resourceValueConfigPathTemplate.match(resourceValueConfigName).resource_value_config; - } - - /** - * Return a fully-qualified simulation resource name string. - * - * @param {string} organization - * @param {string} simulation - * @returns {string} Resource name string. - */ - simulationPath(organization:string,simulation:string) { - return this.pathTemplates.simulationPathTemplate.render({ - organization: organization, - simulation: simulation, - }); - } - - /** - * Parse the organization from Simulation resource. - * - * @param {string} simulationName - * A fully-qualified path representing Simulation resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromSimulationName(simulationName: string) { - return this.pathTemplates.simulationPathTemplate.match(simulationName).organization; - } - - /** - * Parse the simulation from Simulation resource. - * - * @param {string} simulationName - * A fully-qualified path representing Simulation resource. - * @returns {string} A string representing the simulation. - */ - matchSimulationFromSimulationName(simulationName: string) { - return this.pathTemplates.simulationPathTemplate.match(simulationName).simulation; - } - - /** - * Return a fully-qualified valuedResource resource name string. - * - * @param {string} organization - * @param {string} simulation - * @param {string} valued_resource - * @returns {string} Resource name string. - */ - valuedResourcePath(organization:string,simulation:string,valuedResource:string) { - return this.pathTemplates.valuedResourcePathTemplate.render({ - organization: organization, - simulation: simulation, - valued_resource: valuedResource, - }); - } - - /** - * Parse the organization from ValuedResource resource. - * - * @param {string} valuedResourceName - * A fully-qualified path representing ValuedResource resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromValuedResourceName(valuedResourceName: string) { - return this.pathTemplates.valuedResourcePathTemplate.match(valuedResourceName).organization; - } - - /** - * Parse the simulation from ValuedResource resource. - * - * @param {string} valuedResourceName - * A fully-qualified path representing ValuedResource resource. - * @returns {string} A string representing the simulation. - */ - matchSimulationFromValuedResourceName(valuedResourceName: string) { - return this.pathTemplates.valuedResourcePathTemplate.match(valuedResourceName).simulation; - } - - /** - * Parse the valued_resource from ValuedResource resource. - * - * @param {string} valuedResourceName - * A fully-qualified path representing ValuedResource resource. - * @returns {string} A string representing the valued_resource. - */ - matchValuedResourceFromValuedResourceName(valuedResourceName: string) { - return this.pathTemplates.valuedResourcePathTemplate.match(valuedResourceName).valued_resource; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.securityCenterStub && !this._terminated) { - return this.securityCenterStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client_config.json b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client_config.json deleted file mode 100644 index 84de80f3eba..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ /dev/null @@ -1,309 +0,0 @@ -{ - "interfaces": { - "google.cloud.securitycenter.v1.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": { - "BulkMuteFindings": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSecurityHealthAnalyticsCustomModule": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "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" - }, - "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", - "retry_params_name": "default" - }, - "DeleteSecurityHealthAnalyticsCustomModule": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSimulation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetValuedResource": { - "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", - "retry_params_name": "default" - }, - "GetMuteConfig": { - "retry_codes_name": "non_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", - "retry_params_name": "default" - }, - "GetEffectiveSecurityHealthAnalyticsCustomModule": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetSecurityHealthAnalyticsCustomModule": { - "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": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GroupFindings": { - "timeout_millis": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListAssets": { - "timeout_millis": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListDescendantSecurityHealthAnalyticsCustomModules": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListFindings": { - "timeout_millis": 480000, - "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", - "retry_params_name": "default" - }, - "ListEffectiveSecurityHealthAnalyticsCustomModules": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListSecurityHealthAnalyticsCustomModules": { - "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" - }, - "SetMute": { - "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" - }, - "SimulateSecurityHealthAnalyticsCustomModule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateExternalSystem": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateFinding": { - "timeout_millis": 60000, - "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", - "retry_params_name": "default" - }, - "UpdateOrganizationSettings": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateSecurityHealthAnalyticsCustomModule": { - "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": 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" - }, - "CreateEventThreatDetectionCustomModule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteEventThreatDetectionCustomModule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEventThreatDetectionCustomModule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDescendantEventThreatDetectionCustomModules": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEventThreatDetectionCustomModules": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateEventThreatDetectionCustomModule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ValidateEventThreatDetectionCustomModule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEffectiveEventThreatDetectionCustomModule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEffectiveEventThreatDetectionCustomModules": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateResourceValueConfigs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteResourceValueConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetResourceValueConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListResourceValueConfigs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateResourceValueConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListValuedResources": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListAttackPaths": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_proto_list.json deleted file mode 100644 index 4a842ba0b8b..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ /dev/null @@ -1,57 +0,0 @@ -[ - "../../protos/google/cloud/securitycenter/v1/access.proto", - "../../protos/google/cloud/securitycenter/v1/application.proto", - "../../protos/google/cloud/securitycenter/v1/asset.proto", - "../../protos/google/cloud/securitycenter/v1/attack_exposure.proto", - "../../protos/google/cloud/securitycenter/v1/attack_path.proto", - "../../protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto", - "../../protos/google/cloud/securitycenter/v1/bigquery_export.proto", - "../../protos/google/cloud/securitycenter/v1/chokepoint.proto", - "../../protos/google/cloud/securitycenter/v1/cloud_armor.proto", - "../../protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto", - "../../protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.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/container.proto", - "../../protos/google/cloud/securitycenter/v1/database.proto", - "../../protos/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto", - "../../protos/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto", - "../../protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto", - "../../protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto", - "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", - "../../protos/google/cloud/securitycenter/v1/external_exposure.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/group_membership.proto", - "../../protos/google/cloud/securitycenter/v1/iam_binding.proto", - "../../protos/google/cloud/securitycenter/v1/indicator.proto", - "../../protos/google/cloud/securitycenter/v1/kernel_rootkit.proto", - "../../protos/google/cloud/securitycenter/v1/kubernetes.proto", - "../../protos/google/cloud/securitycenter/v1/label.proto", - "../../protos/google/cloud/securitycenter/v1/load_balancer.proto", - "../../protos/google/cloud/securitycenter/v1/log_entry.proto", - "../../protos/google/cloud/securitycenter/v1/mitre_attack.proto", - "../../protos/google/cloud/securitycenter/v1/mute_config.proto", - "../../protos/google/cloud/securitycenter/v1/notebook.proto", - "../../protos/google/cloud/securitycenter/v1/notification_config.proto", - "../../protos/google/cloud/securitycenter/v1/notification_message.proto", - "../../protos/google/cloud/securitycenter/v1/org_policy.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/resource_value_config.proto", - "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", - "../../protos/google/cloud/securitycenter/v1/security_health_analytics_custom_config.proto", - "../../protos/google/cloud/securitycenter/v1/security_health_analytics_custom_module.proto", - "../../protos/google/cloud/securitycenter/v1/security_marks.proto", - "../../protos/google/cloud/securitycenter/v1/security_posture.proto", - "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", - "../../protos/google/cloud/securitycenter/v1/simulation.proto", - "../../protos/google/cloud/securitycenter/v1/source.proto", - "../../protos/google/cloud/securitycenter/v1/toxic_combination.proto", - "../../protos/google/cloud/securitycenter/v1/valued_resource.proto", - "../../protos/google/cloud/securitycenter/v1/vulnerability.proto" -] diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json deleted file mode 100644 index 02da4303dc4..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/index.ts deleted file mode 100644 index 750912594f5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {SecurityCenterClient} from './security_center_client'; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client.ts deleted file mode 100644 index 7b564ee1062..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ /dev/null @@ -1,3681 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * 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'; -const version = require('../../../package.json').version; - -/** - * V1 Beta APIs for Security Center service. - * @class - * @memberof v1beta1 - */ -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: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('security-center'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - securityCenterStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of 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/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * 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: true}, 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; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'securitycenter.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - assetPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}' - ), - findingPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' - ), - organizationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}' - ), - 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' - ), - sourcePathTemplate: new this._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 this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), - groupFindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), - listAssets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listAssetsResults'), - listFindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'findings'), - listSources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sources') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { - 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(lroOptions).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 this._gaxModule.LongrunningDescriptor( - this.operationsClient, - runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), - runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.securityCenterStub) { - return this.securityCenterStub; - } - - // Put together the "service stub" for - // google.cloud.securitycenter.v1beta1.SecurityCenter. - this.securityCenterStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.securitycenter.v1beta1.SecurityCenter') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.securitycenter.v1beta1.SecurityCenter, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const 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 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); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.securityCenterStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|undefined, {}|undefined - ]>; - createSource( - request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|null|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; - createSource( - request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('createSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|undefined, {}|undefined - ]>; - createFinding( - request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|null|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; - createFinding( - request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createFinding request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createFinding response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createFinding(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest|undefined, - {}|undefined - ]) => { - this._log.info('createFinding response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - 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; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.OrganizationSettings|OrganizationSettings}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|undefined, {}|undefined - ]>; - getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|null|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; - getOrganizationSettings( - request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getOrganizationSettings request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getOrganizationSettings response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getOrganizationSettings(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest|undefined, - {}|undefined - ]) => { - this._log.info('getOrganizationSettings response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|undefined, {}|undefined - ]>; - getSource( - request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|null|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; - getSource( - request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|undefined, {}|undefined - ]>; - setFindingState( - request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|null|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; - setFindingState( - request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setFindingState request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setFindingState response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setFindingState(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest|undefined, - {}|undefined - ]) => { - this._log.info('setFindingState response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {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. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - 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; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - 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; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|undefined, {}|undefined - ]>; - updateFinding( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|null|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; - updateFinding( - request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'finding.name': request.finding!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateFinding request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateFinding response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateFinding(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.IFinding, - protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateFinding response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.OrganizationSettings|OrganizationSettings}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined - ]>; - updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|null|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; - updateOrganizationSettings( - request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateOrganizationSettings request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateOrganizationSettings response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateOrganizationSettings(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateOrganizationSettings response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|undefined, {}|undefined - ]>; - updateSource( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|null|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; - updateSource( - request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'source.name': request.source!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.ISource, - protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.SecurityMarks|SecurityMarks}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|undefined, {}|undefined - ]>; - updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|null|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; - updateSecurityMarks( - request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1beta1.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSecurityMarks request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSecurityMarks response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSecurityMarks(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSecurityMarks response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * 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): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, - options: CallOptions, - callback: Callback< - 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; - runAssetDiscovery( - request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('runAssetDiscovery response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('runAssetDiscovery request %j', request); - return this.innerApiCalls.runAssetDiscovery(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('runAssetDiscovery response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * 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. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/security_center.run_asset_discovery.js - * region_tag:securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async - */ - async checkRunAssetDiscoveryProgress(name: string): Promise>{ - this._log.info('runAssetDiscovery long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|GroupResult}. - * 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 `groupAssetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest|null, - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('groupAssets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('groupAssets request %j', request); - return this.innerApiCalls - .groupAssets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest|null, - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse - ]) => { - this._log.info('groupAssets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `groupAssets`, but returns a NodeJS Stream object. - * @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 {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - groupAssetsStream( - request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupAssets stream %j', request); - return this.descriptors.page.groupAssets.createStream( - this.innerApiCalls.groupAssets as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupAssets iterate %j', request); - return this.descriptors.page.groupAssets.asyncIterate( - this.innerApiCalls['groupAssets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|GroupResult}. - * 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 `groupFindingsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('groupFindings values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('groupFindings request %j', request); - return this.innerApiCalls - .groupFindings(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse - ]) => { - this._log.info('groupFindings values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `groupFindings`, but returns a NodeJS Stream object. - * @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 {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - groupFindingsStream( - request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupFindings stream %j', request); - return this.descriptors.page.groupFindings.createStream( - this.innerApiCalls.groupFindings as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupFindings iterate %j', request); - return this.descriptors.page.groupFindings.asyncIterate( - this.innerApiCalls['groupFindings'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult|ListAssetsResult}. - * 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 `listAssetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest|null, - protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAssets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAssets request %j', request); - return this.innerApiCalls - .listAssets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest|null, - protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse - ]) => { - this._log.info('listAssets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAssets`, but returns a NodeJS Stream object. - * @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 {@link protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAssetsStream( - request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAssets stream %j', request); - return this.descriptors.page.listAssets.createStream( - this.innerApiCalls.listAssets as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAssets iterate %j', request); - return this.descriptors.page.listAssets.asyncIterate( - this.innerApiCalls['listAssets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * 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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|Finding}. - * 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 `listFindingsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IFinding>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IFinding>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.IFinding[], - protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.IFinding>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listFindings values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listFindings request %j', request); - return this.innerApiCalls - .listFindings(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1beta1.IFinding[], - protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse - ]) => { - this._log.info('listFindings values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listFindings`, but returns a NodeJS Stream object. - * @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 {@link protos.google.cloud.securitycenter.v1beta1.Finding|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listFindingsStream( - request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listFindings stream %j', request); - return this.descriptors.page.listFindings.createStream( - this.innerApiCalls.listFindings as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1beta1.Finding|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listFindings iterate %j', request); - return this.descriptors.page.listFindings.asyncIterate( - this.innerApiCalls['listFindings'] as GaxCall, - request as {}, - 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 {@link protos.google.cloud.securitycenter.v1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSources( - request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISource[], - protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse - ]>; - listSources( - request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - options: CallOptions, - 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; - listSources( - request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.ISource>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.ISource>): - Promise<[ - protos.google.cloud.securitycenter.v1beta1.ISource[], - protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1beta1.ISource>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSources values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSources request %j', request); - return this.innerApiCalls - .listSources(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1beta1.ISource[], - protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse - ]) => { - this._log.info('listSources values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSources`, but returns a NodeJS Stream object. - * @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 {@link protos.google.cloud.securitycenter.v1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSourcesStream( - request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSources stream %j', request); - return this.descriptors.page.listSources.createStream( - this.innerApiCalls.listSources as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSources iterate %j', request); - return this.descriptors.page.listSources.asyncIterate( - this.innerApiCalls['listSources'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- 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. - * - * @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: organization, - source: source, - finding: 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: 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 organizationAssetSecurityMarks resource name string. - * - * @param {string} organization - * @param {string} asset - * @returns {string} Resource name string. - */ - organizationAssetSecurityMarksPath(organization:string,asset:string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render({ - organization: organization, - asset: asset, - }); - } - - /** - * Parse the organization from OrganizationAssetSecurityMarks resource. - * - * @param {string} organizationAssetSecurityMarksName - * A fully-qualified path representing organization_asset_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).organization; - } - - /** - * Parse the asset from OrganizationAssetSecurityMarks resource. - * - * @param {string} organizationAssetSecurityMarksName - * A fully-qualified path representing organization_asset_securityMarks resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).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: 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 organizationSourceFindingSecurityMarks resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceFindingSecurityMarksPath(organization:string,source:string,finding:string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); - } - - /** - * Parse the organization from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).organization; - } - - /** - * Parse the source from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).source; - } - - /** - * Parse the finding from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).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: organization, - source: 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. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.securityCenterStub && !this._terminated) { - return this.securityCenterStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json deleted file mode 100644 index a1a7e2d9386..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "interfaces": { - "google.cloud.securitycenter.v1beta1.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": 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": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GroupFindings": { - "timeout_millis": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListAssets": { - "timeout_millis": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListFindings": { - "timeout_millis": 480000, - "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": 480000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json b/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json deleted file mode 100644 index d10dce6c60d..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "../../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/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json deleted file mode 100644 index c0d8ccc6990..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/index.ts deleted file mode 100644 index 750912594f5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {SecurityCenterClient} from './security_center_client'; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts deleted file mode 100644 index 96fdf7781be..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ /dev/null @@ -1,5466 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * 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'; -const version = require('../../../package.json').version; - -/** - * V1p1Beta1 APIs for Security Center service. - * @class - * @memberof v1p1beta1 - */ -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: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('security-center'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - securityCenterStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of 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/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * 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: true}, 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; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'securitycenter.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - folderAssetPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/assets/{asset}' - ), - 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' - ), - 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' - ), - 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, - // (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 this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), - groupFindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), - listAssets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listAssetsResults'), - listFindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listFindingsResults'), - listNotificationConfigs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'notificationConfigs'), - listSources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sources') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { - 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(lroOptions).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 this._gaxModule.LongrunningDescriptor( - this.operationsClient, - runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), - runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.securityCenterStub) { - return this.securityCenterStub; - } - - // Put together the "service stub" for - // google.cloud.securitycenter.v1p1beta1.SecurityCenter. - this.securityCenterStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.securitycenter.v1p1beta1.SecurityCenter') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.securitycenter.v1p1beta1.SecurityCenter, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const 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 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); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.securityCenterStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|undefined, {}|undefined - ]>; - createSource( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|null|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; - createSource( - request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('createSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|undefined, {}|undefined - ]>; - createFinding( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|null|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; - createFinding( - request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createFinding request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createFinding response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createFinding(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest|undefined, - {}|undefined - ]) => { - this._log.info('createFinding response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|undefined, {}|undefined - ]>; - createNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|null|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; - createNotificationConfig( - request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('createNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|undefined, {}|undefined - ]>; - deleteNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|null|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; - deleteNotificationConfig( - request?: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - 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; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|undefined, {}|undefined - ]>; - getNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|null|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; - getNotificationConfig( - request?: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('getNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings|OrganizationSettings}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|undefined, {}|undefined - ]>; - getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|null|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; - getOrganizationSettings( - request?: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getOrganizationSettings request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getOrganizationSettings response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getOrganizationSettings(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest|undefined, - {}|undefined - ]) => { - this._log.info('getOrganizationSettings response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|undefined, {}|undefined - ]>; - getSource( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|null|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; - getSource( - request?: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|undefined, {}|undefined - ]>; - setFindingState( - request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|null|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; - setFindingState( - request?: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setFindingState request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setFindingState response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setFindingState(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest|undefined, - {}|undefined - ]) => { - this._log.info('setFindingState response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {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. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - 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; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - 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; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|undefined, {}|undefined - ]>; - updateFinding( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|null|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; - updateFinding( - request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'finding.name': request.finding!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateFinding request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateFinding response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateFinding(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.IFinding, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateFinding response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|undefined, {}|undefined - ]>; - updateNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|null|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; - updateNotificationConfig( - request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'notification_config.name': request.notificationConfig!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings|OrganizationSettings}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined - ]>; - updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, - options: CallOptions, - 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, - 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|Callback< - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateOrganizationSettings request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateOrganizationSettings response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateOrganizationSettings(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateOrganizationSettings response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|undefined, {}|undefined - ]>; - updateSource( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|null|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; - updateSource( - request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'source.name': request.source!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.ISource, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks|SecurityMarks}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|undefined, {}|undefined - ]>; - updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|null|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; - updateSecurityMarks( - request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1p1beta1.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSecurityMarks request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSecurityMarks response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSecurityMarks(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSecurityMarks response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * 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): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runAssetDiscovery( - request?: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('runAssetDiscovery response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('runAssetDiscovery request %j', request); - return this.innerApiCalls.runAssetDiscovery(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('runAssetDiscovery response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * 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. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1p1beta1/security_center.run_asset_discovery.js - * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async - */ - async checkRunAssetDiscoveryProgress(name: string): Promise>{ - this._log.info('runAssetDiscovery long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * 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], 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 - * 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 : ""` - * @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.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 {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|GroupResult}. - * 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 `groupAssetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('groupAssets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('groupAssets request %j', request); - return this.innerApiCalls - .groupAssets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse - ]) => { - this._log.info('groupAssets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `groupAssets`, but returns a NodeJS Stream object. - * @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], 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 - * 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 : ""` - * @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.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 {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - groupAssetsStream( - request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupAssets stream %j', request); - return this.descriptors.page.groupAssets.createStream( - this.innerApiCalls.groupAssets as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * Required. Name of the organization to groupBy. Its format is - * "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 - * 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 : ""` - * @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.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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupAssets iterate %j', request); - return this.descriptors.page.groupAssets.asyncIterate( - this.innerApiCalls['groupAssets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * 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 - * - * @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]", - * 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 - * 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 : ""` - * @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 - * * severity - * - * 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 {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|GroupResult}. - * 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 `groupFindingsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('groupFindings values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('groupFindings request %j', request); - return this.innerApiCalls - .groupFindings(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse - ]) => { - this._log.info('groupFindings values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `groupFindings`, but returns a NodeJS Stream object. - * @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]", - * 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 - * 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 : ""` - * @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 - * * severity - * - * 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 {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - groupFindingsStream( - request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupFindings stream %j', request); - return this.descriptors.page.groupFindings.createStream( - this.innerApiCalls.groupFindings as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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/- - * @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: `=`, `>`, `<`, `>=`, `<=` - * * 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 : ""` - * @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 - * * severity - * - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1p1beta1.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupFindings iterate %j', request); - return this.descriptors.page.groupFindings.asyncIterate( - this.innerApiCalls['groupFindings'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * 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], 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 - * 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 : ""` - * @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 - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult|ListAssetsResult}. - * 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 `listAssetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAssets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAssets request %j', request); - return this.innerApiCalls - .listAssets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse - ]) => { - this._log.info('listAssets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAssets`, but returns a NodeJS Stream object. - * @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], 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 - * 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 : ""` - * @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 - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAssetsStream( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAssets stream %j', request); - return this.descriptors.page.listAssets.createStream( - this.innerApiCalls.listAssets as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * Required. Name of the organization assets should belong to. Its format is - * "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 - * 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 : ""` - * @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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAssets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAssets iterate %j', request); - return this.descriptors.page.listAssets.asyncIterate( - this.innerApiCalls['listAssets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * 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], - * 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 - * 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 : ""` - * @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 - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult|ListFindingsResult}. - * 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 `listFindingsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * 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?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listFindings values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listFindings request %j', request); - return this.innerApiCalls - .listFindings(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse - ]) => { - this._log.info('listFindings values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listFindings`, but returns a NodeJS Stream object. - * @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], - * 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 - * 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 : ""` - * @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 - * 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 {@link protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listFindingsStream( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listFindings stream %j', request); - return this.descriptors.page.listFindings.createStream( - this.innerApiCalls.listFindings as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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/- - * @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: `=`, `>`, `<`, `>=`, `<=` - * * 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 : ""` - * @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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listFindings iterate %j', request); - return this.descriptors.page.listFindings.asyncIterate( - this.innerApiCalls['listFindings'] as GaxCall, - request as {}, - 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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listNotificationConfigs( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse - ]>; - listNotificationConfigs( - request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - options: CallOptions, - 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; - listNotificationConfigs( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listNotificationConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listNotificationConfigs request %j', request); - return this.innerApiCalls - .listNotificationConfigs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse - ]) => { - this._log.info('listNotificationConfigs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listNotificationConfigs`, but returns a NodeJS Stream object. - * @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 {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listNotificationConfigsStream( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listNotificationConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listNotificationConfigs stream %j', request); - return this.descriptors.page.listNotificationConfigs.createStream( - this.innerApiCalls.listNotificationConfigs as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listNotificationConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listNotificationConfigs iterate %j', request); - return this.descriptors.page.listNotificationConfigs.asyncIterate( - this.innerApiCalls['listNotificationConfigs'] as GaxCall, - request as {}, - 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 {@link protos.google.cloud.securitycenter.v1p1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSources( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISource[], - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse - ]>; - listSources( - request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - options: CallOptions, - 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; - listSources( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ISource>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ISource>): - Promise<[ - protos.google.cloud.securitycenter.v1p1beta1.ISource[], - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v1p1beta1.ISource>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSources values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSources request %j', request); - return this.innerApiCalls - .listSources(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v1p1beta1.ISource[], - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse - ]) => { - this._log.info('listSources values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSources`, but returns a NodeJS Stream object. - * @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 {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v1p1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSourcesStream( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSources stream %j', request); - return this.descriptors.page.listSources.createStream( - this.innerApiCalls.listSources as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v1p1beta1.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @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, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSources iterate %j', request); - return this.descriptors.page.listSources.asyncIterate( - this.innerApiCalls['listSources'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified folderAsset resource name string. - * - * @param {string} folder - * @param {string} asset - * @returns {string} Resource name string. - */ - folderAssetPath(folder:string,asset:string) { - return this.pathTemplates.folderAssetPathTemplate.render({ - folder: folder, - asset: asset, - }); - } - - /** - * Parse the folder from FolderAsset resource. - * - * @param {string} folderAssetName - * A fully-qualified path representing folder_asset resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderAssetName(folderAssetName: string) { - return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName).folder; - } - - /** - * Parse the asset from FolderAsset resource. - * - * @param {string} folderAssetName - * A fully-qualified path representing folder_asset resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromFolderAssetName(folderAssetName: string) { - return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName).asset; - } - - /** - * Return a fully-qualified folderAssetSecurityMarks resource name string. - * - * @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. - */ - folderSourceFindingPath(folder:string,source:string,finding:string) { - return this.pathTemplates.folderSourceFindingPathTemplate.render({ - folder: folder, - source: source, - finding: finding, - }); - } - - /** - * Parse the folder from FolderSourceFinding resource. - * - * @param {string} folderSourceFindingName - * A fully-qualified path representing folder_source_finding resource. - * @returns {string} A string representing the folder. - */ - 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; - } - - /** - * 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; - } - - /** - * 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. - * - * @param {string} organization - * @returns {string} Resource name string. - */ - organizationPath(organization:string) { - return this.pathTemplates.organizationPathTemplate.render({ - organization: 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: 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. - * - * @param {string} organization - * @param {string} asset - * @returns {string} Resource name string. - */ - organizationAssetSecurityMarksPath(organization:string,asset:string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render({ - organization: organization, - asset: asset, - }); - } - - /** - * Parse the organization from OrganizationAssetSecurityMarks resource. - * - * @param {string} organizationAssetSecurityMarksName - * A fully-qualified path representing organization_asset_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).organization; - } - - /** - * Parse the asset from OrganizationAssetSecurityMarks resource. - * - * @param {string} organizationAssetSecurityMarksName - * A fully-qualified path representing organization_asset_securityMarks resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).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: 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 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. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceFindingSecurityMarksPath(organization:string,source:string,finding:string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); - } - - /** - * Parse the organization from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).organization; - } - - /** - * Parse the source from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).source; - } - - /** - * Parse the finding from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).finding; - } - - /** - * Return a fully-qualified projectAsset resource name string. - * - * @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. - */ - projectSourcePath(project:string,source:string) { - return this.pathTemplates.projectSourcePathTemplate.render({ - project: project, - source: source, - }); - } - - /** - * Parse the project from ProjectSource resource. - * - * @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. - */ - 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 ProjectSourceFindingSecurityMarks resource. - * - * @param {string} projectSourceFindingSecurityMarksName - * A fully-qualified path representing project_source_finding_securityMarks resource. - * @returns {string} A string representing the 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; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.securityCenterStub && !this._terminated) { - return this.securityCenterStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json deleted file mode 100644 index b8821e07010..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "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": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateFinding": { - "timeout_millis": 60000, - "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", - "retry_params_name": "default" - }, - "GetSource": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GroupAssets": { - "timeout_millis": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GroupFindings": { - "timeout_millis": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListAssets": { - "timeout_millis": 480000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListFindings": { - "timeout_millis": 480000, - "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", - "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" - }, - "UpdateNotificationConfig": { - "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": 480000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json b/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json deleted file mode 100644 index dcb821bf6e0..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - "../../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", - "../../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" -] diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/gapic_metadata.json b/owl-bot-staging/google-cloud-securitycenter/src/v2/gapic_metadata.json deleted file mode 100644 index 60fd987d039..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v2/gapic_metadata.json +++ /dev/null @@ -1,459 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.securitycenter.v2", - "libraryPackage": "@google-cloud/securitycenter", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "SecurityCenterClient", - "rpcs": { - "BatchCreateResourceValueConfigs": { - "methods": [ - "batchCreateResourceValueConfigs" - ] - }, - "CreateBigQueryExport": { - "methods": [ - "createBigQueryExport" - ] - }, - "CreateFinding": { - "methods": [ - "createFinding" - ] - }, - "CreateMuteConfig": { - "methods": [ - "createMuteConfig" - ] - }, - "CreateNotificationConfig": { - "methods": [ - "createNotificationConfig" - ] - }, - "CreateSource": { - "methods": [ - "createSource" - ] - }, - "DeleteBigQueryExport": { - "methods": [ - "deleteBigQueryExport" - ] - }, - "DeleteMuteConfig": { - "methods": [ - "deleteMuteConfig" - ] - }, - "DeleteNotificationConfig": { - "methods": [ - "deleteNotificationConfig" - ] - }, - "DeleteResourceValueConfig": { - "methods": [ - "deleteResourceValueConfig" - ] - }, - "GetBigQueryExport": { - "methods": [ - "getBigQueryExport" - ] - }, - "GetSimulation": { - "methods": [ - "getSimulation" - ] - }, - "GetValuedResource": { - "methods": [ - "getValuedResource" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetMuteConfig": { - "methods": [ - "getMuteConfig" - ] - }, - "GetNotificationConfig": { - "methods": [ - "getNotificationConfig" - ] - }, - "GetResourceValueConfig": { - "methods": [ - "getResourceValueConfig" - ] - }, - "GetSource": { - "methods": [ - "getSource" - ] - }, - "SetFindingState": { - "methods": [ - "setFindingState" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "SetMute": { - "methods": [ - "setMute" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateBigQueryExport": { - "methods": [ - "updateBigQueryExport" - ] - }, - "UpdateExternalSystem": { - "methods": [ - "updateExternalSystem" - ] - }, - "UpdateFinding": { - "methods": [ - "updateFinding" - ] - }, - "UpdateMuteConfig": { - "methods": [ - "updateMuteConfig" - ] - }, - "UpdateNotificationConfig": { - "methods": [ - "updateNotificationConfig" - ] - }, - "UpdateResourceValueConfig": { - "methods": [ - "updateResourceValueConfig" - ] - }, - "UpdateSecurityMarks": { - "methods": [ - "updateSecurityMarks" - ] - }, - "UpdateSource": { - "methods": [ - "updateSource" - ] - }, - "BulkMuteFindings": { - "methods": [ - "bulkMuteFindings" - ] - }, - "GroupFindings": { - "methods": [ - "groupFindings", - "groupFindingsStream", - "groupFindingsAsync" - ] - }, - "ListAttackPaths": { - "methods": [ - "listAttackPaths", - "listAttackPathsStream", - "listAttackPathsAsync" - ] - }, - "ListBigQueryExports": { - "methods": [ - "listBigQueryExports", - "listBigQueryExportsStream", - "listBigQueryExportsAsync" - ] - }, - "ListFindings": { - "methods": [ - "listFindings", - "listFindingsStream", - "listFindingsAsync" - ] - }, - "ListMuteConfigs": { - "methods": [ - "listMuteConfigs", - "listMuteConfigsStream", - "listMuteConfigsAsync" - ] - }, - "ListNotificationConfigs": { - "methods": [ - "listNotificationConfigs", - "listNotificationConfigsStream", - "listNotificationConfigsAsync" - ] - }, - "ListResourceValueConfigs": { - "methods": [ - "listResourceValueConfigs", - "listResourceValueConfigsStream", - "listResourceValueConfigsAsync" - ] - }, - "ListSources": { - "methods": [ - "listSources", - "listSourcesStream", - "listSourcesAsync" - ] - }, - "ListValuedResources": { - "methods": [ - "listValuedResources", - "listValuedResourcesStream", - "listValuedResourcesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SecurityCenterClient", - "rpcs": { - "BatchCreateResourceValueConfigs": { - "methods": [ - "batchCreateResourceValueConfigs" - ] - }, - "CreateBigQueryExport": { - "methods": [ - "createBigQueryExport" - ] - }, - "CreateFinding": { - "methods": [ - "createFinding" - ] - }, - "CreateMuteConfig": { - "methods": [ - "createMuteConfig" - ] - }, - "CreateNotificationConfig": { - "methods": [ - "createNotificationConfig" - ] - }, - "CreateSource": { - "methods": [ - "createSource" - ] - }, - "DeleteBigQueryExport": { - "methods": [ - "deleteBigQueryExport" - ] - }, - "DeleteMuteConfig": { - "methods": [ - "deleteMuteConfig" - ] - }, - "DeleteNotificationConfig": { - "methods": [ - "deleteNotificationConfig" - ] - }, - "DeleteResourceValueConfig": { - "methods": [ - "deleteResourceValueConfig" - ] - }, - "GetBigQueryExport": { - "methods": [ - "getBigQueryExport" - ] - }, - "GetSimulation": { - "methods": [ - "getSimulation" - ] - }, - "GetValuedResource": { - "methods": [ - "getValuedResource" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetMuteConfig": { - "methods": [ - "getMuteConfig" - ] - }, - "GetNotificationConfig": { - "methods": [ - "getNotificationConfig" - ] - }, - "GetResourceValueConfig": { - "methods": [ - "getResourceValueConfig" - ] - }, - "GetSource": { - "methods": [ - "getSource" - ] - }, - "SetFindingState": { - "methods": [ - "setFindingState" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "SetMute": { - "methods": [ - "setMute" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateBigQueryExport": { - "methods": [ - "updateBigQueryExport" - ] - }, - "UpdateExternalSystem": { - "methods": [ - "updateExternalSystem" - ] - }, - "UpdateFinding": { - "methods": [ - "updateFinding" - ] - }, - "UpdateMuteConfig": { - "methods": [ - "updateMuteConfig" - ] - }, - "UpdateNotificationConfig": { - "methods": [ - "updateNotificationConfig" - ] - }, - "UpdateResourceValueConfig": { - "methods": [ - "updateResourceValueConfig" - ] - }, - "UpdateSecurityMarks": { - "methods": [ - "updateSecurityMarks" - ] - }, - "UpdateSource": { - "methods": [ - "updateSource" - ] - }, - "BulkMuteFindings": { - "methods": [ - "bulkMuteFindings" - ] - }, - "GroupFindings": { - "methods": [ - "groupFindings", - "groupFindingsStream", - "groupFindingsAsync" - ] - }, - "ListAttackPaths": { - "methods": [ - "listAttackPaths", - "listAttackPathsStream", - "listAttackPathsAsync" - ] - }, - "ListBigQueryExports": { - "methods": [ - "listBigQueryExports", - "listBigQueryExportsStream", - "listBigQueryExportsAsync" - ] - }, - "ListFindings": { - "methods": [ - "listFindings", - "listFindingsStream", - "listFindingsAsync" - ] - }, - "ListMuteConfigs": { - "methods": [ - "listMuteConfigs", - "listMuteConfigsStream", - "listMuteConfigsAsync" - ] - }, - "ListNotificationConfigs": { - "methods": [ - "listNotificationConfigs", - "listNotificationConfigsStream", - "listNotificationConfigsAsync" - ] - }, - "ListResourceValueConfigs": { - "methods": [ - "listResourceValueConfigs", - "listResourceValueConfigsStream", - "listResourceValueConfigsAsync" - ] - }, - "ListSources": { - "methods": [ - "listSources", - "listSourcesStream", - "listSourcesAsync" - ] - }, - "ListValuedResources": { - "methods": [ - "listValuedResources", - "listValuedResourcesStream", - "listValuedResourcesAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/index.ts b/owl-bot-staging/google-cloud-securitycenter/src/v2/index.ts deleted file mode 100644 index 750912594f5..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v2/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {SecurityCenterClient} from './security_center_client'; diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client.ts b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client.ts deleted file mode 100644 index a0f1faca157..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client.ts +++ /dev/null @@ -1,9119 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/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'; -const version = require('../../../package.json').version; - -/** - * V2 APIs for Security Center service. - * @class - * @memberof v2 - */ -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: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('securitycenter'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - securityCenterStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of 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/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * 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: true}, 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; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'securitycenter.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/assets/{asset}/securityMarks' - ), - folderConstraintNamePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/policies/{constraint_name}' - ), - folderLocationBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/locations/{location}/bigQueryExports/{export}' - ), - folderLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/locations/{location}/muteConfigs/{mute_config}' - ), - folderLocationNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/locations/{location}/notificationConfigs/{notification_config}' - ), - folderMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/muteConfigs/{mute_config}' - ), - folderSourcePathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}' - ), - 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' - ), - folderSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}/findings/{finding}' - ), - folderSourceLocationFindingExternalsystemPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}' - ), - folderSourceLocationFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks' - ), - folderSourceLocationFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'folders/{folder}/sources/{source}/locations/{location}/findings/{finding}' - ), - organizationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}' - ), - organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), - organizationConstraintNamePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/policies/{constraint_name}' - ), - organizationLocationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}' - ), - organizationLocationBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/bigQueryExports/{export}' - ), - organizationLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/muteConfigs/{mute_config}' - ), - organizationLocationNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/notificationConfigs/{notification_config}' - ), - organizationLocationResourceValueConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}' - ), - organizationLocationSimluationValuedResourcesPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}' - ), - organizationLocationSimulationValuedResourceAttackPathsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}' - ), - organizationLocationSimulationsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}/simulations/{simluation}' - ), - organizationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/muteConfigs/{mute_config}' - ), - organizationResourceValueConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/resourceValueConfigs/{resource_value_config}' - ), - organizationSimulationValuedResourceAttackPathsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}' - ), - organizationSimulationValuedResourcesPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}' - ), - organizationSimulationsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/simulations/{simulation}' - ), - organizationSourcePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' - ), - 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' - ), - organizationSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' - ), - organizationSourceLocationFindingExternalsystemPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}' - ), - organizationSourceLocationFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks' - ), - organizationSourceLocationFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}' - ), - projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/assets/{asset}/securityMarks' - ), - projectConstraintNamePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/policies/{constraint_name}' - ), - projectLocationBigQueryExportsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/bigQueryExports/{export}' - ), - projectLocationMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/muteConfigs/{mute_config}' - ), - projectLocationNotificationConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/notificationConfigs/{notification_config}' - ), - projectMuteConfigsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/muteConfigs/{mute_config}' - ), - projectSourcePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}' - ), - 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' - ), - projectSourceFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}/findings/{finding}' - ), - projectSourceLocationFindingExternalsystemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}' - ), - projectSourceLocationFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks' - ), - projectSourceLocationFindingsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/sources/{source}/locations/{location}/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 = { - groupFindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'groupByResults'), - listAttackPaths: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attackPaths'), - listBigQueryExports: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'bigQueryExports'), - listFindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'listFindingsResults'), - listMuteConfigs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'muteConfigs'), - listNotificationConfigs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'notificationConfigs'), - listResourceValueConfigs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceValueConfigs'), - listSources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sources'), - listValuedResources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'valuedResources') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(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) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v2/{name=organizations/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=organizations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=organizations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=organizations/*/operations}',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const bulkMuteFindingsResponse = protoFilesRoot.lookup( - '.google.cloud.securitycenter.v2.BulkMuteFindingsResponse') as gax.protobuf.Type; - const bulkMuteFindingsMetadata = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - - this.descriptors.longrunning = { - bulkMuteFindings: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - bulkMuteFindingsResponse.decode.bind(bulkMuteFindingsResponse), - bulkMuteFindingsMetadata.decode.bind(bulkMuteFindingsMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.securitycenter.v2.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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.securityCenterStub) { - return this.securityCenterStub; - } - - // Put together the "service stub" for - // google.cloud.securitycenter.v2.SecurityCenter. - this.securityCenterStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.securitycenter.v2.SecurityCenter') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.securitycenter.v2.SecurityCenter, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const securityCenterStubMethods = - ['batchCreateResourceValueConfigs', 'bulkMuteFindings', 'createBigQueryExport', 'createFinding', 'createMuteConfig', 'createNotificationConfig', 'createSource', 'deleteBigQueryExport', 'deleteMuteConfig', 'deleteNotificationConfig', 'deleteResourceValueConfig', 'getBigQueryExport', 'getSimulation', 'getValuedResource', 'getIamPolicy', 'getMuteConfig', 'getNotificationConfig', 'getResourceValueConfig', 'getSource', 'groupFindings', 'listAttackPaths', 'listBigQueryExports', 'listFindings', 'listMuteConfigs', 'listNotificationConfigs', 'listResourceValueConfigs', 'listSources', 'listValuedResources', 'setFindingState', 'setIamPolicy', 'setMute', 'testIamPermissions', 'updateBigQueryExport', 'updateExternalSystem', 'updateFinding', 'updateMuteConfig', 'updateNotificationConfig', 'updateResourceValueConfig', 'updateSecurityMarks', 'updateSource']; - 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); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.securityCenterStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a ResourceValueConfig for an organization. Maps user's tags to - * difference resource values for use by the attack path simulation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new ResourceValueConfig's parent. - * The parent field in the CreateResourceValueConfigRequest - * messages must either be empty or match this field. - * @param {number[]} request.requests - * Required. The resource value configs to be created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse|BatchCreateResourceValueConfigsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.batch_create_resource_value_configs.js - * region_tag:securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_async - */ - batchCreateResourceValueConfigs( - request?: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|undefined, {}|undefined - ]>; - batchCreateResourceValueConfigs( - request: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateResourceValueConfigs( - request: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateResourceValueConfigs( - request?: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('batchCreateResourceValueConfigs request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('batchCreateResourceValueConfigs response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.batchCreateResourceValueConfigs(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse, - protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsRequest|undefined, - {}|undefined - ]) => { - this._log.info('batchCreateResourceValueConfigs response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a BigQuery export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource of the new BigQuery export. Its - * format is `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_id]`. - * @param {google.cloud.securitycenter.v2.BigQueryExport} request.bigQueryExport - * Required. The BigQuery export being created. - * @param {string} request.bigQueryExportId - * Required. Unique identifier provided by the client within the parent scope. - * It must consist of only lowercase letters, numbers, and hyphens, must start - * with a letter, must end with either a letter or a number, and must be 63 - * characters or less. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.BigQueryExport|BigQueryExport}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.create_big_query_export.js - * region_tag:securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_async - */ - createBigQueryExport( - request?: protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|undefined, {}|undefined - ]>; - createBigQueryExport( - request: protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - createBigQueryExport( - request: protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - createBigQueryExport( - request?: protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createBigQueryExport request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createBigQueryExport response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createBigQueryExport(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.ICreateBigQueryExportRequest|undefined, - {}|undefined - ]) => { - this._log.info('createBigQueryExport response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a finding in a location. 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. The following list - * shows some examples of the format: - * + - * `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_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.v2.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 {@link protos.google.cloud.securitycenter.v2.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.create_finding.js - * region_tag:securitycenter_v2_generated_SecurityCenter_CreateFinding_async - */ - createFinding( - request?: protos.google.cloud.securitycenter.v2.ICreateFindingRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ICreateFindingRequest|undefined, {}|undefined - ]>; - createFinding( - request: protos.google.cloud.securitycenter.v2.ICreateFindingRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, - {}|null|undefined>): void; - createFinding( - request: protos.google.cloud.securitycenter.v2.ICreateFindingRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, - {}|null|undefined>): void; - createFinding( - request?: protos.google.cloud.securitycenter.v2.ICreateFindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ICreateFindingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createFinding request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ICreateFindingRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createFinding response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createFinding(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ICreateFindingRequest|undefined, - {}|undefined - ]) => { - this._log.info('createFinding response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_id]`. - * @param {google.cloud.securitycenter.v2.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 only lowercase letters, numbers, and hyphens, must start - * with a letter, must end with either a letter or a number, and must be 63 - * characters or less. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.MuteConfig|MuteConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.create_mute_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_CreateMuteConfig_async - */ - createMuteConfig( - request?: protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|undefined, {}|undefined - ]>; - createMuteConfig( - request: protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, - {}|null|undefined>): void; - createMuteConfig( - request: protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, - {}|null|undefined>): void; - createMuteConfig( - request?: protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('createMuteConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createMuteConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createMuteConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.ICreateMuteConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('createMuteConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_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 contain alphanumeric - * characters, underscores, or hyphens only. - * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.create_notification_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_async - */ - createNotificationConfig( - request?: protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|undefined, {}|undefined - ]>; - createNotificationConfig( - request: protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>): void; - createNotificationConfig( - request: protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>): void; - createNotificationConfig( - request?: protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.ICreateNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('createNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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.v2.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 {@link protos.google.cloud.securitycenter.v2.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.create_source.js - * region_tag:securitycenter_v2_generated_SecurityCenter_CreateSource_async - */ - createSource( - request?: protos.google.cloud.securitycenter.v2.ICreateSourceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.ICreateSourceRequest|undefined, {}|undefined - ]>; - createSource( - request: protos.google.cloud.securitycenter.v2.ICreateSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, - {}|null|undefined>): void; - createSource( - request: protos.google.cloud.securitycenter.v2.ICreateSourceRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, - {}|null|undefined>): void; - createSource( - request?: protos.google.cloud.securitycenter.v2.ICreateSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.ICreateSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.ICreateSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.ICreateSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('createSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes an existing BigQuery export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BigQuery export to delete. The following list - * shows some examples of the format: - * - * + - * `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - * + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - * + `projects/{project}/locations/{location}/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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.delete_big_query_export.js - * region_tag:securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_async - */ - deleteBigQueryExport( - request?: protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|undefined, {}|undefined - ]>; - deleteBigQueryExport( - request: protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - deleteBigQueryExport( - request: protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - deleteBigQueryExport( - request?: protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteBigQueryExport request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteBigQueryExport response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteBigQueryExport(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteBigQueryExportRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteBigQueryExport response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes an existing mute config. If no location is specified, default is - * global. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the mute config to delete. The following list shows some - * examples of the format: - * - * + `organizations/{organization}/muteConfigs/{config_id}` - * + - * `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - * + `folders/{folder}/muteConfigs/{config_id}` - * + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - * + `projects/{project}/muteConfigs/{config_id}` - * + `projects/{project}/locations/{location}/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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.delete_mute_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_async - */ - deleteMuteConfig( - request?: protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|undefined, {}|undefined - ]>; - deleteMuteConfig( - request: protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteMuteConfig( - request: protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteMuteConfig( - request?: protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('deleteMuteConfig request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteMuteConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteMuteConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteMuteConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteMuteConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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. The following list - * shows some examples of the format: - * - * + - * `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - * + - * `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` - * + - * `projects/[project_id]/locations/[location_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 {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.delete_notification_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_async - */ - deleteNotificationConfig( - request?: protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|undefined, {}|undefined - ]>; - deleteNotificationConfig( - request: protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteNotificationConfig( - request: protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteNotificationConfig( - request?: protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a ResourceValueConfig. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the ResourceValueConfig to delete - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.delete_resource_value_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_async - */ - deleteResourceValueConfig( - request?: protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|undefined, {}|undefined - ]>; - deleteResourceValueConfig( - request: protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteResourceValueConfig( - request: protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteResourceValueConfig( - request?: protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteResourceValueConfig request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteResourceValueConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteResourceValueConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.securitycenter.v2.IDeleteResourceValueConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteResourceValueConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a BigQuery export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the BigQuery export to retrieve. The following list shows - * some examples of the format: - * - * + - * `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - * + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - * + `projects/{project}locations/{location}//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 {@link protos.google.cloud.securitycenter.v2.BigQueryExport|BigQueryExport}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.get_big_query_export.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_async - */ - getBigQueryExport( - request?: protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|undefined, {}|undefined - ]>; - getBigQueryExport( - request: protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - getBigQueryExport( - request: protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - getBigQueryExport( - request?: protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getBigQueryExport request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBigQueryExport response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBigQueryExport(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IGetBigQueryExportRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBigQueryExport response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Get the simulation by name or the latest simulation for the given - * organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The organization name or simulation name of this simulation - * - * Valid format: - * `organizations/{organization}/simulations/latest` - * `organizations/{organization}/simulations/{simulation}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.Simulation|Simulation}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.get_simulation.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GetSimulation_async - */ - getSimulation( - request?: protos.google.cloud.securitycenter.v2.IGetSimulationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.ISimulation, - protos.google.cloud.securitycenter.v2.IGetSimulationRequest|undefined, {}|undefined - ]>; - getSimulation( - request: protos.google.cloud.securitycenter.v2.IGetSimulationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISimulation, - protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, - {}|null|undefined>): void; - getSimulation( - request: protos.google.cloud.securitycenter.v2.IGetSimulationRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISimulation, - protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, - {}|null|undefined>): void; - getSimulation( - request?: protos.google.cloud.securitycenter.v2.IGetSimulationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.ISimulation, - protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.ISimulation, - protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.ISimulation, - protos.google.cloud.securitycenter.v2.IGetSimulationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSimulation request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.ISimulation, - protos.google.cloud.securitycenter.v2.IGetSimulationRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSimulation response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSimulation(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.ISimulation, - protos.google.cloud.securitycenter.v2.IGetSimulationRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSimulation response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Get the valued resource by name - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of this valued resource - * - * Valid format: - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_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 {@link protos.google.cloud.securitycenter.v2.ValuedResource|ValuedResource}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.get_valued_resource.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GetValuedResource_async - */ - getValuedResource( - request?: protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IValuedResource, - protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|undefined, {}|undefined - ]>; - getValuedResource( - request: protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IValuedResource, - protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>): void; - getValuedResource( - request: protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IValuedResource, - protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>): void; - getValuedResource( - request?: protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IValuedResource, - protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IValuedResource, - protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IValuedResource, - protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getValuedResource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IValuedResource, - protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getValuedResource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getValuedResource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IValuedResource, - protos.google.cloud.securitycenter.v2.IGetValuedResourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getValuedResource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.get_iam_policy.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - 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; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a mute config. If no location is specified, default is - * global. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the mute config to retrieve. The following list shows - * some examples of the format: - * - * + `organizations/{organization}/muteConfigs/{config_id}` - * + - * `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - * + `folders/{folder}/muteConfigs/{config_id}` - * + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - * + `projects/{project}/muteConfigs/{config_id}` - * + `projects/{project}/locations/{location}/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 {@link protos.google.cloud.securitycenter.v2.MuteConfig|MuteConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.get_mute_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GetMuteConfig_async - */ - getMuteConfig( - request?: protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|undefined, {}|undefined - ]>; - getMuteConfig( - request: protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, - {}|null|undefined>): void; - getMuteConfig( - request: protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, - {}|null|undefined>): void; - getMuteConfig( - request?: protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getMuteConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getMuteConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getMuteConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IGetMuteConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('getMuteConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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. The following list shows - * some examples of the format: - * - * + - * `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - * + - * `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` - * + - * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.get_notification_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_async - */ - getNotificationConfig( - request?: protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|undefined, {}|undefined - ]>; - getNotificationConfig( - request: protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>): void; - getNotificationConfig( - request: protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>): void; - getNotificationConfig( - request?: protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IGetNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('getNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a ResourceValueConfig. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource value config to retrieve. Its format is - * organizations/{organization}/resourceValueConfigs/{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 {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.get_resource_value_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_async - */ - getResourceValueConfig( - request?: protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|undefined, {}|undefined - ]>; - getResourceValueConfig( - request: protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - getResourceValueConfig( - request: protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - getResourceValueConfig( - request?: protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getResourceValueConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getResourceValueConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getResourceValueConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IGetResourceValueConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('getResourceValueConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.cloud.securitycenter.v2.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.get_source.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GetSource_async - */ - getSource( - request?: protos.google.cloud.securitycenter.v2.IGetSourceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IGetSourceRequest|undefined, {}|undefined - ]>; - getSource( - request: protos.google.cloud.securitycenter.v2.IGetSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, - {}|null|undefined>): void; - getSource( - request: protos.google.cloud.securitycenter.v2.IGetSourceRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, - {}|null|undefined>): void; - getSource( - request?: protos.google.cloud.securitycenter.v2.IGetSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IGetSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IGetSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IGetSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the state of a finding. If no location is specified, finding is - * assumed to be in global - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The [relative resource - * name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * of the finding. If no location is specified, finding is assumed to be in - * global. The following list shows some examples: - * - * + - * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - * + - * `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - * + - * `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - * + - * `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * @param {google.cloud.securitycenter.v2.Finding.State} request.state - * Required. The desired State of the 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 {@link protos.google.cloud.securitycenter.v2.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.set_finding_state.js - * region_tag:securitycenter_v2_generated_SecurityCenter_SetFindingState_async - */ - setFindingState( - request?: protos.google.cloud.securitycenter.v2.ISetFindingStateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|undefined, {}|undefined - ]>; - setFindingState( - request: protos.google.cloud.securitycenter.v2.ISetFindingStateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, - {}|null|undefined>): void; - setFindingState( - request: protos.google.cloud.securitycenter.v2.ISetFindingStateRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, - {}|null|undefined>): void; - setFindingState( - request?: protos.google.cloud.securitycenter.v2.ISetFindingStateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setFindingState request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setFindingState response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setFindingState(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetFindingStateRequest|undefined, - {}|undefined - ]) => { - this._log.info('setFindingState response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {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. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.set_iam_policy.js - * region_tag:securitycenter_v2_generated_SecurityCenter_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - 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; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the mute state of a finding. If no location is specified, finding - * is assumed to be in global - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The [relative resource - * name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * of the finding. If no location is specified, finding is assumed to be in - * global. The following list shows some examples: - * - * + - * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - * + - * `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - * + - * `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - * + - * `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.set_mute.js - * region_tag:securitycenter_v2_generated_SecurityCenter_SetMute_async - */ - setMute( - request?: protos.google.cloud.securitycenter.v2.ISetMuteRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetMuteRequest|undefined, {}|undefined - ]>; - setMute( - request: protos.google.cloud.securitycenter.v2.ISetMuteRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, - {}|null|undefined>): void; - setMute( - request: protos.google.cloud.securitycenter.v2.ISetMuteRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, - {}|null|undefined>): void; - setMute( - request?: protos.google.cloud.securitycenter.v2.ISetMuteRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setMute request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetMuteRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setMute response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setMute(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.ISetMuteRequest|undefined, - {}|undefined - ]) => { - this._log.info('setMute response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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 {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.test_iam_permissions.js - * region_tag:securitycenter_v2_generated_SecurityCenter_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - 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; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates a BigQuery export. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v2.BigQueryExport} request.bigQueryExport - * Required. The BigQuery export 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 {@link protos.google.cloud.securitycenter.v2.BigQueryExport|BigQueryExport}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.update_big_query_export.js - * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateBigQueryExport_async - */ - updateBigQueryExport( - request?: protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|undefined, {}|undefined - ]>; - updateBigQueryExport( - request: protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - updateBigQueryExport( - request: protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>): void; - updateBigQueryExport( - request?: protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'big_query_export.name': request.bigQueryExport!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateBigQueryExport request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateBigQueryExport response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateBigQueryExport(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IBigQueryExport, - protos.google.cloud.securitycenter.v2.IUpdateBigQueryExportRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateBigQueryExport response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates external system. This is for a given finding. If no location is - * specified, finding is assumed to be in global - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.ExternalSystem|ExternalSystem}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.update_external_system.js - * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_async - */ - updateExternalSystem( - request?: protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IExternalSystem, - protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|undefined, {}|undefined - ]>; - updateExternalSystem( - request: protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IExternalSystem, - protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, - {}|null|undefined>): void; - updateExternalSystem( - request: protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IExternalSystem, - protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, - {}|null|undefined>): void; - updateExternalSystem( - request?: protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IExternalSystem, - protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IExternalSystem, - protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IExternalSystem, - protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'external_system.name': request.externalSystem!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateExternalSystem request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IExternalSystem, - protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateExternalSystem response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateExternalSystem(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IExternalSystem, - protos.google.cloud.securitycenter.v2.IUpdateExternalSystemRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateExternalSystem response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates or updates a finding. If no location is specified, finding is - * assumed to be in global. 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.v2.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 {@link protos.google.cloud.securitycenter.v2.Finding|Finding}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.update_finding.js - * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateFinding_async - */ - updateFinding( - request?: protos.google.cloud.securitycenter.v2.IUpdateFindingRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|undefined, {}|undefined - ]>; - updateFinding( - request: protos.google.cloud.securitycenter.v2.IUpdateFindingRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, - {}|null|undefined>): void; - updateFinding( - request: protos.google.cloud.securitycenter.v2.IUpdateFindingRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, - {}|null|undefined>): void; - updateFinding( - request?: protos.google.cloud.securitycenter.v2.IUpdateFindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'finding.name': request.finding!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateFinding request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateFinding response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateFinding(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IFinding, - protos.google.cloud.securitycenter.v2.IUpdateFindingRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateFinding response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates a mute config. If no location is specified, default is - * global. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.MuteConfig|MuteConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.update_mute_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_async - */ - updateMuteConfig( - request?: protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|undefined, {}|undefined - ]>; - updateMuteConfig( - request: protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, - {}|null|undefined>): void; - updateMuteConfig( - request: protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, - {}|null|undefined>): void; - updateMuteConfig( - request?: protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.muteConfig?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.muteConfig?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.muteConfig?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('updateMuteConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateMuteConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateMuteConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IMuteConfig, - protos.google.cloud.securitycenter.v2.IUpdateMuteConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateMuteConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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.v2.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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|NotificationConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.update_notification_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_async - */ - updateNotificationConfig( - request?: protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|undefined, {}|undefined - ]>; - updateNotificationConfig( - request: protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>): void; - updateNotificationConfig( - request: protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>): void; - updateNotificationConfig( - request?: protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'notification_config.name': request.notificationConfig!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateNotificationConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateNotificationConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateNotificationConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.INotificationConfig, - protos.google.cloud.securitycenter.v2.IUpdateNotificationConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateNotificationConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates an existing ResourceValueConfigs with new rules. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v2.ResourceValueConfig} request.resourceValueConfig - * Required. The resource value config being updated. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. - * If empty all mutable fields will be updated. - * - * To update nested fields, include the top level field in the mask - * For example, to update gcp_metadata.resource_type, include the - * "gcp_metadata" 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 {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.update_resource_value_config.js - * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_async - */ - updateResourceValueConfig( - request?: protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|undefined, {}|undefined - ]>; - updateResourceValueConfig( - request: protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - updateResourceValueConfig( - request: protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>): void; - updateResourceValueConfig( - request?: protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource_value_config.name': request.resourceValueConfig!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateResourceValueConfig request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateResourceValueConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateResourceValueConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.IResourceValueConfig, - protos.google.cloud.securitycenter.v2.IUpdateResourceValueConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateResourceValueConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates security marks. For Finding Security marks, if no location is - * specified, finding is assumed to be in global. Assets Security Marks can - * only be accessed through global endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v2.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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.securitycenter.v2.SecurityMarks|SecurityMarks}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.update_security_marks.js - * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_async - */ - updateSecurityMarks( - request?: protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.ISecurityMarks, - protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|undefined, {}|undefined - ]>; - updateSecurityMarks( - request: protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISecurityMarks, - protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>): void; - updateSecurityMarks( - request: protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISecurityMarks, - protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>): void; - updateSecurityMarks( - request?: protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.ISecurityMarks, - protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.ISecurityMarks, - protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.ISecurityMarks, - protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSecurityMarks request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.ISecurityMarks, - protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSecurityMarks response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSecurityMarks(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.ISecurityMarks, - protos.google.cloud.securitycenter.v2.IUpdateSecurityMarksRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSecurityMarks response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v2.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 {@link protos.google.cloud.securitycenter.v2.Source|Source}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.update_source.js - * region_tag:securitycenter_v2_generated_SecurityCenter_UpdateSource_async - */ - updateSource( - request?: protos.google.cloud.securitycenter.v2.IUpdateSourceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|undefined, {}|undefined - ]>; - updateSource( - request: protos.google.cloud.securitycenter.v2.IUpdateSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, - {}|null|undefined>): void; - updateSource( - request: protos.google.cloud.securitycenter.v2.IUpdateSourceRequest, - callback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, - {}|null|undefined>): void; - updateSource( - request?: protos.google.cloud.securitycenter.v2.IUpdateSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'source.name': request.source!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.securitycenter.v2.ISource, - protos.google.cloud.securitycenter.v2.IUpdateSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSource response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Kicks off an LRO to bulk mute findings for a parent based on a filter. If - * no location is specified, findings are muted in global. 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. If no - * location is specified, findings are updated in global. The following list - * shows some examples: - * - * + `organizations/[organization_id]` - * + `organizations/[organization_id]/locations/[location_id]` - * + `folders/[folder_id]` - * + `folders/[folder_id]/locations/[location_id]` - * + `projects/[project_id]` - * + `projects/[project_id]/locations/[location_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 {google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState} [request.muteState] - * Optional. All findings matching the given filter will have their mute state - * set to this value. The default value is `MUTED`. Setting this to - * `UNDEFINED` will clear the mute state on all matching findings. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.bulk_mute_findings.js - * region_tag:securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_async - */ - bulkMuteFindings( - request?: protos.google.cloud.securitycenter.v2.IBulkMuteFindingsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - bulkMuteFindings( - request: protos.google.cloud.securitycenter.v2.IBulkMuteFindingsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - bulkMuteFindings( - request: protos.google.cloud.securitycenter.v2.IBulkMuteFindingsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - bulkMuteFindings( - request?: protos.google.cloud.securitycenter.v2.IBulkMuteFindingsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('bulkMuteFindings response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('bulkMuteFindings request %j', request); - return this.innerApiCalls.bulkMuteFindings(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('bulkMuteFindings response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.bulk_mute_findings.js - * region_tag:securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_async - */ - async checkBulkMuteFindingsProgress(name: string): Promise>{ - this._log.info('bulkMuteFindings long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.bulkMuteFindings, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Filters an organization or source's findings and groups them by their - * specified properties in a location. If no location is specified, findings - * are assumed to be in global - * - * To group across all sources provide a `-` as the source id. - * The following list shows some examples: - * - * + `/v2/organizations/{organization_id}/sources/-/findings` - * + - * `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - * + `/v2/folders/{folder_id}/sources/-/findings` - * + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` - * + `/v2/projects/{project_id}/sources/-/findings` - * + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source to groupBy. If no location is specified, - * finding is assumed to be in global. - * The following list shows some examples: - * - * + `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - * + `folders/[folder_id]/sources/[source_id]` - * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - * + `projects/[project_id]/sources/[source_id]` - * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - * - * To groupBy across all sources provide a source_id of `-`. The following - * list shows some examples: - * - * + `organizations/{organization_id}/sources/-` - * + `organizations/{organization_id}/sources/-/locations/[location_id]` - * + `folders/{folder_id}/sources/-` - * + `folders/{folder_id}/sources/-/locations/[location_id]` - * + `projects/{project_id}/sources/-` - * + `projects/{project_id}/sources/-/locations/[location_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 - * 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 - * * 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: `=`, `:` - * * security_marks.marks: `=`, `:` - * * 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. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: "parent,resource_name". - * @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 {@link protos.google.cloud.securitycenter.v2.GroupResult|GroupResult}. - * 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 `groupFindingsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - groupFindings( - request?: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IGroupResult[], - protos.google.cloud.securitycenter.v2.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v2.IGroupFindingsResponse - ]>; - groupFindings( - request: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IGroupResult>): void; - groupFindings( - request: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IGroupResult>): void; - groupFindings( - request?: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IGroupResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IGroupResult>): - Promise<[ - protos.google.cloud.securitycenter.v2.IGroupResult[], - protos.google.cloud.securitycenter.v2.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v2.IGroupFindingsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - protos.google.cloud.securitycenter.v2.IGroupFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IGroupResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('groupFindings values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('groupFindings request %j', request); - return this.innerApiCalls - .groupFindings(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.IGroupResult[], - protos.google.cloud.securitycenter.v2.IGroupFindingsRequest|null, - protos.google.cloud.securitycenter.v2.IGroupFindingsResponse - ]) => { - this._log.info('groupFindings values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `groupFindings`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source to groupBy. If no location is specified, - * finding is assumed to be in global. - * The following list shows some examples: - * - * + `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - * + `folders/[folder_id]/sources/[source_id]` - * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - * + `projects/[project_id]/sources/[source_id]` - * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - * - * To groupBy across all sources provide a source_id of `-`. The following - * list shows some examples: - * - * + `organizations/{organization_id}/sources/-` - * + `organizations/{organization_id}/sources/-/locations/[location_id]` - * + `folders/{folder_id}/sources/-` - * + `folders/{folder_id}/sources/-/locations/[location_id]` - * + `projects/{project_id}/sources/-` - * + `projects/{project_id}/sources/-/locations/[location_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 - * 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 - * * 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: `=`, `:` - * * security_marks.marks: `=`, `:` - * * 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. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: "parent,resource_name". - * @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 {@link protos.google.cloud.securitycenter.v2.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - groupFindingsStream( - request?: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupFindings stream %j', request); - return this.descriptors.page.groupFindings.createStream( - this.innerApiCalls.groupFindings as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * Required. Name of the source to groupBy. If no location is specified, - * finding is assumed to be in global. - * The following list shows some examples: - * - * + `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - * + `folders/[folder_id]/sources/[source_id]` - * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - * + `projects/[project_id]/sources/[source_id]` - * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - * - * To groupBy across all sources provide a source_id of `-`. The following - * list shows some examples: - * - * + `organizations/{organization_id}/sources/-` - * + `organizations/{organization_id}/sources/-/locations/[location_id]` - * + `folders/{folder_id}/sources/-` - * + `folders/{folder_id}/sources/-/locations/[location_id]` - * + `projects/{project_id}/sources/-` - * + `projects/{project_id}/sources/-/locations/[location_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 - * 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 - * * 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: `=`, `:` - * * security_marks.marks: `=`, `:` - * * 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. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: "parent,resource_name". - * @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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.GroupResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.group_findings.js - * region_tag:securitycenter_v2_generated_SecurityCenter_GroupFindings_async - */ - groupFindingsAsync( - request?: protos.google.cloud.securitycenter.v2.IGroupFindingsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['groupFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('groupFindings iterate %j', request); - return this.descriptors.page.groupFindings.asyncIterate( - this.innerApiCalls['groupFindings'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the attack paths for a set of simulation results or valued resources - * and filter. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list attack paths. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - * @param {string} request.filter - * The filter expression that filters the attack path in the response. - * Supported fields: - * - * * `valued_resources` supports = - * @param {string} request.pageToken - * The value returned by the last `ListAttackPathsResponse`; indicates - * that this is a continuation of a prior `ListAttackPaths` 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 {@link protos.google.cloud.securitycenter.v2.AttackPath|AttackPath}. - * 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 `listAttackPathsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAttackPaths( - request?: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IAttackPath[], - protos.google.cloud.securitycenter.v2.IListAttackPathsRequest|null, - protos.google.cloud.securitycenter.v2.IListAttackPathsResponse - ]>; - listAttackPaths( - request: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IAttackPath>): void; - listAttackPaths( - request: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IAttackPath>): void; - listAttackPaths( - request?: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IAttackPath>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IAttackPath>): - Promise<[ - protos.google.cloud.securitycenter.v2.IAttackPath[], - protos.google.cloud.securitycenter.v2.IListAttackPathsRequest|null, - protos.google.cloud.securitycenter.v2.IListAttackPathsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - protos.google.cloud.securitycenter.v2.IListAttackPathsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IAttackPath>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAttackPaths values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAttackPaths request %j', request); - return this.innerApiCalls - .listAttackPaths(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.IAttackPath[], - protos.google.cloud.securitycenter.v2.IListAttackPathsRequest|null, - protos.google.cloud.securitycenter.v2.IListAttackPathsResponse - ]) => { - this._log.info('listAttackPaths values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAttackPaths`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list attack paths. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - * @param {string} request.filter - * The filter expression that filters the attack path in the response. - * Supported fields: - * - * * `valued_resources` supports = - * @param {string} request.pageToken - * The value returned by the last `ListAttackPathsResponse`; indicates - * that this is a continuation of a prior `ListAttackPaths` 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 {@link protos.google.cloud.securitycenter.v2.AttackPath|AttackPath} 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 `listAttackPathsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAttackPathsStream( - request?: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAttackPaths']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAttackPaths stream %j', request); - return this.descriptors.page.listAttackPaths.createStream( - this.innerApiCalls.listAttackPaths as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAttackPaths`, 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. Name of parent to list attack paths. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - * @param {string} request.filter - * The filter expression that filters the attack path in the response. - * Supported fields: - * - * * `valued_resources` supports = - * @param {string} request.pageToken - * The value returned by the last `ListAttackPathsResponse`; indicates - * that this is a continuation of a prior `ListAttackPaths` 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.AttackPath|AttackPath}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.list_attack_paths.js - * region_tag:securitycenter_v2_generated_SecurityCenter_ListAttackPaths_async - */ - listAttackPathsAsync( - request?: protos.google.cloud.securitycenter.v2.IListAttackPathsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAttackPaths']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAttackPaths iterate %j', request); - return this.descriptors.page.listAttackPaths.asyncIterate( - this.innerApiCalls['listAttackPaths'] as GaxCall, - request as {}, - 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]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBigQueryExports( - request?: protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IBigQueryExport[], - protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest|null, - protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse - ]>; - listBigQueryExports( - request: protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IBigQueryExport>): void; - listBigQueryExports( - request: protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IBigQueryExport>): void; - listBigQueryExports( - request?: protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IBigQueryExport>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IBigQueryExport>): - Promise<[ - protos.google.cloud.securitycenter.v2.IBigQueryExport[], - protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest|null, - protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest, - protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IBigQueryExport>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBigQueryExports values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBigQueryExports request %j', request); - return this.innerApiCalls - .listBigQueryExports(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.IBigQueryExport[], - protos.google.cloud.securitycenter.v2.IListBigQueryExportsRequest|null, - protos.google.cloud.securitycenter.v2.IListBigQueryExportsResponse - ]) => { - this._log.info('listBigQueryExports values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBigQueryExports`, 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]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBigQueryExportsStream( - request?: protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBigQueryExports']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBigQueryExports stream %j', request); - return this.descriptors.page.listBigQueryExports.createStream( - this.innerApiCalls.listBigQueryExports as 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]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, or - * `projects/[project_id]/locations/[location_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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.BigQueryExport|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.list_big_query_exports.js - * region_tag:securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_async - */ - listBigQueryExportsAsync( - request?: protos.google.cloud.securitycenter.v2.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBigQueryExports']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBigQueryExports iterate %j', request); - return this.descriptors.page.listBigQueryExports.asyncIterate( - this.innerApiCalls['listBigQueryExports'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists an organization or source's findings. - * - * To list across all sources for a given location provide a `-` as the source - * id. If no location is specified, finding are assumed to be in global. - * The following list shows some examples: - * - * + `/v2/organizations/{organization_id}/sources/-/findings` - * + - * `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source the findings belong to. If no location is - * specified, the default is global. The following list shows some examples: - * - * + `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - * + `folders/[folder_id]/sources/[source_id]` - * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - * + `projects/[project_id]/sources/[source_id]` - * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - * - * To list across all sources provide a source_id of `-`. The following - * list shows some examples: - * - * + `organizations/{organization_id}/sources/-` - * + `organizations/{organization_id}/sources/-/locations/{location_id}` - * + `folders/{folder_id}/sources/-` - * + `folders/{folder_id}/sources/-locations/{location_id}` - * + `projects/{projects_id}/sources/-` - * + `projects/{projects_id}/sources/-/locations/{location_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 - * 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 - * * 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: `=`, `:` - * * security_marks.marks: `=`, `:` - * * resource: - * * resource.name: `=`, `:` - * * resource.parent_name: `=`, `:` - * * resource.parent_display_name: `=`, `:` - * * resource.project_name: `=`, `:` - * * 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 - * example: "name,parent". 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,parent". Redundant space characters in the - * syntax are insignificant. "name desc,parent" and " - * name desc , parent " are equivalent. - * - * The following fields are supported: - * name - * parent - * state - * category - * resource_name - * event_time - * security_marks.marks - * @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 - * 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 {@link protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult|ListFindingsResult}. - * 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 `listFindingsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listFindings( - request?: protos.google.cloud.securitycenter.v2.IListFindingsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v2.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v2.IListFindingsResponse - ]>; - listFindings( - request: protos.google.cloud.securitycenter.v2.IListFindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListFindingsRequest, - protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>): void; - listFindings( - request: protos.google.cloud.securitycenter.v2.IListFindingsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListFindingsRequest, - protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>): void; - listFindings( - request?: protos.google.cloud.securitycenter.v2.IListFindingsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IListFindingsRequest, - protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListFindingsRequest, - protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>): - Promise<[ - protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v2.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v2.IListFindingsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListFindingsRequest, - protos.google.cloud.securitycenter.v2.IListFindingsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listFindings values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listFindings request %j', request); - return this.innerApiCalls - .listFindings(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v2.IListFindingsRequest|null, - protos.google.cloud.securitycenter.v2.IListFindingsResponse - ]) => { - this._log.info('listFindings values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listFindings`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source the findings belong to. If no location is - * specified, the default is global. The following list shows some examples: - * - * + `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - * + `folders/[folder_id]/sources/[source_id]` - * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - * + `projects/[project_id]/sources/[source_id]` - * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - * - * To list across all sources provide a source_id of `-`. The following - * list shows some examples: - * - * + `organizations/{organization_id}/sources/-` - * + `organizations/{organization_id}/sources/-/locations/{location_id}` - * + `folders/{folder_id}/sources/-` - * + `folders/{folder_id}/sources/-locations/{location_id}` - * + `projects/{projects_id}/sources/-` - * + `projects/{projects_id}/sources/-/locations/{location_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 - * 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 - * * 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: `=`, `:` - * * security_marks.marks: `=`, `:` - * * resource: - * * resource.name: `=`, `:` - * * resource.parent_name: `=`, `:` - * * resource.parent_display_name: `=`, `:` - * * resource.project_name: `=`, `:` - * * 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 - * example: "name,parent". 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,parent". Redundant space characters in the - * syntax are insignificant. "name desc,parent" and " - * name desc , parent " are equivalent. - * - * The following fields are supported: - * name - * parent - * state - * category - * resource_name - * event_time - * security_marks.marks - * @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 - * 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 {@link protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listFindingsStream( - request?: protos.google.cloud.securitycenter.v2.IListFindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listFindings stream %j', request); - return this.descriptors.page.listFindings.createStream( - this.innerApiCalls.listFindings as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * Required. Name of the source the findings belong to. If no location is - * specified, the default is global. The following list shows some examples: - * - * + `organizations/[organization_id]/sources/[source_id]` - * + - * `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - * + `folders/[folder_id]/sources/[source_id]` - * + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - * + `projects/[project_id]/sources/[source_id]` - * + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - * - * To list across all sources provide a source_id of `-`. The following - * list shows some examples: - * - * + `organizations/{organization_id}/sources/-` - * + `organizations/{organization_id}/sources/-/locations/{location_id}` - * + `folders/{folder_id}/sources/-` - * + `folders/{folder_id}/sources/-locations/{location_id}` - * + `projects/{projects_id}/sources/-` - * + `projects/{projects_id}/sources/-/locations/{location_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 - * 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 - * * 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: `=`, `:` - * * security_marks.marks: `=`, `:` - * * resource: - * * resource.name: `=`, `:` - * * resource.parent_name: `=`, `:` - * * resource.parent_display_name: `=`, `:` - * * resource.project_name: `=`, `:` - * * 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 - * example: "name,parent". 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,parent". Redundant space characters in the - * syntax are insignificant. "name desc,parent" and " - * name desc , parent " are equivalent. - * - * The following fields are supported: - * name - * parent - * state - * category - * resource_name - * event_time - * security_marks.marks - * @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 - * 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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.list_findings.js - * region_tag:securitycenter_v2_generated_SecurityCenter_ListFindings_async - */ - listFindingsAsync( - request?: protos.google.cloud.securitycenter.v2.IListFindingsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listFindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listFindings iterate %j', request); - return this.descriptors.page.listFindings.asyncIterate( - this.innerApiCalls['listFindings'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists mute configs. If no location is specified, default is - * global. - * - * @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]`, - * `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, - * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listMuteConfigs( - request?: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IMuteConfig[], - protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest|null, - protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse - ]>; - listMuteConfigs( - request: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IMuteConfig>): void; - listMuteConfigs( - request: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IMuteConfig>): void; - listMuteConfigs( - request?: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IMuteConfig>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IMuteConfig>): - Promise<[ - protos.google.cloud.securitycenter.v2.IMuteConfig[], - protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest|null, - protos.google.cloud.securitycenter.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IMuteConfig>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listMuteConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listMuteConfigs request %j', request); - return this.innerApiCalls - .listMuteConfigs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.IMuteConfig[], - protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest|null, - protos.google.cloud.securitycenter.v2.IListMuteConfigsResponse - ]) => { - this._log.info('listMuteConfigs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listMuteConfigs`, 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]`, - * `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, - * `projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listMuteConfigsStream( - request?: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listMuteConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listMuteConfigs stream %j', request); - return this.descriptors.page.listMuteConfigs.createStream( - this.innerApiCalls.listMuteConfigs as 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]`, - * `organizations/[organization_id]/locations/[location_id]`, - * `folders/[folder_id]/locations/[location_id]`, - * `projects/[project_id]/locations/[location_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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.MuteConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.list_mute_configs.js - * region_tag:securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_async - */ - listMuteConfigsAsync( - request?: protos.google.cloud.securitycenter.v2.IListMuteConfigsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('organizations/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('folders/[^/]+/locations/(?[^/]+)/muteConfigs')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listMuteConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listMuteConfigs iterate %j', request); - return this.descriptors.page.listMuteConfigs.asyncIterate( - this.innerApiCalls['listMuteConfigs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists notification configs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent in which to list the notification - * configurations. Its format is - * "organizations/[organization_id]/locations/[location_id]", - * "folders/[folder_id]/locations/[location_id]", or - * "projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listNotificationConfigs( - request?: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.INotificationConfig[], - protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse - ]>; - listNotificationConfigs( - request: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.INotificationConfig>): void; - listNotificationConfigs( - request: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.INotificationConfig>): void; - listNotificationConfigs( - request?: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.INotificationConfig>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.INotificationConfig>): - Promise<[ - protos.google.cloud.securitycenter.v2.INotificationConfig[], - protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.INotificationConfig>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listNotificationConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listNotificationConfigs request %j', request); - return this.innerApiCalls - .listNotificationConfigs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.INotificationConfig[], - protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest|null, - protos.google.cloud.securitycenter.v2.IListNotificationConfigsResponse - ]) => { - this._log.info('listNotificationConfigs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listNotificationConfigs`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent in which to list the notification - * configurations. Its format is - * "organizations/[organization_id]/locations/[location_id]", - * "folders/[folder_id]/locations/[location_id]", or - * "projects/[project_id]/locations/[location_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 {@link protos.google.cloud.securitycenter.v2.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listNotificationConfigsStream( - request?: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listNotificationConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listNotificationConfigs stream %j', request); - return this.descriptors.page.listNotificationConfigs.createStream( - this.innerApiCalls.listNotificationConfigs as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * Required. The name of the parent in which to list the notification - * configurations. Its format is - * "organizations/[organization_id]/locations/[location_id]", - * "folders/[folder_id]/locations/[location_id]", or - * "projects/[project_id]/locations/[location_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 allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.NotificationConfig|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.list_notification_configs.js - * region_tag:securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_async - */ - listNotificationConfigsAsync( - request?: protos.google.cloud.securitycenter.v2.IListNotificationConfigsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listNotificationConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listNotificationConfigs iterate %j', request); - return this.descriptors.page.listNotificationConfigs.asyncIterate( - this.innerApiCalls['listNotificationConfigs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all ResourceValueConfigs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns the collection of resource value configs. - * Its format is - * `organizations/[organization_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 `ListResourceValueConfigs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListResourceValueConfigs` must match the call that provided the - * page token. - * - * page_size can be specified, and the new page_size will be used. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig}. - * 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 `listResourceValueConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listResourceValueConfigs( - request?: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IResourceValueConfig[], - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest|null, - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse - ]>; - listResourceValueConfigs( - request: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IResourceValueConfig>): void; - listResourceValueConfigs( - request: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IResourceValueConfig>): void; - listResourceValueConfigs( - request?: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IResourceValueConfig>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IResourceValueConfig>): - Promise<[ - protos.google.cloud.securitycenter.v2.IResourceValueConfig[], - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest|null, - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IResourceValueConfig>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listResourceValueConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listResourceValueConfigs request %j', request); - return this.innerApiCalls - .listResourceValueConfigs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.IResourceValueConfig[], - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest|null, - protos.google.cloud.securitycenter.v2.IListResourceValueConfigsResponse - ]) => { - this._log.info('listResourceValueConfigs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listResourceValueConfigs`, 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 resource value configs. - * Its format is - * `organizations/[organization_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 `ListResourceValueConfigs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListResourceValueConfigs` must match the call that provided the - * page token. - * - * page_size can be specified, and the new page_size will be used. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig} 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 `listResourceValueConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listResourceValueConfigsStream( - request?: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listResourceValueConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listResourceValueConfigs stream %j', request); - return this.descriptors.page.listResourceValueConfigs.createStream( - this.innerApiCalls.listResourceValueConfigs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listResourceValueConfigs`, 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 resource value configs. - * Its format is - * `organizations/[organization_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 `ListResourceValueConfigs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListResourceValueConfigs` must match the call that provided the - * page token. - * - * page_size can be specified, and the new page_size will be used. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.ResourceValueConfig|ResourceValueConfig}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.list_resource_value_configs.js - * region_tag:securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_async - */ - listResourceValueConfigsAsync( - request?: protos.google.cloud.securitycenter.v2.IListResourceValueConfigsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listResourceValueConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listResourceValueConfigs iterate %j', request); - return this.descriptors.page.listResourceValueConfigs.asyncIterate( - this.innerApiCalls['listResourceValueConfigs'] as GaxCall, - request as {}, - 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 {@link protos.google.cloud.securitycenter.v2.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSources( - request?: protos.google.cloud.securitycenter.v2.IListSourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.ISource[], - protos.google.cloud.securitycenter.v2.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v2.IListSourcesResponse - ]>; - listSources( - request: protos.google.cloud.securitycenter.v2.IListSourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListSourcesRequest, - protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ISource>): void; - listSources( - request: protos.google.cloud.securitycenter.v2.IListSourcesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListSourcesRequest, - protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ISource>): void; - listSources( - request?: protos.google.cloud.securitycenter.v2.IListSourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IListSourcesRequest, - protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ISource>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListSourcesRequest, - protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ISource>): - Promise<[ - protos.google.cloud.securitycenter.v2.ISource[], - protos.google.cloud.securitycenter.v2.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v2.IListSourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListSourcesRequest, - protos.google.cloud.securitycenter.v2.IListSourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.ISource>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSources values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSources request %j', request); - return this.innerApiCalls - .listSources(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.ISource[], - protos.google.cloud.securitycenter.v2.IListSourcesRequest|null, - protos.google.cloud.securitycenter.v2.IListSourcesResponse - ]) => { - this._log.info('listSources values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSources`, but returns a NodeJS Stream object. - * @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 {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v2.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSourcesStream( - request?: protos.google.cloud.securitycenter.v2.IListSourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSources stream %j', request); - return this.descriptors.page.listSources.createStream( - this.innerApiCalls.listSources as GaxCall, - request, - callSettings - ); - } - -/** - * 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 - * 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 {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.Source|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.list_sources.js - * region_tag:securitycenter_v2_generated_SecurityCenter_ListSources_async - */ - listSourcesAsync( - request?: protos.google.cloud.securitycenter.v2.IListSourcesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSources iterate %j', request); - return this.descriptors.page.listSources.asyncIterate( - this.innerApiCalls['listSources'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the valued resources for a set of simulation results and filter. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list exposed resources. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * @param {string} request.filter - * The filter expression that filters the valued resources in the response. - * Supported fields: - * - * * `resource_value` supports = - * * `resource_type` supports = - * @param {string} request.pageToken - * The value returned by the last `ListValuedResourcesResponse`; indicates - * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] - * Optional. The fields by which to order the valued resources response. - * - * Supported fields: - * - * * `exposed_score` - * - * * `resource_value` - * - * * `resource_type` - * - * Values should be a comma separated list of fields. For example: - * `exposed_score,resource_value`. - * - * The default sorting order is descending. To specify ascending or descending - * order for a field, append a " ASC" or a " DESC" suffix, respectively; for - * example: `exposed_score DESC`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.securitycenter.v2.ValuedResource|ValuedResource}. - * 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 `listValuedResourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listValuedResources( - request?: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.securitycenter.v2.IValuedResource[], - protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest|null, - protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse - ]>; - listValuedResources( - request: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IValuedResource>): void; - listValuedResources( - request: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IValuedResource>): void; - listValuedResources( - request?: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IValuedResource>, - callback?: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IValuedResource>): - Promise<[ - protos.google.cloud.securitycenter.v2.IValuedResource[], - protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest|null, - protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse|null|undefined, - protos.google.cloud.securitycenter.v2.IValuedResource>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listValuedResources values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listValuedResources request %j', request); - return this.innerApiCalls - .listValuedResources(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.securitycenter.v2.IValuedResource[], - protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest|null, - protos.google.cloud.securitycenter.v2.IListValuedResourcesResponse - ]) => { - this._log.info('listValuedResources values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listValuedResources`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of parent to list exposed resources. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * @param {string} request.filter - * The filter expression that filters the valued resources in the response. - * Supported fields: - * - * * `resource_value` supports = - * * `resource_type` supports = - * @param {string} request.pageToken - * The value returned by the last `ListValuedResourcesResponse`; indicates - * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] - * Optional. The fields by which to order the valued resources response. - * - * Supported fields: - * - * * `exposed_score` - * - * * `resource_value` - * - * * `resource_type` - * - * Values should be a comma separated list of fields. For example: - * `exposed_score,resource_value`. - * - * The default sorting order is descending. To specify ascending or descending - * order for a field, append a " ASC" or a " DESC" suffix, respectively; for - * example: `exposed_score DESC`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.securitycenter.v2.ValuedResource|ValuedResource} 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 `listValuedResourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listValuedResourcesStream( - request?: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listValuedResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listValuedResources stream %j', request); - return this.descriptors.page.listValuedResources.createStream( - this.innerApiCalls.listValuedResources as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listValuedResources`, 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. Name of parent to list exposed resources. - * - * Valid formats: - * `organizations/{organization}`, - * `organizations/{organization}/simulations/{simulation}` - * `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - * @param {string} request.filter - * The filter expression that filters the valued resources in the response. - * Supported fields: - * - * * `resource_value` supports = - * * `resource_type` supports = - * @param {string} request.pageToken - * The value returned by the last `ListValuedResourcesResponse`; indicates - * that this is a continuation of a prior `ListValuedResources` 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 {string} [request.orderBy] - * Optional. The fields by which to order the valued resources response. - * - * Supported fields: - * - * * `exposed_score` - * - * * `resource_value` - * - * * `resource_type` - * - * Values should be a comma separated list of fields. For example: - * `exposed_score,resource_value`. - * - * The default sorting order is descending. To specify ascending or descending - * order for a field, append a " ASC" or a " DESC" suffix, respectively; for - * example: `exposed_score DESC`. - * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.securitycenter.v2.ValuedResource|ValuedResource}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v2/security_center.list_valued_resources.js - * region_tag:securitycenter_v2_generated_SecurityCenter_ListValuedResources_async - */ - listValuedResourcesAsync( - request?: protos.google.cloud.securitycenter.v2.IListValuedResourcesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listValuedResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listValuedResources iterate %j', request); - return this.descriptors.page.listValuedResources.asyncIterate( - this.innerApiCalls['listValuedResources'] as GaxCall, - request as {}, - 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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, - optionsOrCallback?: - | 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]> { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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, - optionsOrCallback?: - | 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 { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified folderAssetSecurityMarks resource name string. - * - * @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 folderConstraintName resource name string. - * - * @param {string} folder - * @param {string} constraint_name - * @returns {string} Resource name string. - */ - folderConstraintNamePath(folder:string,constraintName:string) { - return this.pathTemplates.folderConstraintNamePathTemplate.render({ - folder: folder, - constraint_name: constraintName, - }); - } - - /** - * Parse the folder from FolderConstraintName resource. - * - * @param {string} folderConstraintNameName - * A fully-qualified path representing folder_constraint_name resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderConstraintNameName(folderConstraintNameName: string) { - return this.pathTemplates.folderConstraintNamePathTemplate.match(folderConstraintNameName).folder; - } - - /** - * Parse the constraint_name from FolderConstraintName resource. - * - * @param {string} folderConstraintNameName - * A fully-qualified path representing folder_constraint_name resource. - * @returns {string} A string representing the constraint_name. - */ - matchConstraintNameFromFolderConstraintNameName(folderConstraintNameName: string) { - return this.pathTemplates.folderConstraintNamePathTemplate.match(folderConstraintNameName).constraint_name; - } - - /** - * Return a fully-qualified folderLocationBigQueryExports resource name string. - * - * @param {string} folder - * @param {string} location - * @param {string} exportParam - * @returns {string} Resource name string. - */ - folderLocationBigQueryExportsPath(folder:string,location:string,exportParam:string) { - return this.pathTemplates.folderLocationBigQueryExportsPathTemplate.render({ - folder: folder, - location: location, - export: exportParam, - }); - } - - /** - * Parse the folder from FolderLocationBigQueryExports resource. - * - * @param {string} folderLocationBigQueryExportsName - * A fully-qualified path representing folder_location_bigQueryExports resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderLocationBigQueryExportsName(folderLocationBigQueryExportsName: string) { - return this.pathTemplates.folderLocationBigQueryExportsPathTemplate.match(folderLocationBigQueryExportsName).folder; - } - - /** - * Parse the location from FolderLocationBigQueryExports resource. - * - * @param {string} folderLocationBigQueryExportsName - * A fully-qualified path representing folder_location_bigQueryExports resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFolderLocationBigQueryExportsName(folderLocationBigQueryExportsName: string) { - return this.pathTemplates.folderLocationBigQueryExportsPathTemplate.match(folderLocationBigQueryExportsName).location; - } - - /** - * Parse the export from FolderLocationBigQueryExports resource. - * - * @param {string} folderLocationBigQueryExportsName - * A fully-qualified path representing folder_location_bigQueryExports resource. - * @returns {string} A string representing the export. - */ - matchExportFromFolderLocationBigQueryExportsName(folderLocationBigQueryExportsName: string) { - return this.pathTemplates.folderLocationBigQueryExportsPathTemplate.match(folderLocationBigQueryExportsName).export; - } - - /** - * Return a fully-qualified folderLocationMuteConfigs resource name string. - * - * @param {string} folder - * @param {string} location - * @param {string} mute_config - * @returns {string} Resource name string. - */ - folderLocationMuteConfigsPath(folder:string,location:string,muteConfig:string) { - return this.pathTemplates.folderLocationMuteConfigsPathTemplate.render({ - folder: folder, - location: location, - mute_config: muteConfig, - }); - } - - /** - * Parse the folder from FolderLocationMuteConfigs resource. - * - * @param {string} folderLocationMuteConfigsName - * A fully-qualified path representing folder_location_muteConfigs resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { - return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).folder; - } - - /** - * Parse the location from FolderLocationMuteConfigs resource. - * - * @param {string} folderLocationMuteConfigsName - * A fully-qualified path representing folder_location_muteConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { - return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).location; - } - - /** - * Parse the mute_config from FolderLocationMuteConfigs resource. - * - * @param {string} folderLocationMuteConfigsName - * A fully-qualified path representing folder_location_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromFolderLocationMuteConfigsName(folderLocationMuteConfigsName: string) { - return this.pathTemplates.folderLocationMuteConfigsPathTemplate.match(folderLocationMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified folderLocationNotificationConfigs resource name string. - * - * @param {string} folder - * @param {string} location - * @param {string} notification_config - * @returns {string} Resource name string. - */ - folderLocationNotificationConfigsPath(folder:string,location:string,notificationConfig:string) { - return this.pathTemplates.folderLocationNotificationConfigsPathTemplate.render({ - folder: folder, - location: location, - notification_config: notificationConfig, - }); - } - - /** - * Parse the folder from FolderLocationNotificationConfigs resource. - * - * @param {string} folderLocationNotificationConfigsName - * A fully-qualified path representing folder_location_notificationConfigs resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderLocationNotificationConfigsName(folderLocationNotificationConfigsName: string) { - return this.pathTemplates.folderLocationNotificationConfigsPathTemplate.match(folderLocationNotificationConfigsName).folder; - } - - /** - * Parse the location from FolderLocationNotificationConfigs resource. - * - * @param {string} folderLocationNotificationConfigsName - * A fully-qualified path representing folder_location_notificationConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFolderLocationNotificationConfigsName(folderLocationNotificationConfigsName: string) { - return this.pathTemplates.folderLocationNotificationConfigsPathTemplate.match(folderLocationNotificationConfigsName).location; - } - - /** - * Parse the notification_config from FolderLocationNotificationConfigs resource. - * - * @param {string} folderLocationNotificationConfigsName - * A fully-qualified path representing folder_location_notificationConfigs resource. - * @returns {string} A string representing the notification_config. - */ - matchNotificationConfigFromFolderLocationNotificationConfigsName(folderLocationNotificationConfigsName: string) { - return this.pathTemplates.folderLocationNotificationConfigsPathTemplate.match(folderLocationNotificationConfigsName).notification_config; - } - - /** - * Return a fully-qualified folderMuteConfigs resource name string. - * - * @param {string} folder - * @param {string} mute_config - * @returns {string} Resource name string. - */ - folderMuteConfigsPath(folder:string,muteConfig:string) { - return this.pathTemplates.folderMuteConfigsPathTemplate.render({ - folder: folder, - mute_config: muteConfig, - }); - } - - /** - * Parse the folder from FolderMuteConfigs resource. - * - * @param {string} folderMuteConfigsName - * A fully-qualified path representing folder_muteConfigs resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderMuteConfigsName(folderMuteConfigsName: string) { - return this.pathTemplates.folderMuteConfigsPathTemplate.match(folderMuteConfigsName).folder; - } - - /** - * Parse the mute_config from FolderMuteConfigs resource. - * - * @param {string} folderMuteConfigsName - * A fully-qualified path representing folder_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromFolderMuteConfigsName(folderMuteConfigsName: string) { - return this.pathTemplates.folderMuteConfigsPathTemplate.match(folderMuteConfigsName).mute_config; - } - - /** - * 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 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. - * - * @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; - } - - /** - * Return a fully-qualified folderSourceFindings resource name string. - * - * @param {string} folder - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - folderSourceFindingsPath(folder:string,source:string,finding:string) { - return this.pathTemplates.folderSourceFindingsPathTemplate.render({ - folder: folder, - source: source, - finding: finding, - }); - } - - /** - * Parse the folder from FolderSourceFindings resource. - * - * @param {string} folderSourceFindingsName - * A fully-qualified path representing folder_source_findings resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderSourceFindingsName(folderSourceFindingsName: string) { - return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).folder; - } - - /** - * Parse the source from FolderSourceFindings resource. - * - * @param {string} folderSourceFindingsName - * A fully-qualified path representing folder_source_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromFolderSourceFindingsName(folderSourceFindingsName: string) { - return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).source; - } - - /** - * Parse the finding from FolderSourceFindings resource. - * - * @param {string} folderSourceFindingsName - * A fully-qualified path representing folder_source_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromFolderSourceFindingsName(folderSourceFindingsName: string) { - return this.pathTemplates.folderSourceFindingsPathTemplate.match(folderSourceFindingsName).finding; - } - - /** - * Return a fully-qualified folderSourceLocationFindingExternalsystem resource name string. - * - * @param {string} folder - * @param {string} source - * @param {string} location - * @param {string} finding - * @param {string} externalsystem - * @returns {string} Resource name string. - */ - folderSourceLocationFindingExternalsystemPath(folder:string,source:string,location:string,finding:string,externalsystem:string) { - return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.render({ - folder: folder, - source: source, - location: location, - finding: finding, - externalsystem: externalsystem, - }); - } - - /** - * Parse the folder from FolderSourceLocationFindingExternalsystem resource. - * - * @param {string} folderSourceLocationFindingExternalsystemName - * A fully-qualified path representing folder_source_location_finding_externalsystem resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).folder; - } - - /** - * Parse the source from FolderSourceLocationFindingExternalsystem resource. - * - * @param {string} folderSourceLocationFindingExternalsystemName - * A fully-qualified path representing folder_source_location_finding_externalsystem resource. - * @returns {string} A string representing the source. - */ - matchSourceFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).source; - } - - /** - * Parse the location from FolderSourceLocationFindingExternalsystem resource. - * - * @param {string} folderSourceLocationFindingExternalsystemName - * A fully-qualified path representing folder_source_location_finding_externalsystem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).location; - } - - /** - * Parse the finding from FolderSourceLocationFindingExternalsystem resource. - * - * @param {string} folderSourceLocationFindingExternalsystemName - * A fully-qualified path representing folder_source_location_finding_externalsystem resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).finding; - } - - /** - * Parse the externalsystem from FolderSourceLocationFindingExternalsystem resource. - * - * @param {string} folderSourceLocationFindingExternalsystemName - * A fully-qualified path representing folder_source_location_finding_externalsystem resource. - * @returns {string} A string representing the externalsystem. - */ - matchExternalsystemFromFolderSourceLocationFindingExternalsystemName(folderSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match(folderSourceLocationFindingExternalsystemName).externalsystem; - } - - /** - * Return a fully-qualified folderSourceLocationFindingSecurityMarks resource name string. - * - * @param {string} folder - * @param {string} source - * @param {string} location - * @param {string} finding - * @returns {string} Resource name string. - */ - folderSourceLocationFindingSecurityMarksPath(folder:string,source:string,location:string,finding:string) { - return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.render({ - folder: folder, - source: source, - location: location, - finding: finding, - }); - } - - /** - * Parse the folder from FolderSourceLocationFindingSecurityMarks resource. - * - * @param {string} folderSourceLocationFindingSecurityMarksName - * A fully-qualified path representing folder_source_location_finding_securityMarks resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderSourceLocationFindingSecurityMarksName(folderSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match(folderSourceLocationFindingSecurityMarksName).folder; - } - - /** - * Parse the source from FolderSourceLocationFindingSecurityMarks resource. - * - * @param {string} folderSourceLocationFindingSecurityMarksName - * A fully-qualified path representing folder_source_location_finding_securityMarks resource. - * @returns {string} A string representing the source. - */ - matchSourceFromFolderSourceLocationFindingSecurityMarksName(folderSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match(folderSourceLocationFindingSecurityMarksName).source; - } - - /** - * Parse the location from FolderSourceLocationFindingSecurityMarks resource. - * - * @param {string} folderSourceLocationFindingSecurityMarksName - * A fully-qualified path representing folder_source_location_finding_securityMarks resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFolderSourceLocationFindingSecurityMarksName(folderSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match(folderSourceLocationFindingSecurityMarksName).location; - } - - /** - * Parse the finding from FolderSourceLocationFindingSecurityMarks resource. - * - * @param {string} folderSourceLocationFindingSecurityMarksName - * A fully-qualified path representing folder_source_location_finding_securityMarks resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromFolderSourceLocationFindingSecurityMarksName(folderSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match(folderSourceLocationFindingSecurityMarksName).finding; - } - - /** - * Return a fully-qualified folderSourceLocationFindings resource name string. - * - * @param {string} folder - * @param {string} source - * @param {string} location - * @param {string} finding - * @returns {string} Resource name string. - */ - folderSourceLocationFindingsPath(folder:string,source:string,location:string,finding:string) { - return this.pathTemplates.folderSourceLocationFindingsPathTemplate.render({ - folder: folder, - source: source, - location: location, - finding: finding, - }); - } - - /** - * Parse the folder from FolderSourceLocationFindings resource. - * - * @param {string} folderSourceLocationFindingsName - * A fully-qualified path representing folder_source_location_findings resource. - * @returns {string} A string representing the folder. - */ - matchFolderFromFolderSourceLocationFindingsName(folderSourceLocationFindingsName: string) { - return this.pathTemplates.folderSourceLocationFindingsPathTemplate.match(folderSourceLocationFindingsName).folder; - } - - /** - * Parse the source from FolderSourceLocationFindings resource. - * - * @param {string} folderSourceLocationFindingsName - * A fully-qualified path representing folder_source_location_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromFolderSourceLocationFindingsName(folderSourceLocationFindingsName: string) { - return this.pathTemplates.folderSourceLocationFindingsPathTemplate.match(folderSourceLocationFindingsName).source; - } - - /** - * Parse the location from FolderSourceLocationFindings resource. - * - * @param {string} folderSourceLocationFindingsName - * A fully-qualified path representing folder_source_location_findings resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFolderSourceLocationFindingsName(folderSourceLocationFindingsName: string) { - return this.pathTemplates.folderSourceLocationFindingsPathTemplate.match(folderSourceLocationFindingsName).location; - } - - /** - * Parse the finding from FolderSourceLocationFindings resource. - * - * @param {string} folderSourceLocationFindingsName - * A fully-qualified path representing folder_source_location_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromFolderSourceLocationFindingsName(folderSourceLocationFindingsName: string) { - return this.pathTemplates.folderSourceLocationFindingsPathTemplate.match(folderSourceLocationFindingsName).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: 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 organizationAssetSecurityMarks resource name string. - * - * @param {string} organization - * @param {string} asset - * @returns {string} Resource name string. - */ - organizationAssetSecurityMarksPath(organization:string,asset:string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render({ - organization: organization, - asset: asset, - }); - } - - /** - * Parse the organization from OrganizationAssetSecurityMarks resource. - * - * @param {string} organizationAssetSecurityMarksName - * A fully-qualified path representing organization_asset_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).organization; - } - - /** - * Parse the asset from OrganizationAssetSecurityMarks resource. - * - * @param {string} organizationAssetSecurityMarksName - * A fully-qualified path representing organization_asset_securityMarks resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string) { - return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match(organizationAssetSecurityMarksName).asset; - } - - /** - * Return a fully-qualified organizationConstraintName resource name string. - * - * @param {string} organization - * @param {string} constraint_name - * @returns {string} Resource name string. - */ - organizationConstraintNamePath(organization:string,constraintName:string) { - return this.pathTemplates.organizationConstraintNamePathTemplate.render({ - organization: organization, - constraint_name: constraintName, - }); - } - - /** - * Parse the organization from OrganizationConstraintName resource. - * - * @param {string} organizationConstraintNameName - * A fully-qualified path representing organization_constraint_name resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationConstraintNameName(organizationConstraintNameName: string) { - return this.pathTemplates.organizationConstraintNamePathTemplate.match(organizationConstraintNameName).organization; - } - - /** - * Parse the constraint_name from OrganizationConstraintName resource. - * - * @param {string} organizationConstraintNameName - * A fully-qualified path representing organization_constraint_name resource. - * @returns {string} A string representing the constraint_name. - */ - matchConstraintNameFromOrganizationConstraintNameName(organizationConstraintNameName: string) { - return this.pathTemplates.organizationConstraintNamePathTemplate.match(organizationConstraintNameName).constraint_name; - } - - /** - * Return a fully-qualified organizationLocation resource name string. - * - * @param {string} organization - * @param {string} location - * @returns {string} Resource name string. - */ - organizationLocationPath(organization:string,location:string) { - return this.pathTemplates.organizationLocationPathTemplate.render({ - organization: organization, - location: location, - }); - } - - /** - * Parse the organization from OrganizationLocation resource. - * - * @param {string} organizationLocationName - * A fully-qualified path representing OrganizationLocation resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationName(organizationLocationName: string) { - return this.pathTemplates.organizationLocationPathTemplate.match(organizationLocationName).organization; - } - - /** - * Parse the location from OrganizationLocation resource. - * - * @param {string} organizationLocationName - * A fully-qualified path representing OrganizationLocation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationName(organizationLocationName: string) { - return this.pathTemplates.organizationLocationPathTemplate.match(organizationLocationName).location; - } - - /** - * Return a fully-qualified organizationLocationBigQueryExports resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} exportParam - * @returns {string} Resource name string. - */ - organizationLocationBigQueryExportsPath(organization:string,location:string,exportParam:string) { - return this.pathTemplates.organizationLocationBigQueryExportsPathTemplate.render({ - organization: organization, - location: location, - export: exportParam, - }); - } - - /** - * Parse the organization from OrganizationLocationBigQueryExports resource. - * - * @param {string} organizationLocationBigQueryExportsName - * A fully-qualified path representing organization_location_bigQueryExports resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationBigQueryExportsName(organizationLocationBigQueryExportsName: string) { - return this.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match(organizationLocationBigQueryExportsName).organization; - } - - /** - * Parse the location from OrganizationLocationBigQueryExports resource. - * - * @param {string} organizationLocationBigQueryExportsName - * A fully-qualified path representing organization_location_bigQueryExports resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationBigQueryExportsName(organizationLocationBigQueryExportsName: string) { - return this.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match(organizationLocationBigQueryExportsName).location; - } - - /** - * Parse the export from OrganizationLocationBigQueryExports resource. - * - * @param {string} organizationLocationBigQueryExportsName - * A fully-qualified path representing organization_location_bigQueryExports resource. - * @returns {string} A string representing the export. - */ - matchExportFromOrganizationLocationBigQueryExportsName(organizationLocationBigQueryExportsName: string) { - return this.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match(organizationLocationBigQueryExportsName).export; - } - - /** - * Return a fully-qualified organizationLocationMuteConfigs resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} mute_config - * @returns {string} Resource name string. - */ - organizationLocationMuteConfigsPath(organization:string,location:string,muteConfig:string) { - return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.render({ - organization: organization, - location: location, - mute_config: muteConfig, - }); - } - - /** - * Parse the organization from OrganizationLocationMuteConfigs resource. - * - * @param {string} organizationLocationMuteConfigsName - * A fully-qualified path representing organization_location_muteConfigs resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { - return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).organization; - } - - /** - * Parse the location from OrganizationLocationMuteConfigs resource. - * - * @param {string} organizationLocationMuteConfigsName - * A fully-qualified path representing organization_location_muteConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { - return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).location; - } - - /** - * Parse the mute_config from OrganizationLocationMuteConfigs resource. - * - * @param {string} organizationLocationMuteConfigsName - * A fully-qualified path representing organization_location_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromOrganizationLocationMuteConfigsName(organizationLocationMuteConfigsName: string) { - return this.pathTemplates.organizationLocationMuteConfigsPathTemplate.match(organizationLocationMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified organizationLocationNotificationConfigs resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} notification_config - * @returns {string} Resource name string. - */ - organizationLocationNotificationConfigsPath(organization:string,location:string,notificationConfig:string) { - return this.pathTemplates.organizationLocationNotificationConfigsPathTemplate.render({ - organization: organization, - location: location, - notification_config: notificationConfig, - }); - } - - /** - * Parse the organization from OrganizationLocationNotificationConfigs resource. - * - * @param {string} organizationLocationNotificationConfigsName - * A fully-qualified path representing organization_location_notificationConfigs resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationNotificationConfigsName(organizationLocationNotificationConfigsName: string) { - return this.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match(organizationLocationNotificationConfigsName).organization; - } - - /** - * Parse the location from OrganizationLocationNotificationConfigs resource. - * - * @param {string} organizationLocationNotificationConfigsName - * A fully-qualified path representing organization_location_notificationConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationNotificationConfigsName(organizationLocationNotificationConfigsName: string) { - return this.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match(organizationLocationNotificationConfigsName).location; - } - - /** - * Parse the notification_config from OrganizationLocationNotificationConfigs resource. - * - * @param {string} organizationLocationNotificationConfigsName - * A fully-qualified path representing organization_location_notificationConfigs resource. - * @returns {string} A string representing the notification_config. - */ - matchNotificationConfigFromOrganizationLocationNotificationConfigsName(organizationLocationNotificationConfigsName: string) { - return this.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match(organizationLocationNotificationConfigsName).notification_config; - } - - /** - * Return a fully-qualified organizationLocationResourceValueConfigs resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} resource_value_config - * @returns {string} Resource name string. - */ - organizationLocationResourceValueConfigsPath(organization:string,location:string,resourceValueConfig:string) { - return this.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.render({ - organization: organization, - location: location, - resource_value_config: resourceValueConfig, - }); - } - - /** - * Parse the organization from OrganizationLocationResourceValueConfigs resource. - * - * @param {string} organizationLocationResourceValueConfigsName - * A fully-qualified path representing organization_location_resourceValueConfigs resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationResourceValueConfigsName(organizationLocationResourceValueConfigsName: string) { - return this.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match(organizationLocationResourceValueConfigsName).organization; - } - - /** - * Parse the location from OrganizationLocationResourceValueConfigs resource. - * - * @param {string} organizationLocationResourceValueConfigsName - * A fully-qualified path representing organization_location_resourceValueConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationResourceValueConfigsName(organizationLocationResourceValueConfigsName: string) { - return this.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match(organizationLocationResourceValueConfigsName).location; - } - - /** - * Parse the resource_value_config from OrganizationLocationResourceValueConfigs resource. - * - * @param {string} organizationLocationResourceValueConfigsName - * A fully-qualified path representing organization_location_resourceValueConfigs resource. - * @returns {string} A string representing the resource_value_config. - */ - matchResourceValueConfigFromOrganizationLocationResourceValueConfigsName(organizationLocationResourceValueConfigsName: string) { - return this.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match(organizationLocationResourceValueConfigsName).resource_value_config; - } - - /** - * Return a fully-qualified organizationLocationSimluationValuedResources resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} simluation - * @param {string} valued_resource - * @returns {string} Resource name string. - */ - organizationLocationSimluationValuedResourcesPath(organization:string,location:string,simluation:string,valuedResource:string) { - return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.render({ - organization: organization, - location: location, - simluation: simluation, - valued_resource: valuedResource, - }); - } - - /** - * Parse the organization from OrganizationLocationSimluationValuedResources resource. - * - * @param {string} organizationLocationSimluationValuedResourcesName - * A fully-qualified path representing organization_location_simluation_valuedResources resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationSimluationValuedResourcesName(organizationLocationSimluationValuedResourcesName: string) { - return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match(organizationLocationSimluationValuedResourcesName).organization; - } - - /** - * Parse the location from OrganizationLocationSimluationValuedResources resource. - * - * @param {string} organizationLocationSimluationValuedResourcesName - * A fully-qualified path representing organization_location_simluation_valuedResources resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationSimluationValuedResourcesName(organizationLocationSimluationValuedResourcesName: string) { - return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match(organizationLocationSimluationValuedResourcesName).location; - } - - /** - * Parse the simluation from OrganizationLocationSimluationValuedResources resource. - * - * @param {string} organizationLocationSimluationValuedResourcesName - * A fully-qualified path representing organization_location_simluation_valuedResources resource. - * @returns {string} A string representing the simluation. - */ - matchSimluationFromOrganizationLocationSimluationValuedResourcesName(organizationLocationSimluationValuedResourcesName: string) { - return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match(organizationLocationSimluationValuedResourcesName).simluation; - } - - /** - * Parse the valued_resource from OrganizationLocationSimluationValuedResources resource. - * - * @param {string} organizationLocationSimluationValuedResourcesName - * A fully-qualified path representing organization_location_simluation_valuedResources resource. - * @returns {string} A string representing the valued_resource. - */ - matchValuedResourceFromOrganizationLocationSimluationValuedResourcesName(organizationLocationSimluationValuedResourcesName: string) { - return this.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match(organizationLocationSimluationValuedResourcesName).valued_resource; - } - - /** - * Return a fully-qualified organizationLocationSimulationValuedResourceAttackPaths resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} simulation - * @param {string} valued_resource - * @param {string} attack_path - * @returns {string} Resource name string. - */ - organizationLocationSimulationValuedResourceAttackPathsPath(organization:string,location:string,simulation:string,valuedResource:string,attackPath:string) { - return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.render({ - organization: organization, - location: location, - simulation: simulation, - valued_resource: valuedResource, - attack_path: attackPath, - }); - } - - /** - * Parse the organization from OrganizationLocationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationLocationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).organization; - } - - /** - * Parse the location from OrganizationLocationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationLocationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).location; - } - - /** - * Parse the simulation from OrganizationLocationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationLocationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the simulation. - */ - matchSimulationFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).simulation; - } - - /** - * Parse the valued_resource from OrganizationLocationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationLocationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the valued_resource. - */ - matchValuedResourceFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).valued_resource; - } - - /** - * Parse the attack_path from OrganizationLocationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationLocationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_location_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the attack_path. - */ - matchAttackPathFromOrganizationLocationSimulationValuedResourceAttackPathsName(organizationLocationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match(organizationLocationSimulationValuedResourceAttackPathsName).attack_path; - } - - /** - * Return a fully-qualified organizationLocationSimulations resource name string. - * - * @param {string} organization - * @param {string} location - * @param {string} simluation - * @returns {string} Resource name string. - */ - organizationLocationSimulationsPath(organization:string,location:string,simluation:string) { - return this.pathTemplates.organizationLocationSimulationsPathTemplate.render({ - organization: organization, - location: location, - simluation: simluation, - }); - } - - /** - * Parse the organization from OrganizationLocationSimulations resource. - * - * @param {string} organizationLocationSimulationsName - * A fully-qualified path representing organization_location_simulations resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationLocationSimulationsName(organizationLocationSimulationsName: string) { - return this.pathTemplates.organizationLocationSimulationsPathTemplate.match(organizationLocationSimulationsName).organization; - } - - /** - * Parse the location from OrganizationLocationSimulations resource. - * - * @param {string} organizationLocationSimulationsName - * A fully-qualified path representing organization_location_simulations resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationLocationSimulationsName(organizationLocationSimulationsName: string) { - return this.pathTemplates.organizationLocationSimulationsPathTemplate.match(organizationLocationSimulationsName).location; - } - - /** - * Parse the simluation from OrganizationLocationSimulations resource. - * - * @param {string} organizationLocationSimulationsName - * A fully-qualified path representing organization_location_simulations resource. - * @returns {string} A string representing the simluation. - */ - matchSimluationFromOrganizationLocationSimulationsName(organizationLocationSimulationsName: string) { - return this.pathTemplates.organizationLocationSimulationsPathTemplate.match(organizationLocationSimulationsName).simluation; - } - - /** - * Return a fully-qualified organizationMuteConfigs resource name string. - * - * @param {string} organization - * @param {string} mute_config - * @returns {string} Resource name string. - */ - organizationMuteConfigsPath(organization:string,muteConfig:string) { - return this.pathTemplates.organizationMuteConfigsPathTemplate.render({ - organization: organization, - mute_config: muteConfig, - }); - } - - /** - * Parse the organization from OrganizationMuteConfigs resource. - * - * @param {string} organizationMuteConfigsName - * A fully-qualified path representing organization_muteConfigs resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationMuteConfigsName(organizationMuteConfigsName: string) { - return this.pathTemplates.organizationMuteConfigsPathTemplate.match(organizationMuteConfigsName).organization; - } - - /** - * Parse the mute_config from OrganizationMuteConfigs resource. - * - * @param {string} organizationMuteConfigsName - * A fully-qualified path representing organization_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromOrganizationMuteConfigsName(organizationMuteConfigsName: string) { - return this.pathTemplates.organizationMuteConfigsPathTemplate.match(organizationMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified organizationResourceValueConfigs resource name string. - * - * @param {string} organization - * @param {string} resource_value_config - * @returns {string} Resource name string. - */ - organizationResourceValueConfigsPath(organization:string,resourceValueConfig:string) { - return this.pathTemplates.organizationResourceValueConfigsPathTemplate.render({ - organization: organization, - resource_value_config: resourceValueConfig, - }); - } - - /** - * Parse the organization from OrganizationResourceValueConfigs resource. - * - * @param {string} organizationResourceValueConfigsName - * A fully-qualified path representing organization_resourceValueConfigs resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationResourceValueConfigsName(organizationResourceValueConfigsName: string) { - return this.pathTemplates.organizationResourceValueConfigsPathTemplate.match(organizationResourceValueConfigsName).organization; - } - - /** - * Parse the resource_value_config from OrganizationResourceValueConfigs resource. - * - * @param {string} organizationResourceValueConfigsName - * A fully-qualified path representing organization_resourceValueConfigs resource. - * @returns {string} A string representing the resource_value_config. - */ - matchResourceValueConfigFromOrganizationResourceValueConfigsName(organizationResourceValueConfigsName: string) { - return this.pathTemplates.organizationResourceValueConfigsPathTemplate.match(organizationResourceValueConfigsName).resource_value_config; - } - - /** - * Return a fully-qualified organizationSimulationValuedResourceAttackPaths resource name string. - * - * @param {string} organization - * @param {string} simulation - * @param {string} valued_resource - * @param {string} attack_path - * @returns {string} Resource name string. - */ - organizationSimulationValuedResourceAttackPathsPath(organization:string,simulation:string,valuedResource:string,attackPath:string) { - return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.render({ - organization: organization, - simulation: simulation, - valued_resource: valuedResource, - attack_path: attackPath, - }); - } - - /** - * Parse the organization from OrganizationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSimulationValuedResourceAttackPathsName(organizationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match(organizationSimulationValuedResourceAttackPathsName).organization; - } - - /** - * Parse the simulation from OrganizationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the simulation. - */ - matchSimulationFromOrganizationSimulationValuedResourceAttackPathsName(organizationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match(organizationSimulationValuedResourceAttackPathsName).simulation; - } - - /** - * Parse the valued_resource from OrganizationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the valued_resource. - */ - matchValuedResourceFromOrganizationSimulationValuedResourceAttackPathsName(organizationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match(organizationSimulationValuedResourceAttackPathsName).valued_resource; - } - - /** - * Parse the attack_path from OrganizationSimulationValuedResourceAttackPaths resource. - * - * @param {string} organizationSimulationValuedResourceAttackPathsName - * A fully-qualified path representing organization_simulation_valued_resource_attackPaths resource. - * @returns {string} A string representing the attack_path. - */ - matchAttackPathFromOrganizationSimulationValuedResourceAttackPathsName(organizationSimulationValuedResourceAttackPathsName: string) { - return this.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match(organizationSimulationValuedResourceAttackPathsName).attack_path; - } - - /** - * Return a fully-qualified organizationSimulationValuedResources resource name string. - * - * @param {string} organization - * @param {string} simulation - * @param {string} valued_resource - * @returns {string} Resource name string. - */ - organizationSimulationValuedResourcesPath(organization:string,simulation:string,valuedResource:string) { - return this.pathTemplates.organizationSimulationValuedResourcesPathTemplate.render({ - organization: organization, - simulation: simulation, - valued_resource: valuedResource, - }); - } - - /** - * Parse the organization from OrganizationSimulationValuedResources resource. - * - * @param {string} organizationSimulationValuedResourcesName - * A fully-qualified path representing organization_simulation_valuedResources resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSimulationValuedResourcesName(organizationSimulationValuedResourcesName: string) { - return this.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match(organizationSimulationValuedResourcesName).organization; - } - - /** - * Parse the simulation from OrganizationSimulationValuedResources resource. - * - * @param {string} organizationSimulationValuedResourcesName - * A fully-qualified path representing organization_simulation_valuedResources resource. - * @returns {string} A string representing the simulation. - */ - matchSimulationFromOrganizationSimulationValuedResourcesName(organizationSimulationValuedResourcesName: string) { - return this.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match(organizationSimulationValuedResourcesName).simulation; - } - - /** - * Parse the valued_resource from OrganizationSimulationValuedResources resource. - * - * @param {string} organizationSimulationValuedResourcesName - * A fully-qualified path representing organization_simulation_valuedResources resource. - * @returns {string} A string representing the valued_resource. - */ - matchValuedResourceFromOrganizationSimulationValuedResourcesName(organizationSimulationValuedResourcesName: string) { - return this.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match(organizationSimulationValuedResourcesName).valued_resource; - } - - /** - * Return a fully-qualified organizationSimulations resource name string. - * - * @param {string} organization - * @param {string} simulation - * @returns {string} Resource name string. - */ - organizationSimulationsPath(organization:string,simulation:string) { - return this.pathTemplates.organizationSimulationsPathTemplate.render({ - organization: organization, - simulation: simulation, - }); - } - - /** - * Parse the organization from OrganizationSimulations resource. - * - * @param {string} organizationSimulationsName - * A fully-qualified path representing organization_simulations resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSimulationsName(organizationSimulationsName: string) { - return this.pathTemplates.organizationSimulationsPathTemplate.match(organizationSimulationsName).organization; - } - - /** - * Parse the simulation from OrganizationSimulations resource. - * - * @param {string} organizationSimulationsName - * A fully-qualified path representing organization_simulations resource. - * @returns {string} A string representing the simulation. - */ - matchSimulationFromOrganizationSimulationsName(organizationSimulationsName: string) { - return this.pathTemplates.organizationSimulationsPathTemplate.match(organizationSimulationsName).simulation; - } - - /** - * 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 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. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceFindingSecurityMarksPath(organization:string,source:string,finding:string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); - } - - /** - * Parse the organization from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).organization; - } - - /** - * Parse the source from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).source; - } - - /** - * Parse the finding from OrganizationSourceFindingSecurityMarks resource. - * - * @param {string} organizationSourceFindingSecurityMarksName - * A fully-qualified path representing organization_source_finding_securityMarks resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match(organizationSourceFindingSecurityMarksName).finding; - } - - /** - * Return a fully-qualified organizationSourceFindings resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceFindingsPath(organization:string,source:string,finding:string) { - return this.pathTemplates.organizationSourceFindingsPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); - } - - /** - * Parse the organization from OrganizationSourceFindings resource. - * - * @param {string} organizationSourceFindingsName - * A fully-qualified path representing organization_source_findings resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { - return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).organization; - } - - /** - * Parse the source from OrganizationSourceFindings resource. - * - * @param {string} organizationSourceFindingsName - * A fully-qualified path representing organization_source_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { - return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).source; - } - - /** - * Parse the finding from OrganizationSourceFindings resource. - * - * @param {string} organizationSourceFindingsName - * A fully-qualified path representing organization_source_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingsName(organizationSourceFindingsName: string) { - return this.pathTemplates.organizationSourceFindingsPathTemplate.match(organizationSourceFindingsName).finding; - } - - /** - * Return a fully-qualified organizationSourceLocationFindingExternalsystem resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} location - * @param {string} finding - * @param {string} externalsystem - * @returns {string} Resource name string. - */ - organizationSourceLocationFindingExternalsystemPath(organization:string,source:string,location:string,finding:string,externalsystem:string) { - return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.render({ - organization: organization, - source: source, - location: location, - finding: finding, - externalsystem: externalsystem, - }); - } - - /** - * Parse the organization from OrganizationSourceLocationFindingExternalsystem resource. - * - * @param {string} organizationSourceLocationFindingExternalsystemName - * A fully-qualified path representing organization_source_location_finding_externalsystem resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).organization; - } - - /** - * Parse the source from OrganizationSourceLocationFindingExternalsystem resource. - * - * @param {string} organizationSourceLocationFindingExternalsystemName - * A fully-qualified path representing organization_source_location_finding_externalsystem resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).source; - } - - /** - * Parse the location from OrganizationSourceLocationFindingExternalsystem resource. - * - * @param {string} organizationSourceLocationFindingExternalsystemName - * A fully-qualified path representing organization_source_location_finding_externalsystem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).location; - } - - /** - * Parse the finding from OrganizationSourceLocationFindingExternalsystem resource. - * - * @param {string} organizationSourceLocationFindingExternalsystemName - * A fully-qualified path representing organization_source_location_finding_externalsystem resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).finding; - } - - /** - * Parse the externalsystem from OrganizationSourceLocationFindingExternalsystem resource. - * - * @param {string} organizationSourceLocationFindingExternalsystemName - * A fully-qualified path representing organization_source_location_finding_externalsystem resource. - * @returns {string} A string representing the externalsystem. - */ - matchExternalsystemFromOrganizationSourceLocationFindingExternalsystemName(organizationSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match(organizationSourceLocationFindingExternalsystemName).externalsystem; - } - - /** - * Return a fully-qualified organizationSourceLocationFindingSecurityMarks resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} location - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceLocationFindingSecurityMarksPath(organization:string,source:string,location:string,finding:string) { - return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.render({ - organization: organization, - source: source, - location: location, - finding: finding, - }); - } - - /** - * Parse the organization from OrganizationSourceLocationFindingSecurityMarks resource. - * - * @param {string} organizationSourceLocationFindingSecurityMarksName - * A fully-qualified path representing organization_source_location_finding_securityMarks resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceLocationFindingSecurityMarksName(organizationSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match(organizationSourceLocationFindingSecurityMarksName).organization; - } - - /** - * Parse the source from OrganizationSourceLocationFindingSecurityMarks resource. - * - * @param {string} organizationSourceLocationFindingSecurityMarksName - * A fully-qualified path representing organization_source_location_finding_securityMarks resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceLocationFindingSecurityMarksName(organizationSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match(organizationSourceLocationFindingSecurityMarksName).source; - } - - /** - * Parse the location from OrganizationSourceLocationFindingSecurityMarks resource. - * - * @param {string} organizationSourceLocationFindingSecurityMarksName - * A fully-qualified path representing organization_source_location_finding_securityMarks resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationSourceLocationFindingSecurityMarksName(organizationSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match(organizationSourceLocationFindingSecurityMarksName).location; - } - - /** - * Parse the finding from OrganizationSourceLocationFindingSecurityMarks resource. - * - * @param {string} organizationSourceLocationFindingSecurityMarksName - * A fully-qualified path representing organization_source_location_finding_securityMarks resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceLocationFindingSecurityMarksName(organizationSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match(organizationSourceLocationFindingSecurityMarksName).finding; - } - - /** - * Return a fully-qualified organizationSourceLocationFindings resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} location - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceLocationFindingsPath(organization:string,source:string,location:string,finding:string) { - return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.render({ - organization: organization, - source: source, - location: location, - finding: finding, - }); - } - - /** - * Parse the organization from OrganizationSourceLocationFindings resource. - * - * @param {string} organizationSourceLocationFindingsName - * A fully-qualified path representing organization_source_location_findings resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceLocationFindingsName(organizationSourceLocationFindingsName: string) { - return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.match(organizationSourceLocationFindingsName).organization; - } - - /** - * Parse the source from OrganizationSourceLocationFindings resource. - * - * @param {string} organizationSourceLocationFindingsName - * A fully-qualified path representing organization_source_location_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceLocationFindingsName(organizationSourceLocationFindingsName: string) { - return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.match(organizationSourceLocationFindingsName).source; - } - - /** - * Parse the location from OrganizationSourceLocationFindings resource. - * - * @param {string} organizationSourceLocationFindingsName - * A fully-qualified path representing organization_source_location_findings resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOrganizationSourceLocationFindingsName(organizationSourceLocationFindingsName: string) { - return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.match(organizationSourceLocationFindingsName).location; - } - - /** - * Parse the finding from OrganizationSourceLocationFindings resource. - * - * @param {string} organizationSourceLocationFindingsName - * A fully-qualified path representing organization_source_location_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceLocationFindingsName(organizationSourceLocationFindingsName: string) { - return this.pathTemplates.organizationSourceLocationFindingsPathTemplate.match(organizationSourceLocationFindingsName).finding; - } - - /** - * 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 projectConstraintName resource name string. - * - * @param {string} project - * @param {string} constraint_name - * @returns {string} Resource name string. - */ - projectConstraintNamePath(project:string,constraintName:string) { - return this.pathTemplates.projectConstraintNamePathTemplate.render({ - project: project, - constraint_name: constraintName, - }); - } - - /** - * Parse the project from ProjectConstraintName resource. - * - * @param {string} projectConstraintNameName - * A fully-qualified path representing project_constraint_name resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectConstraintNameName(projectConstraintNameName: string) { - return this.pathTemplates.projectConstraintNamePathTemplate.match(projectConstraintNameName).project; - } - - /** - * Parse the constraint_name from ProjectConstraintName resource. - * - * @param {string} projectConstraintNameName - * A fully-qualified path representing project_constraint_name resource. - * @returns {string} A string representing the constraint_name. - */ - matchConstraintNameFromProjectConstraintNameName(projectConstraintNameName: string) { - return this.pathTemplates.projectConstraintNamePathTemplate.match(projectConstraintNameName).constraint_name; - } - - /** - * Return a fully-qualified projectLocationBigQueryExports resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} exportParam - * @returns {string} Resource name string. - */ - projectLocationBigQueryExportsPath(project:string,location:string,exportParam:string) { - return this.pathTemplates.projectLocationBigQueryExportsPathTemplate.render({ - project: project, - location: location, - export: exportParam, - }); - } - - /** - * Parse the project from ProjectLocationBigQueryExports resource. - * - * @param {string} projectLocationBigQueryExportsName - * A fully-qualified path representing project_location_bigQueryExports resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationBigQueryExportsName(projectLocationBigQueryExportsName: string) { - return this.pathTemplates.projectLocationBigQueryExportsPathTemplate.match(projectLocationBigQueryExportsName).project; - } - - /** - * Parse the location from ProjectLocationBigQueryExports resource. - * - * @param {string} projectLocationBigQueryExportsName - * A fully-qualified path representing project_location_bigQueryExports resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationBigQueryExportsName(projectLocationBigQueryExportsName: string) { - return this.pathTemplates.projectLocationBigQueryExportsPathTemplate.match(projectLocationBigQueryExportsName).location; - } - - /** - * Parse the export from ProjectLocationBigQueryExports resource. - * - * @param {string} projectLocationBigQueryExportsName - * A fully-qualified path representing project_location_bigQueryExports resource. - * @returns {string} A string representing the export. - */ - matchExportFromProjectLocationBigQueryExportsName(projectLocationBigQueryExportsName: string) { - return this.pathTemplates.projectLocationBigQueryExportsPathTemplate.match(projectLocationBigQueryExportsName).export; - } - - /** - * Return a fully-qualified projectLocationMuteConfigs resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} mute_config - * @returns {string} Resource name string. - */ - projectLocationMuteConfigsPath(project:string,location:string,muteConfig:string) { - return this.pathTemplates.projectLocationMuteConfigsPathTemplate.render({ - project: project, - location: location, - mute_config: muteConfig, - }); - } - - /** - * Parse the project from ProjectLocationMuteConfigs resource. - * - * @param {string} projectLocationMuteConfigsName - * A fully-qualified path representing project_location_muteConfigs resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { - return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).project; - } - - /** - * Parse the location from ProjectLocationMuteConfigs resource. - * - * @param {string} projectLocationMuteConfigsName - * A fully-qualified path representing project_location_muteConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { - return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).location; - } - - /** - * Parse the mute_config from ProjectLocationMuteConfigs resource. - * - * @param {string} projectLocationMuteConfigsName - * A fully-qualified path representing project_location_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromProjectLocationMuteConfigsName(projectLocationMuteConfigsName: string) { - return this.pathTemplates.projectLocationMuteConfigsPathTemplate.match(projectLocationMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified projectLocationNotificationConfigs resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} notification_config - * @returns {string} Resource name string. - */ - projectLocationNotificationConfigsPath(project:string,location:string,notificationConfig:string) { - return this.pathTemplates.projectLocationNotificationConfigsPathTemplate.render({ - project: project, - location: location, - notification_config: notificationConfig, - }); - } - - /** - * Parse the project from ProjectLocationNotificationConfigs resource. - * - * @param {string} projectLocationNotificationConfigsName - * A fully-qualified path representing project_location_notificationConfigs resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationNotificationConfigsName(projectLocationNotificationConfigsName: string) { - return this.pathTemplates.projectLocationNotificationConfigsPathTemplate.match(projectLocationNotificationConfigsName).project; - } - - /** - * Parse the location from ProjectLocationNotificationConfigs resource. - * - * @param {string} projectLocationNotificationConfigsName - * A fully-qualified path representing project_location_notificationConfigs resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationNotificationConfigsName(projectLocationNotificationConfigsName: string) { - return this.pathTemplates.projectLocationNotificationConfigsPathTemplate.match(projectLocationNotificationConfigsName).location; - } - - /** - * Parse the notification_config from ProjectLocationNotificationConfigs resource. - * - * @param {string} projectLocationNotificationConfigsName - * A fully-qualified path representing project_location_notificationConfigs resource. - * @returns {string} A string representing the notification_config. - */ - matchNotificationConfigFromProjectLocationNotificationConfigsName(projectLocationNotificationConfigsName: string) { - return this.pathTemplates.projectLocationNotificationConfigsPathTemplate.match(projectLocationNotificationConfigsName).notification_config; - } - - /** - * Return a fully-qualified projectMuteConfigs resource name string. - * - * @param {string} project - * @param {string} mute_config - * @returns {string} Resource name string. - */ - projectMuteConfigsPath(project:string,muteConfig:string) { - return this.pathTemplates.projectMuteConfigsPathTemplate.render({ - project: project, - mute_config: muteConfig, - }); - } - - /** - * Parse the project from ProjectMuteConfigs resource. - * - * @param {string} projectMuteConfigsName - * A fully-qualified path representing project_muteConfigs resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectMuteConfigsName(projectMuteConfigsName: string) { - return this.pathTemplates.projectMuteConfigsPathTemplate.match(projectMuteConfigsName).project; - } - - /** - * Parse the mute_config from ProjectMuteConfigs resource. - * - * @param {string} projectMuteConfigsName - * A fully-qualified path representing project_muteConfigs resource. - * @returns {string} A string representing the mute_config. - */ - matchMuteConfigFromProjectMuteConfigsName(projectMuteConfigsName: string) { - return this.pathTemplates.projectMuteConfigsPathTemplate.match(projectMuteConfigsName).mute_config; - } - - /** - * Return a fully-qualified projectSource resource name string. - * - * @param {string} project - * @param {string} source - * @returns {string} Resource name string. - */ - projectSourcePath(project:string,source:string) { - return this.pathTemplates.projectSourcePathTemplate.render({ - project: project, - source: source, - }); - } - - /** - * Parse the project from ProjectSource resource. - * - * @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 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. - * - * @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 ProjectSourceFindingSecurityMarks resource. - * - * @param {string} projectSourceFindingSecurityMarksName - * A fully-qualified path representing project_source_finding_securityMarks resource. - * @returns {string} A string representing the 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; - } - - /** - * Return a fully-qualified projectSourceFindings resource name string. - * - * @param {string} project - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - projectSourceFindingsPath(project:string,source:string,finding:string) { - return this.pathTemplates.projectSourceFindingsPathTemplate.render({ - project: project, - source: source, - finding: finding, - }); - } - - /** - * Parse the project from ProjectSourceFindings resource. - * - * @param {string} projectSourceFindingsName - * A fully-qualified path representing project_source_findings resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectSourceFindingsName(projectSourceFindingsName: string) { - return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).project; - } - - /** - * Parse the source from ProjectSourceFindings resource. - * - * @param {string} projectSourceFindingsName - * A fully-qualified path representing project_source_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromProjectSourceFindingsName(projectSourceFindingsName: string) { - return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).source; - } - - /** - * Parse the finding from ProjectSourceFindings resource. - * - * @param {string} projectSourceFindingsName - * A fully-qualified path representing project_source_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromProjectSourceFindingsName(projectSourceFindingsName: string) { - return this.pathTemplates.projectSourceFindingsPathTemplate.match(projectSourceFindingsName).finding; - } - - /** - * Return a fully-qualified projectSourceLocationFindingExternalsystem resource name string. - * - * @param {string} project - * @param {string} source - * @param {string} location - * @param {string} finding - * @param {string} externalsystem - * @returns {string} Resource name string. - */ - projectSourceLocationFindingExternalsystemPath(project:string,source:string,location:string,finding:string,externalsystem:string) { - return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.render({ - project: project, - source: source, - location: location, - finding: finding, - externalsystem: externalsystem, - }); - } - - /** - * Parse the project from ProjectSourceLocationFindingExternalsystem resource. - * - * @param {string} projectSourceLocationFindingExternalsystemName - * A fully-qualified path representing project_source_location_finding_externalsystem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).project; - } - - /** - * Parse the source from ProjectSourceLocationFindingExternalsystem resource. - * - * @param {string} projectSourceLocationFindingExternalsystemName - * A fully-qualified path representing project_source_location_finding_externalsystem resource. - * @returns {string} A string representing the source. - */ - matchSourceFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).source; - } - - /** - * Parse the location from ProjectSourceLocationFindingExternalsystem resource. - * - * @param {string} projectSourceLocationFindingExternalsystemName - * A fully-qualified path representing project_source_location_finding_externalsystem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).location; - } - - /** - * Parse the finding from ProjectSourceLocationFindingExternalsystem resource. - * - * @param {string} projectSourceLocationFindingExternalsystemName - * A fully-qualified path representing project_source_location_finding_externalsystem resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).finding; - } - - /** - * Parse the externalsystem from ProjectSourceLocationFindingExternalsystem resource. - * - * @param {string} projectSourceLocationFindingExternalsystemName - * A fully-qualified path representing project_source_location_finding_externalsystem resource. - * @returns {string} A string representing the externalsystem. - */ - matchExternalsystemFromProjectSourceLocationFindingExternalsystemName(projectSourceLocationFindingExternalsystemName: string) { - return this.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match(projectSourceLocationFindingExternalsystemName).externalsystem; - } - - /** - * Return a fully-qualified projectSourceLocationFindingSecurityMarks resource name string. - * - * @param {string} project - * @param {string} source - * @param {string} location - * @param {string} finding - * @returns {string} Resource name string. - */ - projectSourceLocationFindingSecurityMarksPath(project:string,source:string,location:string,finding:string) { - return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.render({ - project: project, - source: source, - location: location, - finding: finding, - }); - } - - /** - * Parse the project from ProjectSourceLocationFindingSecurityMarks resource. - * - * @param {string} projectSourceLocationFindingSecurityMarksName - * A fully-qualified path representing project_source_location_finding_securityMarks resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectSourceLocationFindingSecurityMarksName(projectSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match(projectSourceLocationFindingSecurityMarksName).project; - } - - /** - * Parse the source from ProjectSourceLocationFindingSecurityMarks resource. - * - * @param {string} projectSourceLocationFindingSecurityMarksName - * A fully-qualified path representing project_source_location_finding_securityMarks resource. - * @returns {string} A string representing the source. - */ - matchSourceFromProjectSourceLocationFindingSecurityMarksName(projectSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match(projectSourceLocationFindingSecurityMarksName).source; - } - - /** - * Parse the location from ProjectSourceLocationFindingSecurityMarks resource. - * - * @param {string} projectSourceLocationFindingSecurityMarksName - * A fully-qualified path representing project_source_location_finding_securityMarks resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectSourceLocationFindingSecurityMarksName(projectSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match(projectSourceLocationFindingSecurityMarksName).location; - } - - /** - * Parse the finding from ProjectSourceLocationFindingSecurityMarks resource. - * - * @param {string} projectSourceLocationFindingSecurityMarksName - * A fully-qualified path representing project_source_location_finding_securityMarks resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromProjectSourceLocationFindingSecurityMarksName(projectSourceLocationFindingSecurityMarksName: string) { - return this.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match(projectSourceLocationFindingSecurityMarksName).finding; - } - - /** - * Return a fully-qualified projectSourceLocationFindings resource name string. - * - * @param {string} project - * @param {string} source - * @param {string} location - * @param {string} finding - * @returns {string} Resource name string. - */ - projectSourceLocationFindingsPath(project:string,source:string,location:string,finding:string) { - return this.pathTemplates.projectSourceLocationFindingsPathTemplate.render({ - project: project, - source: source, - location: location, - finding: finding, - }); - } - - /** - * Parse the project from ProjectSourceLocationFindings resource. - * - * @param {string} projectSourceLocationFindingsName - * A fully-qualified path representing project_source_location_findings resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectSourceLocationFindingsName(projectSourceLocationFindingsName: string) { - return this.pathTemplates.projectSourceLocationFindingsPathTemplate.match(projectSourceLocationFindingsName).project; - } - - /** - * Parse the source from ProjectSourceLocationFindings resource. - * - * @param {string} projectSourceLocationFindingsName - * A fully-qualified path representing project_source_location_findings resource. - * @returns {string} A string representing the source. - */ - matchSourceFromProjectSourceLocationFindingsName(projectSourceLocationFindingsName: string) { - return this.pathTemplates.projectSourceLocationFindingsPathTemplate.match(projectSourceLocationFindingsName).source; - } - - /** - * Parse the location from ProjectSourceLocationFindings resource. - * - * @param {string} projectSourceLocationFindingsName - * A fully-qualified path representing project_source_location_findings resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectSourceLocationFindingsName(projectSourceLocationFindingsName: string) { - return this.pathTemplates.projectSourceLocationFindingsPathTemplate.match(projectSourceLocationFindingsName).location; - } - - /** - * Parse the finding from ProjectSourceLocationFindings resource. - * - * @param {string} projectSourceLocationFindingsName - * A fully-qualified path representing project_source_location_findings resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromProjectSourceLocationFindingsName(projectSourceLocationFindingsName: string) { - return this.pathTemplates.projectSourceLocationFindingsPathTemplate.match(projectSourceLocationFindingsName).finding; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.securityCenterStub && !this._terminated) { - return this.securityCenterStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client_config.json b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client_config.json deleted file mode 100644 index 22214ca4974..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_client_config.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "interfaces": { - "google.cloud.securitycenter.v2.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": { - "BatchCreateResourceValueConfigs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BulkMuteFindings": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateBigQueryExport": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateFinding": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateMuteConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateNotificationConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSource": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBigQueryExport": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteMuteConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteNotificationConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteResourceValueConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBigQueryExport": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSimulation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetValuedResource": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetMuteConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetNotificationConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetResourceValueConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSource": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GroupFindings": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListAttackPaths": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBigQueryExports": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListFindings": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListMuteConfigs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNotificationConfigs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListResourceValueConfigs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSources": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListValuedResources": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetFindingState": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetMute": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateBigQueryExport": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateExternalSystem": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateFinding": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateMuteConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateNotificationConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateResourceValueConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateSecurityMarks": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateSource": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_proto_list.json b/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_proto_list.json deleted file mode 100644 index 774021938b8..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/src/v2/security_center_proto_list.json +++ /dev/null @@ -1,57 +0,0 @@ -[ - "../../protos/google/cloud/securitycenter/v2/access.proto", - "../../protos/google/cloud/securitycenter/v2/affected_resources.proto", - "../../protos/google/cloud/securitycenter/v2/ai_model.proto", - "../../protos/google/cloud/securitycenter/v2/application.proto", - "../../protos/google/cloud/securitycenter/v2/attack_exposure.proto", - "../../protos/google/cloud/securitycenter/v2/attack_path.proto", - "../../protos/google/cloud/securitycenter/v2/backup_disaster_recovery.proto", - "../../protos/google/cloud/securitycenter/v2/bigquery_export.proto", - "../../protos/google/cloud/securitycenter/v2/chokepoint.proto", - "../../protos/google/cloud/securitycenter/v2/cloud_armor.proto", - "../../protos/google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto", - "../../protos/google/cloud/securitycenter/v2/cloud_dlp_inspection.proto", - "../../protos/google/cloud/securitycenter/v2/compliance.proto", - "../../protos/google/cloud/securitycenter/v2/connection.proto", - "../../protos/google/cloud/securitycenter/v2/contact_details.proto", - "../../protos/google/cloud/securitycenter/v2/container.proto", - "../../protos/google/cloud/securitycenter/v2/data_access_event.proto", - "../../protos/google/cloud/securitycenter/v2/data_flow_event.proto", - "../../protos/google/cloud/securitycenter/v2/data_retention_deletion_event.proto", - "../../protos/google/cloud/securitycenter/v2/database.proto", - "../../protos/google/cloud/securitycenter/v2/disk.proto", - "../../protos/google/cloud/securitycenter/v2/exfiltration.proto", - "../../protos/google/cloud/securitycenter/v2/external_system.proto", - "../../protos/google/cloud/securitycenter/v2/file.proto", - "../../protos/google/cloud/securitycenter/v2/finding.proto", - "../../protos/google/cloud/securitycenter/v2/folder.proto", - "../../protos/google/cloud/securitycenter/v2/group_membership.proto", - "../../protos/google/cloud/securitycenter/v2/iam_binding.proto", - "../../protos/google/cloud/securitycenter/v2/indicator.proto", - "../../protos/google/cloud/securitycenter/v2/ip_rules.proto", - "../../protos/google/cloud/securitycenter/v2/job.proto", - "../../protos/google/cloud/securitycenter/v2/kernel_rootkit.proto", - "../../protos/google/cloud/securitycenter/v2/kubernetes.proto", - "../../protos/google/cloud/securitycenter/v2/label.proto", - "../../protos/google/cloud/securitycenter/v2/load_balancer.proto", - "../../protos/google/cloud/securitycenter/v2/log_entry.proto", - "../../protos/google/cloud/securitycenter/v2/mitre_attack.proto", - "../../protos/google/cloud/securitycenter/v2/mute_config.proto", - "../../protos/google/cloud/securitycenter/v2/network.proto", - "../../protos/google/cloud/securitycenter/v2/notebook.proto", - "../../protos/google/cloud/securitycenter/v2/notification_config.proto", - "../../protos/google/cloud/securitycenter/v2/notification_message.proto", - "../../protos/google/cloud/securitycenter/v2/org_policy.proto", - "../../protos/google/cloud/securitycenter/v2/process.proto", - "../../protos/google/cloud/securitycenter/v2/resource.proto", - "../../protos/google/cloud/securitycenter/v2/resource_value_config.proto", - "../../protos/google/cloud/securitycenter/v2/security_marks.proto", - "../../protos/google/cloud/securitycenter/v2/security_posture.proto", - "../../protos/google/cloud/securitycenter/v2/securitycenter_service.proto", - "../../protos/google/cloud/securitycenter/v2/simulation.proto", - "../../protos/google/cloud/securitycenter/v2/source.proto", - "../../protos/google/cloud/securitycenter/v2/toxic_combination.proto", - "../../protos/google/cloud/securitycenter/v2/valued_resource.proto", - "../../protos/google/cloud/securitycenter/v2/vertex_ai.proto", - "../../protos/google/cloud/securitycenter/v2/vulnerability.proto" -] diff --git a/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 1e447cf1ff6..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index be57255cffa..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 {SecurityCenterClient} from '@google-cloud/security-center'; - -// check that the client class type name can be used -function doStuffWithSecurityCenterClient(client: SecurityCenterClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const securityCenterClient = new SecurityCenterClient(); - doStuffWithSecurityCenterClient(securityCenterClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-securitycenter/system-test/install.ts b/owl-bot-staging/google-cloud-securitycenter/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1.ts deleted file mode 100644 index 9d759b51456..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ /dev/null @@ -1,11894 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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) - .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', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new securitycenterModule.v1.SecurityCenterClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new securitycenterModule.v1.SecurityCenterClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = securitycenterModule.v1.SecurityCenterClient.servicePath; - assert.strictEqual(servicePath, 'securitycenter.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = securitycenterModule.v1.SecurityCenterClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new securitycenterModule.v1.SecurityCenterClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new securitycenterModule.v1.SecurityCenterClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new securitycenterModule.v1.SecurityCenterClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new securitycenterModule.v1.SecurityCenterClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new securitycenterModule.v1.SecurityCenterClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - 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 for the initialized client', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.securityCenterStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - 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(); - }).catch(err => {throw err}); - }); - - 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('createSecurityHealthAnalyticsCustomModule', () => { - it('invokes createSecurityHealthAnalyticsCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() - ); - client.innerApiCalls.createSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.createSecurityHealthAnalyticsCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecurityHealthAnalyticsCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() - ); - client.innerApiCalls.createSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSecurityHealthAnalyticsCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecurityHealthAnalyticsCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSecurityHealthAnalyticsCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecurityHealthAnalyticsCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createSecurityHealthAnalyticsCustomModule(request), expectedError); - }); - }); - - describe('createSource', () => { - it('invokes createSource without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createSource(request), expectedError); - }); - }); - - describe('createFinding', () => { - it('invokes createFinding without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createFinding(request), expectedError); - }); - }); - - describe('createMuteConfig', () => { - it('invokes createMuteConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateMuteConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() - ); - client.innerApiCalls.createMuteConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMuteConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IMuteConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateMuteConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createMuteConfig(request), expectedError); - }); - }); - - describe('createNotificationConfig', () => { - it('invokes createNotificationConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createNotificationConfig(request), expectedError); - }); - }); - - describe('deleteMuteConfig', () => { - it('invokes deleteMuteConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteMuteConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteMuteConfig( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteMuteConfig(request), expectedError); - }); - }); - - describe('deleteNotificationConfig', () => { - it('invokes deleteNotificationConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNotificationConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteNotificationConfig(request), expectedError); - }); - }); - - describe('deleteSecurityHealthAnalyticsCustomModule', () => { - it('invokes deleteSecurityHealthAnalyticsCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSecurityHealthAnalyticsCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSecurityHealthAnalyticsCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSecurityHealthAnalyticsCustomModule( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSecurityHealthAnalyticsCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSecurityHealthAnalyticsCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSecurityHealthAnalyticsCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteSecurityHealthAnalyticsCustomModule(request), expectedError); - }); - }); - - describe('getSimulation', () => { - it('invokes getSimulation without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSimulationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSimulationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Simulation() - ); - client.innerApiCalls.getSimulation = stubSimpleCall(expectedResponse); - const [response] = await client.getSimulation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSimulation without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSimulationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSimulationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Simulation() - ); - client.innerApiCalls.getSimulation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSimulation( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISimulation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSimulation with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSimulationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSimulationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSimulation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSimulation(request), expectedError); - const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSimulation with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSimulationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSimulationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSimulation(request), expectedError); - }); - }); - - describe('getValuedResource', () => { - it('invokes getValuedResource without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetValuedResourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetValuedResourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ValuedResource() - ); - client.innerApiCalls.getValuedResource = stubSimpleCall(expectedResponse); - const [response] = await client.getValuedResource(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getValuedResource without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetValuedResourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetValuedResourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ValuedResource() - ); - client.innerApiCalls.getValuedResource = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getValuedResource( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IValuedResource|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getValuedResource with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetValuedResourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetValuedResourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getValuedResource = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getValuedResource(request), expectedError); - const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getValuedResource with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetValuedResourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetValuedResourceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getValuedResource(request), expectedError); - }); - }); - - describe('getBigQueryExport', () => { - it('invokes getBigQueryExport without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBigQueryExport(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('getMuteConfig', () => { - it('invokes getMuteConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetMuteConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() - ); - client.innerApiCalls.getMuteConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMuteConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IMuteConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetMuteConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getMuteConfig(request), expectedError); - }); - }); - - describe('getNotificationConfig', () => { - it('invokes getNotificationConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getNotificationConfig(request), expectedError); - }); - }); - - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOrganizationSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOrganizationSettings(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getOrganizationSettings(request), expectedError); - }); - }); - - describe('getEffectiveSecurityHealthAnalyticsCustomModule', () => { - it('invokes getEffectiveSecurityHealthAnalyticsCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule() - ); - client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.getEffectiveSecurityHealthAnalyticsCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEffectiveSecurityHealthAnalyticsCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule() - ); - client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEffectiveSecurityHealthAnalyticsCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEffectiveSecurityHealthAnalyticsCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEffectiveSecurityHealthAnalyticsCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEffectiveSecurityHealthAnalyticsCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getEffectiveSecurityHealthAnalyticsCustomModule(request), expectedError); - }); - }); - - describe('getSecurityHealthAnalyticsCustomModule', () => { - it('invokes getSecurityHealthAnalyticsCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() - ); - client.innerApiCalls.getSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.getSecurityHealthAnalyticsCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSecurityHealthAnalyticsCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() - ); - client.innerApiCalls.getSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSecurityHealthAnalyticsCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSecurityHealthAnalyticsCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSecurityHealthAnalyticsCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSecurityHealthAnalyticsCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSecurityHealthAnalyticsCustomModule(request), expectedError); - }); - }); - - describe('getSource', () => { - it('invokes getSource without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSource(request), expectedError); - }); - }); - - describe('setFindingState', () => { - it('invokes setFindingState without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setFindingState(request), expectedError); - }); - }); - - describe('setMute', () => { - it('invokes setMute without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetMuteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetMuteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.SetMuteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Finding() - ); - client.innerApiCalls.setMute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMute( - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetMuteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetMuteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.SetMuteRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setMute(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('simulateSecurityHealthAnalyticsCustomModule', () => { - it('invokes simulateSecurityHealthAnalyticsCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse() - ); - client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.simulateSecurityHealthAnalyticsCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes simulateSecurityHealthAnalyticsCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse() - ); - client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.simulateSecurityHealthAnalyticsCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISimulateSecurityHealthAnalyticsCustomModuleResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes simulateSecurityHealthAnalyticsCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.simulateSecurityHealthAnalyticsCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.simulateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes simulateSecurityHealthAnalyticsCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.simulateSecurityHealthAnalyticsCustomModule(request), expectedError); - }); - }); - - describe('updateExternalSystem', () => { - it('invokes updateExternalSystem without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() - ); - request.externalSystem ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', ['externalSystem', 'name']); - request.externalSystem.name = defaultValue1; - const expectedHeaderRequestParams = `external_system.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() - ); - request.externalSystem ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', ['externalSystem', 'name']); - request.externalSystem.name = defaultValue1; - const expectedHeaderRequestParams = `external_system.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() - ); - request.externalSystem ??= {}; - 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'); - client.innerApiCalls.updateExternalSystem = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExternalSystem(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() - ); - request.externalSystem ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateExternalSystem(request), expectedError); - }); - }); - - describe('updateFinding', () => { - it('invokes updateFinding without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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 = 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() - ); - request.finding ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateFinding(request), expectedError); - }); - }); - - describe('updateMuteConfig', () => { - it('invokes updateMuteConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() - ); - request.muteConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() - ); - request.muteConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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 = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMuteConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IMuteConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() - ); - request.muteConfig ??= {}; - 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'); - client.innerApiCalls.updateMuteConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMuteConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() - ); - request.muteConfig ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateMuteConfig(request), expectedError); - }); - }); - - describe('updateNotificationConfig', () => { - it('invokes updateNotificationConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateNotificationConfig(request), expectedError); - }); - }); - - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateOrganizationSettings(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateOrganizationSettings(request), expectedError); - }); - }); - - describe('updateSecurityHealthAnalyticsCustomModule', () => { - it('invokes updateSecurityHealthAnalyticsCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest() - ); - request.securityHealthAnalyticsCustomModule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest', ['securityHealthAnalyticsCustomModule', 'name']); - request.securityHealthAnalyticsCustomModule.name = defaultValue1; - const expectedHeaderRequestParams = `security_health_analytics_custom_module.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() - ); - client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.updateSecurityHealthAnalyticsCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSecurityHealthAnalyticsCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest() - ); - request.securityHealthAnalyticsCustomModule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest', ['securityHealthAnalyticsCustomModule', 'name']); - request.securityHealthAnalyticsCustomModule.name = defaultValue1; - const expectedHeaderRequestParams = `security_health_analytics_custom_module.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule() - ); - client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSecurityHealthAnalyticsCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSecurityHealthAnalyticsCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest() - ); - request.securityHealthAnalyticsCustomModule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest', ['securityHealthAnalyticsCustomModule', 'name']); - request.securityHealthAnalyticsCustomModule.name = defaultValue1; - const expectedHeaderRequestParams = `security_health_analytics_custom_module.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSecurityHealthAnalyticsCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSecurityHealthAnalyticsCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest() - ); - request.securityHealthAnalyticsCustomModule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest', ['securityHealthAnalyticsCustomModule', 'name']); - request.securityHealthAnalyticsCustomModule.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateSecurityHealthAnalyticsCustomModule(request), expectedError); - }); - }); - - describe('updateSource', () => { - it('invokes updateSource without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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 = 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() - ); - request.source ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateSource(request), expectedError); - }); - }); - - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - 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'); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSecurityMarks(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateSecurityMarks(request), expectedError); - }); - }); - - describe('createBigQueryExport', () => { - it('invokes createBigQueryExport without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BigQueryExport() - ); - client.innerApiCalls.createBigQueryExport = stubSimpleCall(expectedResponse); - const [response] = await client.createBigQueryExport(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BigQueryExport() - ); - client.innerApiCalls.createBigQueryExport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBigQueryExport( - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createBigQueryExport(request), expectedError); - }); - }); - - describe('deleteBigQueryExport', () => { - it('invokes deleteBigQueryExport without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBigQueryExport = stubSimpleCall(expectedResponse); - const [response] = await client.deleteBigQueryExport(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBigQueryExport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBigQueryExport( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() - ); - request.bigQueryExport ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); - request.bigQueryExport.name = defaultValue1; - const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() - ); - request.bigQueryExport ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); - request.bigQueryExport.name = defaultValue1; - const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() - ); - request.bigQueryExport ??= {}; - 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'); - client.innerApiCalls.updateBigQueryExport = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateBigQueryExport(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() - ); - request.bigQueryExport ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateBigQueryExport(request), expectedError); - }); - }); - - describe('createEventThreatDetectionCustomModule', () => { - it('invokes createEventThreatDetectionCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() - ); - client.innerApiCalls.createEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.createEventThreatDetectionCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEventThreatDetectionCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() - ); - client.innerApiCalls.createEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createEventThreatDetectionCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEventThreatDetectionCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createEventThreatDetectionCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEventThreatDetectionCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createEventThreatDetectionCustomModule(request), expectedError); - }); - }); - - describe('deleteEventThreatDetectionCustomModule', () => { - it('invokes deleteEventThreatDetectionCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.deleteEventThreatDetectionCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEventThreatDetectionCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteEventThreatDetectionCustomModule( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEventThreatDetectionCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteEventThreatDetectionCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEventThreatDetectionCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteEventThreatDetectionCustomModule(request), expectedError); - }); - }); - - describe('getEventThreatDetectionCustomModule', () => { - it('invokes getEventThreatDetectionCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() - ); - client.innerApiCalls.getEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.getEventThreatDetectionCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEventThreatDetectionCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() - ); - client.innerApiCalls.getEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEventThreatDetectionCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEventThreatDetectionCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEventThreatDetectionCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEventThreatDetectionCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getEventThreatDetectionCustomModule(request), expectedError); - }); - }); - - describe('updateEventThreatDetectionCustomModule', () => { - it('invokes updateEventThreatDetectionCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest() - ); - request.eventThreatDetectionCustomModule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest', ['eventThreatDetectionCustomModule', 'name']); - request.eventThreatDetectionCustomModule.name = defaultValue1; - const expectedHeaderRequestParams = `event_threat_detection_custom_module.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() - ); - client.innerApiCalls.updateEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.updateEventThreatDetectionCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEventThreatDetectionCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest() - ); - request.eventThreatDetectionCustomModule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest', ['eventThreatDetectionCustomModule', 'name']); - request.eventThreatDetectionCustomModule.name = defaultValue1; - const expectedHeaderRequestParams = `event_threat_detection_custom_module.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule() - ); - client.innerApiCalls.updateEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEventThreatDetectionCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEventThreatDetectionCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest() - ); - request.eventThreatDetectionCustomModule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest', ['eventThreatDetectionCustomModule', 'name']); - request.eventThreatDetectionCustomModule.name = defaultValue1; - const expectedHeaderRequestParams = `event_threat_detection_custom_module.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEventThreatDetectionCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEventThreatDetectionCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest() - ); - request.eventThreatDetectionCustomModule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest', ['eventThreatDetectionCustomModule', 'name']); - request.eventThreatDetectionCustomModule.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateEventThreatDetectionCustomModule(request), expectedError); - }); - }); - - describe('validateEventThreatDetectionCustomModule', () => { - it('invokes validateEventThreatDetectionCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse() - ); - client.innerApiCalls.validateEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.validateEventThreatDetectionCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateEventThreatDetectionCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse() - ); - client.innerApiCalls.validateEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.validateEventThreatDetectionCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IValidateEventThreatDetectionCustomModuleResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateEventThreatDetectionCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.validateEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.validateEventThreatDetectionCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateEventThreatDetectionCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.validateEventThreatDetectionCustomModule(request), expectedError); - }); - }); - - describe('getEffectiveEventThreatDetectionCustomModule', () => { - it('invokes getEffectiveEventThreatDetectionCustomModule without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule() - ); - client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule = stubSimpleCall(expectedResponse); - const [response] = await client.getEffectiveEventThreatDetectionCustomModule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEffectiveEventThreatDetectionCustomModule without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule() - ); - client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEffectiveEventThreatDetectionCustomModule( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEffectiveEventThreatDetectionCustomModule with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEffectiveEventThreatDetectionCustomModule(request), expectedError); - const actualRequest = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEffectiveEventThreatDetectionCustomModule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEffectiveEventThreatDetectionCustomModule with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getEffectiveEventThreatDetectionCustomModule(request), expectedError); - }); - }); - - describe('batchCreateResourceValueConfigs', () => { - it('invokes batchCreateResourceValueConfigs without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse() - ); - client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateResourceValueConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateResourceValueConfigs without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse() - ); - client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateResourceValueConfigs( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IBatchCreateResourceValueConfigsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateResourceValueConfigs with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateResourceValueConfigs(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateResourceValueConfigs with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.batchCreateResourceValueConfigs(request), expectedError); - }); - }); - - describe('deleteResourceValueConfig', () => { - it('invokes deleteResourceValueConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteResourceValueConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteResourceValueConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceValueConfig without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteResourceValueConfig( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceValueConfig with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteResourceValueConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteResourceValueConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceValueConfig with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteResourceValueConfig(request), expectedError); - }); - }); - - describe('getResourceValueConfig', () => { - it('invokes getResourceValueConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ResourceValueConfig() - ); - client.innerApiCalls.getResourceValueConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getResourceValueConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceValueConfig without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ResourceValueConfig() - ); - client.innerApiCalls.getResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getResourceValueConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IResourceValueConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceValueConfig with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getResourceValueConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getResourceValueConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceValueConfig with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GetResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getResourceValueConfig(request), expectedError); - }); - }); - - describe('updateResourceValueConfig', () => { - it('invokes updateResourceValueConfig without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest() - ); - request.resourceValueConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); - request.resourceValueConfig.name = defaultValue1; - const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ResourceValueConfig() - ); - client.innerApiCalls.updateResourceValueConfig = stubSimpleCall(expectedResponse); - const [response] = await client.updateResourceValueConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceValueConfig without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest() - ); - request.resourceValueConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); - request.resourceValueConfig.name = defaultValue1; - const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ResourceValueConfig() - ); - client.innerApiCalls.updateResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateResourceValueConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IResourceValueConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceValueConfig with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest() - ); - request.resourceValueConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); - request.resourceValueConfig.name = defaultValue1; - const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateResourceValueConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateResourceValueConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceValueConfig with closed client', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest() - ); - request.resourceValueConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); - request.resourceValueConfig.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateResourceValueConfig(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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.bulkMuteFindings = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.bulkMuteFindings(request); - await assert.rejects(operation.promise(), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', - }); - await 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', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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(stub.calledOnce); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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(stub.calledOnce); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await 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(stub.calledOnce); - 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', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRunAssetDiscoveryProgress(''), expectedError); - assert(stub.calledOnce); - 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', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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(stub.calledOnce); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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(stub.calledOnce); - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.groupAssets, request)); - assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes groupAssetsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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(stub.calledOnce); - assert((client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.groupAssets, request)); - assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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(stub.calledOnce); - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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(stub.calledOnce); - assert.deepStrictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('groupFindings', () => { - it('invokes groupFindings without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes groupFindingsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.groupFindings, request)); - assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAssets', () => { - it('invokes listAssets without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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(stub.calledOnce); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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(stub.calledOnce); - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); - assert( - (client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAssetsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert(stub.calledOnce); - assert((client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); - assert( - (client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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(stub.calledOnce); - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAssetsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert(stub.calledOnce); - assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDescendantSecurityHealthAnalyticsCustomModules', () => { - it('invokes listDescendantSecurityHealthAnalyticsCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - ]; - client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules = stubSimpleCall(expectedResponse); - const [response] = await client.listDescendantSecurityHealthAnalyticsCustomModules(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDescendantSecurityHealthAnalyticsCustomModules without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - ]; - client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDescendantSecurityHealthAnalyticsCustomModules( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDescendantSecurityHealthAnalyticsCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDescendantSecurityHealthAnalyticsCustomModules(request), expectedError); - const actualRequest = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDescendantSecurityHealthAnalyticsCustomModulesStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - ]; - client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDescendantSecurityHealthAnalyticsCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => { - 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.listDescendantSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules, request)); - assert( - (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDescendantSecurityHealthAnalyticsCustomModulesStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDescendantSecurityHealthAnalyticsCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDescendantSecurityHealthAnalyticsCustomModules, request)); - assert( - (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDescendantSecurityHealthAnalyticsCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - ]; - client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[] = []; - const iterable = client.listDescendantSecurityHealthAnalyticsCustomModulesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDescendantSecurityHealthAnalyticsCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDescendantSecurityHealthAnalyticsCustomModulesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDescendantSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listFindings', () => { - it('invokes listFindings without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listFindingsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFindings, request)); - assert( - (client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listMuteConfigs', () => { - it('invokes listMuteConfigs without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - ]; - client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.listMuteConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - ]; - client.innerApiCalls.listMuteConfigs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMuteConfigs( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IMuteConfig[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - ]; - client.descriptors.page.listMuteConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMuteConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { - 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.listMuteConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMuteConfigs, request)); - assert( - (client.descriptors.page.listMuteConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listMuteConfigsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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.MuteConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listMuteConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMuteConfigs, request)); - assert( - (client.descriptors.page.listMuteConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listMuteConfigs without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.MuteConfig()), - ]; - client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - 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.listMuteConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listMuteConfigs with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListMuteConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMuteConfigsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listNotificationConfigs', () => { - it('invokes listNotificationConfigs without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNotificationConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNotificationConfigs(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNotificationConfigsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNotificationConfigs, request)); - assert( - (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listEffectiveSecurityHealthAnalyticsCustomModules', () => { - it('invokes listEffectiveSecurityHealthAnalyticsCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - ]; - client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules = stubSimpleCall(expectedResponse); - const [response] = await client.listEffectiveSecurityHealthAnalyticsCustomModules(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEffectiveSecurityHealthAnalyticsCustomModules without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - ]; - client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEffectiveSecurityHealthAnalyticsCustomModules( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEffectiveSecurityHealthAnalyticsCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEffectiveSecurityHealthAnalyticsCustomModules(request), expectedError); - const actualRequest = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEffectiveSecurityHealthAnalyticsCustomModulesStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - ]; - client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEffectiveSecurityHealthAnalyticsCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule) => { - 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.listEffectiveSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules, request)); - assert( - (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listEffectiveSecurityHealthAnalyticsCustomModulesStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEffectiveSecurityHealthAnalyticsCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEffectiveSecurityHealthAnalyticsCustomModules, request)); - assert( - (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEffectiveSecurityHealthAnalyticsCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule()), - ]; - client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[] = []; - const iterable = client.listEffectiveSecurityHealthAnalyticsCustomModulesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEffectiveSecurityHealthAnalyticsCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEffectiveSecurityHealthAnalyticsCustomModulesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IEffectiveSecurityHealthAnalyticsCustomModule[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEffectiveSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSecurityHealthAnalyticsCustomModules', () => { - it('invokes listSecurityHealthAnalyticsCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - ]; - client.innerApiCalls.listSecurityHealthAnalyticsCustomModules = stubSimpleCall(expectedResponse); - const [response] = await client.listSecurityHealthAnalyticsCustomModules(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSecurityHealthAnalyticsCustomModules without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - ]; - client.innerApiCalls.listSecurityHealthAnalyticsCustomModules = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSecurityHealthAnalyticsCustomModules( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSecurityHealthAnalyticsCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSecurityHealthAnalyticsCustomModules = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSecurityHealthAnalyticsCustomModules(request), expectedError); - const actualRequest = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSecurityHealthAnalyticsCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSecurityHealthAnalyticsCustomModulesStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - ]; - client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSecurityHealthAnalyticsCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => { - 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.listSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSecurityHealthAnalyticsCustomModules, request)); - assert( - (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSecurityHealthAnalyticsCustomModulesStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSecurityHealthAnalyticsCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSecurityHealthAnalyticsCustomModules, request)); - assert( - (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSecurityHealthAnalyticsCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule()), - ]; - client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[] = []; - const iterable = client.listSecurityHealthAnalyticsCustomModulesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSecurityHealthAnalyticsCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSecurityHealthAnalyticsCustomModulesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ISecurityHealthAnalyticsCustomModule[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSecurityHealthAnalyticsCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSources', () => { - it('invokes listSources without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSourcesStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSources, request)); - assert( - (client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSourcesAsync(request); - await 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( - (client.descriptors.page.listSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBigQueryExports', () => { - it('invokes listBigQueryExports without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - ]; - client.innerApiCalls.listBigQueryExports = stubSimpleCall(expectedResponse); - const [response] = await client.listBigQueryExports(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - ]; - client.innerApiCalls.listBigQueryExports = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBigQueryExports( - 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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.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); - 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 () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - ]; - client.descriptors.page.listBigQueryExports.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBigQueryExportsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.BigQueryExport[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.BigQueryExport) => { - 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.listBigQueryExports.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBigQueryExports, request)); - assert( - (client.descriptors.page.listBigQueryExports.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBigQueryExportsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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.BigQueryExport[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.BigQueryExport) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBigQueryExports.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBigQueryExports, request)); - assert( - (client.descriptors.page.listBigQueryExports.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBigQueryExports without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.BigQueryExport()), - ]; - client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(expectedResponse); - 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.listBigQueryExports.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBigQueryExports with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBigQueryExportsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IBigQueryExport[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDescendantEventThreatDetectionCustomModules', () => { - it('invokes listDescendantEventThreatDetectionCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - ]; - client.innerApiCalls.listDescendantEventThreatDetectionCustomModules = stubSimpleCall(expectedResponse); - const [response] = await client.listDescendantEventThreatDetectionCustomModules(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDescendantEventThreatDetectionCustomModules without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - ]; - client.innerApiCalls.listDescendantEventThreatDetectionCustomModules = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDescendantEventThreatDetectionCustomModules( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDescendantEventThreatDetectionCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDescendantEventThreatDetectionCustomModules = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDescendantEventThreatDetectionCustomModules(request), expectedError); - const actualRequest = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDescendantEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDescendantEventThreatDetectionCustomModulesStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - ]; - client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDescendantEventThreatDetectionCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => { - 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.listDescendantEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDescendantEventThreatDetectionCustomModules, request)); - assert( - (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDescendantEventThreatDetectionCustomModulesStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDescendantEventThreatDetectionCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDescendantEventThreatDetectionCustomModules, request)); - assert( - (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDescendantEventThreatDetectionCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - ]; - client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[] = []; - const iterable = client.listDescendantEventThreatDetectionCustomModulesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDescendantEventThreatDetectionCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDescendantEventThreatDetectionCustomModulesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDescendantEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listEventThreatDetectionCustomModules', () => { - it('invokes listEventThreatDetectionCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - ]; - client.innerApiCalls.listEventThreatDetectionCustomModules = stubSimpleCall(expectedResponse); - const [response] = await client.listEventThreatDetectionCustomModules(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEventThreatDetectionCustomModules without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - ]; - client.innerApiCalls.listEventThreatDetectionCustomModules = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEventThreatDetectionCustomModules( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEventThreatDetectionCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEventThreatDetectionCustomModules = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEventThreatDetectionCustomModules(request), expectedError); - const actualRequest = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEventThreatDetectionCustomModulesStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - ]; - client.descriptors.page.listEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEventThreatDetectionCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => { - 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.listEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEventThreatDetectionCustomModules, request)); - assert( - (client.descriptors.page.listEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listEventThreatDetectionCustomModulesStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEventThreatDetectionCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEventThreatDetectionCustomModules, request)); - assert( - (client.descriptors.page.listEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEventThreatDetectionCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule()), - ]; - client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[] = []; - const iterable = client.listEventThreatDetectionCustomModulesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEventThreatDetectionCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEventThreatDetectionCustomModulesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IEventThreatDetectionCustomModule[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listEffectiveEventThreatDetectionCustomModules', () => { - it('invokes listEffectiveEventThreatDetectionCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - ]; - client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules = stubSimpleCall(expectedResponse); - const [response] = await client.listEffectiveEventThreatDetectionCustomModules(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEffectiveEventThreatDetectionCustomModules without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - ]; - client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEffectiveEventThreatDetectionCustomModules( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEffectiveEventThreatDetectionCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEffectiveEventThreatDetectionCustomModules(request), expectedError); - const actualRequest = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEffectiveEventThreatDetectionCustomModulesStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - ]; - client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEffectiveEventThreatDetectionCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule) => { - 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.listEffectiveEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules, request)); - assert( - (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listEffectiveEventThreatDetectionCustomModulesStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEffectiveEventThreatDetectionCustomModulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEffectiveEventThreatDetectionCustomModules, request)); - assert( - (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEffectiveEventThreatDetectionCustomModules without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule()), - ]; - client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[] = []; - const iterable = client.listEffectiveEventThreatDetectionCustomModulesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEffectiveEventThreatDetectionCustomModules with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEffectiveEventThreatDetectionCustomModulesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IEffectiveEventThreatDetectionCustomModule[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEffectiveEventThreatDetectionCustomModules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listResourceValueConfigs', () => { - it('invokes listResourceValueConfigs without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - ]; - client.innerApiCalls.listResourceValueConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.listResourceValueConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceValueConfigs without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - ]; - client.innerApiCalls.listResourceValueConfigs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listResourceValueConfigs( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IResourceValueConfig[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceValueConfigs with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listResourceValueConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listResourceValueConfigs(request), expectedError); - const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceValueConfigsStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - ]; - client.descriptors.page.listResourceValueConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listResourceValueConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ResourceValueConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.ResourceValueConfig) => { - 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.listResourceValueConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listResourceValueConfigs, request)); - assert( - (client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listResourceValueConfigsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listResourceValueConfigs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listResourceValueConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ResourceValueConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.ResourceValueConfig) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listResourceValueConfigs, request)); - assert( - (client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listResourceValueConfigs without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ResourceValueConfig()), - ]; - client.descriptors.page.listResourceValueConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IResourceValueConfig[] = []; - const iterable = client.listResourceValueConfigsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listResourceValueConfigs with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listResourceValueConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listResourceValueConfigsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IResourceValueConfig[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listValuedResources', () => { - it('invokes listValuedResources without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - ]; - client.innerApiCalls.listValuedResources = stubSimpleCall(expectedResponse); - const [response] = await client.listValuedResources(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listValuedResources without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - ]; - client.innerApiCalls.listValuedResources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listValuedResources( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IValuedResource[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listValuedResources with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listValuedResources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listValuedResources(request), expectedError); - const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listValuedResourcesStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - ]; - client.descriptors.page.listValuedResources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listValuedResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ValuedResource[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.ValuedResource) => { - 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.listValuedResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listValuedResources, request)); - assert( - (client.descriptors.page.listValuedResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listValuedResourcesStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listValuedResources.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listValuedResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ValuedResource[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.ValuedResource) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listValuedResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listValuedResources, request)); - assert( - (client.descriptors.page.listValuedResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listValuedResources without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.ValuedResource()), - ]; - client.descriptors.page.listValuedResources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IValuedResource[] = []; - const iterable = client.listValuedResourcesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listValuedResources with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listValuedResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listValuedResourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IValuedResource[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAttackPaths', () => { - it('invokes listAttackPaths without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - ]; - client.innerApiCalls.listAttackPaths = stubSimpleCall(expectedResponse); - const [response] = await client.listAttackPaths(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttackPaths without error using callback', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - ]; - client.innerApiCalls.listAttackPaths = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAttackPaths( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v1.IAttackPath[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttackPaths with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAttackPaths = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAttackPaths(request), expectedError); - const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttackPathsStream without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - ]; - client.descriptors.page.listAttackPaths.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAttackPathsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.AttackPath[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.AttackPath) => { - 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.listAttackPaths.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttackPaths, request)); - assert( - (client.descriptors.page.listAttackPaths.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAttackPathsStream with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttackPaths.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAttackPathsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.AttackPath[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v1.AttackPath) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAttackPaths.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttackPaths, request)); - assert( - (client.descriptors.page.listAttackPaths.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttackPaths without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v1.AttackPath()), - ]; - client.descriptors.page.listAttackPaths.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IAttackPath[] = []; - const iterable = client.listAttackPathsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttackPaths with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttackPaths.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAttackPathsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IAttackPath[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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); - } - }).catch(err => {throw err}); - }); - 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', - }); - await 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); - } - }).catch(err => {throw err}); - }); - 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', - }); - await 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); - } - }).catch(err => {throw err}); - }); - 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.IOperation[] = []; - 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', - }); - await 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.IOperation[] = []; - 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('attackPath', async () => { - const fakePath = "/rendered/path/attackPath"; - const expectedParameters = { - organization: "organizationValue", - simulation: "simulationValue", - valued_resource: "valuedResourceValue", - attack_path: "attackPathValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.attackPathPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attackPathPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attackPathPath', () => { - const result = client.attackPathPath("organizationValue", "simulationValue", "valuedResourceValue", "attackPathValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attackPathPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromAttackPathName', () => { - const result = client.matchOrganizationFromAttackPathName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.attackPathPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimulationFromAttackPathName', () => { - const result = client.matchSimulationFromAttackPathName(fakePath); - assert.strictEqual(result, "simulationValue"); - assert((client.pathTemplates.attackPathPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchValuedResourceFromAttackPathName', () => { - const result = client.matchValuedResourceFromAttackPathName(fakePath); - assert.strictEqual(result, "valuedResourceValue"); - assert((client.pathTemplates.attackPathPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttackPathFromAttackPathName', () => { - const result = client.matchAttackPathFromAttackPathName(fakePath); - assert.strictEqual(result, "attackPathValue"); - assert((client.pathTemplates.attackPathPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderAssetSecurityMarks', async () => { - const fakePath = "/rendered/path/folderAssetSecurityMarks"; - const expectedParameters = { - folder: "folderValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('folderAssets', async () => { - const fakePath = "/rendered/path/folderAssets"; - const expectedParameters = { - folder: "folderValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderAssetsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderAssetsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderAssetsPath', () => { - const result = client.folderAssetsPath("folderValue", "assetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderAssetsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderAssetsName', () => { - const result = client.matchFolderFromFolderAssetsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderAssetsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAssetFromFolderAssetsName', () => { - const result = client.matchAssetFromFolderAssetsName(fakePath); - assert.strictEqual(result, "assetValue"); - assert((client.pathTemplates.folderAssetsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderBigQueryExports', async () => { - const fakePath = "/rendered/path/folderBigQueryExports"; - const expectedParameters = { - folder: "folderValue", - export: "exportValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderBigQueryExportsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderBigQueryExportsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderBigQueryExportsPath', () => { - const result = client.folderBigQueryExportsPath("folderValue", "exportValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderBigQueryExportsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderBigQueryExportsName', () => { - const result = client.matchFolderFromFolderBigQueryExportsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExportFromFolderBigQueryExportsName', () => { - const result = client.matchExportFromFolderBigQueryExportsName(fakePath); - assert.strictEqual(result, "exportValue"); - assert((client.pathTemplates.folderBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderConstraintName', async () => { - const fakePath = "/rendered/path/folderConstraintName"; - const expectedParameters = { - folder: "folderValue", - constraint_name: "constraintNameValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderConstraintNamePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderConstraintNamePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderConstraintNamePath', () => { - const result = client.folderConstraintNamePath("folderValue", "constraintNameValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderConstraintNamePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderConstraintNameName', () => { - const result = client.matchFolderFromFolderConstraintNameName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConstraintNameFromFolderConstraintNameName', () => { - const result = client.matchConstraintNameFromFolderConstraintNameName(fakePath); - assert.strictEqual(result, "constraintNameValue"); - assert((client.pathTemplates.folderConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderEventThreatDetectionSettingsModule', async () => { - const fakePath = "/rendered/path/folderEventThreatDetectionSettingsModule"; - const expectedParameters = { - folder: "folderValue", - module: "moduleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderEventThreatDetectionSettingsModulePath', () => { - const result = client.folderEventThreatDetectionSettingsModulePath("folderValue", "moduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderEventThreatDetectionSettingsModuleName', () => { - const result = client.matchFolderFromFolderEventThreatDetectionSettingsModuleName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModuleFromFolderEventThreatDetectionSettingsModuleName', () => { - const result = client.matchModuleFromFolderEventThreatDetectionSettingsModuleName(fakePath); - assert.strictEqual(result, "moduleValue"); - assert((client.pathTemplates.folderEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderLocationMuteConfigs', async () => { - const fakePath = "/rendered/path/folderLocationMuteConfigs"; - const expectedParameters = { - folder: "folderValue", - location: "locationValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderLocationMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderLocationMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderLocationMuteConfigsPath', () => { - const result = client.folderLocationMuteConfigsPath("folderValue", "locationValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderLocationMuteConfigsName', () => { - const result = client.matchFolderFromFolderLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFolderLocationMuteConfigsName', () => { - const result = client.matchLocationFromFolderLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromFolderLocationMuteConfigsName', () => { - const result = client.matchMuteConfigFromFolderLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderMuteConfigs', async () => { - const fakePath = "/rendered/path/folderMuteConfigs"; - const expectedParameters = { - folder: "folderValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMuteConfigsPath', () => { - const result = client.folderMuteConfigsPath("folderValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMuteConfigsName', () => { - const result = client.matchFolderFromFolderMuteConfigsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromFolderMuteConfigsName', () => { - const result = client.matchMuteConfigFromFolderMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.folderMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderNotificationConfigs', async () => { - const fakePath = "/rendered/path/folderNotificationConfigs"; - const expectedParameters = { - folder: "folderValue", - notification_config: "notificationConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderNotificationConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderNotificationConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderNotificationConfigsPath', () => { - const result = client.folderNotificationConfigsPath("folderValue", "notificationConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderNotificationConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderNotificationConfigsName', () => { - const result = client.matchFolderFromFolderNotificationConfigsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNotificationConfigFromFolderNotificationConfigsName', () => { - const result = client.matchNotificationConfigFromFolderNotificationConfigsName(fakePath); - assert.strictEqual(result, "notificationConfigValue"); - assert((client.pathTemplates.folderNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSecurityHealthAnalyticsSettingsCustomModule', async () => { - const fakePath = "/rendered/path/folderSecurityHealthAnalyticsSettingsCustomModule"; - const expectedParameters = { - folder: "folderValue", - custom_module: "customModuleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSecurityHealthAnalyticsSettingsCustomModulePath', () => { - const result = client.folderSecurityHealthAnalyticsSettingsCustomModulePath("folderValue", "customModuleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderSecurityHealthAnalyticsSettingsCustomModuleName', () => { - const result = client.matchFolderFromFolderSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomModuleFromFolderSecurityHealthAnalyticsSettingsCustomModuleName', () => { - const result = client.matchCustomModuleFromFolderSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); - assert.strictEqual(result, "customModuleValue"); - assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSecurityHealthAnalyticsSettingsEffectiveCustomModule', async () => { - const fakePath = "/rendered/path/folderSecurityHealthAnalyticsSettingsEffectiveCustomModule"; - const expectedParameters = { - folder: "folderValue", - effective_custom_module: "effectiveCustomModuleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePath', () => { - const result = client.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePath("folderValue", "effectiveCustomModuleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { - const result = client.matchFolderFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEffectiveCustomModuleFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { - const result = client.matchEffectiveCustomModuleFromFolderSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); - assert.strictEqual(result, "effectiveCustomModuleValue"); - assert((client.pathTemplates.folderSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSource', async () => { - 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', - }); - await 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('folderSourceFindingExternalSystems', async () => { - const fakePath = "/rendered/path/folderSourceFindingExternalSystems"; - 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', - }); - await client.initialize(); - client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSourceFindingExternalSystemsPath', () => { - const result = client.folderSourceFindingExternalSystemsPath("folderValue", "sourceValue", "findingValue", "externalsystemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderSourceFindingExternalSystemsName', () => { - const result = client.matchFolderFromFolderSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceFindingExternalSystemsName', () => { - const result = client.matchSourceFromFolderSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceFindingExternalSystemsName', () => { - const result = client.matchFindingFromFolderSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalsystemFromFolderSourceFindingExternalSystemsName', () => { - const result = client.matchExternalsystemFromFolderSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "externalsystemValue"); - assert((client.pathTemplates.folderSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSourceFindingSecurityMarks', async () => { - 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', - }); - await 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.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { - const result = client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSourceFindings', async () => { - const fakePath = "/rendered/path/folderSourceFindings"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderSourceFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSourceFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSourceFindingsPath', () => { - const result = client.folderSourceFindingsPath("folderValue", "sourceValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSourceFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderSourceFindingsName', () => { - const result = client.matchFolderFromFolderSourceFindingsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceFindingsName', () => { - const result = client.matchSourceFromFolderSourceFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceFindingsName', () => { - const result = client.matchFindingFromFolderSourceFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organization', async () => { - const fakePath = "/rendered/path/organization"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - 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', - }); - await 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('organizationAssets', async () => { - const fakePath = "/rendered/path/organizationAssets"; - const expectedParameters = { - organization: "organizationValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationAssetsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationAssetsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationAssetsPath', () => { - const result = client.organizationAssetsPath("organizationValue", "assetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationAssetsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationAssetsName', () => { - const result = client.matchOrganizationFromOrganizationAssetsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationAssetsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAssetFromOrganizationAssetsName', () => { - const result = client.matchAssetFromOrganizationAssetsName(fakePath); - assert.strictEqual(result, "assetValue"); - assert((client.pathTemplates.organizationAssetsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationBigQueryExports', async () => { - const fakePath = "/rendered/path/organizationBigQueryExports"; - const expectedParameters = { - organization: "organizationValue", - export: "exportValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationBigQueryExportsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationBigQueryExportsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationBigQueryExportsPath', () => { - const result = client.organizationBigQueryExportsPath("organizationValue", "exportValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationBigQueryExportsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationBigQueryExportsName', () => { - const result = client.matchOrganizationFromOrganizationBigQueryExportsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExportFromOrganizationBigQueryExportsName', () => { - const result = client.matchExportFromOrganizationBigQueryExportsName(fakePath); - assert.strictEqual(result, "exportValue"); - assert((client.pathTemplates.organizationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationConstraintName', async () => { - const fakePath = "/rendered/path/organizationConstraintName"; - const expectedParameters = { - organization: "organizationValue", - constraint_name: "constraintNameValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationConstraintNamePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationConstraintNamePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationConstraintNamePath', () => { - const result = client.organizationConstraintNamePath("organizationValue", "constraintNameValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationConstraintNamePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationConstraintNameName', () => { - const result = client.matchOrganizationFromOrganizationConstraintNameName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConstraintNameFromOrganizationConstraintNameName', () => { - const result = client.matchConstraintNameFromOrganizationConstraintNameName(fakePath); - assert.strictEqual(result, "constraintNameValue"); - assert((client.pathTemplates.organizationConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationEventThreatDetectionSettings', async () => { - const fakePath = "/rendered/path/organizationEventThreatDetectionSettings"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationEventThreatDetectionSettingsPath', () => { - const result = client.organizationEventThreatDetectionSettingsPath("organizationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationEventThreatDetectionSettingsName', () => { - const result = client.matchOrganizationFromOrganizationEventThreatDetectionSettingsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationEventThreatDetectionSettingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationEventThreatDetectionSettingsModule', async () => { - const fakePath = "/rendered/path/organizationEventThreatDetectionSettingsModule"; - const expectedParameters = { - organization: "organizationValue", - module: "moduleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationEventThreatDetectionSettingsModulePath', () => { - const result = client.organizationEventThreatDetectionSettingsModulePath("organizationValue", "moduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationEventThreatDetectionSettingsModuleName', () => { - const result = client.matchOrganizationFromOrganizationEventThreatDetectionSettingsModuleName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModuleFromOrganizationEventThreatDetectionSettingsModuleName', () => { - const result = client.matchModuleFromOrganizationEventThreatDetectionSettingsModuleName(fakePath); - assert.strictEqual(result, "moduleValue"); - assert((client.pathTemplates.organizationEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationMuteConfigs', async () => { - const fakePath = "/rendered/path/organizationLocationMuteConfigs"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationMuteConfigsPath', () => { - const result = client.organizationLocationMuteConfigsPath("organizationValue", "locationValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationMuteConfigsName', () => { - const result = client.matchOrganizationFromOrganizationLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationMuteConfigsName', () => { - const result = client.matchLocationFromOrganizationLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromOrganizationLocationMuteConfigsName', () => { - const result = client.matchMuteConfigFromOrganizationLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationMuteConfigs', async () => { - const fakePath = "/rendered/path/organizationMuteConfigs"; - const expectedParameters = { - organization: "organizationValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMuteConfigsPath', () => { - const result = client.organizationMuteConfigsPath("organizationValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMuteConfigsName', () => { - const result = client.matchOrganizationFromOrganizationMuteConfigsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromOrganizationMuteConfigsName', () => { - const result = client.matchMuteConfigFromOrganizationMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.organizationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationNotificationConfigs', async () => { - const fakePath = "/rendered/path/organizationNotificationConfigs"; - const expectedParameters = { - organization: "organizationValue", - notification_config: "notificationConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationNotificationConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationNotificationConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationNotificationConfigsPath', () => { - const result = client.organizationNotificationConfigsPath("organizationValue", "notificationConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationNotificationConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationNotificationConfigsName', () => { - const result = client.matchOrganizationFromOrganizationNotificationConfigsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNotificationConfigFromOrganizationNotificationConfigsName', () => { - const result = client.matchNotificationConfigFromOrganizationNotificationConfigsName(fakePath); - assert.strictEqual(result, "notificationConfigValue"); - assert((client.pathTemplates.organizationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSecurityHealthAnalyticsSettings', async () => { - const fakePath = "/rendered/path/organizationSecurityHealthAnalyticsSettings"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSecurityHealthAnalyticsSettingsPath', () => { - const result = client.organizationSecurityHealthAnalyticsSettingsPath("organizationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsName', () => { - const result = client.matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSecurityHealthAnalyticsSettingsCustomModule', async () => { - const fakePath = "/rendered/path/organizationSecurityHealthAnalyticsSettingsCustomModule"; - const expectedParameters = { - organization: "organizationValue", - custom_module: "customModuleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSecurityHealthAnalyticsSettingsCustomModulePath', () => { - const result = client.organizationSecurityHealthAnalyticsSettingsCustomModulePath("organizationValue", "customModuleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName', () => { - const result = client.matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName', () => { - const result = client.matchCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); - assert.strictEqual(result, "customModuleValue"); - assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSecurityHealthAnalyticsSettingsEffectiveCustomModule', async () => { - const fakePath = "/rendered/path/organizationSecurityHealthAnalyticsSettingsEffectiveCustomModule"; - const expectedParameters = { - organization: "organizationValue", - effective_custom_module: "effectiveCustomModuleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePath', () => { - const result = client.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePath("organizationValue", "effectiveCustomModuleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { - const result = client.matchOrganizationFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEffectiveCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { - const result = client.matchEffectiveCustomModuleFromOrganizationSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); - assert.strictEqual(result, "effectiveCustomModuleValue"); - assert((client.pathTemplates.organizationSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSettings', async () => { - const fakePath = "/rendered/path/organizationSettings"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('organizationSimulation', async () => { - const fakePath = "/rendered/path/organizationSimulation"; - const expectedParameters = { - organization: "organizationValue", - simulation: "simulationValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSimulationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSimulationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSimulationPath', () => { - const result = client.organizationSimulationPath("organizationValue", "simulationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSimulationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSimulationName', () => { - const result = client.matchOrganizationFromOrganizationSimulationName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSimulationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimulationFromOrganizationSimulationName', () => { - const result = client.matchSimulationFromOrganizationSimulationName(fakePath); - assert.strictEqual(result, "simulationValue"); - assert((client.pathTemplates.organizationSimulationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSource', async () => { - const fakePath = "/rendered/path/organizationSource"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSourcePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourcePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourcePath', () => { - const result = client.organizationSourcePath("organizationValue", "sourceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourcePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceName', () => { - const result = client.matchOrganizationFromOrganizationSourceName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceName', () => { - const result = client.matchSourceFromOrganizationSourceName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSourceFindingExternalSystems', async () => { - const fakePath = "/rendered/path/organizationSourceFindingExternalSystems"; - 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', - }); - await client.initialize(); - client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourceFindingExternalSystemsPath', () => { - const result = client.organizationSourceFindingExternalSystemsPath("organizationValue", "sourceValue", "findingValue", "externalsystemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceFindingExternalSystemsName', () => { - const result = client.matchOrganizationFromOrganizationSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceFindingExternalSystemsName', () => { - const result = client.matchSourceFromOrganizationSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromOrganizationSourceFindingExternalSystemsName', () => { - const result = client.matchFindingFromOrganizationSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalsystemFromOrganizationSourceFindingExternalSystemsName', () => { - const result = client.matchExternalsystemFromOrganizationSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "externalsystemValue"); - assert((client.pathTemplates.organizationSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSourceFindingSecurityMarks', async () => { - 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', - }); - await 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('organizationSourceFindings', async () => { - const fakePath = "/rendered/path/organizationSourceFindings"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSourceFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourceFindingsPath', () => { - const result = client.organizationSourceFindingsPath("organizationValue", "sourceValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourceFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceFindingsName', () => { - const result = client.matchOrganizationFromOrganizationSourceFindingsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceFindingsName', () => { - const result = client.matchSourceFromOrganizationSourceFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromOrganizationSourceFindingsName', () => { - const result = client.matchFindingFromOrganizationSourceFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectAssetSecurityMarks', async () => { - 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', - }); - await 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('projectAssets', async () => { - const fakePath = "/rendered/path/projectAssets"; - const expectedParameters = { - project: "projectValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectAssetsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectAssetsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectAssetsPath', () => { - const result = client.projectAssetsPath("projectValue", "assetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectAssetsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectAssetsName', () => { - const result = client.matchProjectFromProjectAssetsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectAssetsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAssetFromProjectAssetsName', () => { - const result = client.matchAssetFromProjectAssetsName(fakePath); - assert.strictEqual(result, "assetValue"); - assert((client.pathTemplates.projectAssetsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectBigQueryExports', async () => { - const fakePath = "/rendered/path/projectBigQueryExports"; - const expectedParameters = { - project: "projectValue", - export: "exportValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectBigQueryExportsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectBigQueryExportsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectBigQueryExportsPath', () => { - const result = client.projectBigQueryExportsPath("projectValue", "exportValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectBigQueryExportsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectBigQueryExportsName', () => { - const result = client.matchProjectFromProjectBigQueryExportsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExportFromProjectBigQueryExportsName', () => { - const result = client.matchExportFromProjectBigQueryExportsName(fakePath); - assert.strictEqual(result, "exportValue"); - assert((client.pathTemplates.projectBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectConstraintName', async () => { - const fakePath = "/rendered/path/projectConstraintName"; - const expectedParameters = { - project: "projectValue", - constraint_name: "constraintNameValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectConstraintNamePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectConstraintNamePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectConstraintNamePath', () => { - const result = client.projectConstraintNamePath("projectValue", "constraintNameValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectConstraintNamePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectConstraintNameName', () => { - const result = client.matchProjectFromProjectConstraintNameName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConstraintNameFromProjectConstraintNameName', () => { - const result = client.matchConstraintNameFromProjectConstraintNameName(fakePath); - assert.strictEqual(result, "constraintNameValue"); - assert((client.pathTemplates.projectConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectEventThreatDetectionSettingsModule', async () => { - const fakePath = "/rendered/path/projectEventThreatDetectionSettingsModule"; - const expectedParameters = { - project: "projectValue", - module: "moduleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectEventThreatDetectionSettingsModulePath', () => { - const result = client.projectEventThreatDetectionSettingsModulePath("projectValue", "moduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectEventThreatDetectionSettingsModuleName', () => { - const result = client.matchProjectFromProjectEventThreatDetectionSettingsModuleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModuleFromProjectEventThreatDetectionSettingsModuleName', () => { - const result = client.matchModuleFromProjectEventThreatDetectionSettingsModuleName(fakePath); - assert.strictEqual(result, "moduleValue"); - assert((client.pathTemplates.projectEventThreatDetectionSettingsModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationMuteConfigs', async () => { - const fakePath = "/rendered/path/projectLocationMuteConfigs"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationMuteConfigsPath', () => { - const result = client.projectLocationMuteConfigsPath("projectValue", "locationValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationMuteConfigsName', () => { - const result = client.matchProjectFromProjectLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationMuteConfigsName', () => { - const result = client.matchLocationFromProjectLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromProjectLocationMuteConfigsName', () => { - const result = client.matchMuteConfigFromProjectLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectMuteConfigs', async () => { - const fakePath = "/rendered/path/projectMuteConfigs"; - const expectedParameters = { - project: "projectValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMuteConfigsPath', () => { - const result = client.projectMuteConfigsPath("projectValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMuteConfigsName', () => { - const result = client.matchProjectFromProjectMuteConfigsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromProjectMuteConfigsName', () => { - const result = client.matchMuteConfigFromProjectMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.projectMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectNotificationConfigs', async () => { - const fakePath = "/rendered/path/projectNotificationConfigs"; - const expectedParameters = { - project: "projectValue", - notification_config: "notificationConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectNotificationConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectNotificationConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectNotificationConfigsPath', () => { - const result = client.projectNotificationConfigsPath("projectValue", "notificationConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectNotificationConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectNotificationConfigsName', () => { - const result = client.matchProjectFromProjectNotificationConfigsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNotificationConfigFromProjectNotificationConfigsName', () => { - const result = client.matchNotificationConfigFromProjectNotificationConfigsName(fakePath); - assert.strictEqual(result, "notificationConfigValue"); - assert((client.pathTemplates.projectNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectSecurityHealthAnalyticsSettingsCustomModule', async () => { - const fakePath = "/rendered/path/projectSecurityHealthAnalyticsSettingsCustomModule"; - const expectedParameters = { - project: "projectValue", - custom_module: "customModuleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectSecurityHealthAnalyticsSettingsCustomModulePath', () => { - const result = client.projectSecurityHealthAnalyticsSettingsCustomModulePath("projectValue", "customModuleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectSecurityHealthAnalyticsSettingsCustomModuleName', () => { - const result = client.matchProjectFromProjectSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomModuleFromProjectSecurityHealthAnalyticsSettingsCustomModuleName', () => { - const result = client.matchCustomModuleFromProjectSecurityHealthAnalyticsSettingsCustomModuleName(fakePath); - assert.strictEqual(result, "customModuleValue"); - assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectSecurityHealthAnalyticsSettingsEffectiveCustomModule', async () => { - const fakePath = "/rendered/path/projectSecurityHealthAnalyticsSettingsEffectiveCustomModule"; - const expectedParameters = { - project: "projectValue", - effective_custom_module: "effectiveCustomModuleValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePath', () => { - const result = client.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePath("projectValue", "effectiveCustomModuleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { - const result = client.matchProjectFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEffectiveCustomModuleFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName', () => { - const result = client.matchEffectiveCustomModuleFromProjectSecurityHealthAnalyticsSettingsEffectiveCustomModuleName(fakePath); - assert.strictEqual(result, "effectiveCustomModuleValue"); - assert((client.pathTemplates.projectSecurityHealthAnalyticsSettingsEffectiveCustomModulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectSource', async () => { - 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', - }); - await 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('projectSourceFindingExternalSystems', async () => { - const fakePath = "/rendered/path/projectSourceFindingExternalSystems"; - 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', - }); - await client.initialize(); - client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectSourceFindingExternalSystemsPath', () => { - const result = client.projectSourceFindingExternalSystemsPath("projectValue", "sourceValue", "findingValue", "externalsystemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectSourceFindingExternalSystemsName', () => { - const result = client.matchProjectFromProjectSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromProjectSourceFindingExternalSystemsName', () => { - const result = client.matchSourceFromProjectSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromProjectSourceFindingExternalSystemsName', () => { - const result = client.matchFindingFromProjectSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalsystemFromProjectSourceFindingExternalSystemsName', () => { - const result = client.matchExternalsystemFromProjectSourceFindingExternalSystemsName(fakePath); - assert.strictEqual(result, "externalsystemValue"); - assert((client.pathTemplates.projectSourceFindingExternalSystemsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectSourceFindingSecurityMarks', async () => { - 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', - }); - await 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('matchSourceFromProjectSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((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)); - }); - }); - - describe('projectSourceFindings', async () => { - const fakePath = "/rendered/path/projectSourceFindings"; - const expectedParameters = { - project: "projectValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectSourceFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectSourceFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectSourceFindingsPath', () => { - const result = client.projectSourceFindingsPath("projectValue", "sourceValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectSourceFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectSourceFindingsName', () => { - const result = client.matchProjectFromProjectSourceFindingsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromProjectSourceFindingsName', () => { - const result = client.matchSourceFromProjectSourceFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromProjectSourceFindingsName', () => { - const result = client.matchFindingFromProjectSourceFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('resourceValueConfig', async () => { - const fakePath = "/rendered/path/resourceValueConfig"; - const expectedParameters = { - organization: "organizationValue", - resource_value_config: "resourceValueConfigValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.resourceValueConfigPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.resourceValueConfigPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('resourceValueConfigPath', () => { - const result = client.resourceValueConfigPath("organizationValue", "resourceValueConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.resourceValueConfigPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromResourceValueConfigName', () => { - const result = client.matchOrganizationFromResourceValueConfigName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.resourceValueConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchResourceValueConfigFromResourceValueConfigName', () => { - const result = client.matchResourceValueConfigFromResourceValueConfigName(fakePath); - assert.strictEqual(result, "resourceValueConfigValue"); - assert((client.pathTemplates.resourceValueConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('simulation', async () => { - const fakePath = "/rendered/path/simulation"; - const expectedParameters = { - organization: "organizationValue", - simulation: "simulationValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.simulationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.simulationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('simulationPath', () => { - const result = client.simulationPath("organizationValue", "simulationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.simulationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromSimulationName', () => { - const result = client.matchOrganizationFromSimulationName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.simulationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimulationFromSimulationName', () => { - const result = client.matchSimulationFromSimulationName(fakePath); - assert.strictEqual(result, "simulationValue"); - assert((client.pathTemplates.simulationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('valuedResource', async () => { - const fakePath = "/rendered/path/valuedResource"; - const expectedParameters = { - organization: "organizationValue", - simulation: "simulationValue", - valued_resource: "valuedResourceValue", - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.valuedResourcePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.valuedResourcePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('valuedResourcePath', () => { - const result = client.valuedResourcePath("organizationValue", "simulationValue", "valuedResourceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.valuedResourcePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromValuedResourceName', () => { - const result = client.matchOrganizationFromValuedResourceName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.valuedResourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimulationFromValuedResourceName', () => { - const result = client.matchSimulationFromValuedResourceName(fakePath); - assert.strictEqual(result, "simulationValue"); - assert((client.pathTemplates.valuedResourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchValuedResourceFromValuedResourceName', () => { - const result = client.matchValuedResourceFromValuedResourceName(fakePath); - assert.strictEqual(result, "valuedResourceValue"); - assert((client.pathTemplates.valuedResourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts deleted file mode 100644 index 0bdc83ed249..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ /dev/null @@ -1,3237 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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) - .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', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = securitycenterModule.v1beta1.SecurityCenterClient.servicePath; - assert.strictEqual(servicePath, 'securitycenter.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = securitycenterModule.v1beta1.SecurityCenterClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new securitycenterModule.v1beta1.SecurityCenterClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new securitycenterModule.v1beta1.SecurityCenterClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new securitycenterModule.v1beta1.SecurityCenterClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - 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 for the initialized client', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.securityCenterStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - 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(); - }).catch(err => {throw err}); - }); - - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createSource(request), expectedError); - }); - }); - - describe('createFinding', () => { - it('invokes createFinding without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createFinding(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOrganizationSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOrganizationSettings(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getOrganizationSettings(request), expectedError); - }); - }); - - describe('getSource', () => { - it('invokes getSource without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSource(request), expectedError); - }); - }); - - describe('setFindingState', () => { - it('invokes setFindingState without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setFindingState(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('updateFinding', () => { - it('invokes updateFinding without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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 = 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() - ); - request.finding ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateFinding(request), expectedError); - }); - }); - - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateOrganizationSettings(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateOrganizationSettings(request), expectedError); - }); - }); - - describe('updateSource', () => { - it('invokes updateSource without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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 = 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() - ); - request.source ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateSource(request), expectedError); - }); - }); - - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - 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'); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSecurityMarks(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateSecurityMarks(request), expectedError); - }); - }); - - describe('runAssetDiscovery', () => { - it('invokes runAssetDiscovery without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.runAssetDiscovery(request); - await assert.rejects(operation.promise(), expectedError); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', - }); - await 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.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes groupAssetsStream with error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.groupAssets, request)); - assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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.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( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('groupFindings', () => { - it('invokes groupFindings without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes groupFindingsStream with error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.groupFindings, request)); - assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAssets', () => { - it('invokes listAssets without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAssetsStream with error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); - assert( - (client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAssetsAsync(request); - await 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( - (client.descriptors.page.listAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listFindings', () => { - it('invokes listFindings without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listFindingsStream with error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFindings, request)); - assert( - (client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSources', () => { - it('invokes listSources without error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.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); - 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 () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSourcesStream with error', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSources, request)); - assert( - (client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSourcesAsync(request); - await 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( - (client.descriptors.page.listSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('asset', async () => { - 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', - }); - await 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', async () => { - 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', - }); - await 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', async () => { - const fakePath = "/rendered/path/organization"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - 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', - }); - await 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', async () => { - const fakePath = "/rendered/path/organizationSettings"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - 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', - }); - await 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', async () => { - 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', - }); - await 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/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts deleted file mode 100644 index a388c67efe6..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ /dev/null @@ -1,4368 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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) - .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', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = securitycenterModule.v1p1beta1.SecurityCenterClient.servicePath; - assert.strictEqual(servicePath, 'securitycenter.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = securitycenterModule.v1p1beta1.SecurityCenterClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new securitycenterModule.v1p1beta1.SecurityCenterClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - 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 for the initialized client', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.securityCenterStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - 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(); - }).catch(err => {throw err}); - }); - - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createSource(request), expectedError); - }); - }); - - describe('createFinding', () => { - it('invokes createFinding without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createFinding(request), expectedError); - }); - }); - - describe('createNotificationConfig', () => { - it('invokes createNotificationConfig without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createNotificationConfig(request), expectedError); - }); - }); - - describe('deleteNotificationConfig', () => { - it('invokes deleteNotificationConfig without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNotificationConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteNotificationConfig(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('getNotificationConfig', () => { - it('invokes getNotificationConfig without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getNotificationConfig(request), expectedError); - }); - }); - - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOrganizationSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOrganizationSettings(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getOrganizationSettings(request), expectedError); - }); - }); - - describe('getSource', () => { - it('invokes getSource without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSource(request), expectedError); - }); - }); - - describe('setFindingState', () => { - it('invokes setFindingState without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setFindingState(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('updateFinding', () => { - it('invokes updateFinding without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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 = 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() - ); - request.finding ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateFinding(request), expectedError); - }); - }); - - describe('updateNotificationConfig', () => { - it('invokes updateNotificationConfig without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateNotificationConfig(request), expectedError); - }); - }); - - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateOrganizationSettings(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() - ); - request.organizationSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name']); - request.organizationSettings.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateOrganizationSettings(request), expectedError); - }); - }); - - describe('updateSource', () => { - it('invokes updateSource without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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 = 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() - ); - request.source ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateSource(request), expectedError); - }); - }); - - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - 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'); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSecurityMarks(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - 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().catch(err => {throw err}); - await assert.rejects(client.updateSecurityMarks(request), expectedError); - }); - }); - - describe('runAssetDiscovery', () => { - it('invokes runAssetDiscovery without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.runAssetDiscovery(request); - await assert.rejects(operation.promise(), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', - }); - await 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.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes groupAssetsStream with error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.groupAssets, request)); - assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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.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( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('groupFindings', () => { - it('invokes groupFindings without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes groupFindingsStream with error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.groupFindings, request)); - assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAssets', () => { - it('invokes listAssets without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAssetsStream with error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); - assert( - (client.descriptors.page.listAssets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAssetsAsync(request); - await 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( - (client.descriptors.page.listAssets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listFindings', () => { - it('invokes listFindings without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listFindingsStream with error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFindings, request)); - assert( - (client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listNotificationConfigs', () => { - it('invokes listNotificationConfigs without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNotificationConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNotificationConfigs(request), expectedError); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNotificationConfigsStream with error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNotificationConfigs, request)); - assert( - (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSources', () => { - it('invokes listSources without error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.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); - 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 () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSourcesStream with error', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSources, request)); - assert( - (client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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( - (client.descriptors.page.listSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSourcesAsync(request); - await 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( - (client.descriptors.page.listSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('folderAsset', async () => { - const fakePath = "/rendered/path/folderAsset"; - const expectedParameters = { - folder: "folderValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderAssetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderAssetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderAssetPath', () => { - const result = client.folderAssetPath("folderValue", "assetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderAssetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderAssetName', () => { - const result = client.matchFolderFromFolderAssetName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderAssetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAssetFromFolderAssetName', () => { - const result = client.matchAssetFromFolderAssetName(fakePath); - assert.strictEqual(result, "assetValue"); - assert((client.pathTemplates.folderAssetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderAssetSecurityMarks', async () => { - const fakePath = "/rendered/path/folderAssetSecurityMarks"; - const expectedParameters = { - folder: "folderValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - 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', - }); - await 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', async () => { - const fakePath = "/rendered/path/folderSourceFinding"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderSourceFindingPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSourceFindingPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSourceFindingPath', () => { - const result = client.folderSourceFindingPath("folderValue", "sourceValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSourceFindingPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - 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', async () => { - 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', - }); - await 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.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { - const result = client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('notificationConfig', async () => { - 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', - }); - await 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', async () => { - const fakePath = "/rendered/path/organization"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('organizationAsset', async () => { - 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', - }); - await 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', async () => { - 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', - }); - await 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', async () => { - const fakePath = "/rendered/path/organizationSettings"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('organizationSource', async () => { - const fakePath = "/rendered/path/organizationSource"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - }; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSourcePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourcePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourcePath', () => { - const result = client.organizationSourcePath("organizationValue", "sourceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourcePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceName', () => { - const result = client.matchOrganizationFromOrganizationSourceName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceName', () => { - const result = client.matchSourceFromOrganizationSourceName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSourceFinding', async () => { - 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', - }); - await client.initialize(); - client.pathTemplates.organizationSourceFindingPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceFindingPathTemplate.match = - sinon.stub().returns(expectedParameters); - - 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', async () => { - 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', - }); - await 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('projectAsset', async () => { - 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', - }); - await 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', async () => { - 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', - }); - await 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', async () => { - 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', - }); - await 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', async () => { - 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', - }); - await 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', async () => { - 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', - }); - await 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('matchSourceFromProjectSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((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)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v2.ts b/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v2.ts deleted file mode 100644 index de8659027bd..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/test/gapic_security_center_v2.ts +++ /dev/null @@ -1,8513 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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) - .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('v2.SecurityCenterClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new securitycenterModule.v2.SecurityCenterClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new securitycenterModule.v2.SecurityCenterClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = securitycenterModule.v2.SecurityCenterClient.servicePath; - assert.strictEqual(servicePath, 'securitycenter.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = securitycenterModule.v2.SecurityCenterClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'securitycenter.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new securitycenterModule.v2.SecurityCenterClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new securitycenterModule.v2.SecurityCenterClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new securitycenterModule.v2.SecurityCenterClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new securitycenterModule.v2.SecurityCenterClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'securitycenter.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new securitycenterModule.v2.SecurityCenterClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = securitycenterModule.v2.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new securitycenterModule.v2.SecurityCenterClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new securitycenterModule.v2.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 initialized client', done => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.securityCenterStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.securityCenterStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new securitycenterModule.v2.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.v2.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('batchCreateResourceValueConfigs', () => { - it('invokes batchCreateResourceValueConfigs without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse() - ); - client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateResourceValueConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateResourceValueConfigs without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse() - ); - client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateResourceValueConfigs( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBatchCreateResourceValueConfigsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateResourceValueConfigs with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateResourceValueConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateResourceValueConfigs(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateResourceValueConfigs with closed client', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.batchCreateResourceValueConfigs(request), expectedError); - }); - }); - - describe('createBigQueryExport', () => { - it('invokes createBigQueryExport without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateBigQueryExportRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BigQueryExport() - ); - client.innerApiCalls.createBigQueryExport = stubSimpleCall(expectedResponse); - const [response] = await client.createBigQueryExport(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateBigQueryExportRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BigQueryExport() - ); - client.innerApiCalls.createBigQueryExport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBigQueryExport( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBigQueryExport|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateBigQueryExportRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createBigQueryExport(request), expectedError); - }); - }); - - describe('createFinding', () => { - it('invokes createFinding without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Finding() - ); - client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); - const [response] = await client.createFinding(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Finding() - ); - client.innerApiCalls.createFinding = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createFinding( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IFinding|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateFindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateFindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createFinding(request), expectedError); - }); - }); - - describe('createMuteConfig', () => { - it('invokes createMuteConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - // path template: organizations/*/locations/{location=*} - request.parent = 'organizations/value/locations/value'; - // path template: folders/*/locations/{location=*} - request.parent = 'folders/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.MuteConfig() - ); - client.innerApiCalls.createMuteConfig = stubSimpleCall(expectedResponse); - const [response] = await client.createMuteConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - // path template: organizations/*/locations/{location=*} - request.parent = 'organizations/value/locations/value'; - // path template: folders/*/locations/{location=*} - request.parent = 'folders/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.MuteConfig() - ); - client.innerApiCalls.createMuteConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMuteConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IMuteConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - // path template: organizations/*/locations/{location=*} - request.parent = 'organizations/value/locations/value'; - // path template: folders/*/locations/{location=*} - request.parent = 'folders/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createMuteConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createMuteConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - // path template: organizations/*/locations/{location=*} - request.parent = 'organizations/value/locations/value'; - // path template: folders/*/locations/{location=*} - request.parent = 'folders/value/locations/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createMuteConfig(request), expectedError); - }); - }); - - describe('createNotificationConfig', () => { - it('invokes createNotificationConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.NotificationConfig() - ); - client.innerApiCalls.createNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.createNotificationConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.NotificationConfig() - ); - client.innerApiCalls.createNotificationConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNotificationConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.INotificationConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateNotificationConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createNotificationConfig(request), expectedError); - }); - }); - - describe('createSource', () => { - it('invokes createSource without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Source() - ); - client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); - const [response] = await client.createSource(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Source() - ); - client.innerApiCalls.createSource = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSource( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISource|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.CreateSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.CreateSourceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createSource(request), expectedError); - }); - }); - - describe('deleteBigQueryExport', () => { - it('invokes deleteBigQueryExport without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBigQueryExport = stubSimpleCall(expectedResponse); - const [response] = await client.deleteBigQueryExport(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBigQueryExport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBigQueryExport( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteBigQueryExport(request), expectedError); - }); - }); - - describe('deleteMuteConfig', () => { - it('invokes deleteMuteConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.name = 'projects/value/locations/value/muteConfigs/value'; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.name = 'organizations/value/locations/value/muteConfigs/value'; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteMuteConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteMuteConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.name = 'projects/value/locations/value/muteConfigs/value'; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.name = 'organizations/value/locations/value/muteConfigs/value'; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteMuteConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteMuteConfig( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.name = 'projects/value/locations/value/muteConfigs/value'; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.name = 'organizations/value/locations/value/muteConfigs/value'; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMuteConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteMuteConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.name = 'projects/value/locations/value/muteConfigs/value'; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.name = 'organizations/value/locations/value/muteConfigs/value'; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteMuteConfig(request), expectedError); - }); - }); - - describe('deleteNotificationConfig', () => { - it('invokes deleteNotificationConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNotificationConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteNotificationConfig(request), expectedError); - }); - }); - - describe('deleteResourceValueConfig', () => { - it('invokes deleteResourceValueConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteResourceValueConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteResourceValueConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceValueConfig without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteResourceValueConfig( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceValueConfig with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteResourceValueConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteResourceValueConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceValueConfig with closed client', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteResourceValueConfig(request), expectedError); - }); - }); - - describe('getBigQueryExport', () => { - it('invokes getBigQueryExport without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BigQueryExport() - ); - client.innerApiCalls.getBigQueryExport = stubSimpleCall(expectedResponse); - const [response] = await client.getBigQueryExport(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BigQueryExport() - ); - client.innerApiCalls.getBigQueryExport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBigQueryExport( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBigQueryExport|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetBigQueryExportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetBigQueryExportRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBigQueryExport(request), expectedError); - }); - }); - - describe('getSimulation', () => { - it('invokes getSimulation without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetSimulationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSimulationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Simulation() - ); - client.innerApiCalls.getSimulation = stubSimpleCall(expectedResponse); - const [response] = await client.getSimulation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSimulation without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetSimulationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSimulationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Simulation() - ); - client.innerApiCalls.getSimulation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSimulation( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISimulation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSimulation with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetSimulationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSimulationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSimulation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSimulation(request), expectedError); - const actualRequest = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSimulation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSimulation with closed client', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetSimulationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSimulationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSimulation(request), expectedError); - }); - }); - - describe('getValuedResource', () => { - it('invokes getValuedResource without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetValuedResourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetValuedResourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ValuedResource() - ); - client.innerApiCalls.getValuedResource = stubSimpleCall(expectedResponse); - const [response] = await client.getValuedResource(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getValuedResource without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetValuedResourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetValuedResourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ValuedResource() - ); - client.innerApiCalls.getValuedResource = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getValuedResource( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IValuedResource|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getValuedResource with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetValuedResourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetValuedResourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getValuedResource = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getValuedResource(request), expectedError); - const actualRequest = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getValuedResource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getValuedResource with closed client', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetValuedResourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetValuedResourceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getValuedResource(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('getMuteConfig', () => { - it('invokes getMuteConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.name = 'projects/value/locations/value/muteConfigs/value'; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.name = 'organizations/value/locations/value/muteConfigs/value'; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.MuteConfig() - ); - client.innerApiCalls.getMuteConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getMuteConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.name = 'projects/value/locations/value/muteConfigs/value'; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.name = 'organizations/value/locations/value/muteConfigs/value'; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.MuteConfig() - ); - client.innerApiCalls.getMuteConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMuteConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IMuteConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.name = 'projects/value/locations/value/muteConfigs/value'; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.name = 'organizations/value/locations/value/muteConfigs/value'; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.getMuteConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMuteConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetMuteConfigRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.name = 'projects/value/locations/value/muteConfigs/value'; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.name = 'organizations/value/locations/value/muteConfigs/value'; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getMuteConfig(request), expectedError); - }); - }); - - describe('getNotificationConfig', () => { - it('invokes getNotificationConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.NotificationConfig() - ); - client.innerApiCalls.getNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getNotificationConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.NotificationConfig() - ); - client.innerApiCalls.getNotificationConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNotificationConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.INotificationConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetNotificationConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetNotificationConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getNotificationConfig(request), expectedError); - }); - }); - - describe('getResourceValueConfig', () => { - it('invokes getResourceValueConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ResourceValueConfig() - ); - client.innerApiCalls.getResourceValueConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getResourceValueConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceValueConfig without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ResourceValueConfig() - ); - client.innerApiCalls.getResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getResourceValueConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IResourceValueConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceValueConfig with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getResourceValueConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getResourceValueConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceValueConfig with closed client', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetResourceValueConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetResourceValueConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getResourceValueConfig(request), expectedError); - }); - }); - - describe('getSource', () => { - it('invokes getSource without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Source() - ); - client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); - const [response] = await client.getSource(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Source() - ); - client.innerApiCalls.getSource = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSource( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISource|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GetSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GetSourceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSource(request), expectedError); - }); - }); - - describe('setFindingState', () => { - it('invokes setFindingState without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Finding() - ); - client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); - const [response] = await client.setFindingState(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Finding() - ); - client.innerApiCalls.setFindingState = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setFindingState( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IFinding|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SetFindingStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.SetFindingStateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setFindingState(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('setMute', () => { - it('invokes setMute without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SetMuteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.SetMuteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Finding() - ); - client.innerApiCalls.setMute = stubSimpleCall(expectedResponse); - const [response] = await client.setMute(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SetMuteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.SetMuteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Finding() - ); - client.innerApiCalls.setMute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setMute( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IFinding|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SetMuteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SetMuteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.SetMuteRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setMute(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('updateBigQueryExport', () => { - it('invokes updateBigQueryExport without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest() - ); - request.bigQueryExport ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); - request.bigQueryExport.name = defaultValue1; - const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BigQueryExport() - ); - client.innerApiCalls.updateBigQueryExport = stubSimpleCall(expectedResponse); - const [response] = await client.updateBigQueryExport(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest() - ); - request.bigQueryExport ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); - request.bigQueryExport.name = defaultValue1; - const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BigQueryExport() - ); - client.innerApiCalls.updateBigQueryExport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBigQueryExport( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBigQueryExport|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest() - ); - request.bigQueryExport ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest() - ); - request.bigQueryExport ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest', ['bigQueryExport', 'name']); - request.bigQueryExport.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateBigQueryExport(request), expectedError); - }); - }); - - describe('updateExternalSystem', () => { - it('invokes updateExternalSystem without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateExternalSystemRequest() - ); - request.externalSystem ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateExternalSystemRequest', ['externalSystem', 'name']); - request.externalSystem.name = defaultValue1; - const expectedHeaderRequestParams = `external_system.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ExternalSystem() - ); - client.innerApiCalls.updateExternalSystem = stubSimpleCall(expectedResponse); - const [response] = await client.updateExternalSystem(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateExternalSystemRequest() - ); - request.externalSystem ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateExternalSystemRequest', ['externalSystem', 'name']); - request.externalSystem.name = defaultValue1; - const expectedHeaderRequestParams = `external_system.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ExternalSystem() - ); - client.innerApiCalls.updateExternalSystem = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateExternalSystem( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IExternalSystem|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateExternalSystemRequest() - ); - request.externalSystem ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateExternalSystemRequest() - ); - request.externalSystem ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateExternalSystemRequest', ['externalSystem', 'name']); - request.externalSystem.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateExternalSystem(request), expectedError); - }); - }); - - describe('updateFinding', () => { - it('invokes updateFinding without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateFindingRequest', ['finding', 'name']); - request.finding.name = defaultValue1; - const expectedHeaderRequestParams = `finding.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Finding() - ); - client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); - const [response] = await client.updateFinding(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateFindingRequest', ['finding', 'name']); - request.finding.name = defaultValue1; - const expectedHeaderRequestParams = `finding.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Finding() - ); - client.innerApiCalls.updateFinding = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateFinding( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IFinding|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateFindingRequest() - ); - request.finding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateFindingRequest', ['finding', 'name']); - request.finding.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateFinding(request), expectedError); - }); - }); - - describe('updateMuteConfig', () => { - it('invokes updateMuteConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateMuteConfigRequest() - ); - request.muteConfig = {}; - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'projects/value/locations/value/muteConfigs/value'; - request.muteConfig = {}; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'organizations/value/locations/value/muteConfigs/value'; - request.muteConfig = {}; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.MuteConfig() - ); - client.innerApiCalls.updateMuteConfig = stubSimpleCall(expectedResponse); - const [response] = await client.updateMuteConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateMuteConfigRequest() - ); - request.muteConfig = {}; - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'projects/value/locations/value/muteConfigs/value'; - request.muteConfig = {}; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'organizations/value/locations/value/muteConfigs/value'; - request.muteConfig = {}; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.MuteConfig() - ); - client.innerApiCalls.updateMuteConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMuteConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IMuteConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateMuteConfigRequest() - ); - request.muteConfig = {}; - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'projects/value/locations/value/muteConfigs/value'; - request.muteConfig = {}; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'organizations/value/locations/value/muteConfigs/value'; - request.muteConfig = {}; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMuteConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMuteConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateMuteConfigRequest() - ); - request.muteConfig = {}; - // path template: projects/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'projects/value/locations/value/muteConfigs/value'; - request.muteConfig = {}; - // path template: organizations/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'organizations/value/locations/value/muteConfigs/value'; - request.muteConfig = {}; - // path template: folders/*/locations/{location=*}/muteConfigs/* - request.muteConfig.name = 'folders/value/locations/value/muteConfigs/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateMuteConfig(request), expectedError); - }); - }); - - describe('updateNotificationConfig', () => { - it('invokes updateNotificationConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.NotificationConfig() - ); - client.innerApiCalls.updateNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.updateNotificationConfig(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.NotificationConfig() - ); - client.innerApiCalls.updateNotificationConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateNotificationConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.INotificationConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedHeaderRequestParams = `notification_config.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateNotificationConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateNotificationConfig(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest() - ); - request.notificationConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest', ['notificationConfig', 'name']); - request.notificationConfig.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateNotificationConfig(request), expectedError); - }); - }); - - describe('updateResourceValueConfig', () => { - it('invokes updateResourceValueConfig without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest() - ); - request.resourceValueConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); - request.resourceValueConfig.name = defaultValue1; - const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ResourceValueConfig() - ); - client.innerApiCalls.updateResourceValueConfig = stubSimpleCall(expectedResponse); - const [response] = await client.updateResourceValueConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceValueConfig without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest() - ); - request.resourceValueConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); - request.resourceValueConfig.name = defaultValue1; - const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ResourceValueConfig() - ); - client.innerApiCalls.updateResourceValueConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateResourceValueConfig( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IResourceValueConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceValueConfig with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest() - ); - request.resourceValueConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); - request.resourceValueConfig.name = defaultValue1; - const expectedHeaderRequestParams = `resource_value_config.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateResourceValueConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateResourceValueConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceValueConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceValueConfig with closed client', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest() - ); - request.resourceValueConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest', ['resourceValueConfig', 'name']); - request.resourceValueConfig.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateResourceValueConfig(request), expectedError); - }); - }); - - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SecurityMarks() - ); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall(expectedResponse); - const [response] = await client.updateSecurityMarks(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedHeaderRequestParams = `security_marks.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.SecurityMarks() - ); - client.innerApiCalls.updateSecurityMarks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSecurityMarks( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISecurityMarks|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest() - ); - request.securityMarks ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest', ['securityMarks', 'name']); - request.securityMarks.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateSecurityMarks(request), expectedError); - }); - }); - - describe('updateSource', () => { - it('invokes updateSource without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSourceRequest', ['source', 'name']); - request.source.name = defaultValue1; - const expectedHeaderRequestParams = `source.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Source() - ); - client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); - const [response] = await client.updateSource(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSourceRequest', ['source', 'name']); - request.source.name = defaultValue1; - const expectedHeaderRequestParams = `source.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.Source() - ); - client.innerApiCalls.updateSource = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSource( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISource|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.UpdateSourceRequest() - ); - request.source ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.UpdateSourceRequest', ['source', 'name']); - request.source.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateSource(request), expectedError); - }); - }); - - describe('bulkMuteFindings', () => { - it('invokes bulkMuteFindings without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BulkMuteFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.BulkMuteFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BulkMuteFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.BulkMuteFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BulkMuteFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.BulkMuteFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.BulkMuteFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.bulkMuteFindings = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.bulkMuteFindings(request); - await assert.rejects(operation.promise(), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('groupFindings', () => { - it('invokes groupFindings without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - ]; - client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); - const [response] = await client.groupFindings(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - ]; - client.innerApiCalls.groupFindings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.groupFindings( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IGroupResult[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.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.v2.GroupResult[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes groupFindingsStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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.v2.GroupResult[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.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.groupFindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.groupFindings, request)); - assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with groupFindings without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.GroupResult()), - ]; - client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with groupFindings with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.GroupFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.GroupFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.groupFindingsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.groupFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAttackPaths', () => { - it('invokes listAttackPaths without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - ]; - client.innerApiCalls.listAttackPaths = stubSimpleCall(expectedResponse); - const [response] = await client.listAttackPaths(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttackPaths without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - ]; - client.innerApiCalls.listAttackPaths = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAttackPaths( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IAttackPath[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttackPaths with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAttackPaths = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAttackPaths(request), expectedError); - const actualRequest = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttackPaths as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttackPathsStream without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - ]; - client.descriptors.page.listAttackPaths.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAttackPathsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v2.AttackPath[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.AttackPath) => { - 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.listAttackPaths.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttackPaths, request)); - assert( - (client.descriptors.page.listAttackPaths.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAttackPathsStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttackPaths.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAttackPathsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v2.AttackPath[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.AttackPath) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAttackPaths.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttackPaths, request)); - assert( - (client.descriptors.page.listAttackPaths.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttackPaths without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.AttackPath()), - ]; - client.descriptors.page.listAttackPaths.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.IAttackPath[] = []; - const iterable = client.listAttackPathsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttackPaths with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListAttackPathsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListAttackPathsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttackPaths.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAttackPathsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.IAttackPath[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttackPaths.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBigQueryExports', () => { - it('invokes listBigQueryExports without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - ]; - client.innerApiCalls.listBigQueryExports = stubSimpleCall(expectedResponse); - const [response] = await client.listBigQueryExports(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - ]; - client.innerApiCalls.listBigQueryExports = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBigQueryExports( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IBigQueryExport[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - ]; - client.descriptors.page.listBigQueryExports.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBigQueryExportsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v2.BigQueryExport[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.BigQueryExport) => { - 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.listBigQueryExports.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBigQueryExports, request)); - assert( - (client.descriptors.page.listBigQueryExports.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBigQueryExportsStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - 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.v2.BigQueryExport[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.BigQueryExport) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBigQueryExports.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBigQueryExports, request)); - assert( - (client.descriptors.page.listBigQueryExports.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBigQueryExports without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.BigQueryExport()), - ]; - client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.IBigQueryExport[] = []; - const iterable = client.listBigQueryExportsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBigQueryExports with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListBigQueryExportsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListBigQueryExportsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBigQueryExportsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.IBigQueryExport[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listFindings', () => { - it('invokes listFindings without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - ]; - client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); - const [response] = await client.listFindings(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - ]; - client.innerApiCalls.listFindings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listFindings( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ListFindingsResponse.IListFindingsResult[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.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.v2.ListFindingsResponse.ListFindingsResult[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listFindingsStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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.v2.ListFindingsResponse.ListFindingsResult[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFindings, request)); - assert( - (client.descriptors.page.listFindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listFindings without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult()), - ]; - client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listFindings with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListFindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListFindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFindingsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listFindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listMuteConfigs', () => { - it('invokes listMuteConfigs without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs - request.parent = 'projects/value/locations/value/muteConfigs'; - // path template: organizations/*/locations/{location=*}/muteConfigs - request.parent = 'organizations/value/locations/value/muteConfigs'; - // path template: folders/*/locations/{location=*}/muteConfigs - request.parent = 'folders/value/locations/value/muteConfigs'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - ]; - client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.listMuteConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs - request.parent = 'projects/value/locations/value/muteConfigs'; - // path template: organizations/*/locations/{location=*}/muteConfigs - request.parent = 'organizations/value/locations/value/muteConfigs'; - // path template: folders/*/locations/{location=*}/muteConfigs - request.parent = 'folders/value/locations/value/muteConfigs'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - ]; - client.innerApiCalls.listMuteConfigs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMuteConfigs( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IMuteConfig[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs - request.parent = 'projects/value/locations/value/muteConfigs'; - // path template: organizations/*/locations/{location=*}/muteConfigs - request.parent = 'organizations/value/locations/value/muteConfigs'; - // path template: folders/*/locations/{location=*}/muteConfigs - request.parent = 'folders/value/locations/value/muteConfigs'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.listMuteConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMuteConfigs(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs - request.parent = 'projects/value/locations/value/muteConfigs'; - // path template: organizations/*/locations/{location=*}/muteConfigs - request.parent = 'organizations/value/locations/value/muteConfigs'; - // path template: folders/*/locations/{location=*}/muteConfigs - request.parent = 'folders/value/locations/value/muteConfigs'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - ]; - client.descriptors.page.listMuteConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMuteConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v2.MuteConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.MuteConfig) => { - 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.listMuteConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMuteConfigs, request)); - assert( - (client.descriptors.page.listMuteConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listMuteConfigsStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs - request.parent = 'projects/value/locations/value/muteConfigs'; - // path template: organizations/*/locations/{location=*}/muteConfigs - request.parent = 'organizations/value/locations/value/muteConfigs'; - // path template: folders/*/locations/{location=*}/muteConfigs - request.parent = 'folders/value/locations/value/muteConfigs'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - 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.v2.MuteConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.MuteConfig) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listMuteConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMuteConfigs, request)); - assert( - (client.descriptors.page.listMuteConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listMuteConfigs without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs - request.parent = 'projects/value/locations/value/muteConfigs'; - // path template: organizations/*/locations/{location=*}/muteConfigs - request.parent = 'organizations/value/locations/value/muteConfigs'; - // path template: folders/*/locations/{location=*}/muteConfigs - request.parent = 'folders/value/locations/value/muteConfigs'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.MuteConfig()), - ]; - client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.IMuteConfig[] = []; - const iterable = client.listMuteConfigsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listMuteConfigs with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListMuteConfigsRequest() - ); - // path template: projects/*/locations/{location=*}/muteConfigs - request.parent = 'projects/value/locations/value/muteConfigs'; - // path template: organizations/*/locations/{location=*}/muteConfigs - request.parent = 'organizations/value/locations/value/muteConfigs'; - // path template: folders/*/locations/{location=*}/muteConfigs - request.parent = 'folders/value/locations/value/muteConfigs'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMuteConfigsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.IMuteConfig[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listNotificationConfigs', () => { - it('invokes listNotificationConfigs without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - ]; - client.innerApiCalls.listNotificationConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.listNotificationConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - ]; - client.innerApiCalls.listNotificationConfigs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNotificationConfigs( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.INotificationConfig[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNotificationConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNotificationConfigs(request), expectedError); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.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.v2.NotificationConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNotificationConfigsStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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.v2.NotificationConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.NotificationConfig) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNotificationConfigs, request)); - assert( - (client.descriptors.page.listNotificationConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNotificationConfigs without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.NotificationConfig()), - ]; - client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNotificationConfigs with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListNotificationConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListNotificationConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNotificationConfigsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listNotificationConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listResourceValueConfigs', () => { - it('invokes listResourceValueConfigs without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - ]; - client.innerApiCalls.listResourceValueConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.listResourceValueConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceValueConfigs without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - ]; - client.innerApiCalls.listResourceValueConfigs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listResourceValueConfigs( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IResourceValueConfig[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceValueConfigs with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listResourceValueConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listResourceValueConfigs(request), expectedError); - const actualRequest = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceValueConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceValueConfigsStream without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - ]; - client.descriptors.page.listResourceValueConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listResourceValueConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v2.ResourceValueConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.ResourceValueConfig) => { - 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.listResourceValueConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listResourceValueConfigs, request)); - assert( - (client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listResourceValueConfigsStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listResourceValueConfigs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listResourceValueConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v2.ResourceValueConfig[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.ResourceValueConfig) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listResourceValueConfigs, request)); - assert( - (client.descriptors.page.listResourceValueConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listResourceValueConfigs without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ResourceValueConfig()), - ]; - client.descriptors.page.listResourceValueConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.IResourceValueConfig[] = []; - const iterable = client.listResourceValueConfigsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listResourceValueConfigs with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListResourceValueConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listResourceValueConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listResourceValueConfigsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.IResourceValueConfig[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listResourceValueConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSources', () => { - it('invokes listSources without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - ]; - client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); - const [response] = await client.listSources(request); - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - ]; - client.innerApiCalls.listSources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSources( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.ISource[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.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); - 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 () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.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.v2.Source[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSourcesStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - 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.v2.Source[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.Source) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSources, request)); - assert( - (client.descriptors.page.listSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSources without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.Source()), - ]; - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSources with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.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( - (client.descriptors.page.listSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listValuedResources', () => { - it('invokes listValuedResources without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - ]; - client.innerApiCalls.listValuedResources = stubSimpleCall(expectedResponse); - const [response] = await client.listValuedResources(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listValuedResources without error using callback', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - ]; - client.innerApiCalls.listValuedResources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listValuedResources( - request, - (err?: Error|null, result?: protos.google.cloud.securitycenter.v2.IValuedResource[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listValuedResources with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listValuedResources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listValuedResources(request), expectedError); - const actualRequest = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listValuedResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listValuedResourcesStream without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - ]; - client.descriptors.page.listValuedResources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listValuedResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v2.ValuedResource[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.ValuedResource) => { - 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.listValuedResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listValuedResources, request)); - assert( - (client.descriptors.page.listValuedResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listValuedResourcesStream with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listValuedResources.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listValuedResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v2.ValuedResource[] = []; - stream.on('data', (response: protos.google.cloud.securitycenter.v2.ValuedResource) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listValuedResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listValuedResources, request)); - assert( - (client.descriptors.page.listValuedResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listValuedResources without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - generateSampleMessage(new protos.google.cloud.securitycenter.v2.ValuedResource()), - ]; - client.descriptors.page.listValuedResources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v2.IValuedResource[] = []; - const iterable = client.listValuedResourcesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listValuedResources with error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v2.ListValuedResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.securitycenter.v2.ListValuedResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listValuedResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listValuedResourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v2.IValuedResource[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listValuedResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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.v2.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); - } - }).catch(err => {throw err}); - }); - 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.v2.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.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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.v2.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); - } - }).catch(err => {throw err}); - }); - 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.v2.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.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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.v2.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); - } - }).catch(err => {throw err}); - }); - 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.v2.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.v2.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.IOperation[] = []; - 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.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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.IOperation[] = []; - 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('folderAssetSecurityMarks', async () => { - const fakePath = "/rendered/path/folderAssetSecurityMarks"; - const expectedParameters = { - folder: "folderValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('folderConstraintName', async () => { - const fakePath = "/rendered/path/folderConstraintName"; - const expectedParameters = { - folder: "folderValue", - constraint_name: "constraintNameValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderConstraintNamePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderConstraintNamePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderConstraintNamePath', () => { - const result = client.folderConstraintNamePath("folderValue", "constraintNameValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderConstraintNamePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderConstraintNameName', () => { - const result = client.matchFolderFromFolderConstraintNameName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConstraintNameFromFolderConstraintNameName', () => { - const result = client.matchConstraintNameFromFolderConstraintNameName(fakePath); - assert.strictEqual(result, "constraintNameValue"); - assert((client.pathTemplates.folderConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderLocationBigQueryExports', async () => { - const fakePath = "/rendered/path/folderLocationBigQueryExports"; - const expectedParameters = { - folder: "folderValue", - location: "locationValue", - export: "exportValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderLocationBigQueryExportsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderLocationBigQueryExportsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderLocationBigQueryExportsPath', () => { - const result = client.folderLocationBigQueryExportsPath("folderValue", "locationValue", "exportValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderLocationBigQueryExportsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderLocationBigQueryExportsName', () => { - const result = client.matchFolderFromFolderLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFolderLocationBigQueryExportsName', () => { - const result = client.matchLocationFromFolderLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.folderLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExportFromFolderLocationBigQueryExportsName', () => { - const result = client.matchExportFromFolderLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "exportValue"); - assert((client.pathTemplates.folderLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderLocationMuteConfigs', async () => { - const fakePath = "/rendered/path/folderLocationMuteConfigs"; - const expectedParameters = { - folder: "folderValue", - location: "locationValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderLocationMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderLocationMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderLocationMuteConfigsPath', () => { - const result = client.folderLocationMuteConfigsPath("folderValue", "locationValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderLocationMuteConfigsName', () => { - const result = client.matchFolderFromFolderLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFolderLocationMuteConfigsName', () => { - const result = client.matchLocationFromFolderLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromFolderLocationMuteConfigsName', () => { - const result = client.matchMuteConfigFromFolderLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.folderLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderLocationNotificationConfigs', async () => { - const fakePath = "/rendered/path/folderLocationNotificationConfigs"; - const expectedParameters = { - folder: "folderValue", - location: "locationValue", - notification_config: "notificationConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderLocationNotificationConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderLocationNotificationConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderLocationNotificationConfigsPath', () => { - const result = client.folderLocationNotificationConfigsPath("folderValue", "locationValue", "notificationConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderLocationNotificationConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderLocationNotificationConfigsName', () => { - const result = client.matchFolderFromFolderLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFolderLocationNotificationConfigsName', () => { - const result = client.matchLocationFromFolderLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.folderLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNotificationConfigFromFolderLocationNotificationConfigsName', () => { - const result = client.matchNotificationConfigFromFolderLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "notificationConfigValue"); - assert((client.pathTemplates.folderLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderMuteConfigs', async () => { - const fakePath = "/rendered/path/folderMuteConfigs"; - const expectedParameters = { - folder: "folderValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderMuteConfigsPath', () => { - const result = client.folderMuteConfigsPath("folderValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderMuteConfigsName', () => { - const result = client.matchFolderFromFolderMuteConfigsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromFolderMuteConfigsName', () => { - const result = client.matchMuteConfigFromFolderMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.folderMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSource', async () => { - const fakePath = "/rendered/path/folderSource"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('folderSourceFindingExternalsystem', async () => { - const fakePath = "/rendered/path/folderSourceFindingExternalsystem"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - finding: "findingValue", - externalsystem: "externalsystemValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/folderSourceFindingSecurityMarks"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { - const result = client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSourceFindings', async () => { - const fakePath = "/rendered/path/folderSourceFindings"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderSourceFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSourceFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSourceFindingsPath', () => { - const result = client.folderSourceFindingsPath("folderValue", "sourceValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSourceFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderSourceFindingsName', () => { - const result = client.matchFolderFromFolderSourceFindingsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceFindingsName', () => { - const result = client.matchSourceFromFolderSourceFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceFindingsName', () => { - const result = client.matchFindingFromFolderSourceFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSourceLocationFindingExternalsystem', async () => { - const fakePath = "/rendered/path/folderSourceLocationFindingExternalsystem"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - externalsystem: "externalsystemValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSourceLocationFindingExternalsystemPath', () => { - const result = client.folderSourceLocationFindingExternalsystemPath("folderValue", "sourceValue", "locationValue", "findingValue", "externalsystemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderSourceLocationFindingExternalsystemName', () => { - const result = client.matchFolderFromFolderSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceLocationFindingExternalsystemName', () => { - const result = client.matchSourceFromFolderSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFolderSourceLocationFindingExternalsystemName', () => { - const result = client.matchLocationFromFolderSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceLocationFindingExternalsystemName', () => { - const result = client.matchFindingFromFolderSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalsystemFromFolderSourceLocationFindingExternalsystemName', () => { - const result = client.matchExternalsystemFromFolderSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "externalsystemValue"); - assert((client.pathTemplates.folderSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSourceLocationFindingSecurityMarks', async () => { - const fakePath = "/rendered/path/folderSourceLocationFindingSecurityMarks"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSourceLocationFindingSecurityMarksPath', () => { - const result = client.folderSourceLocationFindingSecurityMarksPath("folderValue", "sourceValue", "locationValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderSourceLocationFindingSecurityMarksName', () => { - const result = client.matchFolderFromFolderSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceLocationFindingSecurityMarksName', () => { - const result = client.matchSourceFromFolderSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFolderSourceLocationFindingSecurityMarksName', () => { - const result = client.matchLocationFromFolderSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceLocationFindingSecurityMarksName', () => { - const result = client.matchFindingFromFolderSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('folderSourceLocationFindings', async () => { - const fakePath = "/rendered/path/folderSourceLocationFindings"; - const expectedParameters = { - folder: "folderValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.folderSourceLocationFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.folderSourceLocationFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('folderSourceLocationFindingsPath', () => { - const result = client.folderSourceLocationFindingsPath("folderValue", "sourceValue", "locationValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchFolderFromFolderSourceLocationFindingsName', () => { - const result = client.matchFolderFromFolderSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "folderValue"); - assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromFolderSourceLocationFindingsName', () => { - const result = client.matchSourceFromFolderSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFolderSourceLocationFindingsName', () => { - const result = client.matchLocationFromFolderSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromFolderSourceLocationFindingsName', () => { - const result = client.matchFindingFromFolderSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.folderSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organization', async () => { - const fakePath = "/rendered/path/organization"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/organizationAssetSecurityMarks"; - const expectedParameters = { - organization: "organizationValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('organizationConstraintName', async () => { - const fakePath = "/rendered/path/organizationConstraintName"; - const expectedParameters = { - organization: "organizationValue", - constraint_name: "constraintNameValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationConstraintNamePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationConstraintNamePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationConstraintNamePath', () => { - const result = client.organizationConstraintNamePath("organizationValue", "constraintNameValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationConstraintNamePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationConstraintNameName', () => { - const result = client.matchOrganizationFromOrganizationConstraintNameName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConstraintNameFromOrganizationConstraintNameName', () => { - const result = client.matchConstraintNameFromOrganizationConstraintNameName(fakePath); - assert.strictEqual(result, "constraintNameValue"); - assert((client.pathTemplates.organizationConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocation', async () => { - const fakePath = "/rendered/path/organizationLocation"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationPath', () => { - const result = client.organizationLocationPath("organizationValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationName', () => { - const result = client.matchOrganizationFromOrganizationLocationName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationName', () => { - const result = client.matchLocationFromOrganizationLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationBigQueryExports', async () => { - const fakePath = "/rendered/path/organizationLocationBigQueryExports"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - export: "exportValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationBigQueryExportsPath', () => { - const result = client.organizationLocationBigQueryExportsPath("organizationValue", "locationValue", "exportValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationBigQueryExportsName', () => { - const result = client.matchOrganizationFromOrganizationLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationBigQueryExportsName', () => { - const result = client.matchLocationFromOrganizationLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExportFromOrganizationLocationBigQueryExportsName', () => { - const result = client.matchExportFromOrganizationLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "exportValue"); - assert((client.pathTemplates.organizationLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationMuteConfigs', async () => { - const fakePath = "/rendered/path/organizationLocationMuteConfigs"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationMuteConfigsPath', () => { - const result = client.organizationLocationMuteConfigsPath("organizationValue", "locationValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationMuteConfigsName', () => { - const result = client.matchOrganizationFromOrganizationLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationMuteConfigsName', () => { - const result = client.matchLocationFromOrganizationLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromOrganizationLocationMuteConfigsName', () => { - const result = client.matchMuteConfigFromOrganizationLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.organizationLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationNotificationConfigs', async () => { - const fakePath = "/rendered/path/organizationLocationNotificationConfigs"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - notification_config: "notificationConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationNotificationConfigsPath', () => { - const result = client.organizationLocationNotificationConfigsPath("organizationValue", "locationValue", "notificationConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationNotificationConfigsName', () => { - const result = client.matchOrganizationFromOrganizationLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationNotificationConfigsName', () => { - const result = client.matchLocationFromOrganizationLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNotificationConfigFromOrganizationLocationNotificationConfigsName', () => { - const result = client.matchNotificationConfigFromOrganizationLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "notificationConfigValue"); - assert((client.pathTemplates.organizationLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationResourceValueConfigs', async () => { - const fakePath = "/rendered/path/organizationLocationResourceValueConfigs"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - resource_value_config: "resourceValueConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationResourceValueConfigsPath', () => { - const result = client.organizationLocationResourceValueConfigsPath("organizationValue", "locationValue", "resourceValueConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationResourceValueConfigsName', () => { - const result = client.matchOrganizationFromOrganizationLocationResourceValueConfigsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationResourceValueConfigsName', () => { - const result = client.matchLocationFromOrganizationLocationResourceValueConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchResourceValueConfigFromOrganizationLocationResourceValueConfigsName', () => { - const result = client.matchResourceValueConfigFromOrganizationLocationResourceValueConfigsName(fakePath); - assert.strictEqual(result, "resourceValueConfigValue"); - assert((client.pathTemplates.organizationLocationResourceValueConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationSimluationValuedResources', async () => { - const fakePath = "/rendered/path/organizationLocationSimluationValuedResources"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - simluation: "simluationValue", - valued_resource: "valuedResourceValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationSimluationValuedResourcesPath', () => { - const result = client.organizationLocationSimluationValuedResourcesPath("organizationValue", "locationValue", "simluationValue", "valuedResourceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationSimluationValuedResourcesName', () => { - const result = client.matchOrganizationFromOrganizationLocationSimluationValuedResourcesName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationSimluationValuedResourcesName', () => { - const result = client.matchLocationFromOrganizationLocationSimluationValuedResourcesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimluationFromOrganizationLocationSimluationValuedResourcesName', () => { - const result = client.matchSimluationFromOrganizationLocationSimluationValuedResourcesName(fakePath); - assert.strictEqual(result, "simluationValue"); - assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchValuedResourceFromOrganizationLocationSimluationValuedResourcesName', () => { - const result = client.matchValuedResourceFromOrganizationLocationSimluationValuedResourcesName(fakePath); - assert.strictEqual(result, "valuedResourceValue"); - assert((client.pathTemplates.organizationLocationSimluationValuedResourcesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationSimulationValuedResourceAttackPaths', async () => { - const fakePath = "/rendered/path/organizationLocationSimulationValuedResourceAttackPaths"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - simulation: "simulationValue", - valued_resource: "valuedResourceValue", - attack_path: "attackPathValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationSimulationValuedResourceAttackPathsPath', () => { - const result = client.organizationLocationSimulationValuedResourceAttackPathsPath("organizationValue", "locationValue", "simulationValue", "valuedResourceValue", "attackPathValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchOrganizationFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchLocationFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimulationFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchSimulationFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "simulationValue"); - assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchValuedResourceFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchValuedResourceFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "valuedResourceValue"); - assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttackPathFromOrganizationLocationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchAttackPathFromOrganizationLocationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "attackPathValue"); - assert((client.pathTemplates.organizationLocationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationLocationSimulations', async () => { - const fakePath = "/rendered/path/organizationLocationSimulations"; - const expectedParameters = { - organization: "organizationValue", - location: "locationValue", - simluation: "simluationValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationLocationSimulationsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationLocationSimulationsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationLocationSimulationsPath', () => { - const result = client.organizationLocationSimulationsPath("organizationValue", "locationValue", "simluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationLocationSimulationsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationLocationSimulationsName', () => { - const result = client.matchOrganizationFromOrganizationLocationSimulationsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationLocationSimulationsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationLocationSimulationsName', () => { - const result = client.matchLocationFromOrganizationLocationSimulationsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationLocationSimulationsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimluationFromOrganizationLocationSimulationsName', () => { - const result = client.matchSimluationFromOrganizationLocationSimulationsName(fakePath); - assert.strictEqual(result, "simluationValue"); - assert((client.pathTemplates.organizationLocationSimulationsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationMuteConfigs', async () => { - const fakePath = "/rendered/path/organizationMuteConfigs"; - const expectedParameters = { - organization: "organizationValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationMuteConfigsPath', () => { - const result = client.organizationMuteConfigsPath("organizationValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationMuteConfigsName', () => { - const result = client.matchOrganizationFromOrganizationMuteConfigsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromOrganizationMuteConfigsName', () => { - const result = client.matchMuteConfigFromOrganizationMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.organizationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationResourceValueConfigs', async () => { - const fakePath = "/rendered/path/organizationResourceValueConfigs"; - const expectedParameters = { - organization: "organizationValue", - resource_value_config: "resourceValueConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationResourceValueConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationResourceValueConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationResourceValueConfigsPath', () => { - const result = client.organizationResourceValueConfigsPath("organizationValue", "resourceValueConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationResourceValueConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationResourceValueConfigsName', () => { - const result = client.matchOrganizationFromOrganizationResourceValueConfigsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationResourceValueConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchResourceValueConfigFromOrganizationResourceValueConfigsName', () => { - const result = client.matchResourceValueConfigFromOrganizationResourceValueConfigsName(fakePath); - assert.strictEqual(result, "resourceValueConfigValue"); - assert((client.pathTemplates.organizationResourceValueConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSimulationValuedResourceAttackPaths', async () => { - const fakePath = "/rendered/path/organizationSimulationValuedResourceAttackPaths"; - const expectedParameters = { - organization: "organizationValue", - simulation: "simulationValue", - valued_resource: "valuedResourceValue", - attack_path: "attackPathValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSimulationValuedResourceAttackPathsPath', () => { - const result = client.organizationSimulationValuedResourceAttackPathsPath("organizationValue", "simulationValue", "valuedResourceValue", "attackPathValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchOrganizationFromOrganizationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimulationFromOrganizationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchSimulationFromOrganizationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "simulationValue"); - assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchValuedResourceFromOrganizationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchValuedResourceFromOrganizationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "valuedResourceValue"); - assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttackPathFromOrganizationSimulationValuedResourceAttackPathsName', () => { - const result = client.matchAttackPathFromOrganizationSimulationValuedResourceAttackPathsName(fakePath); - assert.strictEqual(result, "attackPathValue"); - assert((client.pathTemplates.organizationSimulationValuedResourceAttackPathsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSimulationValuedResources', async () => { - const fakePath = "/rendered/path/organizationSimulationValuedResources"; - const expectedParameters = { - organization: "organizationValue", - simulation: "simulationValue", - valued_resource: "valuedResourceValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSimulationValuedResourcesPath', () => { - const result = client.organizationSimulationValuedResourcesPath("organizationValue", "simulationValue", "valuedResourceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSimulationValuedResourcesName', () => { - const result = client.matchOrganizationFromOrganizationSimulationValuedResourcesName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimulationFromOrganizationSimulationValuedResourcesName', () => { - const result = client.matchSimulationFromOrganizationSimulationValuedResourcesName(fakePath); - assert.strictEqual(result, "simulationValue"); - assert((client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchValuedResourceFromOrganizationSimulationValuedResourcesName', () => { - const result = client.matchValuedResourceFromOrganizationSimulationValuedResourcesName(fakePath); - assert.strictEqual(result, "valuedResourceValue"); - assert((client.pathTemplates.organizationSimulationValuedResourcesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSimulations', async () => { - const fakePath = "/rendered/path/organizationSimulations"; - const expectedParameters = { - organization: "organizationValue", - simulation: "simulationValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSimulationsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSimulationsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSimulationsPath', () => { - const result = client.organizationSimulationsPath("organizationValue", "simulationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSimulationsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSimulationsName', () => { - const result = client.matchOrganizationFromOrganizationSimulationsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSimulationsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSimulationFromOrganizationSimulationsName', () => { - const result = client.matchSimulationFromOrganizationSimulationsName(fakePath); - assert.strictEqual(result, "simulationValue"); - assert((client.pathTemplates.organizationSimulationsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSource', async () => { - const fakePath = "/rendered/path/organizationSource"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSourcePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourcePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourcePath', () => { - const result = client.organizationSourcePath("organizationValue", "sourceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourcePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceName', () => { - const result = client.matchOrganizationFromOrganizationSourceName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceName', () => { - const result = client.matchSourceFromOrganizationSourceName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSourceFindingExternalsystem', async () => { - const fakePath = "/rendered/path/organizationSourceFindingExternalsystem"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - finding: "findingValue", - externalsystem: "externalsystemValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/organizationSourceFindingSecurityMarks"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('organizationSourceFindings', async () => { - const fakePath = "/rendered/path/organizationSourceFindings"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSourceFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourceFindingsPath', () => { - const result = client.organizationSourceFindingsPath("organizationValue", "sourceValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourceFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceFindingsName', () => { - const result = client.matchOrganizationFromOrganizationSourceFindingsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceFindingsName', () => { - const result = client.matchSourceFromOrganizationSourceFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromOrganizationSourceFindingsName', () => { - const result = client.matchFindingFromOrganizationSourceFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.organizationSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSourceLocationFindingExternalsystem', async () => { - const fakePath = "/rendered/path/organizationSourceLocationFindingExternalsystem"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - externalsystem: "externalsystemValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourceLocationFindingExternalsystemPath', () => { - const result = client.organizationSourceLocationFindingExternalsystemPath("organizationValue", "sourceValue", "locationValue", "findingValue", "externalsystemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceLocationFindingExternalsystemName', () => { - const result = client.matchOrganizationFromOrganizationSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceLocationFindingExternalsystemName', () => { - const result = client.matchSourceFromOrganizationSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationSourceLocationFindingExternalsystemName', () => { - const result = client.matchLocationFromOrganizationSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromOrganizationSourceLocationFindingExternalsystemName', () => { - const result = client.matchFindingFromOrganizationSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalsystemFromOrganizationSourceLocationFindingExternalsystemName', () => { - const result = client.matchExternalsystemFromOrganizationSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "externalsystemValue"); - assert((client.pathTemplates.organizationSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSourceLocationFindingSecurityMarks', async () => { - const fakePath = "/rendered/path/organizationSourceLocationFindingSecurityMarks"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourceLocationFindingSecurityMarksPath', () => { - const result = client.organizationSourceLocationFindingSecurityMarksPath("organizationValue", "sourceValue", "locationValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceLocationFindingSecurityMarksName', () => { - const result = client.matchOrganizationFromOrganizationSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceLocationFindingSecurityMarksName', () => { - const result = client.matchSourceFromOrganizationSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationSourceLocationFindingSecurityMarksName', () => { - const result = client.matchLocationFromOrganizationSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromOrganizationSourceLocationFindingSecurityMarksName', () => { - const result = client.matchFindingFromOrganizationSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.organizationSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationSourceLocationFindings', async () => { - const fakePath = "/rendered/path/organizationSourceLocationFindings"; - const expectedParameters = { - organization: "organizationValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationSourceLocationFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationSourceLocationFindingsPath', () => { - const result = client.organizationSourceLocationFindingsPath("organizationValue", "sourceValue", "locationValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationSourceLocationFindingsName', () => { - const result = client.matchOrganizationFromOrganizationSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromOrganizationSourceLocationFindingsName', () => { - const result = client.matchSourceFromOrganizationSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOrganizationSourceLocationFindingsName', () => { - const result = client.matchLocationFromOrganizationSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromOrganizationSourceLocationFindingsName', () => { - const result = client.matchFindingFromOrganizationSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.organizationSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectAssetSecurityMarks', async () => { - const fakePath = "/rendered/path/projectAssetSecurityMarks"; - const expectedParameters = { - project: "projectValue", - asset: "assetValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('projectConstraintName', async () => { - const fakePath = "/rendered/path/projectConstraintName"; - const expectedParameters = { - project: "projectValue", - constraint_name: "constraintNameValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectConstraintNamePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectConstraintNamePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectConstraintNamePath', () => { - const result = client.projectConstraintNamePath("projectValue", "constraintNameValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectConstraintNamePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectConstraintNameName', () => { - const result = client.matchProjectFromProjectConstraintNameName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConstraintNameFromProjectConstraintNameName', () => { - const result = client.matchConstraintNameFromProjectConstraintNameName(fakePath); - assert.strictEqual(result, "constraintNameValue"); - assert((client.pathTemplates.projectConstraintNamePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationBigQueryExports', async () => { - const fakePath = "/rendered/path/projectLocationBigQueryExports"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - export: "exportValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationBigQueryExportsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationBigQueryExportsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationBigQueryExportsPath', () => { - const result = client.projectLocationBigQueryExportsPath("projectValue", "locationValue", "exportValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationBigQueryExportsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationBigQueryExportsName', () => { - const result = client.matchProjectFromProjectLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationBigQueryExportsName', () => { - const result = client.matchLocationFromProjectLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExportFromProjectLocationBigQueryExportsName', () => { - const result = client.matchExportFromProjectLocationBigQueryExportsName(fakePath); - assert.strictEqual(result, "exportValue"); - assert((client.pathTemplates.projectLocationBigQueryExportsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationMuteConfigs', async () => { - const fakePath = "/rendered/path/projectLocationMuteConfigs"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationMuteConfigsPath', () => { - const result = client.projectLocationMuteConfigsPath("projectValue", "locationValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationMuteConfigsName', () => { - const result = client.matchProjectFromProjectLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationMuteConfigsName', () => { - const result = client.matchLocationFromProjectLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromProjectLocationMuteConfigsName', () => { - const result = client.matchMuteConfigFromProjectLocationMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.projectLocationMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationNotificationConfigs', async () => { - const fakePath = "/rendered/path/projectLocationNotificationConfigs"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - notification_config: "notificationConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationNotificationConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationNotificationConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationNotificationConfigsPath', () => { - const result = client.projectLocationNotificationConfigsPath("projectValue", "locationValue", "notificationConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationNotificationConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationNotificationConfigsName', () => { - const result = client.matchProjectFromProjectLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationNotificationConfigsName', () => { - const result = client.matchLocationFromProjectLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNotificationConfigFromProjectLocationNotificationConfigsName', () => { - const result = client.matchNotificationConfigFromProjectLocationNotificationConfigsName(fakePath); - assert.strictEqual(result, "notificationConfigValue"); - assert((client.pathTemplates.projectLocationNotificationConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectMuteConfigs', async () => { - const fakePath = "/rendered/path/projectMuteConfigs"; - const expectedParameters = { - project: "projectValue", - mute_config: "muteConfigValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectMuteConfigsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectMuteConfigsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectMuteConfigsPath', () => { - const result = client.projectMuteConfigsPath("projectValue", "muteConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectMuteConfigsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectMuteConfigsName', () => { - const result = client.matchProjectFromProjectMuteConfigsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMuteConfigFromProjectMuteConfigsName', () => { - const result = client.matchMuteConfigFromProjectMuteConfigsName(fakePath); - assert.strictEqual(result, "muteConfigValue"); - assert((client.pathTemplates.projectMuteConfigsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectSource', async () => { - const fakePath = "/rendered/path/projectSource"; - const expectedParameters = { - project: "projectValue", - source: "sourceValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('projectSourceFindingExternalsystem', async () => { - const fakePath = "/rendered/path/projectSourceFindingExternalsystem"; - const expectedParameters = { - project: "projectValue", - source: "sourceValue", - finding: "findingValue", - externalsystem: "externalsystemValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/projectSourceFindingSecurityMarks"; - const expectedParameters = { - project: "projectValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('matchSourceFromProjectSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((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)); - }); - }); - - describe('projectSourceFindings', async () => { - const fakePath = "/rendered/path/projectSourceFindings"; - const expectedParameters = { - project: "projectValue", - source: "sourceValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectSourceFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectSourceFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectSourceFindingsPath', () => { - const result = client.projectSourceFindingsPath("projectValue", "sourceValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectSourceFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectSourceFindingsName', () => { - const result = client.matchProjectFromProjectSourceFindingsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromProjectSourceFindingsName', () => { - const result = client.matchSourceFromProjectSourceFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromProjectSourceFindingsName', () => { - const result = client.matchFindingFromProjectSourceFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.projectSourceFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectSourceLocationFindingExternalsystem', async () => { - const fakePath = "/rendered/path/projectSourceLocationFindingExternalsystem"; - const expectedParameters = { - project: "projectValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - externalsystem: "externalsystemValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectSourceLocationFindingExternalsystemPath', () => { - const result = client.projectSourceLocationFindingExternalsystemPath("projectValue", "sourceValue", "locationValue", "findingValue", "externalsystemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectSourceLocationFindingExternalsystemName', () => { - const result = client.matchProjectFromProjectSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromProjectSourceLocationFindingExternalsystemName', () => { - const result = client.matchSourceFromProjectSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectSourceLocationFindingExternalsystemName', () => { - const result = client.matchLocationFromProjectSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromProjectSourceLocationFindingExternalsystemName', () => { - const result = client.matchFindingFromProjectSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalsystemFromProjectSourceLocationFindingExternalsystemName', () => { - const result = client.matchExternalsystemFromProjectSourceLocationFindingExternalsystemName(fakePath); - assert.strictEqual(result, "externalsystemValue"); - assert((client.pathTemplates.projectSourceLocationFindingExternalsystemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectSourceLocationFindingSecurityMarks', async () => { - const fakePath = "/rendered/path/projectSourceLocationFindingSecurityMarks"; - const expectedParameters = { - project: "projectValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectSourceLocationFindingSecurityMarksPath', () => { - const result = client.projectSourceLocationFindingSecurityMarksPath("projectValue", "sourceValue", "locationValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectSourceLocationFindingSecurityMarksName', () => { - const result = client.matchProjectFromProjectSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromProjectSourceLocationFindingSecurityMarksName', () => { - const result = client.matchSourceFromProjectSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectSourceLocationFindingSecurityMarksName', () => { - const result = client.matchLocationFromProjectSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromProjectSourceLocationFindingSecurityMarksName', () => { - const result = client.matchFindingFromProjectSourceLocationFindingSecurityMarksName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.projectSourceLocationFindingSecurityMarksPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectSourceLocationFindings', async () => { - const fakePath = "/rendered/path/projectSourceLocationFindings"; - const expectedParameters = { - project: "projectValue", - source: "sourceValue", - location: "locationValue", - finding: "findingValue", - }; - const client = new securitycenterModule.v2.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectSourceLocationFindingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectSourceLocationFindingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectSourceLocationFindingsPath', () => { - const result = client.projectSourceLocationFindingsPath("projectValue", "sourceValue", "locationValue", "findingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectSourceLocationFindingsName', () => { - const result = client.matchProjectFromProjectSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSourceFromProjectSourceLocationFindingsName', () => { - const result = client.matchSourceFromProjectSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "sourceValue"); - assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectSourceLocationFindingsName', () => { - const result = client.matchLocationFromProjectSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFindingFromProjectSourceLocationFindingsName', () => { - const result = client.matchFindingFromProjectSourceLocationFindingsName(fakePath); - assert.strictEqual(result, "findingValue"); - assert((client.pathTemplates.projectSourceLocationFindingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-securitycenter/tsconfig.json b/owl-bot-staging/google-cloud-securitycenter/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/google-cloud-securitycenter/webpack.config.js b/owl-bot-staging/google-cloud-securitycenter/webpack.config.js deleted file mode 100644 index 4aeca8bf63a..00000000000 --- a/owl-bot-staging/google-cloud-securitycenter/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'SecurityCenter', - filename: './security-center.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto similarity index 100% rename from owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto rename to packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/chokepoint.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto index ba47341d3d8..b4408c9f14f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -54,4 +54,60 @@ message CloudDlpDataProfile { // The resource hierarchy level at which the data profile was generated. ParentType parent_type = 2; + + // Type of information detected by SDP. + // Info type includes name, version and sensitivity of the detected + // information type. + repeated InfoType info_types = 3; +} + +// Type of information detected by the API. +message InfoType { + // Name of the information type. Either a name of your choosing when + // creating a CustomInfoType, or one of the names listed + // at + // https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference + // when specifying a built-in type. When sending Cloud DLP results to Data + // Catalog, infoType names should conform to the pattern + // `[A-Za-z0-9$_-]{1,64}`. + string name = 1; + + // Optional version name for this InfoType. + string version = 2; + + // Optional custom sensitivity for this InfoType. + // This only applies to data profiling. + SensitivityScore sensitivity_score = 3; +} + +// Score is calculated from of all elements in the data profile. +// A higher level means the data is more sensitive. +message SensitivityScore { + // Various sensitivity score levels for resources. + enum SensitivityScoreLevel { + // Unused. + SENSITIVITY_SCORE_LEVEL_UNSPECIFIED = 0; + + // No sensitive information detected. The resource isn't publicly + // accessible. + SENSITIVITY_LOW = 10; + + // Unable to determine sensitivity. + SENSITIVITY_UNKNOWN = 12; + + // Medium risk. Contains personally identifiable information (PII), + // potentially sensitive data, or fields with free-text data that are at a + // higher risk of having intermittent sensitive data. Consider limiting + // access. + SENSITIVITY_MODERATE = 20; + + // High risk. Sensitive personally identifiable information (SPII) can be + // present. Exfiltration of data can lead to user data loss. + // Re-identification of users might be possible. Consider limiting usage and + // or removing SPII. + SENSITIVITY_HIGH = 30; + } + + // The sensitivity score applied to the resource. + SensitivityScoreLevel score = 1; } diff --git a/owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.proto similarity index 100% rename from owl-bot-staging/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.proto rename to packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_exposure.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 b5403cdf9af..dd7a7e1a05c 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 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import "google/cloud/securitycenter/v1/access.proto"; import "google/cloud/securitycenter/v1/application.proto"; import "google/cloud/securitycenter/v1/attack_exposure.proto"; import "google/cloud/securitycenter/v1/backup_disaster_recovery.proto"; +import "google/cloud/securitycenter/v1/chokepoint.proto"; import "google/cloud/securitycenter/v1/cloud_armor.proto"; import "google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto"; import "google/cloud/securitycenter/v1/cloud_dlp_inspection.proto"; @@ -31,6 +32,7 @@ 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_exposure.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/file.proto"; import "google/cloud/securitycenter/v1/group_membership.proto"; @@ -194,6 +196,18 @@ message Finding { // independently. A group of such issues is referred to as a toxic // combination. TOXIC_COMBINATION = 7; + + // Describes a potential security risk to data assets that contain sensitive + // data. + SENSITIVE_DATA_RISK = 8; + + // Describes a resource or resource group where high risk attack paths + // converge, based on attack path simulations (APS). + CHOKEPOINT = 9; + + // Describes a potential security risk due to the resource being exposed to + // the internet. + EXTERNAL_EXPOSURE = 10; } // Mute information about the finding, including whether the finding has a @@ -459,4 +473,13 @@ message Finding { // a collection of findings that are related in some way. // This field cannot be updated. Its value is ignored in all update requests. repeated GroupMembership group_memberships = 65; + + // Contains details about a chokepoint, which is a resource or resource group + // where high-risk attack paths converge, based on [attack path simulations] + // (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). + // This field cannot be updated. Its value is ignored in all update requests. + Chokepoint chokepoint = 77; + + // External exposure associated with the finding. + ExternalExposure external_exposure = 84; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto index 3ce140c602d..1625145ca45 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,6 +34,9 @@ message GroupMembership { // Group represents a toxic combination. GROUP_TYPE_TOXIC_COMBINATION = 1; + + // Group represents a chokepoint. + GROUP_TYPE_CHOKEPOINT = 3; } // Type of group. diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index e9e17344ca6..ada272cf21a 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -2099,6 +2099,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Chokepoint. */ + interface IChokepoint { + + /** Chokepoint relatedFindings */ + relatedFindings?: (string[]|null); + } + + /** Represents a Chokepoint. */ + class Chokepoint implements IChokepoint { + + /** + * Constructs a new Chokepoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IChokepoint); + + /** Chokepoint relatedFindings. */ + public relatedFindings: string[]; + + /** + * Creates a new Chokepoint instance using the specified properties. + * @param [properties] Properties to set + * @returns Chokepoint instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IChokepoint): google.cloud.securitycenter.v1.Chokepoint; + + /** + * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. + * @param message Chokepoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. + * @param message Chokepoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IChokepoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chokepoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chokepoint + * @throws {Error} If the payload is not a reader 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.Chokepoint; + + /** + * Decodes a Chokepoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chokepoint + * @throws {Error} If the payload is not 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.Chokepoint; + + /** + * Verifies a Chokepoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chokepoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Chokepoint; + + /** + * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. + * @param message Chokepoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Chokepoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chokepoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chokepoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CloudArmor. */ interface ICloudArmor { @@ -2664,6 +2761,9 @@ export namespace google { /** CloudDlpDataProfile parentType */ parentType?: (google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|null); + + /** CloudDlpDataProfile infoTypes */ + infoTypes?: (google.cloud.securitycenter.v1.IInfoType[]|null); } /** Represents a CloudDlpDataProfile. */ @@ -2681,6 +2781,9 @@ export namespace google { /** CloudDlpDataProfile parentType. */ public parentType: (google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType); + /** CloudDlpDataProfile infoTypes. */ + public infoTypes: google.cloud.securitycenter.v1.IInfoType[]; + /** * Creates a new CloudDlpDataProfile instance using the specified properties. * @param [properties] Properties to set @@ -2769,6 +2872,224 @@ export namespace google { } } + /** Properties of an InfoType. */ + interface IInfoType { + + /** InfoType name */ + name?: (string|null); + + /** InfoType version */ + version?: (string|null); + + /** InfoType sensitivityScore */ + sensitivityScore?: (google.cloud.securitycenter.v1.ISensitivityScore|null); + } + + /** Represents an InfoType. */ + class InfoType implements IInfoType { + + /** + * Constructs a new InfoType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IInfoType); + + /** InfoType name. */ + public name: string; + + /** InfoType version. */ + public version: string; + + /** InfoType sensitivityScore. */ + public sensitivityScore?: (google.cloud.securitycenter.v1.ISensitivityScore|null); + + /** + * Creates a new InfoType instance using the specified properties. + * @param [properties] Properties to set + * @returns InfoType instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IInfoType): google.cloud.securitycenter.v1.InfoType; + + /** + * Encodes the specified InfoType message. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. + * @param message InfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfoType message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. + * @param message InfoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IInfoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfoType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfoType + * @throws {Error} If the payload is not a reader 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.InfoType; + + /** + * Decodes an InfoType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfoType + * @throws {Error} If the payload is not 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.InfoType; + + /** + * Verifies an InfoType message. + * @param message Plain 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 InfoType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfoType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.InfoType; + + /** + * Creates a plain object from an InfoType message. Also converts values to other types if specified. + * @param message InfoType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.InfoType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfoType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InfoType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SensitivityScore. */ + interface ISensitivityScore { + + /** SensitivityScore score */ + score?: (google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|keyof typeof google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|null); + } + + /** Represents a SensitivityScore. */ + class SensitivityScore implements ISensitivityScore { + + /** + * Constructs a new SensitivityScore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISensitivityScore); + + /** SensitivityScore score. */ + public score: (google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|keyof typeof google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel); + + /** + * Creates a new SensitivityScore instance using the specified properties. + * @param [properties] Properties to set + * @returns SensitivityScore instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISensitivityScore): google.cloud.securitycenter.v1.SensitivityScore; + + /** + * Encodes the specified SensitivityScore message. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. + * @param message SensitivityScore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISensitivityScore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SensitivityScore message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. + * @param message SensitivityScore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISensitivityScore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SensitivityScore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SensitivityScore + * @throws {Error} If the payload is not a reader 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.SensitivityScore; + + /** + * Decodes a SensitivityScore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SensitivityScore + * @throws {Error} If the payload is not 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.SensitivityScore; + + /** + * Verifies a SensitivityScore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SensitivityScore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SensitivityScore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SensitivityScore; + + /** + * Creates a plain object from a SensitivityScore message. Also converts values to other types if specified. + * @param message SensitivityScore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SensitivityScore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SensitivityScore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SensitivityScore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SensitivityScore { + + /** SensitivityScoreLevel enum. */ + enum SensitivityScoreLevel { + SENSITIVITY_SCORE_LEVEL_UNSPECIFIED = 0, + SENSITIVITY_LOW = 10, + SENSITIVITY_UNKNOWN = 12, + SENSITIVITY_MODERATE = 20, + SENSITIVITY_HIGH = 30 + } + } + /** Properties of a CloudDlpInspection. */ interface ICloudDlpInspection { @@ -5056,6 +5377,169 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an ExternalExposure. */ + interface IExternalExposure { + + /** ExternalExposure privateIpAddress */ + privateIpAddress?: (string|null); + + /** ExternalExposure privatePort */ + privatePort?: (string|null); + + /** ExternalExposure exposedService */ + exposedService?: (string|null); + + /** ExternalExposure publicIpAddress */ + publicIpAddress?: (string|null); + + /** ExternalExposure publicPort */ + publicPort?: (string|null); + + /** ExternalExposure exposedEndpoint */ + exposedEndpoint?: (string|null); + + /** ExternalExposure loadBalancerFirewallPolicy */ + loadBalancerFirewallPolicy?: (string|null); + + /** ExternalExposure serviceFirewallPolicy */ + serviceFirewallPolicy?: (string|null); + + /** ExternalExposure forwardingRule */ + forwardingRule?: (string|null); + + /** ExternalExposure backendService */ + backendService?: (string|null); + + /** ExternalExposure instanceGroup */ + instanceGroup?: (string|null); + + /** ExternalExposure networkEndpointGroup */ + networkEndpointGroup?: (string|null); + } + + /** Represents an ExternalExposure. */ + class ExternalExposure implements IExternalExposure { + + /** + * Constructs a new ExternalExposure. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IExternalExposure); + + /** ExternalExposure privateIpAddress. */ + public privateIpAddress: string; + + /** ExternalExposure privatePort. */ + public privatePort: string; + + /** ExternalExposure exposedService. */ + public exposedService: string; + + /** ExternalExposure publicIpAddress. */ + public publicIpAddress: string; + + /** ExternalExposure publicPort. */ + public publicPort: string; + + /** ExternalExposure exposedEndpoint. */ + public exposedEndpoint: string; + + /** ExternalExposure loadBalancerFirewallPolicy. */ + public loadBalancerFirewallPolicy: string; + + /** ExternalExposure serviceFirewallPolicy. */ + public serviceFirewallPolicy: string; + + /** ExternalExposure forwardingRule. */ + public forwardingRule: string; + + /** ExternalExposure backendService. */ + public backendService: string; + + /** ExternalExposure instanceGroup. */ + public instanceGroup: string; + + /** ExternalExposure networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** + * Creates a new ExternalExposure instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalExposure instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IExternalExposure): google.cloud.securitycenter.v1.ExternalExposure; + + /** + * Encodes the specified ExternalExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. + * @param message ExternalExposure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IExternalExposure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. + * @param message ExternalExposure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IExternalExposure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalExposure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalExposure + * @throws {Error} If the payload is not a reader 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.ExternalExposure; + + /** + * Decodes an ExternalExposure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalExposure + * @throws {Error} If the payload is not 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.ExternalExposure; + + /** + * Verifies an ExternalExposure message. + * @param message Plain 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 ExternalExposure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalExposure + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExternalExposure; + + /** + * Creates a plain object from an ExternalExposure message. Also converts values to other types if specified. + * @param message ExternalExposure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ExternalExposure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalExposure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalExposure + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an ExternalSystem. */ interface IExternalSystem { @@ -5734,6 +6218,12 @@ export namespace google { /** Finding groupMemberships */ groupMemberships?: (google.cloud.securitycenter.v1.IGroupMembership[]|null); + + /** Finding chokepoint */ + chokepoint?: (google.cloud.securitycenter.v1.IChokepoint|null); + + /** Finding externalExposure */ + externalExposure?: (google.cloud.securitycenter.v1.IExternalExposure|null); } /** Represents a Finding. */ @@ -5895,6 +6385,12 @@ export namespace google { /** Finding groupMemberships. */ public groupMemberships: google.cloud.securitycenter.v1.IGroupMembership[]; + /** Finding chokepoint. */ + public chokepoint?: (google.cloud.securitycenter.v1.IChokepoint|null); + + /** Finding externalExposure. */ + public externalExposure?: (google.cloud.securitycenter.v1.IExternalExposure|null); + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -6008,7 +6504,10 @@ export namespace google { OBSERVATION = 4, SCC_ERROR = 5, POSTURE_VIOLATION = 6, - TOXIC_COMBINATION = 7 + TOXIC_COMBINATION = 7, + SENSITIVE_DATA_RISK = 8, + CHOKEPOINT = 9, + EXTERNAL_EXPOSURE = 10 } /** Properties of a MuteInfo. */ @@ -6432,7 +6931,8 @@ export namespace google { /** GroupType enum. */ enum GroupType { GROUP_TYPE_UNSPECIFIED = 0, - GROUP_TYPE_TOXIC_COMBINATION = 1 + GROUP_TYPE_TOXIC_COMBINATION = 1, + GROUP_TYPE_CHOKEPOINT = 3 } } @@ -54357,6 +54857,115 @@ export namespace google { IDENTIFIER = 8 } + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not 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.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload 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.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + /** Properties of a Http. */ interface IHttp { @@ -58583,6 +59192,9 @@ export namespace google { /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); } /** Represents a FieldOptions. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 5a3f8d767c9..46fdeb4b05c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -5541,6 +5541,227 @@ return BigQueryExport; })(); + v1.Chokepoint = (function() { + + /** + * Properties of a Chokepoint. + * @memberof google.cloud.securitycenter.v1 + * @interface IChokepoint + * @property {Array.|null} [relatedFindings] Chokepoint relatedFindings + */ + + /** + * Constructs a new Chokepoint. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Chokepoint. + * @implements IChokepoint + * @constructor + * @param {google.cloud.securitycenter.v1.IChokepoint=} [properties] Properties to set + */ + function Chokepoint(properties) { + this.relatedFindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chokepoint relatedFindings. + * @member {Array.} relatedFindings + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @instance + */ + Chokepoint.prototype.relatedFindings = $util.emptyArray; + + /** + * Creates a new Chokepoint instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {google.cloud.securitycenter.v1.IChokepoint=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint instance + */ + Chokepoint.create = function create(properties) { + return new Chokepoint(properties); + }; + + /** + * Encodes the specified Chokepoint message. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {google.cloud.securitycenter.v1.IChokepoint} message Chokepoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chokepoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relatedFindings != null && message.relatedFindings.length) + for (var i = 0; i < message.relatedFindings.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.relatedFindings[i]); + return writer; + }; + + /** + * Encodes the specified Chokepoint message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Chokepoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {google.cloud.securitycenter.v1.IChokepoint} message Chokepoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chokepoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chokepoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chokepoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Chokepoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.relatedFindings && message.relatedFindings.length)) + message.relatedFindings = []; + message.relatedFindings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chokepoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chokepoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chokepoint message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chokepoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { + if (!Array.isArray(message.relatedFindings)) + return "relatedFindings: array expected"; + for (var i = 0; i < message.relatedFindings.length; ++i) + if (!$util.isString(message.relatedFindings[i])) + return "relatedFindings: string[] expected"; + } + return null; + }; + + /** + * Creates a Chokepoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Chokepoint} Chokepoint + */ + Chokepoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Chokepoint) + return object; + var message = new $root.google.cloud.securitycenter.v1.Chokepoint(); + if (object.relatedFindings) { + if (!Array.isArray(object.relatedFindings)) + throw TypeError(".google.cloud.securitycenter.v1.Chokepoint.relatedFindings: array expected"); + message.relatedFindings = []; + for (var i = 0; i < object.relatedFindings.length; ++i) + message.relatedFindings[i] = String(object.relatedFindings[i]); + } + return message; + }; + + /** + * Creates a plain object from a Chokepoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {google.cloud.securitycenter.v1.Chokepoint} message Chokepoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chokepoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedFindings = []; + if (message.relatedFindings && message.relatedFindings.length) { + object.relatedFindings = []; + for (var j = 0; j < message.relatedFindings.length; ++j) + object.relatedFindings[j] = message.relatedFindings[j]; + } + return object; + }; + + /** + * Converts this Chokepoint to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @instance + * @returns {Object.} JSON object + */ + Chokepoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chokepoint + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Chokepoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chokepoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Chokepoint"; + }; + + return Chokepoint; + })(); + v1.CloudArmor = (function() { /** @@ -6879,6 +7100,7 @@ * @interface ICloudDlpDataProfile * @property {string|null} [dataProfile] CloudDlpDataProfile dataProfile * @property {google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|null} [parentType] CloudDlpDataProfile parentType + * @property {Array.|null} [infoTypes] CloudDlpDataProfile infoTypes */ /** @@ -6890,6 +7112,7 @@ * @param {google.cloud.securitycenter.v1.ICloudDlpDataProfile=} [properties] Properties to set */ function CloudDlpDataProfile(properties) { + this.infoTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6912,6 +7135,14 @@ */ CloudDlpDataProfile.prototype.parentType = 0; + /** + * CloudDlpDataProfile infoTypes. + * @member {Array.} infoTypes + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @instance + */ + CloudDlpDataProfile.prototype.infoTypes = $util.emptyArray; + /** * Creates a new CloudDlpDataProfile instance using the specified properties. * @function create @@ -6940,6 +7171,9 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataProfile); if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.parentType); + if (message.infoTypes != null && message.infoTypes.length) + for (var i = 0; i < message.infoTypes.length; ++i) + $root.google.cloud.securitycenter.v1.InfoType.encode(message.infoTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -6984,6 +7218,12 @@ message.parentType = reader.int32(); break; } + case 3: { + if (!(message.infoTypes && message.infoTypes.length)) + message.infoTypes = []; + message.infoTypes.push($root.google.cloud.securitycenter.v1.InfoType.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -7031,6 +7271,15 @@ case 2: break; } + if (message.infoTypes != null && message.hasOwnProperty("infoTypes")) { + if (!Array.isArray(message.infoTypes)) + return "infoTypes: array expected"; + for (var i = 0; i < message.infoTypes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.InfoType.verify(message.infoTypes[i]); + if (error) + return "infoTypes." + error; + } + } return null; }; @@ -7068,6 +7317,16 @@ message.parentType = 2; break; } + if (object.infoTypes) { + if (!Array.isArray(object.infoTypes)) + throw TypeError(".google.cloud.securitycenter.v1.CloudDlpDataProfile.infoTypes: array expected"); + message.infoTypes = []; + for (var i = 0; i < object.infoTypes.length; ++i) { + if (typeof object.infoTypes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CloudDlpDataProfile.infoTypes: object expected"); + message.infoTypes[i] = $root.google.cloud.securitycenter.v1.InfoType.fromObject(object.infoTypes[i]); + } + } return message; }; @@ -7084,6 +7343,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.infoTypes = []; if (options.defaults) { object.dataProfile = ""; object.parentType = options.enums === String ? "PARENT_TYPE_UNSPECIFIED" : 0; @@ -7092,6 +7353,11 @@ object.dataProfile = message.dataProfile; if (message.parentType != null && message.hasOwnProperty("parentType")) object.parentType = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType[message.parentType] === undefined ? message.parentType : $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType[message.parentType] : message.parentType; + if (message.infoTypes && message.infoTypes.length) { + object.infoTypes = []; + for (var j = 0; j < message.infoTypes.length; ++j) + object.infoTypes[j] = $root.google.cloud.securitycenter.v1.InfoType.toObject(message.infoTypes[j], options); + } return object; }; @@ -7140,6 +7406,522 @@ return CloudDlpDataProfile; })(); + v1.InfoType = (function() { + + /** + * Properties of an InfoType. + * @memberof google.cloud.securitycenter.v1 + * @interface IInfoType + * @property {string|null} [name] InfoType name + * @property {string|null} [version] InfoType version + * @property {google.cloud.securitycenter.v1.ISensitivityScore|null} [sensitivityScore] InfoType sensitivityScore + */ + + /** + * Constructs a new InfoType. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an InfoType. + * @implements IInfoType + * @constructor + * @param {google.cloud.securitycenter.v1.IInfoType=} [properties] Properties to set + */ + function InfoType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InfoType name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.InfoType + * @instance + */ + InfoType.prototype.name = ""; + + /** + * InfoType version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.InfoType + * @instance + */ + InfoType.prototype.version = ""; + + /** + * InfoType sensitivityScore. + * @member {google.cloud.securitycenter.v1.ISensitivityScore|null|undefined} sensitivityScore + * @memberof google.cloud.securitycenter.v1.InfoType + * @instance + */ + InfoType.prototype.sensitivityScore = null; + + /** + * Creates a new InfoType instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {google.cloud.securitycenter.v1.IInfoType=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.InfoType} InfoType instance + */ + InfoType.create = function create(properties) { + return new InfoType(properties); + }; + + /** + * Encodes the specified InfoType message. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {google.cloud.securitycenter.v1.IInfoType} message InfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoType.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.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.sensitivityScore != null && Object.hasOwnProperty.call(message, "sensitivityScore")) + $root.google.cloud.securitycenter.v1.SensitivityScore.encode(message.sensitivityScore, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InfoType message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.InfoType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {google.cloud.securitycenter.v1.IInfoType} message InfoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfoType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfoType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.InfoType} InfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.InfoType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + message.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfoType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.InfoType} InfoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfoType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfoType message. + * @function verify + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfoType.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.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.sensitivityScore != null && message.hasOwnProperty("sensitivityScore")) { + var error = $root.google.cloud.securitycenter.v1.SensitivityScore.verify(message.sensitivityScore); + if (error) + return "sensitivityScore." + error; + } + return null; + }; + + /** + * Creates an InfoType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.InfoType} InfoType + */ + InfoType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.InfoType) + return object; + var message = new $root.google.cloud.securitycenter.v1.InfoType(); + if (object.name != null) + message.name = String(object.name); + if (object.version != null) + message.version = String(object.version); + if (object.sensitivityScore != null) { + if (typeof object.sensitivityScore !== "object") + throw TypeError(".google.cloud.securitycenter.v1.InfoType.sensitivityScore: object expected"); + message.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.fromObject(object.sensitivityScore); + } + return message; + }; + + /** + * Creates a plain object from an InfoType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {google.cloud.securitycenter.v1.InfoType} message InfoType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfoType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = ""; + object.sensitivityScore = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.sensitivityScore != null && message.hasOwnProperty("sensitivityScore")) + object.sensitivityScore = $root.google.cloud.securitycenter.v1.SensitivityScore.toObject(message.sensitivityScore, options); + return object; + }; + + /** + * Converts this InfoType to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.InfoType + * @instance + * @returns {Object.} JSON object + */ + InfoType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InfoType + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.InfoType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InfoType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.InfoType"; + }; + + return InfoType; + })(); + + v1.SensitivityScore = (function() { + + /** + * Properties of a SensitivityScore. + * @memberof google.cloud.securitycenter.v1 + * @interface ISensitivityScore + * @property {google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel|null} [score] SensitivityScore score + */ + + /** + * Constructs a new SensitivityScore. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SensitivityScore. + * @implements ISensitivityScore + * @constructor + * @param {google.cloud.securitycenter.v1.ISensitivityScore=} [properties] Properties to set + */ + function SensitivityScore(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SensitivityScore score. + * @member {google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel} score + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @instance + */ + SensitivityScore.prototype.score = 0; + + /** + * Creates a new SensitivityScore instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {google.cloud.securitycenter.v1.ISensitivityScore=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore instance + */ + SensitivityScore.create = function create(properties) { + return new SensitivityScore(properties); + }; + + /** + * Encodes the specified SensitivityScore message. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {google.cloud.securitycenter.v1.ISensitivityScore} message SensitivityScore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SensitivityScore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + return writer; + }; + + /** + * Encodes the specified SensitivityScore message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SensitivityScore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {google.cloud.securitycenter.v1.ISensitivityScore} message SensitivityScore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SensitivityScore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SensitivityScore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SensitivityScore.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SensitivityScore(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SensitivityScore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SensitivityScore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SensitivityScore message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SensitivityScore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + switch (message.score) { + default: + return "score: enum value expected"; + case 0: + case 10: + case 12: + case 20: + case 30: + break; + } + return null; + }; + + /** + * Creates a SensitivityScore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SensitivityScore} SensitivityScore + */ + SensitivityScore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SensitivityScore) + return object; + var message = new $root.google.cloud.securitycenter.v1.SensitivityScore(); + switch (object.score) { + default: + if (typeof object.score === "number") { + message.score = object.score; + break; + } + break; + case "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED": + case 0: + message.score = 0; + break; + case "SENSITIVITY_LOW": + case 10: + message.score = 10; + break; + case "SENSITIVITY_UNKNOWN": + case 12: + message.score = 12; + break; + case "SENSITIVITY_MODERATE": + case 20: + message.score = 20; + break; + case "SENSITIVITY_HIGH": + case 30: + message.score = 30; + break; + } + return message; + }; + + /** + * Creates a plain object from a SensitivityScore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {google.cloud.securitycenter.v1.SensitivityScore} message SensitivityScore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SensitivityScore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = options.enums === String ? "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED" : 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.enums === String ? $root.google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel[message.score] === undefined ? message.score : $root.google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel[message.score] : message.score; + return object; + }; + + /** + * Converts this SensitivityScore to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @instance + * @returns {Object.} JSON object + */ + SensitivityScore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SensitivityScore + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SensitivityScore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SensitivityScore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SensitivityScore"; + }; + + /** + * SensitivityScoreLevel enum. + * @name google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel + * @enum {number} + * @property {number} SENSITIVITY_SCORE_LEVEL_UNSPECIFIED=0 SENSITIVITY_SCORE_LEVEL_UNSPECIFIED value + * @property {number} SENSITIVITY_LOW=10 SENSITIVITY_LOW value + * @property {number} SENSITIVITY_UNKNOWN=12 SENSITIVITY_UNKNOWN value + * @property {number} SENSITIVITY_MODERATE=20 SENSITIVITY_MODERATE value + * @property {number} SENSITIVITY_HIGH=30 SENSITIVITY_HIGH value + */ + SensitivityScore.SensitivityScoreLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[10] = "SENSITIVITY_LOW"] = 10; + values[valuesById[12] = "SENSITIVITY_UNKNOWN"] = 12; + values[valuesById[20] = "SENSITIVITY_MODERATE"] = 20; + values[valuesById[30] = "SENSITIVITY_HIGH"] = 30; + return values; + })(); + + return SensitivityScore; + })(); + v1.CloudDlpInspection = (function() { /** @@ -12904,6 +13686,465 @@ return ExfilResource; })(); + v1.ExternalExposure = (function() { + + /** + * Properties of an ExternalExposure. + * @memberof google.cloud.securitycenter.v1 + * @interface IExternalExposure + * @property {string|null} [privateIpAddress] ExternalExposure privateIpAddress + * @property {string|null} [privatePort] ExternalExposure privatePort + * @property {string|null} [exposedService] ExternalExposure exposedService + * @property {string|null} [publicIpAddress] ExternalExposure publicIpAddress + * @property {string|null} [publicPort] ExternalExposure publicPort + * @property {string|null} [exposedEndpoint] ExternalExposure exposedEndpoint + * @property {string|null} [loadBalancerFirewallPolicy] ExternalExposure loadBalancerFirewallPolicy + * @property {string|null} [serviceFirewallPolicy] ExternalExposure serviceFirewallPolicy + * @property {string|null} [forwardingRule] ExternalExposure forwardingRule + * @property {string|null} [backendService] ExternalExposure backendService + * @property {string|null} [instanceGroup] ExternalExposure instanceGroup + * @property {string|null} [networkEndpointGroup] ExternalExposure networkEndpointGroup + */ + + /** + * Constructs a new ExternalExposure. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an ExternalExposure. + * @implements IExternalExposure + * @constructor + * @param {google.cloud.securitycenter.v1.IExternalExposure=} [properties] Properties to set + */ + function ExternalExposure(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalExposure privateIpAddress. + * @member {string} privateIpAddress + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.privateIpAddress = ""; + + /** + * ExternalExposure privatePort. + * @member {string} privatePort + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.privatePort = ""; + + /** + * ExternalExposure exposedService. + * @member {string} exposedService + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.exposedService = ""; + + /** + * ExternalExposure publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.publicIpAddress = ""; + + /** + * ExternalExposure publicPort. + * @member {string} publicPort + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.publicPort = ""; + + /** + * ExternalExposure exposedEndpoint. + * @member {string} exposedEndpoint + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.exposedEndpoint = ""; + + /** + * ExternalExposure loadBalancerFirewallPolicy. + * @member {string} loadBalancerFirewallPolicy + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.loadBalancerFirewallPolicy = ""; + + /** + * ExternalExposure serviceFirewallPolicy. + * @member {string} serviceFirewallPolicy + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.serviceFirewallPolicy = ""; + + /** + * ExternalExposure forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.forwardingRule = ""; + + /** + * ExternalExposure backendService. + * @member {string} backendService + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.backendService = ""; + + /** + * ExternalExposure instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.instanceGroup = ""; + + /** + * ExternalExposure networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + */ + ExternalExposure.prototype.networkEndpointGroup = ""; + + /** + * Creates a new ExternalExposure instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {google.cloud.securitycenter.v1.IExternalExposure=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure instance + */ + ExternalExposure.create = function create(properties) { + return new ExternalExposure(properties); + }; + + /** + * Encodes the specified ExternalExposure message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {google.cloud.securitycenter.v1.IExternalExposure} message ExternalExposure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalExposure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateIpAddress != null && Object.hasOwnProperty.call(message, "privateIpAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateIpAddress); + if (message.privatePort != null && Object.hasOwnProperty.call(message, "privatePort")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privatePort); + if (message.exposedService != null && Object.hasOwnProperty.call(message, "exposedService")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exposedService); + if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicIpAddress); + if (message.publicPort != null && Object.hasOwnProperty.call(message, "publicPort")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicPort); + if (message.exposedEndpoint != null && Object.hasOwnProperty.call(message, "exposedEndpoint")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.exposedEndpoint); + if (message.loadBalancerFirewallPolicy != null && Object.hasOwnProperty.call(message, "loadBalancerFirewallPolicy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.loadBalancerFirewallPolicy); + if (message.serviceFirewallPolicy != null && Object.hasOwnProperty.call(message, "serviceFirewallPolicy")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceFirewallPolicy); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.forwardingRule); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.backendService); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.instanceGroup); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified ExternalExposure message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalExposure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {google.cloud.securitycenter.v1.IExternalExposure} message ExternalExposure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalExposure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalExposure message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalExposure.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ExternalExposure(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.privateIpAddress = reader.string(); + break; + } + case 2: { + message.privatePort = reader.string(); + break; + } + case 3: { + message.exposedService = reader.string(); + break; + } + case 4: { + message.publicIpAddress = reader.string(); + break; + } + case 5: { + message.publicPort = reader.string(); + break; + } + case 6: { + message.exposedEndpoint = reader.string(); + break; + } + case 7: { + message.loadBalancerFirewallPolicy = reader.string(); + break; + } + case 8: { + message.serviceFirewallPolicy = reader.string(); + break; + } + case 9: { + message.forwardingRule = reader.string(); + break; + } + case 10: { + message.backendService = reader.string(); + break; + } + case 11: { + message.instanceGroup = reader.string(); + break; + } + case 12: { + message.networkEndpointGroup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalExposure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalExposure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalExposure message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalExposure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateIpAddress != null && message.hasOwnProperty("privateIpAddress")) + if (!$util.isString(message.privateIpAddress)) + return "privateIpAddress: string expected"; + if (message.privatePort != null && message.hasOwnProperty("privatePort")) + if (!$util.isString(message.privatePort)) + return "privatePort: string expected"; + if (message.exposedService != null && message.hasOwnProperty("exposedService")) + if (!$util.isString(message.exposedService)) + return "exposedService: string expected"; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + if (!$util.isString(message.publicIpAddress)) + return "publicIpAddress: string expected"; + if (message.publicPort != null && message.hasOwnProperty("publicPort")) + if (!$util.isString(message.publicPort)) + return "publicPort: string expected"; + if (message.exposedEndpoint != null && message.hasOwnProperty("exposedEndpoint")) + if (!$util.isString(message.exposedEndpoint)) + return "exposedEndpoint: string expected"; + if (message.loadBalancerFirewallPolicy != null && message.hasOwnProperty("loadBalancerFirewallPolicy")) + if (!$util.isString(message.loadBalancerFirewallPolicy)) + return "loadBalancerFirewallPolicy: string expected"; + if (message.serviceFirewallPolicy != null && message.hasOwnProperty("serviceFirewallPolicy")) + if (!$util.isString(message.serviceFirewallPolicy)) + return "serviceFirewallPolicy: string expected"; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + return null; + }; + + /** + * Creates an ExternalExposure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExternalExposure} ExternalExposure + */ + ExternalExposure.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExternalExposure) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExternalExposure(); + if (object.privateIpAddress != null) + message.privateIpAddress = String(object.privateIpAddress); + if (object.privatePort != null) + message.privatePort = String(object.privatePort); + if (object.exposedService != null) + message.exposedService = String(object.exposedService); + if (object.publicIpAddress != null) + message.publicIpAddress = String(object.publicIpAddress); + if (object.publicPort != null) + message.publicPort = String(object.publicPort); + if (object.exposedEndpoint != null) + message.exposedEndpoint = String(object.exposedEndpoint); + if (object.loadBalancerFirewallPolicy != null) + message.loadBalancerFirewallPolicy = String(object.loadBalancerFirewallPolicy); + if (object.serviceFirewallPolicy != null) + message.serviceFirewallPolicy = String(object.serviceFirewallPolicy); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + return message; + }; + + /** + * Creates a plain object from an ExternalExposure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {google.cloud.securitycenter.v1.ExternalExposure} message ExternalExposure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalExposure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.privateIpAddress = ""; + object.privatePort = ""; + object.exposedService = ""; + object.publicIpAddress = ""; + object.publicPort = ""; + object.exposedEndpoint = ""; + object.loadBalancerFirewallPolicy = ""; + object.serviceFirewallPolicy = ""; + object.forwardingRule = ""; + object.backendService = ""; + object.instanceGroup = ""; + object.networkEndpointGroup = ""; + } + if (message.privateIpAddress != null && message.hasOwnProperty("privateIpAddress")) + object.privateIpAddress = message.privateIpAddress; + if (message.privatePort != null && message.hasOwnProperty("privatePort")) + object.privatePort = message.privatePort; + if (message.exposedService != null && message.hasOwnProperty("exposedService")) + object.exposedService = message.exposedService; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + object.publicIpAddress = message.publicIpAddress; + if (message.publicPort != null && message.hasOwnProperty("publicPort")) + object.publicPort = message.publicPort; + if (message.exposedEndpoint != null && message.hasOwnProperty("exposedEndpoint")) + object.exposedEndpoint = message.exposedEndpoint; + if (message.loadBalancerFirewallPolicy != null && message.hasOwnProperty("loadBalancerFirewallPolicy")) + object.loadBalancerFirewallPolicy = message.loadBalancerFirewallPolicy; + if (message.serviceFirewallPolicy != null && message.hasOwnProperty("serviceFirewallPolicy")) + object.serviceFirewallPolicy = message.serviceFirewallPolicy; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this ExternalExposure to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @instance + * @returns {Object.} JSON object + */ + ExternalExposure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalExposure + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ExternalExposure + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalExposure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExternalExposure"; + }; + + return ExternalExposure; + })(); + v1.ExternalSystem = (function() { /** @@ -14370,6 +15611,8 @@ * @property {google.cloud.securitycenter.v1.INotebook|null} [notebook] Finding notebook * @property {google.cloud.securitycenter.v1.IToxicCombination|null} [toxicCombination] Finding toxicCombination * @property {Array.|null} [groupMemberships] Finding groupMemberships + * @property {google.cloud.securitycenter.v1.IChokepoint|null} [chokepoint] Finding chokepoint + * @property {google.cloud.securitycenter.v1.IExternalExposure|null} [externalExposure] Finding externalExposure */ /** @@ -14800,6 +16043,22 @@ */ Finding.prototype.groupMemberships = $util.emptyArray; + /** + * Finding chokepoint. + * @member {google.cloud.securitycenter.v1.IChokepoint|null|undefined} chokepoint + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.chokepoint = null; + + /** + * Finding externalExposure. + * @member {google.cloud.securitycenter.v1.IExternalExposure|null|undefined} externalExposure + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.externalExposure = null; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -14943,6 +16202,10 @@ if (message.groupMemberships != null && message.groupMemberships.length) for (var i = 0; i < message.groupMemberships.length; ++i) $root.google.cloud.securitycenter.v1.GroupMembership.encode(message.groupMemberships[i], writer.uint32(/* id 65, wireType 2 =*/522).fork()).ldelim(); + if (message.chokepoint != null && Object.hasOwnProperty.call(message, "chokepoint")) + $root.google.cloud.securitycenter.v1.Chokepoint.encode(message.chokepoint, writer.uint32(/* id 77, wireType 2 =*/618).fork()).ldelim(); + if (message.externalExposure != null && Object.hasOwnProperty.call(message, "externalExposure")) + $root.google.cloud.securitycenter.v1.ExternalExposure.encode(message.externalExposure, writer.uint32(/* id 84, wireType 2 =*/674).fork()).ldelim(); return writer; }; @@ -15256,6 +16519,14 @@ message.groupMemberships.push($root.google.cloud.securitycenter.v1.GroupMembership.decode(reader, reader.uint32())); break; } + case 77: { + message.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.decode(reader, reader.uint32()); + break; + } + case 84: { + message.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -15376,6 +16647,9 @@ case 5: case 6: case 7: + case 8: + case 9: + case 10: break; } if (message.indicator != null && message.hasOwnProperty("indicator")) { @@ -15598,6 +16872,16 @@ return "groupMemberships." + error; } } + if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) { + var error = $root.google.cloud.securitycenter.v1.Chokepoint.verify(message.chokepoint); + if (error) + return "chokepoint." + error; + } + if (message.externalExposure != null && message.hasOwnProperty("externalExposure")) { + var error = $root.google.cloud.securitycenter.v1.ExternalExposure.verify(message.externalExposure); + if (error) + return "externalExposure." + error; + } return null; }; @@ -15761,6 +17045,18 @@ case 7: message.findingClass = 7; break; + case "SENSITIVE_DATA_RISK": + case 8: + message.findingClass = 8; + break; + case "CHOKEPOINT": + case 9: + message.findingClass = 9; + break; + case "EXTERNAL_EXPOSURE": + case 10: + message.findingClass = 10; + break; } if (object.indicator != null) { if (typeof object.indicator !== "object") @@ -15987,6 +17283,16 @@ message.groupMemberships[i] = $root.google.cloud.securitycenter.v1.GroupMembership.fromObject(object.groupMemberships[i]); } } + if (object.chokepoint != null) { + if (typeof object.chokepoint !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.chokepoint: object expected"); + message.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.fromObject(object.chokepoint); + } + if (object.externalExposure != null) { + if (typeof object.externalExposure !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalExposure: object expected"); + message.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.fromObject(object.externalExposure); + } return message; }; @@ -16058,6 +17364,8 @@ object.muteInfo = null; object.notebook = null; object.toxicCombination = null; + object.chokepoint = null; + object.externalExposure = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -16199,6 +17507,10 @@ for (var j = 0; j < message.groupMemberships.length; ++j) object.groupMemberships[j] = $root.google.cloud.securitycenter.v1.GroupMembership.toObject(message.groupMemberships[j], options); } + if (message.chokepoint != null && message.hasOwnProperty("chokepoint")) + object.chokepoint = $root.google.cloud.securitycenter.v1.Chokepoint.toObject(message.chokepoint, options); + if (message.externalExposure != null && message.hasOwnProperty("externalExposure")) + object.externalExposure = $root.google.cloud.securitycenter.v1.ExternalExposure.toObject(message.externalExposure, options); return object; }; @@ -16294,6 +17606,9 @@ * @property {number} SCC_ERROR=5 SCC_ERROR value * @property {number} POSTURE_VIOLATION=6 POSTURE_VIOLATION value * @property {number} TOXIC_COMBINATION=7 TOXIC_COMBINATION value + * @property {number} SENSITIVE_DATA_RISK=8 SENSITIVE_DATA_RISK value + * @property {number} CHOKEPOINT=9 CHOKEPOINT value + * @property {number} EXTERNAL_EXPOSURE=10 EXTERNAL_EXPOSURE value */ Finding.FindingClass = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -16305,6 +17620,9 @@ values[valuesById[5] = "SCC_ERROR"] = 5; values[valuesById[6] = "POSTURE_VIOLATION"] = 6; values[valuesById[7] = "TOXIC_COMBINATION"] = 7; + values[valuesById[8] = "SENSITIVE_DATA_RISK"] = 8; + values[valuesById[9] = "CHOKEPOINT"] = 9; + values[valuesById[10] = "EXTERNAL_EXPOSURE"] = 10; return values; })(); @@ -17217,6 +18535,7 @@ return "groupType: enum value expected"; case 0: case 1: + case 3: break; } if (message.groupId != null && message.hasOwnProperty("groupId")) @@ -17252,6 +18571,10 @@ case 1: message.groupType = 1; break; + case "GROUP_TYPE_CHOKEPOINT": + case 3: + message.groupType = 3; + break; } if (object.groupId != null) message.groupId = String(object.groupId); @@ -17314,11 +18637,13 @@ * @enum {number} * @property {number} GROUP_TYPE_UNSPECIFIED=0 GROUP_TYPE_UNSPECIFIED value * @property {number} GROUP_TYPE_TOXIC_COMBINATION=1 GROUP_TYPE_TOXIC_COMBINATION value + * @property {number} GROUP_TYPE_CHOKEPOINT=3 GROUP_TYPE_CHOKEPOINT value */ GroupMembership.GroupType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "GROUP_TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "GROUP_TYPE_TOXIC_COMBINATION"] = 1; + values[valuesById[3] = "GROUP_TYPE_CHOKEPOINT"] = 3; return values; })(); @@ -137756,6 +139081,265 @@ return values; })(); + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + api.Http = (function() { /** @@ -149364,6 +150948,7 @@ * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo */ /** @@ -149505,6 +151090,14 @@ */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + /** * Creates a new FieldOptions instance using the specified properties. * @function create @@ -149563,6 +151156,8 @@ writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); 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(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); return writer; }; @@ -149677,6 +151272,10 @@ message[".google.api.fieldBehavior"].push(reader.int32()); break; } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -149824,6 +151423,11 @@ break; } } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } return null; }; @@ -150043,6 +151647,11 @@ break; } } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } return message; }; @@ -150077,6 +151686,7 @@ object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -150120,6 +151730,8 @@ } 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); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); return object; }; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index ea701079352..b5bf0b8d7b0 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -490,6 +490,15 @@ } } }, + "Chokepoint": { + "fields": { + "relatedFindings": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "CloudArmor": { "fields": { "securityPolicy": { @@ -590,6 +599,11 @@ "parentType": { "type": "ParentType", "id": 2 + }, + "infoTypes": { + "rule": "repeated", + "type": "InfoType", + "id": 3 } }, "nested": { @@ -602,6 +616,41 @@ } } }, + "InfoType": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "sensitivityScore": { + "type": "SensitivityScore", + "id": 3 + } + } + }, + "SensitivityScore": { + "fields": { + "score": { + "type": "SensitivityScoreLevel", + "id": 1 + } + }, + "nested": { + "SensitivityScoreLevel": { + "values": { + "SENSITIVITY_SCORE_LEVEL_UNSPECIFIED": 0, + "SENSITIVITY_LOW": 10, + "SENSITIVITY_UNKNOWN": 12, + "SENSITIVITY_MODERATE": 20, + "SENSITIVITY_HIGH": 30 + } + } + } + }, "CloudDlpInspection": { "fields": { "inspectJob": { @@ -1093,6 +1142,64 @@ } } }, + "ExternalExposure": { + "fields": { + "privateIpAddress": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4_OR_IPV6" + } + }, + "privatePort": { + "type": "string", + "id": 2 + }, + "exposedService": { + "type": "string", + "id": 3 + }, + "publicIpAddress": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "IPV4_OR_IPV6" + } + }, + "publicPort": { + "type": "string", + "id": 5 + }, + "exposedEndpoint": { + "type": "string", + "id": 6 + }, + "loadBalancerFirewallPolicy": { + "type": "string", + "id": 7 + }, + "serviceFirewallPolicy": { + "type": "string", + "id": 8 + }, + "forwardingRule": { + "type": "string", + "id": 9 + }, + "backendService": { + "type": "string", + "id": 10 + }, + "instanceGroup": { + "type": "string", + "id": 11 + }, + "networkEndpointGroup": { + "type": "string", + "id": 12 + } + } + }, "ExternalSystem": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", @@ -1462,6 +1569,14 @@ "rule": "repeated", "type": "GroupMembership", "id": 65 + }, + "chokepoint": { + "type": "Chokepoint", + "id": 77 + }, + "externalExposure": { + "type": "ExternalExposure", + "id": 84 } }, "nested": { @@ -1498,7 +1613,10 @@ "OBSERVATION": 4, "SCC_ERROR": 5, "POSTURE_VIOLATION": 6, - "TOXIC_COMBINATION": 7 + "TOXIC_COMBINATION": 7, + "SENSITIVE_DATA_RISK": 8, + "CHOKEPOINT": 9, + "EXTERNAL_EXPOSURE": 10 } }, "MuteInfo": { @@ -1557,7 +1675,8 @@ "GroupType": { "values": { "GROUP_TYPE_UNSPECIFIED": 0, - "GROUP_TYPE_TOXIC_COMBINATION": 1 + "GROUP_TYPE_TOXIC_COMBINATION": 1, + "GROUP_TYPE_CHOKEPOINT": 3 } } } @@ -15007,6 +15126,30 @@ "IDENTIFIER": 8 } }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, "http": { "type": "HttpRule", "id": 72295728, 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 c0d87dc84bf..4a842ba0b8b 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/attack_path.proto", "../../protos/google/cloud/securitycenter/v1/backup_disaster_recovery.proto", "../../protos/google/cloud/securitycenter/v1/bigquery_export.proto", + "../../protos/google/cloud/securitycenter/v1/chokepoint.proto", "../../protos/google/cloud/securitycenter/v1/cloud_armor.proto", "../../protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto", "../../protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto", @@ -19,6 +20,7 @@ "../../protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto", "../../protos/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto", "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", + "../../protos/google/cloud/securitycenter/v1/external_exposure.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/file.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto",